Skip to content

Commit dd9071e

Browse files
committed
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
1 parent 13d1e27 commit dd9071e

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

libs/miroflow-tool/src/miroflow/tool/mcp_servers/audio_mcp_server.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,6 @@ async def audio_transcription(audio_path_or_url: str) -> str:
149149

150150
# Check content type if available
151151
content_type = response.headers.get("content-type", "").lower()
152-
if content_type and not any(
153-
media_type in content_type
154-
for media_type in ["audio", "video", "application/octet-stream"]
155-
):
156-
raise Exception(f"Invalid content type '{content_type}'.")
157152

158153
# Get proper extension for the temporary file
159154
file_extension = _get_audio_extension(audio_path_or_url, content_type)
@@ -229,11 +224,6 @@ async def audio_question_answering(audio_path_or_url: str, question: str) -> str
229224

230225
# Check content type if available
231226
content_type = response.headers.get("content-type", "").lower()
232-
if content_type and not any(
233-
media_type in content_type
234-
for media_type in ["audio", "video", "application/octet-stream"]
235-
):
236-
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."
237227

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

0 commit comments

Comments
 (0)