yGuy / chatgpt-mattermost-bot

A very simple implementation of a service for a mattermost bot that uses ChatGPT in the backend.
MIT License
145 stars 50 forks source link

Introduce Error Handling for `createChatCompletion` #35

Open your-highness opened 1 year ago

your-highness commented 1 year ago

Recently, we are getting errors from OpenAI API which result in non gracefully exited threads. IMO it would be great to introduce some simple error handling like described in https://www.npmjs.com/package/openai?activeTab=readme#Usage

Working on this right now. Pull request will follow.

your-highness commented 1 year ago

It's been done in processGraphResponse() already: https://github.com/yGuy/chatgpt-mattermost-bot/blob/8c560a486f40baee25ce03b23be23a378c8e0d5e/src/process-graph-response.js#L29-L48

But thread completion still needs some error handling. PR will cover this.