{"record":{"id":"1c7ff8a80e60acac","repo":"microsoft/autogen","slug":"model-does-not-support-function-calling","errorCode":null,"errorMessage":"Model does not support function calling","messagePattern":"Model does not support function calling","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/packages/autogen-ext/src/autogen_ext/models/anthropic/_anthropic_client.py","lineNumber":611,"sourceCode":"                if system_message is not None:\n                    # if that case, system message is must only one\n                    raise ValueError(\"Multiple system messages are not supported\")\n                system_message = to_anthropic_type(message)\n            else:\n                anthropic_message = to_anthropic_type(message)\n                if isinstance(anthropic_message, list):\n                    anthropic_messages.extend(anthropic_message)\n                elif isinstance(anthropic_message, str):\n                    msg = MessageParam(\n                        role=\"user\" if isinstance(message, UserMessage) else \"assistant\", content=anthropic_message\n                    )\n                    anthropic_messages.append(msg)\n                else:\n                    anthropic_messages.append(anthropic_message)\n\n        # Check for function calling support\n        if self.model_info[\"function_calling\"] is False and len(tools) > 0:\n            raise ValueError(\"Model does not support function calling\")\n\n        # Set up the request\n        request_args: Dict[str, Any] = {\n            \"model\": create_args[\"model\"],\n            \"messages\": anthropic_messages,\n            \"max_tokens\": create_args.get(\"max_tokens\", 4096),\n            \"temperature\": create_args.get(\"temperature\", 1.0),\n        }\n\n        # Add system message if present\n        if system_message is not None:\n            request_args[\"system\"] = system_message\n\n        has_tool_results = any(isinstance(msg, FunctionExecutionResultMessage) for msg in messages)\n\n        # Store and add tools if present\n        if len(tools) > 0:\n            converted_tools = convert_tools(tools)","sourceCodeStart":593,"sourceCodeEnd":629,"githubUrl":"https://github.com/microsoft/autogen/blob/027ecf0a379bcc1d09956d46d12d44a3ad9cee14/python/packages/autogen-ext/src/autogen_ext/models/anthropic/_anthropic_client.py#L593-L629","documentation":"Error \"Model does not support function calling\" thrown in microsoft/autogen.","triggerScenarios":"Thrown at python/packages/autogen-ext/src/autogen_ext/models/anthropic/_anthropic_client.py:611 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove tools or use a function-calling-capable model"],"exampleFix":"Set model_info function_calling=True or drop tools","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"027ecf0a379bcc1d09956d46d12d44a3ad9cee14","analyzedAt":"2026-08-15T03:38:00.719Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}