I am using Django framework and want to pass the streaming response to UI(client side Html Page). Is it possible to pass streaming response in to UI. Or do i need to change the framework. Reference: https://platform.openai.com/docs/assistants/overview?context=with-streaming
Please help me on the topic.
As far as i can tell you can use the python SDK runs.create as shown in the API reference: https://platform.openai.com/docs/api-reference/runs/createRun .
You need to create a iterator for the stream events and pass that iterator to the front-end using the StreamingHttpResponse . By looking at the source code, I think you can’t interrupt the streaming using the runs.create_and_stream method.
thanks for contributing, In StreamingHttpResponse , I am getting all the responses together, and not like word/line wise.