{"record":{"id":"089f48d39a585632","repo":"BerriAI/litellm","slug":"prop-type-is-not-supported","errorCode":null,"errorMessage":"Prop `{type}` is not supported","messagePattern":"Prop `(.+?)` is not supported","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"litellm/llms/bytez/chat/transformation.py","lineNumber":398,"sourceCode":"\n    new_messages: Final = []\n\n    for message in messages:\n        role = message[\"role\"]\n        content: list = message[\"content\"]\n\n        new_content = []\n\n        for content_item in content:\n            type: str | None = content_item.get(\"type\")\n\n            if not type:\n                raise Exception(\"Prop `type` is not a string\")\n\n            content_item_map = open_ai_to_bytez_content_item_map[type]\n\n            if not content_item_map:\n                raise Exception(f\"Prop `{type}` is not supported\")\n\n            new_type = content_item_map[\"type\"]\n\n            value_name = content_item_map[\"value_name\"]\n\n            value: str | None = content_item.get(value_name)\n\n            if not value:\n                raise Exception(f\"Prop `{value_name}` is not a string\")\n\n            new_content.append({\"type\": new_type, value_name: value})\n\n        new_messages.append({\"role\": role, \"content\": new_content})\n\n    return new_messages\n\n\n# \"content\": \"The cat ran so fast\"","sourceCodeStart":380,"sourceCodeEnd":416,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/bytez/chat/transformation.py#L380-L416","documentation":"During Bytez content-part normalization, the part's type is looked up in open_ai_to_bytez_content_item_map; types mapped to None ('document' and 'file') are deliberately unsupported and raise this Exception. Note a type entirely absent from the map (e.g. 'audio') instead raises a bare KeyError before this check — a rough edge in the same code path.","triggerScenarios":"Sending a message containing a document or file content part (e.g. {\"type\": \"document\", ...} or {\"type\": \"file\", ...}) to a bytez model; using an assistant/tooling pipeline that attaches PDFs or files to multimodal messages.","commonSituations":"Porting multimodal workflows from providers that do support documents/files; agent frameworks attaching file artifacts uniformly across models; expecting OpenAI-compatible file handling on bytez.","solutions":["Strip document/file parts from messages before routing to bytez models (or route those requests to a provider that supports them).","If the content is text inside the document, extract and send it as a {\"type\": \"text\"} part.","Watch for the related KeyError variant when a type is misspelled — fix the type string."],"exampleFix":"# before\nmessages = [{\n    \"role\": \"user\",\n    \"content\": [\n        {\"type\": \"document\", \"document\": {\"file_id\": \"abc\"}},  # unsupported on Bytez\n        {\"type\": \"text\", \"text\": \"summarize this\"},\n    ],\n}]\n\n# after\nmessages = [{\n    \"role\": \"user\",\n    \"content\": [{\"type\": \"text\", \"text\": extracted_document_text}],\n}]","handlingStrategy":"validation","validationCode":"BYTEZ_OK_TYPES = {\"text\", \"image_url\", \"input_audio\", \"video_url\"}\n\ndef strip_unsupported_parts(messages: list) -> list:\n    return [\n        {\n            \"role\": m[\"role\"],\n            \"content\": [p for p in m[\"content\"] if p.get(\"type\") in BYTEZ_OK_TYPES],\n        }\n        if isinstance(m.get(\"content\"), list)\n        else m\n        for m in messages\n    ]","typeGuard":"BYTEZ_SUPPORTED_PART_TYPES = {\"text\", \"image_url\", \"input_audio\", \"video_url\"}\n\ndef is_bytez_supported_part(part: object) -> bool:\n    return (\n        isinstance(part, dict)\n        and part.get(\"type\") in BYTEZ_SUPPORTED_PART_TYPES\n    )","tryCatchPattern":"try:\n    litellm.completion(model=\"bytez/org/model\", messages=messages)\nexcept Exception as e:\n    if \"is not supported\" in str(e):\n        litellm.completion(model=\"bytez/org/model\", messages=strip_unsupported_parts(messages))\n    else:\n        raise","preventionTips":["Route document/file-bearing conversations to providers that support them; send text extractions to bytez.","Validate part types against the supported set before dispatch, and watch for the KeyError variant on misspelled types."],"tags":["bytez","messages","content-parts","unsupported-feature"],"backgroundTag":"invalid-content-part","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}