[BUG] OpenAI Responses requests crash on audio inputs advertised by provider constraints
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 25/100
Direzione di ricerca
Read lib/crewai-files/src/crewai_files/processing/constraints.py around OPENAI_RESPONSES_CONSTRAINTS and lib/crewai-files/src/crewai_files/formatting/openai.py around OpenAIResponsesFormatter.format_block. Run the named tests in lib/crewai-files/tests/test_openai_responses_files.py to reproduce the failure and confirm the expected behavior. Done means Responses no longer advertises audio support and formatting an audio input returns an empty list; linked pull request #9175 is already open.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description
OPENAI_RESPONSES_CONSTRAINTS advertises audio support, so an audio file attached to a task is auto-injected into the OpenAI Responses request instead of being handled by the file tools. The Responses formatter, however, only knows how to emit image and PDF blocks, so formatting the file raises:
TypeError: Unsupported content type for Responses API: audio/mpeg
lib/crewai-files/src/crewai_files/processing/constraints.py:241:
OPENAI_RESPONSES_CONSTRAINTS = ProviderConstraints(
name="openai_responses",
...
audio=AudioConstraints(
max_size_bytes=26_214_400, # 25 MB - whisper limit
max_duration_seconds=1500, # 25 minutes, arbitrary-ish, this is from the transcriptions limit
),
...
)
The comment points at the transcription endpoint, not the Responses file-input API, and OpenAIResponsesFormatter.format_block (lib/crewai-files/src/crewai_files/formatting/openai.py:38) only handles input_image and input_file; every other content type falls through to TypeError at line 97.
get_supported_content_types("openai", api="responses") therefore returns ['image/', 'application/pdf', 'audio/'], which drives both the task auto-injection decision (lib/crewai/src/crewai/task.py:1041, lib/crewai/src/crewai/crew.py:1718) and the formatter dispatch. An audio attachment that should have gone to the tool fallback is instead sent down a path that cannot format it.
Reproduction
from unittest.mock import patch
from crewai_files import AudioFile, format_multimodal_content
from crewai_files.core.sources import FileBytes
with patch(
"crewai_files.core.sources.detect_content_type", return_value="audio/mpeg"
):
audio = AudioFile(
source=FileBytes(data=b"ID3\x04\x00\x00\x00\x00\x00\x00payload", filename="clip.mp3")
)
format_multimodal_content({"clip": audio}, "openai", api="responses")
# TypeError: Unsupported content type for Responses API: audio/mpeg
Expected behaviour
Audio is not a supported Responses file input in this code path, so it should not be advertised as one. The audio file should be filtered out of the multimodal blocks (and handled by the file tool fallback) exactly like other unsupported types, instead of aborting the whole request.
Suggested fix
Remove the audio=AudioConstraints(...) entry from OPENAI_RESPONSES_CONSTRAINTS (the typo-shaped limits came from the transcription endpoint). The provider then advertises only the types its formatter implements; no formatter change is needed.
Tests
lib/crewai-files/tests/test_openai_responses_files.py adds:
test_responses_does_not_advertise_audio_supportasserts"audio/"is absent fromget_supported_content_types("openai", api="responses").test_audio_input_is_skipped_instead_of_raisingformats an MP3 and asserts the result is[]rather than an exception.
Both pass with the fix. On main they fail with the assertion above and with TypeError: Unsupported content type for Responses API: audio/mpeg.
Prepared with an AI coding agent. Please apply the llm-generated label; this account cannot set repository labels.
- Lingua principale
- Python
- Stelle
- 60.6k
- Fork
- 9.1k
- Merge medio
- 1g 4h
- PR unite (30g)
- 214
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di crewAIInc/crewAI
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 1 giorno
-
Feature request: GoldenDirectiveTool (harmonic relationship score, full vs cropped reporting)Apertafeature-request
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
crewAIInc/crewAI#9200 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[FEATURE] Docs: ApifyActorsTool example with a typed-input ActorForse già presa @johnisanerd l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
crewAIInc/crewAI#9132 · 5 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
[BUG] Scrape tools reject the documented cookies mapping and drop cookies when the URL is passed at runtimeForse già presa @Luckyou-d l’ha presa 6 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
[BUG] OpenAI-compatible embedding model alias breaks embedder constructionForse già presa @gokay-ai l’ha presa 12 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
crewAIInc/crewAI#8761 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di crewAIInc/crewAI
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
With emit_ontology_keys, one ontology key change is reported as two errors (keys and keys_digest)Forse già presa @rvandewater l’ha presa oggi. Apertabug priority:low
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 84/100
iausathub/satchecker#286 ·
I maintainer di solito rispondono entro 1 giorno
-
bug test
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
OpenAssetIO/OpenAssetIO#1527 ·
-
automated endpoint-dead needs-curation
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
almanac-data/climate-almanac#128 ·
I maintainer di solito rispondono entro 1 giorno