Open wong2 opened 3 months ago
This is great, since we want to document the protocol in the coming weeks. Can you share which exact functionality / functions you would need to access? some of it is exposed but not documented
Our user cases include:
@wong2 we have started documenting the data stream protocol: https://sdk.vercel.ai/docs/ai-sdk-ui/stream-protocol#data-stream-protocol
The @ai-sdk/ui-utils
package exposes utilities for formatting and parsing these stream parts (warning: the api is internal/unstable and might change).
Great!
Can only second @wong2 . I love the server-side stuff because it abstracts away the differences between providers, but the UI part just feels wrong. I would very much prefer simple building blocks that you can use individually, and then, fine, put a useChat on top of them. Right now useChat is complicated because it's the only official way to handle the server responses, and thus it's hard to use for anything non-standard. I don't think the solution is to extend useChat even further, but rather to expose the building blocks so people can handle their use-case on their own.
Feature Description
We're using the AI SDK on the server side only, as our client-side code already includes the logic to handle message states and API calls. It would be helpful to have utilities extracted from
useChat
to parse the stream responses generated by the AI SDK.Use Case
No response
Additional context
No response