How do I stream my response when I am using the OpenAI API?

Hi guys, I know there has been multiple questions about this but I still havent seen an answer to this?

How do I stream the response of OpenAI API without paying for a plugin?

If anyone can help me with this, you will be my hero hahha

The only solution is to develop a plugin yourself.
Plugins exist for a reason , which is to save you time and money. :smiley:

Haha ok, if this is truly the only way, Ill have to take a look. On a scale from 1-10, how difficult would this be and an estimate of how long it will take? It obviously depends on my skill level but I have someone to help me with this so just a wild guess?

There are already plugins that exist which do this for you.
These are free or open source.
Just have look at there code by clicking on view plugin code and you can figure out from there.@emilvisser2000

Hey there,

Openai announced a week ago that it now supports streaming for assistants on the API. I’ve spent a couple of hours researching and the only way to achieve is by building a plugin just as someone has suggested. There are some plugins that support streaming but for the entire API flow which goes like this:

  1. Create an Assistant by defining its custom instructions and picking a model. If helpful, add files and enable tools like Code Interpreter, Retrieval, and Function calling.
  2. Create a Thread when a user starts a conversation.
  3. Add Messages to the Thread as the user asks questions.
  4. Run the Assistant on the Thread to generate a response by calling the model and the tools.

You can see more about it in the openai DOCS.

Also, you can checkout this awesome video on how to build assistants

However, for my use case I only need step 4 the las step in the API process to be built in a plugin to be able to stream the response which cannot be accomplished via CURL method but Node.js

I’ve tried testing on VSCODE with Node.js using the code from API docs and the assistance of CHATGPT but haven’t been able to successfully stream the response. I think it has to do with the NPM version of openai that I’m using.

Things to bare in mind:

  • I’m not proficient in coding or VSCODE
  • I don’t know to build plugins

Just wanted to share my 2 cents of my experience regarding streaming the assistant response.

If anyone out there could point me in the right direction on:

  1. How to test te streaming response on VSODE using Node.js
  2. How to build a plugin on bubble

That would be awesome.


Diego F. Duque