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

Standardize on contentType or mimeType but not both #4360

Open
ian opened this issue Jan 11, 2025 · 0 comments
Open

Standardize on contentType or mimeType but not both #4360

ian opened this issue Jan 11, 2025 · 0 comments
Labels
ai/core enhancement New feature or request

Comments

@ian
Copy link

ian commented Jan 11, 2025

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

@ian ian added the enhancement New feature or request label Jan 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ai/core enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants