Skip to content

Fixed GH-3557, Fixed the issue where the filename was lost when requesting the OpenAI audio processing interface. #3558

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sunyuhan1998
Copy link
Contributor

@sunyuhan1998 sunyuhan1998 commented Jun 17, 2025

As mentioned in the issue, there is currently a problem where the filename gets overwritten when requesting OpenAI's /audio/translations and /audio/transcriptions interfaces, leading to request failures.

The root cause lies in the code prior to this PR, specifically in the org.springframework.ai.openai.OpenAiAudioTranscriptionModel#createRequest method. When converting the Resource to a byte[], the original filename information was lost, resulting in a hardcoded filename "audio.webm" being used when sending requests to the OpenAI API, which is clearly unreasonable.

This PR fixes the issue by preserving and passing the original filename to the REST interface.

Fixed #3557

…lename was lost when requesting the OpenAI `/transcriptions` and `/translations` interfaces.

Signed-off-by: Sun Yuhan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Transcription API File Extension Issue
1 participant