{"record":{"id":"2b7b5f33c4f133ae","repo":"microsoft/autogen","slug":"model-info-is-required-when-model-name-is-not-reco","errorCode":null,"errorMessage":"model_info is required when model name is not recognized","messagePattern":"model_info is required when model name is not recognized","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/packages/autogen-ext/src/autogen_ext/models/anthropic/_anthropic_client.py","lineNumber":458,"sourceCode":"        completion_tokens=usage1.completion_tokens + usage2.completion_tokens,\n    )\n\n\nclass BaseAnthropicChatCompletionClient(ChatCompletionClient):\n    def __init__(\n        self,\n        client: Any,\n        *,\n        create_args: Dict[str, Any],\n        model_info: Optional[ModelInfo] = None,\n    ):\n        self._client = client\n\n        if model_info is None:\n            try:\n                self._model_info = _model_info.get_info(create_args[\"model\"])\n            except KeyError as err:\n                raise ValueError(\"model_info is required when model name is not recognized\") from err\n        else:\n            self._model_info = model_info\n\n        # Validate model_info\n        validate_model_info(self._model_info)\n\n        self._create_args = create_args\n        self._total_usage = RequestUsage(prompt_tokens=0, completion_tokens=0)\n        self._actual_usage = RequestUsage(prompt_tokens=0, completion_tokens=0)\n\n        # Store last used tools for anthropic API requirement\n        self._last_used_tools: List[ToolParam] = []\n\n    def _serialize_message(self, message: MessageParam) -> Dict[str, Any]:\n        \"\"\"Convert an Anthropic MessageParam to a JSON-serializable format.\"\"\"\n        if isinstance(message, dict):\n            result: Dict[str, Any] = {}\n            for key, value in message.items():","sourceCodeStart":440,"sourceCodeEnd":476,"githubUrl":"https://github.com/microsoft/autogen/blob/027ecf0a379bcc1d09956d46d12d44a3ad9cee14/python/packages/autogen-ext/src/autogen_ext/models/anthropic/_anthropic_client.py#L440-L476","documentation":"Error \"model_info is required when model name is not recognized\" thrown in microsoft/autogen.","triggerScenarios":"Thrown at python/packages/autogen-ext/src/autogen_ext/models/anthropic/_anthropic_client.py:458 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass model_info describing capabilities for custom models"],"exampleFix":"client = AnthropicChatCompletionClient(model=..., 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"}