Closed
Description
Description
I'm trying to make streamObject
work between a NextJS frontend, and a Fastify backend. But I can't get it to work. I can only get the object to appear at once, at the end of the stream.
I tried using createDataStream
as well, but when using streamObject
I don't have access to result.mergeIntoDataStream
nor result.toDataStream
.
I'm following this documentation here, but something must be missing:
- https://sdk.vercel.ai/cookbook/api-servers/fastify
- https://sdk.vercel.ai/cookbook/next/stream-object
Here's a reproduction: https://github.com/Floriferous/next-fastify
Code example
No response
AI provider
@ai-sdk/openai: "^1.2.3"
Additional context
No response