{"record":{"id":"51293e27ce29a246","repo":"BerriAI/litellm","slug":"oci-response-contained-no-choices","errorCode":null,"errorMessage":"OCI response contained no choices","messagePattern":"OCI response contained no choices","errorType":"http","errorClass":"OCIError","httpStatus":null,"severity":"error","filePath":"litellm/llms/oci/chat/generic.py","lineNumber":322,"sourceCode":"    model_response: ModelResponse,\n    raw_response: httpx.Response,\n) -> ModelResponse:\n    \"\"\"Parse a non-streaming GENERIC OCI response into a LiteLLM ModelResponse.\"\"\"\n    try:\n        completion_response: Final = OCICompletionResponse(**json_data)\n    except (TypeError, ValidationError) as e:\n        raise OCIError(\n            message=f\"Response cannot be casted to OCICompletionResponse: {e}\",\n            status_code=raw_response.status_code,\n        )\n\n    iso_str: Final = completion_response.chatResponse.timeCreated\n    dt: Final = datetime.datetime.fromisoformat(iso_str.replace(\"Z\", \"+00:00\"))\n    model_response.created = int(dt.timestamp())\n    model_response.model = completion_response.modelId\n\n    if not completion_response.chatResponse.choices:\n        raise OCIError(\n            message=\"OCI response contained no choices\",\n            status_code=raw_response.status_code,\n        )\n\n    response_choice: Final = completion_response.chatResponse.choices[0]\n    message: Final = model_response.choices[0].message\n    response_message: Final = response_choice.message\n    if response_message is not None:\n        if response_message.content:\n            # Concatenate all text parts — matches the streaming handler, which\n            # iterates the full content array. Skips non-text parts (e.g. image\n            # parts) so a leading non-text part doesn't suppress trailing text.\n            text: str | None = None\n            for item in response_message.content:\n                if isinstance(item, OCITextContentPart):\n                    text = (text or \"\") + item.text\n            if text is not None:\n                message.content = text","sourceCodeStart":304,"sourceCodeEnd":340,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/llms/oci/chat/generic.py#L304-L340","documentation":"Error \"OCI response contained no choices\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/oci/chat/generic.py:322 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The OCI response contained no choices; check the model and request."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}