vercel / ai

Build AI-powered applications with React, Svelte, Vue, and Solid

Home Page:https://sdk.vercel.ai/docs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support toDataStreamResponse from streamObject

villesau opened this issue · comments

Feature Description

Now streamObject only supports toTextStreamResponse, would be nice to also support toDataStreamResponse

Use Case

Would make it possible to use streamObject with useChat.

Additional context

Currently, useChat always returns empty message arrays if using streamObject & toTextStreamResponse in the backend. Even when streamProtocol: "text".

I tried useChat with streamProtocol: "text" and streamObject. It works as expected.

However, there is a separate use case for useChat with streamObject and additional data.

I need this too