Skip to content

Transcription Fails for Files Without Extension in Multipart Encoder #91

@rezmoth

Description

@rezmoth

Be reader of type io.Reader

transcription, err := client.Audio.Transcriptions.New(ctx, openai.AudioTranscriptionNewParams{
	Model: openai.F(openai.AudioModelWhisper1),
	File:  openai.F[io.Reader](reader),
})

The above call fails with:

POST "https://api.openai.com/v1/audio/transcriptions": 400 Bad Request {
  "error": {
    "message": "Unrecognized file format. Supported formats: ['flac', 'm4a', 'mp3', 'mp4', 'mpeg', 'mpga', 'oga', 'ogg', 'wav', 'webm']",
    "type": "invalid_request_error",
    "param": null,
    "code": null
  }
}

Edit:
Seems like filename in

filename := "anonymous_file"
requires a valid extension otherwise the call fails

Fix in PR #92 seems to fix it

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions