You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using DataStreamWriter's writeData() to send custom data, the data part is not assigned the message as the operations when invoking writeMessageAnnotation() which annotations are assigned to message as expected.
In the current implementation the data is cached and returned as data for the whole chat, not accessible by message, although Message has a data field, but it's never assigned.
As you can see from the following code snippets.
Description
When using DataStreamWriter's writeData() to send custom data, the data part is not assigned the message as the operations when invoking writeMessageAnnotation() which annotations are assigned to message as expected.
In the current implementation the data is cached and returned as data for the whole chat, not accessible by message, although Message has a data field, but it's never assigned.
As you can see from the following code snippets.
https://github.com/vercel/ai/blob/main/packages/ui-utils/src/process-chat-response.ts#L222-L234
https://github.com/vercel/ai/blob/main/packages/ui-utils/src/types.ts#L47-L82
It would be better the data part is accessible by message like annotations.
Code example
No response
AI provider
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: