feat(anthropic): add AnthropicAdvisorTool type and ADVISOR_TOOL_2026_03_01 beta header enum

This commit is contained in:
Ishaan Jaffer 2026-04-10 11:42:55 -07:00
parent d0e347af32
commit 506de4527e
No known key found for this signature in database

View file

@ -126,6 +126,16 @@ class AnthropicToolSearchToolBM25(TypedDict, total=False):
input_examples: Optional[List[Dict[str, Any]]]
class AnthropicAdvisorTool(TypedDict, total=False):
"""Advisor tool — pairs a fast executor model with a high-intelligence advisor model."""
type: Required[Literal["advisor_20260301"]]
name: Required[Literal["advisor"]]
model: Required[str]
max_uses: Optional[int]
caching: Optional[dict]
class ToolReference(TypedDict, total=False):
"""Reference to a tool that should be expanded from deferred tools."""
@ -165,6 +175,7 @@ AllAnthropicToolsValues = Union[
AnthropicMemoryTool,
AnthropicToolSearchToolRegex,
AnthropicToolSearchToolBM25,
AnthropicAdvisorTool,
]
@ -654,6 +665,7 @@ class ANTHROPIC_BETA_HEADER_VALUES(str, Enum):
STRUCTURED_OUTPUT_2025_09_25 = "structured-outputs-2025-11-13"
ADVANCED_TOOL_USE_2025_11_20 = "advanced-tool-use-2025-11-20"
FAST_MODE_2026_02_01 = "fast-mode-2026-02-01"
ADVISOR_TOOL_2026_03_01 = "advisor-tool-2026-03-01"
# Tool search beta header constant (for Anthropic direct API and Microsoft Foundry)