{"record":{"id":"5e5fe667c0d43bb6","repo":"zylon-ai/private-gpt","slug":"failed-to-describe-images-in-the-message","errorCode":null,"errorMessage":"Failed to describe images in the message.","messagePattern":"Failed to describe images in the message\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"private_gpt/components/chat/processors/chat_history/multimodality/image_preprocessor.py","lineNumber":70,"sourceCode":"\n    image_blocks = extract_image_blocks(message)\n    if not image_blocks:\n        yield ImageProcessingResponse(message=message)\n        return\n\n    if image_multimodal_llm is None:\n        raise ValueError(\"Image blocks found but no image-capable LLM provided.\")\n\n    event = MultimodalProcessingStatus(status=\"processing\", type=\"image\")\n    yield ImageProcessingResponse(processing_status=event)\n\n    try:\n        image_description = await process_images_in_message(\n            image_multimodal_llm, message, user_query=message.content, **kwargs\n        )\n\n        if not image_description:\n            raise ValueError(\"Failed to describe images in the message.\")\n\n        event = event.model_copy(\n            update={\n                \"status\": \"completed\",\n                \"content\": image_description,\n            }\n        )\n        yield ImageProcessingResponse(processing_status=event)\n        final_message = (\n            \"The user has included images in their message. \"\n            \"We have processed these images and obtained the following descriptions:\\n\"\n            f\"{image_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/image_preprocessor.py#L52-L88","documentation":"Image preprocessor counterpart of error 55: process_images_in_message completed but returned an empty/falsy description for images present in the message. Rather than continuing with a blank 'we processed these images' payload, the processor raises to signal the vision step effectively failed.","triggerScenarios":"Calling the image preprocessor with ImageBlock content where the vision LLM returns empty text (empty completion, content filter, wrong output parsing).","commonSituations":"Vision model refusing or returning empty for problematic images (corrupt file, unsupported aspect, pure black frame); response-schema mismatch dropping the description field; overloaded inference server returning empty bodies.","solutions":["Retry once — transient empty completions are common under load","Inspect the raw vision LLM response for the image that fails; test the image directly","Validate/normalize images (format, size, corruption) before the LLM call","Wrap with a fallback description if empty results are acceptable in your flow"],"exampleFix":"# before\nimage_description = await process_images_in_message(llm, message, user_query=...)\n\n# after\nimage_description = await process_images_in_message(llm, message, user_query=...)\nif not image_description:\n    image_description = \"(image content could not be described)\"","handlingStrategy":"retry","validationCode":"def is_describable_image(block) -> bool:\n    return block_has_valid_image_data(block)  # decodes, checks non-zero size/format","typeGuard":null,"tryCatchPattern":"try:\n    async for resp in image_preprocessor.run(message, ...):\n        ...\nexcept ValueError as e:\n    if \"Failed to describe images\" in str(e):\n        async for resp in image_preprocessor.run(message, ...):  # one retry\n            ...\n    else:\n        raise","preventionTips":["Verify image integrity and supported formats before the vision call","Inspect raw vision responses for empty content in logs","Add a fallback description path if empty results are tolerable"],"tags":["multimodal","image","llm","vision","empty-response"],"backgroundTag":null,"analyzedSha":"4a030776a31a901ad80b1bf4d7faa2c1a367efbb","analyzedAt":"2026-08-15T03:51:26.951Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}