Open sundar7D0 opened 1 year ago
Since the overall delay in returning the response from ChatGPT along with the context can be huge, does the slack-bot support response streaming where the tokens are returned to user as and when they are returned from the ChatGPT API using 'stream=True' argument?
Yes. You can use chat.update
.
ts
value of the message.stream=True
in the openai.Completion.create
callchat.update
in each loop with the latest unfinished text response from OpenAI.That’s it! Please feel free to create a pull request if you have done so, it will help others too!
Since the overall delay in returning the response from ChatGPT along with the context can be huge, does the slack-bot support response streaming where the tokens are returned to user as and when they are returned from the ChatGPT API using 'stream=True' argument?