-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
useChat to support streamText with structured output #4277
Comments
Would |
Hello, actually I don't know if it's possible to improve useChat because currently the message content only receive the deltas that's why I had to create a function |
Maybe if it can identify if it's a plain |
Actually my workaround completely break the tool calls and other type of message |
OMG, I just found that chunked json can be safety parse on front side with Now I can remove all the work around on backend side and simply Thanks ! |
Feature Description
Thanks to the recent version of AI SDK we can now set the
experimental_output
to streamText function.According to the docs we can then get the streamed object from
experimental_partialOutputStream
.If we implement the useChat response we can do something like this:
But in the front, you end by displaying stream stringified json which cannot be parsed because the json is incomplete.
So I found a work around where I can stream the answer text and send the suggestedUserAnswers through annotation...
It works... but it's very hacky...
Use Cases
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: