Skip to content

File not supported - @ai-sdk/azure - v5 beta #6873

Open
@arthberman

Description

@arthberman

Description

Summary

When attempting to upload a .txt file (with MIME type text/plain) using @ai-sdk/azure (ai v5), I receive an error indicating that this file type is not supported, even though the Azure OpenAI documentation lists text/plain as a supported MIME type.

Error

Error [AI_UnsupportedFunctionalityError]: 'file part media type text/plain' functionality not supported.
    at <unknown> (.next/server/chunks/4744.js:1:42683)
    at Array.map (<anonymous>)
    at prompt (.next/server/chunks/4744.js:1:41594)
    at h.getArgs (.next/server/chunks/4744.js:1:43350)
    at async h.doStream (.next/server/chunks/4744.js:1:48893)
    at async fn (.next/server/chunks/9464.js:33:48102)
    at async (.next/server/chunks/9464.js:33:3017)
    at async tw (.next/server/chunks/9464.js:33:898) {
  cause: undefined,
  functionality: 'file part media type text/plain'
]

Reproduction Steps

  1. Use @ai-sdk/azure (ai v5) to upload a .txt file.
  2. Observe the error above.

Expected Behavior

.txt files with MIME type text/plain should be accepted, as per Azure OpenAI documentation.

Actual Behavior

The SDK throws an AI_UnsupportedFunctionalityError for text/plain files.

Additional Information

AI SDK Version

"@ai-sdk/azure": "2.0.0-beta.1"
"ai": "5.0.0-beta.1"

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions