{"record":{"id":"ad969e85fbbd8b5b","repo":"BerriAI/litellm","slug":"invalid-tool-choice-for-oci-function-type-requi","errorCode":null,"errorMessage":"Invalid tool_choice for OCI: 'FUNCTION' type requires a non-empty function name","messagePattern":"Invalid tool_choice for OCI: 'FUNCTION' type requires a non-empty function name","errorType":"exception","errorClass":"OCIError","httpStatus":400,"severity":"error","filePath":"litellm/llms/oci/chat/transformation.py","lineNumber":162,"sourceCode":"            \"none\": {\"type\": \"NONE\"},\n            \"required\": {\"type\": \"REQUIRED\"},\n            \"any\": {\"type\": \"REQUIRED\"},\n        }\n        selected_params[\"toolChoice\"] = tc_map.get(tc.lower(), {\"type\": \"FUNCTION\", \"name\": tc})\n        return\n    if isinstance(tc, dict):\n        raw_type: Final = tc.get(\"type\")\n        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__}\"),","sourceCodeStart":144,"sourceCodeEnd":180,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/llms/oci/chat/transformation.py#L144-L180","documentation":"Error \"Invalid tool_choice for OCI: 'FUNCTION' type requires a non-empty function name\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/oci/chat/transformation.py:162 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide a non-empty function name for tool_choice type 'FUNCTION'."],"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-15T17:31:12.345Z"}