{"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/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/llms/oci/chat/generic.py#L63-L99","documentation":"The OCI GENERIC adapter only understands two content part types: 'text' and 'image_url'. Any other value of the 'type' field — e.g. 'audio_url', 'input_audio', 'video_url', 'file' — raises OCIError(400) \"Content type `<value>` is not supported by OCI\". It is a hard capability limit of the OCI GENERIC inference API surface as implemented here, enforced client-side.","triggerScenarios":"Sending multimodal content valid for other providers (audio parts for OpenAI, video parts for Gemini) to an oci/ GENERIC model such as oci/meta.llama-3.2-90b-vision-instruct; reusing a provider-agnostic prompt builder that emits audio/file parts on every request.","commonSituations":"Porting an OpenAI or Gemini multimodal app to OCI without trimming unsupported modalities; a shared prompt template that conditionally includes an audio part depending on user input; newer OpenAI content types sneaking in via an SDK upgrade of the caller's framework.","solutions":["Strip or branch on content types not in {'text','image_url'} before routing a request to OCI.","Route audio/video requests to a provider that supports them, keeping OCI for text+vision traffic.","If you control the payload, transcribe audio upstream and send the transcript as a text part."],"exampleFix":"# before\ncontent=[{'type':'text','text':'summarize'}, {'type':'input_audio','input_audio':{'data':b64,'format':'wav'}}]\n\n# after\ncontent=[{'type':'text','text':'summarize'}, {'type':'image_url','image_url':{'url':img}}]  # audio handled by a dedicated STT step","handlingStrategy":"validation","validationCode":"SUPPORTED = {'text', 'image_url'}\ncontent = [p for p in content if p.get('type') in SUPPORTED]\nassert all(p['type'] in SUPPORTED for p in content), 'unsupported content type for OCI'","typeGuard":"def is_oci_supported_part(part: object) -> bool:\n    return isinstance(part, dict) and part.get('type') in ('text', 'image_url')","tryCatchPattern":"try:\n    litellm.completion(model='oci/...', messages=msgs)\nexcept OCIError as e:\n    if 'not supported by OCI' in str(e):\n        msgs = strip_unsupported_parts(msgs)  # drop audio/video/file parts\n    raise","preventionTips":["Know each provider's supported modalities and gate routing on them (capability map per provider).","Fail early in multi-provider apps: validate content types against the target provider before dispatch."],"tags":["oci","unsupported-feature","multimodal","input-validation"],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}