Closed
Description
Feature Description
There's a strange translation happening between UI and core messages, which the params for type of media don't line up.
The UI portion uses a param contentType
:
ai/packages/ui-utils/src/types.ts
Line 36 in 9495438
And core message uses mimeType
:
Because of this translation it seems to be getting lost during message persistence. Might be a lot easier to just use the same param across both.
Use Cases
After calling submit({ experimental_attachments: [...] }) on useChat
, the stream/generate function calls onFinish
will have lost the content type since the params are misaligned.
Additional context
"ai": 4.0.25
"@ai-sdk/openai": 1.0.13
"@ai-sdk/react": 1.0.13