Skip to content

groq-transcription-model.ts: Transcription Fails Due to Missing File Extension in formData #6413

Open
@jie-lyu

Description

@jie-lyu

Description

File: https://github.com/vercel/ai/blob/main/packages/groq/src/groq-transcription-model.ts

Problem:
The current implementation in groq-transcription-model.ts for creating the formData appends a file with a static filename "audio" without an extension:

formData.append('file', new File([blob], 'audio', { type: mediaType }));

This causes the Groq API to return an invalid_request_error because it expects a filename with one of the supported audio file extensions.

Error Message from Groq API:

{
    "error": {
        "message": "file must be one of the following types: [flac mp3 mp4 mpeg mpga m4a ogg opus wav webm]",
        "type": "invalid_request_error"
    }
}

AI SDK Version

  • "ai": "^4.3.16"
  • "@ai-sdk/groq": "^1.2.9"

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions