-
Notifications
You must be signed in to change notification settings - Fork 42
Closed
Milestone
Description
When interacting with AI SDK frontend code, there's a preference for UIMessage. There may also be benefits to passing that into the AI SDK (Mastra mentioned the AI SDK choking on "role: tool" messages).
It's mostly a matter of rearranging messages into a friendlier format, with a few differences:
- The
id
field which is assigned by AI SDK (currently populated for response messages but not for the initial user message). - The
sources
field which is in our steps model but not on each message. - The
annotations
field which I'm not sure the origin of (it mentions StreamData so maybe it's an internal signal for marking the start/end/segment of streaming text/objects)
Some references:
vercel/ai#3161 (comment)
https://github.com/mastra-ai/mastra/pull/3230/files
davidoort