sashabaranov / go-openai

OpenAI ChatGPT, GPT-3, GPT-4, DALL·E, Whisper API wrapper for Go
Apache License 2.0
8.93k stars 1.36k forks source link

Add support for assistants streaming #686

Open weaseldotro opened 5 months ago

weaseldotro commented 5 months ago

The assistants API now supports streaming responses:

weaseldotro commented 5 months ago

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.

tanzyy96 commented 5 months ago

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.