assistant-streaming example should decode the streamed reply
examples/beta/assistant-streaming/main.go sends a query requesting a streamed response.
But the code that handles the stream just prints the type of each streamed chunk:
for stream.Next() {
evt := stream.Current()
println(fmt.Sprintf("%T", evt.Data))
}
The example should demonstrate full decoding and printing of the streamed reply.
(The standard non-Assistant query streaming uses a openai.ChatCompletionAccumulator but this does not appear to handle openai.AssistantStreamEventUnion types.)
Hi @chrbsg , unfortunately this SDK isn't going to support the assistants API post-beta (since latest release).
However, I'd be open to expanding the responses streaming example though. Would that be helpful?
Yes,
- the regular streaming example should demonstrate decoding and not just receiving of events
- if the Assistants API is no longer supported then it should be noted in the README, and the assistants code removed from the SDK (otherwise, if the code is still present, people will expect it to work, and will open bug reports when it doesn't, etc.)
- just as background to this issue, I was specifically interested in streaming Assistant responses as we have been experiencing occasional (but reproducible at the time) extremely high latency with the Assistants API (e.g. 58 seconds to return a response to a simple "hi"), along with Runs becoming stuck in the "cancelled" state (which appears to be a longstanding bug). I was hoping that streamed responses might not have these issues, but it appears not. Given that Assistants are now deprecated and unsupported, we should probably just remove this option for our users.
@jacobzim-stl why this SDK isn't going to support the assistants API? Other SDK(i.e. Java, Python) still has assistant api