{"record":{"id":"60dfff6d35c8483e","repo":"microsoft/autogen","slug":"model-does-not-support-vision-and-image-was-provid","errorCode":null,"errorMessage":"Model does not support vision and image was provided","messagePattern":"Model does not support vision and image was provided","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/packages/autogen-ext/src/autogen_ext/models/anthropic/_anthropic_client.py","lineNumber":571,"sourceCode":"        self,\n        messages: Sequence[LLMMessage],\n        *,\n        tools: Sequence[Tool | ToolSchema] = [],\n        tool_choice: Tool | Literal[\"auto\", \"required\", \"none\"] = \"auto\",\n        json_output: Optional[bool | type[BaseModel]] = None,\n        extra_create_args: Mapping[str, Any] = {},\n        cancellation_token: Optional[CancellationToken] = None,\n    ) -> CreateResult:\n        # Copy create args and update with extra args\n        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)","sourceCodeStart":553,"sourceCodeEnd":589,"githubUrl":"https://github.com/microsoft/autogen/blob/027ecf0a379bcc1d09956d46d12d44a3ad9cee14/python/packages/autogen-ext/src/autogen_ext/models/anthropic/_anthropic_client.py#L553-L589","documentation":"Error \"Model does not support vision and image was provided\" thrown in microsoft/autogen.","triggerScenarios":"Thrown at python/packages/autogen-ext/src/autogen_ext/models/anthropic/_anthropic_client.py:571 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove images or switch to a vision-capable model"],"exampleFix":"Use a model with vision=True in model_info","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"}