Skip to content

fix(audio-tool-bug): loading online non-mp3 file#6

Merged
shiqian-su merged 1 commit intomainfrom
dev-fix-audio
Aug 12, 2025
Merged

fix(audio-tool-bug): loading online non-mp3 file#6
shiqian-su merged 1 commit intomainfrom
dev-fix-audio

Conversation

@shiqian-su
Copy link
Contributor

@shiqian-su shiqian-su commented Aug 12, 2025

remove content type validation for audio files in transcription and QA functions, which caused failing in loading online non-mp3 file

Describe this PR

Checklist for PR

Must Do

  • Write a good PR title and description, i.e. feat(agent): add pdf tool via mcp, perf: make llm client async and fix(utils): load custom config via importlib etc. CI job check-pr-title enforces Angular commit message format to PR title.
  • Run make precommit locally. CI job lint enforce ruff default format/lint rules on all new codes.
  • Run make pytest. Check test summary (located at report.html) and coverage report (located at htmlcov/index.html) on new codes.

Nice To Have

  • (Optional) Write/update tests under /tests for feat and test PR.
  • (Optional) Write/update docs under /docs for docs and ci PR.

…n transcription and QA functions, which caused failing in loading online non-mp3 file
@gali-leilei gali-leilei requested a review from Copilot August 12, 2025 06:46
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a bug where the audio tool was failing to load online non-MP3 audio files due to overly restrictive content type validation. The fix removes the content type checks that were preventing valid audio files from being processed.

Key changes:

  • Removed content type validation logic from both audio_transcription and audio_question_answering functions
  • Allows processing of audio files regardless of their HTTP content-type header

raise Exception(f"Invalid content type '{content_type}'.")

# Get proper extension for the temporary file
file_extension = _get_audio_extension(audio_path_or_url, content_type)
Copy link

Copilot AI Aug 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The content_type variable is now retrieved but never used after removing the validation logic. Consider removing this line to avoid unused variable assignment.

Copilot uses AI. Check for mistakes.
return f"[ERROR]: Audio question answering failed: Invalid content type '{content_type}'. Expected audio file.\nNote: Files from sandbox are not available. You should use local path given in the instruction. \nURLs must include the proper scheme (e.g., 'https://') and be publicly accessible. The file should be in a common audio format such as MP3.\nNote: YouTube video URL is not supported."

# Get proper extension for the temporary file
file_extension = _get_audio_extension(audio_path_or_url, content_type)
Copy link

Copilot AI Aug 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The content_type variable is now retrieved but never used after removing the validation logic. Consider removing this line to avoid unused variable assignment.

Copilot uses AI. Check for mistakes.
@shiqian-su shiqian-su merged commit a206951 into main Aug 12, 2025
8 checks passed
@shiqian-su shiqian-su deleted the dev-fix-audio branch August 12, 2025 06:47
Zhudongsheng75 pushed a commit to open-compass/MiroFlow that referenced this pull request Dec 27, 2025
fix(audio-tool-bug): remove content type validation for audio files in transcription and QA functions, which caused failing in loading online non-mp3 file
BinWang28 added a commit that referenced this pull request Mar 11, 2026
feat(agent): add context error rollback.
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.

2 participants