{"record":{"id":"c29398078aa0b901","repo":"microsoft/autogen","slug":"structured-output-is-currently-not-supported-for-a","errorCode":null,"errorMessage":"Structured output is currently not supported for Anthropic models","messagePattern":"Structured output is currently not supported for Anthropic models","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/packages/autogen-ext/src/autogen_ext/models/anthropic/_anthropic_client.py","lineNumber":581,"sourceCode":"        create_args = self._create_args.copy()\n        create_args.update(extra_create_args)\n\n        # Check for vision capability if images are present\n        if self.model_info[\"vision\"] is False:\n            for message in messages:\n                if isinstance(message, UserMessage):\n                    if isinstance(message.content, list) and any(isinstance(x, Image) for x in message.content):\n                        raise ValueError(\"Model does not support vision and image was provided\")\n\n        # Handle JSON output format\n        if json_output is not None:\n            if self.model_info[\"json_output\"] is False and json_output is True:\n                raise ValueError(\"Model does not support JSON output\")\n\n            if json_output is True:\n                create_args[\"response_format\"] = {\"type\": \"json_object\"}\n            elif isinstance(json_output, type):\n                raise ValueError(\"Structured output is currently not supported for Anthropic models\")\n\n        # Process system message separately\n        system_message = None\n        anthropic_messages: List[MessageParam] = []\n\n        # Merge continuous system messages into a single message\n        messages = self._merge_system_messages(messages)\n        messages = self._rstrip_last_assistant_message(messages)\n\n        for message in messages:\n            if isinstance(message, SystemMessage):\n                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):","sourceCodeStart":563,"sourceCodeEnd":599,"githubUrl":"https://github.com/microsoft/autogen/blob/027ecf0a379bcc1d09956d46d12d44a3ad9cee14/python/packages/autogen-ext/src/autogen_ext/models/anthropic/_anthropic_client.py#L563-L599","documentation":"Error \"Structured output is currently not supported for Anthropic models\" thrown in microsoft/autogen.","triggerScenarios":"Thrown at python/packages/autogen-ext/src/autogen_ext/models/anthropic/_anthropic_client.py:581 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use json_output prompting instead of structured output schema"],"exampleFix":"Remove response_format schema; request JSON via prompt","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"}