Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

data part is not appended to message #4213

Open
JerryKwan opened this issue Dec 27, 2024 · 0 comments
Open

data part is not appended to message #4213

JerryKwan opened this issue Dec 27, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@JerryKwan
Copy link

JerryKwan commented Dec 27, 2024

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

@JerryKwan JerryKwan added the bug Something isn't working label Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant