How to use streaming in Django framework and pass response to UI(Assistants API)

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.

Please help me on the topic.

1 Like

As far as i can tell you can use the python SDK runs.create as shown in the API reference:

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.