{"record":{"id":"53a4ce1783aa0e03","repo":"zylon-ai/private-gpt","slug":"failed-to-describe-audio-in-the-message","errorCode":null,"errorMessage":"Failed to describe audio in the message.","messagePattern":"Failed to describe audio in the message\\.","errorType":"exception","errorClass":"ValueError","httpStatus":400,"severity":"error","filePath":"private_gpt/components/chat/processors/chat_history/multimodality/audio_preprocessor.py","lineNumber":70,"sourceCode":"\n    audio_blocks = extract_audio_blocks(message)\n    if not audio_blocks:\n        yield AudioProcessingResponse(message=message)\n        return\n\n    if audio_multimodal_llm is None:\n        raise ValueError(\"Audio blocks found but no audio-capable LLM provided.\")\n\n    event = MultimodalProcessingStatus(status=\"processing\", type=\"audio\")\n    yield AudioProcessingResponse(processing_status=event)\n\n    try:\n        audio_description = await process_audio_in_message(\n            audio_multimodal_llm, message, user_query=message.content, **kwargs\n        )\n\n        if not audio_description:\n            raise ValueError(\"Failed to describe audio in the message.\")\n\n        event = event.model_copy(\n            update={\n                \"status\": \"completed\",\n                \"content\": audio_description,\n            }\n        )\n        yield AudioProcessingResponse(processing_status=event)\n        final_message = (\n            \"The user has included audios in their message. \"\n            \"We have processed these audios and obtained the following descriptions:\\n\"\n            f\"{audio_description}\"\n        )\n\n    except Errors.RequestTooLarge as e:\n        event = event.model_copy(\n            update={\n                \"status\": \"failed\",","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/zylon-ai/private-gpt/blob/4a030776a31a901ad80b1bf4d7faa2c1a367efbb/private_gpt/components/chat/processors/chat_history/multimodality/audio_preprocessor.py#L52-L88","documentation":"After process_audio_in_message ran with the audio-capable LLM, it returned an empty/falsy description. The call completed without exception but produced no usable transcript/description, which the preprocessor treats as failure rather than emitting an empty 'we processed these audios' message.","triggerScenarios":"Calling the audio preprocessor with a message containing audio blocks where the audio LLM returns an empty string (empty completion, content filter, or unparsable response format).","commonSituations":"Audio model returning empty content on silence/undecodable audio; response parsing that extracts the wrong field; flaky inference server returning 200 with empty body.","solutions":["Retry the request — transient empty completions often succeed on retry","Log/inspect the raw audio LLM response to find why the description is empty","Validate or transcode audio (format, duration, non-silence) before sending","If empties are expected, add a fallback description ('audio could not be described') in a wrapper"],"exampleFix":"# before\naudio_description = await process_audio_in_message(llm, message, user_query=...)\n\n# after\naudio_description = await process_audio_in_message(llm, message, user_query=...)\nif not audio_description:\n    audio_description = \"(audio content could not be transcribed)\"  # or retry once","handlingStrategy":"retry","validationCode":"def is_describable_audio(message: ChatMessage) -> bool:\n    return all(b_has_valid_audio(b) for b in extract_audio_blocks(message))  # non-empty, decodable payload","typeGuard":null,"tryCatchPattern":"try:\n    async for resp in audio_preprocessor.run(message, ...):\n        ...\nexcept ValueError as e:\n    if \"Failed to describe audio\" in str(e):\n        async for resp in audio_preprocessor.run(message, ...):  # one retry for transient empties\n            ...\n    else:\n        raise","preventionTips":["Validate audio format/duration before sending to the LLM","Log raw model responses when descriptions come back empty","Consider a fallback description string instead of hard failure"],"tags":["multimodal","audio","llm","empty-response"],"backgroundTag":null,"analyzedSha":"4a030776a31a901ad80b1bf4d7faa2c1a367efbb","analyzedAt":"2026-08-15T03:51:26.951Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}