{"record":{"id":"669d5065808be937","repo":"BerriAI/litellm","slug":"content-type-item-type-is-not-supported-by-oci","errorCode":null,"errorMessage":"Content type `{item_type}` is not supported by OCI","messagePattern":"Content type `(.+?)` is not supported by OCI","errorType":"validation","errorClass":"OCIError","httpStatus":400,"severity":"error","filePath":"litellm/llms/oci/chat/generic.py","lineNumber":81,"sourceCode":"        return OCIMessage(\n            role=open_ai_to_generic_oci_role_map[role],\n            content=[OCITextContentPart(text=content)],\n            toolCalls=None,\n            toolCallId=None,\n        )\n\n    for content_item in content:\n        if not isinstance(content_item, dict):\n            raise OCIError(status_code=400, message=\"Each content item must be a dictionary\")\n\n        item_type = content_item.get(\"type\")\n        if not isinstance(item_type, str):\n            raise OCIError(\n                status_code=400,\n                message=\"Each content item must have a string `type` field\",\n            )\n        if item_type not in [\"text\", \"image_url\"]:\n            raise OCIError(\n                status_code=400,\n                message=f\"Content type `{item_type}` is not supported by OCI\",\n            )\n\n        if item_type == \"text\":\n            text = content_item.get(\"text\")\n            if not isinstance(text, str):\n                raise OCIError(\n                    status_code=400,\n                    message=\"Content item of type `text` must have a string `text` field\",\n                )\n            new_content.append(OCITextContentPart(text=text))\n\n        elif item_type == \"image_url\":\n            image_url = content_item.get(\"image_url\")\n            if isinstance(image_url, dict):\n                image_url = image_url.get(\"url\")\n            if not isinstance(image_url, str):","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/oci/chat/generic.py#L63-L99","documentation":"OCI GENERIC models only accept content parts of type \"text\" and \"image_url\"; the translator explicitly whitelists these two. Any other discriminator value (e.g. \"audio\", \"input_audio\", \"video\", \"file\") raises OCIError 400. The error embeds the offending type so you can see exactly which part was rejected.","triggerScenarios":"Sending multimodal content that includes a non-supported part to an oci/generic.* model: [{\"type\":\"input_audio\",\"input_audio\":{...}}] or {\"type\":\"file\",\"file\":{...}}. Raised client-side during message adaptation, before the OCI request.","commonSituations":"Reusing an OpenAI multimodal prompt (with audio/file parts) against OCI; provider-agnostic code that forwards every part type; OCI GENERIC genuinely lacking the modality — the request must be restructured before it can succeed.","solutions":["Remove or convert unsupported parts: keep only text and image_url parts for OCI GENERIC models","Transcribe audio out-of-band (e.g. with an STT model) and pass the transcript as a text part","Route requests containing other modalities to a provider/model that supports them, based on the parts present","Filter content parts per target model in a pre-send normalization step"],"exampleFix":"# before\ncontent = [\n  {\"type\": \"text\", \"text\": \"describe\"},\n  {\"type\": \"input_audio\", \"input_audio\": {\"data\": b64, \"format\": \"wav\"}},\n]\nlitellm.completion(model=\"oci/generic.m\", messages=[{\"role\":\"user\",\"content\":content}])\n\n# after: transcribe first, send text\ncontent = [\n  {\"type\": \"text\", \"text\": \"describe\"},\n  {\"type\": \"text\", \"text\": transcript},\n]","handlingStrategy":"validation","validationCode":"SUPPORTED = {\"text\", \"image_url\"}\n\ndef filter_supported_parts(content: list) -> list:\n    return [p for p in content if p.get(\"type\") in SUPPORTED]","typeGuard":"def part_supported_by_oci(part) -> bool:\n    return isinstance(part, dict) and part.get(\"type\") in {\"text\", \"image_url\"}","tryCatchPattern":null,"preventionTips":["Branch your request builder by model capability: send audio/file parts only to providers that accept them","Fail loudly in dev (assert) when unsupported modalities reach an OCI-bound request"],"tags":["oci","multimodal","unsupported-type","content-parts","request-validation"],"backgroundTag":"unsupported-content-type","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}