vercel / ai

Build AI-powered applications with React, Svelte, Vue, and Solid
https://sdk.vercel.ai/docs
Other
9.94k stars 1.47k forks source link

Stream AssistantResponse just like chat responses #787

Closed mfts closed 11 months ago

mfts commented 11 months ago

Feature Description

openai.chat.completions responses are converted to OpenAIStream and then returned to the client as a StreamingTextResponse.

This should be doable with AssistantResponses too. It seems like they are already converted to a stream but not streamed to the client. Instead the useAssistant waits for the full message to display it.

Would love a way to stream it.

Use Case

No response

Additional context

No response

MaxLeiter commented 11 months ago

OpenAI doesn’t officially support streaming assistant responses yet. We will support it when we can.

https://platform.openai.com/docs/assistants/how-it-works/limitations