Bug with OpenAI Completions Streaming Responses Issues

Hey Retool Community,

I wanted to share another bug that we have encountered while using OpenAI Chat Completions. When setting the stream parameter to true, it is returning undefined instead of streaming the responses.

Has anyone else experienced this bug? If so, have you found any solutions or workarounds? Your insights and suggestions would be greatly appreciated.

Looking forward to your help!

Hey, I'm experiencing the same bug and haven't found a solution yet :frowning:

Hi @Dev_EJ, and @konradm! :wave:
I tested a similar request but manually setting "frequency_penalty", "temperature", and "stream".

I ran into no issues getting the response back from the POST request:

Which leads me to believe the error may be coming from the "startTrigger" query. If this is a JS Query, did we include a return statement in it? If we did, the POST request to OpenAI may be running before "startTrigger" has finished running (or any other queries used inside of "startTrigger").

Let me know if this is the case, I'll be happy to take a look at your query. :slightly_smiling_face:

Hello @Paulo,

The error occurs when stream is set to true.

Hey @Dev_EJ, good catch! I apologize for the confusion.
I tested it with stream set to true and I'm able to reproduce the error. We created a bug report and we'll keep you posted with any updates on this issue.

1 Like

Thank you @Paulo

You are welcome! :slightly_smiling_face:

Hi @Dev_EJ, I got some news! :newspaper:

We currently don't support streaming for regular OpenAI resources. I tried finding a workaround with the built in Retool AI resource, but it looks like the streaming is currently not working there either (although the "streamResponse" is set to true by default). I went ahead and created a bug report for that one, and I also created a feature request to allow more customization on the built in Resource. In addition to the keys you are using, I included all the other keys that the OpenAI API accepts for different actions.

AI is new to Retool and we are always looking for ways to improve our product.

Thank you for your feedback! :slightly_smiling_face: