go-openai
go-openai copied to clipboard
Add support for assistants streaming
The assistants API now supports streaming responses:
- https://platform.openai.com/docs/assistants/overview/step-4-create-a-run?context=with-streaming
- https://platform.openai.com/docs/api-reference/assistants-streaming
I've forked this repo and quickly hacked a CreateRunStream
function: https://github.com/weaseldotro/go-openai/commit/9ffb38f63bf2c936f95db9bce41efb7b392efbf1
This works for me just fine, but somebody should do a proper job with this, like add tests and docs and stuff.
I also hacked something together on my own fork.
I had to add on streaming for some other endpoints like submitting tool outputs and just streaming from an existing thread.
(if interested, can take a look at SubmitToolsOutputStream
, CreateRunStreaming
and CreateThreadAndStream
. I know, I know, the naming's kinda shite.