Skip to content

Standardize on contentType or mimeType but not both #4360

Closed
@ian

Description

@ian

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:

contentType?: string;

And core message uses mimeType:

mimeType?: string;

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions