{"record":{"id":"669d0033365b9bc9","repo":"BerriAI/litellm","slug":"invalid-tool-choice-for-oci-unsupported-type-raw","errorCode":null,"errorMessage":"Invalid tool_choice for OCI: unsupported type {raw_type!r}; expected one of 'FUNCTION', 'AUTO', 'NONE', 'REQUIRED'","messagePattern":"Invalid tool_choice for OCI: unsupported type (.+?); expected one of 'FUNCTION', 'AUTO', 'NONE', 'REQUIRED'","errorType":"exception","errorClass":"OCIError","httpStatus":400,"severity":"error","filePath":"litellm/llms/oci/chat/transformation.py","lineNumber":170,"sourceCode":"        if not isinstance(raw_type, str):\n            raise OCIError(\n                status_code=400,\n                message=f\"Invalid tool_choice for OCI: missing or non-string 'type' in {tc!r}\",\n            )\n        upper: Final = raw_type.upper()\n        if upper == \"FUNCTION\":\n            fn: Final = tc.get(\"function\")\n            name: Final = fn.get(\"name\") if isinstance(fn, dict) else tc.get(\"name\")\n            if not (isinstance(name, str) and name):\n                raise OCIError(\n                    status_code=400,\n                    message=\"Invalid tool_choice for OCI: 'FUNCTION' type requires a non-empty function name\",\n                )\n            selected_params[\"toolChoice\"] = {\"type\": \"FUNCTION\", \"name\": name}\n        elif upper in {\"AUTO\", \"NONE\", \"REQUIRED\"}:\n            selected_params[\"toolChoice\"] = {\"type\": upper}\n        else:\n            raise OCIError(\n                status_code=400,\n                message=(\n                    f\"Invalid tool_choice for OCI: unsupported type {raw_type!r}; \"\n                    \"expected one of 'FUNCTION', 'AUTO', 'NONE', 'REQUIRED'\"\n                ),\n            )\n        return\n    raise OCIError(\n        status_code=400,\n        message=(f\"Invalid tool_choice for OCI: expected str or dict, got {type(tc).__name__}\"),\n    )\n\n\ndef _normalize_response_format(selected_params: dict, vendor: OCIVendors) -> None:\n    rf: Final = selected_params.get(\"responseFormat\")\n    if not isinstance(rf, dict) or \"type\" not in rf:\n        return\n","sourceCodeStart":152,"sourceCodeEnd":188,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/llms/oci/chat/transformation.py#L152-L188","documentation":"Error \"Invalid tool_choice for OCI: unsupported type {raw_type!r}; expected one of 'FUNCTION', 'AUTO', 'NONE', 'REQUIRED'\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/oci/chat/transformation.py:170 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use tool_choice type 'FUNCTION', 'AUTO', 'NONE', or 'REQUIRED'."],"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"}