Replies: 1 comment 1 reply
-
This might be close to what you want (but is intended for testing): https://sdk.vercel.ai/docs/ai-sdk-core/testing#simulate-data-stream-protocol-responses |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We know we can use APIs such as streamObject() and streamText() to stream an object or text from backend and consume them from the frontend with React using experimental_useObject() or useCompletion().
I want to create a stream from scratch in the backend, stream that, and consume that using the same React APIs from the frontend. Please note that this is different from sending additional data with the stream, although I might need to do that as well.
Few example use cases:
I feel like something like that should already be available/or the streams are pretty close to NodeJS streams? But haven't figured it out yet. Any help/sample code/references is appreciated.
P.S.: Not using NextJS; assume express/react.
Beta Was this translation helpful? Give feedback.
All reactions