Skip to content

Commit c101559

Browse files
feat(api): Add beta advisor tool
1 parent 5a290a8 commit c101559

22 files changed

+281
-4
lines changed

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 72
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic%2Fanthropic-2803e5a61e6baf09a06c02861b3891a45ecf093b7364946a101bee3ab63f002f.yml
3-
openapi_spec_hash: 24c3be07d605d11323afa51c7808fa00
4-
config_hash: e5581931b467b1d7bae9fee74aeb8bff
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic%2Fanthropic-d87d3ef6f636c667a0256be82cebef0699d17403d409c26ec15813683cfc3263.yml
3+
openapi_spec_hash: d849fdf2c4dd6631a60c4340e9bc1322
4+
config_hash: 062be10c6bf39b6719b3a5ea2bf758b3

api.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,16 @@ Types:
292292

293293
```python
294294
from anthropic.types.beta import (
295+
BetaAdvisorMessageIterationUsage,
296+
BetaAdvisorRedactedResultBlock,
297+
BetaAdvisorRedactedResultBlockParam,
298+
BetaAdvisorResultBlock,
299+
BetaAdvisorResultBlockParam,
300+
BetaAdvisorTool20260301,
301+
BetaAdvisorToolResultBlock,
302+
BetaAdvisorToolResultBlockParam,
303+
BetaAdvisorToolResultError,
304+
BetaAdvisorToolResultErrorParam,
295305
BetaAllThinkingTurns,
296306
BetaBase64ImageSource,
297307
BetaBase64PDFSource,

src/anthropic/types/anthropic_beta_param.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,6 @@
3131
"skills-2025-10-02",
3232
"fast-mode-2026-02-01",
3333
"output-300k-2026-03-24",
34+
"advisor-tool-2026-03-01",
3435
],
3536
]

src/anthropic/types/beta/__init__.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
from .beta_text_citation_param import BetaTextCitationParam as BetaTextCitationParam
8282
from .beta_thinking_capability import BetaThinkingCapability as BetaThinkingCapability
8383
from .beta_user_location_param import BetaUserLocationParam as BetaUserLocationParam
84+
from .beta_advisor_result_block import BetaAdvisorResultBlock as BetaAdvisorResultBlock
8485
from .beta_managed_agents_agent import BetaManagedAgentsAgent as BetaManagedAgentsAgent
8586
from .beta_managed_agents_model import BetaManagedAgentsModel as BetaManagedAgentsModel
8687
from .beta_managed_agents_vault import BetaManagedAgentsVault as BetaManagedAgentsVault
@@ -133,8 +134,11 @@
133134
from .beta_server_tool_caller_param import BetaServerToolCallerParam as BetaServerToolCallerParam
134135
from .beta_tool_bash_20241022_param import BetaToolBash20241022Param as BetaToolBash20241022Param
135136
from .beta_tool_bash_20250124_param import BetaToolBash20250124Param as BetaToolBash20250124Param
137+
from .beta_advisor_tool_result_block import BetaAdvisorToolResultBlock as BetaAdvisorToolResultBlock
138+
from .beta_advisor_tool_result_error import BetaAdvisorToolResultError as BetaAdvisorToolResultError
136139
from .beta_base64_image_source_param import BetaBase64ImageSourceParam as BetaBase64ImageSourceParam
137140
from .beta_search_result_block_param import BetaSearchResultBlockParam as BetaSearchResultBlockParam
141+
from .beta_advisor_result_block_param import BetaAdvisorResultBlockParam as BetaAdvisorResultBlockParam
138142
from .beta_compaction_iteration_usage import BetaCompactionIterationUsage as BetaCompactionIterationUsage
139143
from .beta_content_block_source_param import BetaContentBlockSourceParam as BetaContentBlockSourceParam
140144
from .beta_file_document_source_param import BetaFileDocumentSourceParam as BetaFileDocumentSourceParam
@@ -145,6 +149,7 @@
145149
from .beta_memory_tool_20250818_param import BetaMemoryTool20250818Param as BetaMemoryTool20250818Param
146150
from .beta_tool_reference_block_param import BetaToolReferenceBlockParam as BetaToolReferenceBlockParam
147151
from .beta_unrestricted_network_param import BetaUnrestrictedNetworkParam as BetaUnrestrictedNetworkParam
152+
from .beta_advisor_tool_20260301_param import BetaAdvisorTool20260301Param as BetaAdvisorTool20260301Param
148153
from .beta_code_execution_output_block import BetaCodeExecutionOutputBlock as BetaCodeExecutionOutputBlock
149154
from .beta_code_execution_result_block import BetaCodeExecutionResultBlock as BetaCodeExecutionResultBlock
150155
from .beta_compact_20260112_edit_param import BetaCompact20260112EditParam as BetaCompact20260112EditParam
@@ -169,6 +174,7 @@
169174
from .beta_request_document_block_param import BetaRequestDocumentBlockParam as BetaRequestDocumentBlockParam
170175
from .beta_web_search_tool_result_block import BetaWebSearchToolResultBlock as BetaWebSearchToolResultBlock
171176
from .beta_web_search_tool_result_error import BetaWebSearchToolResultError as BetaWebSearchToolResultError
177+
from .beta_advisor_redacted_result_block import BetaAdvisorRedactedResultBlock as BetaAdvisorRedactedResultBlock
172178
from .beta_cache_control_ephemeral_param import BetaCacheControlEphemeralParam as BetaCacheControlEphemeralParam
173179
from .beta_context_management_capability import BetaContextManagementCapability as BetaContextManagementCapability
174180
from .beta_mcp_tool_default_config_param import BetaMCPToolDefaultConfigParam as BetaMCPToolDefaultConfigParam
@@ -192,6 +198,9 @@
192198
from .beta_thinking_config_disabled_param import BetaThinkingConfigDisabledParam as BetaThinkingConfigDisabledParam
193199
from .beta_web_search_tool_20250305_param import BetaWebSearchTool20250305Param as BetaWebSearchTool20250305Param
194200
from .beta_web_search_tool_20260209_param import BetaWebSearchTool20260209Param as BetaWebSearchTool20260209Param
201+
from .beta_advisor_message_iteration_usage import BetaAdvisorMessageIterationUsage as BetaAdvisorMessageIterationUsage
202+
from .beta_advisor_tool_result_block_param import BetaAdvisorToolResultBlockParam as BetaAdvisorToolResultBlockParam
203+
from .beta_advisor_tool_result_error_param import BetaAdvisorToolResultErrorParam as BetaAdvisorToolResultErrorParam
195204
from .beta_citation_content_block_location import BetaCitationContentBlockLocation as BetaCitationContentBlockLocation
196205
from .beta_citation_search_result_location import BetaCitationSearchResultLocation as BetaCitationSearchResultLocation
197206
from .beta_context_management_config_param import BetaContextManagementConfigParam as BetaContextManagementConfigParam
@@ -258,6 +267,9 @@
258267
from .beta_web_search_tool_result_block_param import (
259268
BetaWebSearchToolResultBlockParam as BetaWebSearchToolResultBlockParam,
260269
)
270+
from .beta_advisor_redacted_result_block_param import (
271+
BetaAdvisorRedactedResultBlockParam as BetaAdvisorRedactedResultBlockParam,
272+
)
261273
from .beta_clear_tool_uses_20250919_edit_param import (
262274
BetaClearToolUses20250919EditParam as BetaClearToolUses20250919EditParam,
263275
)
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from typing import Optional
4+
from typing_extensions import Literal
5+
6+
from ..model import Model
7+
from ..._models import BaseModel
8+
from .beta_cache_creation import BetaCacheCreation
9+
10+
__all__ = ["BetaAdvisorMessageIterationUsage"]
11+
12+
13+
class BetaAdvisorMessageIterationUsage(BaseModel):
14+
"""Token usage for an advisor sub-inference iteration."""
15+
16+
cache_creation: Optional[BetaCacheCreation] = None
17+
"""Breakdown of cached tokens by TTL"""
18+
19+
cache_creation_input_tokens: int
20+
"""The number of input tokens used to create the cache entry."""
21+
22+
cache_read_input_tokens: int
23+
"""The number of input tokens read from the cache."""
24+
25+
input_tokens: int
26+
"""The number of input tokens which were used."""
27+
28+
model: Model
29+
"""
30+
The model that will complete your prompt.\n\nSee
31+
[models](https://docs.anthropic.com/en/docs/models-overview) for additional
32+
details and options.
33+
"""
34+
35+
output_tokens: int
36+
"""The number of output tokens which were used."""
37+
38+
type: Literal["advisor_message"]
39+
"""Usage for an advisor sub-inference iteration"""
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from typing_extensions import Literal
4+
5+
from ..._models import BaseModel
6+
7+
__all__ = ["BetaAdvisorRedactedResultBlock"]
8+
9+
10+
class BetaAdvisorRedactedResultBlock(BaseModel):
11+
encrypted_content: str
12+
"""Opaque blob containing the advisor's output.
13+
14+
Round-trip verbatim; do not inspect or modify.
15+
"""
16+
17+
type: Literal["advisor_redacted_result"]
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing_extensions import Literal, Required, TypedDict
6+
7+
__all__ = ["BetaAdvisorRedactedResultBlockParam"]
8+
9+
10+
class BetaAdvisorRedactedResultBlockParam(TypedDict, total=False):
11+
encrypted_content: Required[str]
12+
"""Opaque blob produced by a prior response; must be round-tripped verbatim."""
13+
14+
type: Required[Literal["advisor_redacted_result"]]
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from typing_extensions import Literal
4+
5+
from ..._models import BaseModel
6+
7+
__all__ = ["BetaAdvisorResultBlock"]
8+
9+
10+
class BetaAdvisorResultBlock(BaseModel):
11+
text: str
12+
13+
type: Literal["advisor_result"]
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing_extensions import Literal, Required, TypedDict
6+
7+
__all__ = ["BetaAdvisorResultBlockParam"]
8+
9+
10+
class BetaAdvisorResultBlockParam(TypedDict, total=False):
11+
text: Required[str]
12+
13+
type: Required[Literal["advisor_result"]]
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing import List, Optional
6+
from typing_extensions import Literal, Required, TypedDict
7+
8+
from ..model_param import ModelParam
9+
from .beta_cache_control_ephemeral_param import BetaCacheControlEphemeralParam
10+
11+
__all__ = ["BetaAdvisorTool20260301Param"]
12+
13+
14+
class BetaAdvisorTool20260301Param(TypedDict, total=False):
15+
model: Required[ModelParam]
16+
"""
17+
The model that will complete your prompt.\n\nSee
18+
[models](https://docs.anthropic.com/en/docs/models-overview) for additional
19+
details and options.
20+
"""
21+
22+
name: Required[Literal["advisor"]]
23+
"""Name of the tool.
24+
25+
This is how the tool will be called by the model and in `tool_use` blocks.
26+
"""
27+
28+
type: Required[Literal["advisor_20260301"]]
29+
30+
allowed_callers: List[Literal["direct", "code_execution_20250825", "code_execution_20260120"]]
31+
32+
cache_control: Optional[BetaCacheControlEphemeralParam]
33+
"""Create a cache control breakpoint at this content block."""
34+
35+
caching: Optional[BetaCacheControlEphemeralParam]
36+
"""Caching for the advisor's own prompt.
37+
38+
When set, each advisor call writes a cache entry at the given TTL so subsequent
39+
calls in the same conversation read the stable prefix. When omitted, the advisor
40+
prompt is not cached.
41+
"""
42+
43+
defer_loading: bool
44+
"""If true, tool will not be included in initial system prompt.
45+
46+
Only loaded when returned via tool_reference from tool search.
47+
"""
48+
49+
max_uses: Optional[int]
50+
"""Maximum number of times the tool can be used in the API request."""
51+
52+
strict: bool
53+
"""When true, guarantees schema validation on tool names and inputs"""

0 commit comments

Comments
 (0)