GPTStream is a personal project I made to show an example of how a real time response stream from the OpenAI Python API would look like. This is a very basic python app written on the Flask Web Framework.
-
Change the .env file to use your OpenAI API Key.
-
Review the code to understand how it works. It may seem insignificant, but learning how to use OpenAI stream in Flask isnt as simple as it seems.
I had a lot of trouble finding how to make a real time stream work, so I've made sure to add a lot of comments in the code files to make it easy for a beginner to understand how to use and modify it.
If this helped you, I'd appreciate a star!