{"record":{"id":"e862b38b50aa0e60","repo":"BerriAI/litellm","slug":"advisor-tool-definition-must-include-a-model-fie","errorCode":null,"errorMessage":"advisor tool definition must include a 'model' field specifying the advisor model","messagePattern":"advisor tool definition must include a 'model' field specifying the advisor model","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/anthropic/experimental_pass_through/messages/interceptors/advisor.py","lineNumber":80,"sourceCode":"        stream: bool | None,\n        max_tokens: int,\n        custom_llm_provider: str | None,\n        **kwargs,\n    ) -> AnthropicMessagesResponse | AsyncIterator:\n        from litellm.llms.anthropic.experimental_pass_through.messages.fake_stream_iterator import (\n            FakeAnthropicMessagesStreamIterator,\n        )\n\n        # Extract advisor tool config.\n        advisor_tool: Final = next(\n            (t for t in (tools or []) if t.get(\"type\") == ANTHROPIC_ADVISOR_TOOL_TYPE),\n            None,\n        )\n        if advisor_tool is None:\n            raise ValueError(f\"handle() called but no {ANTHROPIC_ADVISOR_TOOL_TYPE} tool found in tools list\")\n        advisor_model: Final[str] = advisor_tool.get(\"model\") or \"\"\n        if not advisor_model:\n            raise ValueError(\"advisor tool definition must include a 'model' field specifying the advisor model\")\n        _raw_max_uses: Final = advisor_tool.get(\"max_uses\")\n        max_uses: Final[int] = ADVISOR_MAX_USES if _raw_max_uses is None else int(_raw_max_uses)\n        advisor_api_key, advisor_api_base = _resolve_advisor_credentials(advisor_tool)\n\n        # Build the synthetic tool definition the provider will receive.\n        synthetic_advisor_tool: Final = _make_synthetic_advisor_tool()\n\n        # Executor tools = all original tools with advisor replaced by the synthetic one.\n        executor_tools: Final[list[dict]] = [\n            (synthetic_advisor_tool if t.get(\"type\") == ANTHROPIC_ADVISOR_TOOL_TYPE else t) for t in (tools or [])\n        ]\n\n        # Strip prior advisor blocks from history, preserving advice text as context.\n        current_messages: list[dict] = strip_advisor_blocks_from_messages(\n            [dict(m) for m in messages], replace_with_text=True\n        )\n\n        parent_request_id: Final[str] = str(kwargs.pop(\"litellm_call_id\", None) or uuid.uuid4())","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/anthropic/experimental_pass_through/messages/interceptors/advisor.py#L62-L98","documentation":"Error \"advisor tool definition must include a 'model' field specifying the advisor model\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/anthropic/experimental_pass_through/messages/interceptors/advisor.py:80 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add a 'model' field to the advisor tool definition naming the advisor model."],"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"}