Replies: 1 comment
-
You are missing the finish step and finish message parts: https://sdk.vercel.ai/docs/ai-sdk-ui/stream-protocol#data-stream-protocol |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a pre-existing ReAct agent that I am trying to instrument with the AI SDK to make the client side experience richer. I'll omit some details for brevity, but my current attempt looks like:
After wrapping the stream with
createDataStreamResponse
, the data is being formatted correctly and sent to the client. Here's an example response:All seems OK at first, but
useChat
begins to break. Themessages
fromuseChat
are updated correctly until the first tool call stream part. After that point, the response continues to stream in correctly at the network layer, but theuseChat
hook does not do any further processing. Additionally, theonToolCall
callback is never called.Is there a fundamental issue with this format of stream (eg, text then tool calls then more text)? If not, is my integration simply missing required stream parts? It would be helpful to understand the general anatomy of a
Stream<StreamDataString>
to better understand how to integrate arbitrary systems as providers.Beta Was this translation helpful? Give feedback.
All reactions