{"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/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/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":["When tool_choice type is 'FUNCTION', include a non-empty function name: {'type': 'FUNCTION', 'function': {'name': 'my_fn'}}."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}