anthropic 0.74.1__py3-none-any.whl → 0.75.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. anthropic/_version.py +1 -1
  2. anthropic/lib/streaming/_beta_messages.py +1 -1
  3. anthropic/lib/tools/_beta_compaction_control.py +48 -0
  4. anthropic/lib/tools/_beta_functions.py +30 -8
  5. anthropic/lib/tools/_beta_runner.py +216 -34
  6. anthropic/resources/beta/messages/messages.py +72 -0
  7. anthropic/resources/messages/messages.py +2 -0
  8. anthropic/types/anthropic_beta_param.py +1 -0
  9. anthropic/types/beta/__init__.py +31 -0
  10. anthropic/types/beta/beta_code_execution_tool_20250522_param.py +9 -1
  11. anthropic/types/beta/beta_code_execution_tool_20250825_param.py +9 -1
  12. anthropic/types/beta/beta_content_block.py +2 -0
  13. anthropic/types/beta/beta_content_block_param.py +2 -0
  14. anthropic/types/beta/beta_direct_caller.py +11 -0
  15. anthropic/types/beta/beta_direct_caller_param.py +11 -0
  16. anthropic/types/beta/beta_mcp_tool_config_param.py +13 -0
  17. anthropic/types/beta/beta_mcp_tool_default_config_param.py +13 -0
  18. anthropic/types/beta/beta_mcp_toolset_param.py +28 -0
  19. anthropic/types/beta/beta_memory_tool_20250818_param.py +11 -1
  20. anthropic/types/beta/beta_output_config_param.py +13 -0
  21. anthropic/types/beta/beta_raw_content_block_start_event.py +2 -0
  22. anthropic/types/beta/beta_server_tool_caller.py +13 -0
  23. anthropic/types/beta/beta_server_tool_caller_param.py +13 -0
  24. anthropic/types/beta/beta_server_tool_use_block.py +20 -4
  25. anthropic/types/beta/beta_server_tool_use_block_param.py +19 -4
  26. anthropic/types/beta/beta_tool_bash_20241022_param.py +11 -1
  27. anthropic/types/beta/beta_tool_bash_20250124_param.py +11 -1
  28. anthropic/types/beta/beta_tool_computer_use_20241022_param.py +11 -1
  29. anthropic/types/beta/beta_tool_computer_use_20250124_param.py +11 -1
  30. anthropic/types/beta/beta_tool_computer_use_20251124_param.py +47 -0
  31. anthropic/types/beta/beta_tool_param.py +11 -1
  32. anthropic/types/beta/beta_tool_reference_block.py +13 -0
  33. anthropic/types/beta/beta_tool_reference_block_param.py +19 -0
  34. anthropic/types/beta/beta_tool_result_block_param.py +6 -1
  35. anthropic/types/beta/beta_tool_search_tool_bm25_20251119_param.py +33 -0
  36. anthropic/types/beta/beta_tool_search_tool_regex_20251119_param.py +33 -0
  37. anthropic/types/beta/beta_tool_search_tool_result_block.py +20 -0
  38. anthropic/types/beta/beta_tool_search_tool_result_block_param.py +25 -0
  39. anthropic/types/beta/beta_tool_search_tool_result_error.py +16 -0
  40. anthropic/types/beta/beta_tool_search_tool_result_error_param.py +13 -0
  41. anthropic/types/beta/beta_tool_search_tool_search_result_block.py +15 -0
  42. anthropic/types/beta/beta_tool_search_tool_search_result_block_param.py +16 -0
  43. anthropic/types/beta/beta_tool_text_editor_20241022_param.py +11 -1
  44. anthropic/types/beta/beta_tool_text_editor_20250124_param.py +11 -1
  45. anthropic/types/beta/beta_tool_text_editor_20250429_param.py +11 -1
  46. anthropic/types/beta/beta_tool_text_editor_20250728_param.py +11 -1
  47. anthropic/types/beta/beta_tool_union_param.py +8 -0
  48. anthropic/types/beta/beta_tool_use_block.py +11 -3
  49. anthropic/types/beta/beta_tool_use_block_param.py +10 -3
  50. anthropic/types/beta/beta_web_fetch_tool_20250910_param.py +9 -1
  51. anthropic/types/beta/beta_web_search_tool_20250305_param.py +9 -1
  52. anthropic/types/beta/message_count_tokens_params.py +15 -0
  53. anthropic/types/beta/message_create_params.py +7 -0
  54. anthropic/types/beta/messages/batch_create_params.py +4 -4
  55. anthropic/types/messages/batch_create_params.py +2 -2
  56. anthropic/types/model.py +2 -0
  57. anthropic/types/model_param.py +2 -0
  58. {anthropic-0.74.1.dist-info → anthropic-0.75.0.dist-info}/METADATA +1 -1
  59. {anthropic-0.74.1.dist-info → anthropic-0.75.0.dist-info}/RECORD +61 -41
  60. {anthropic-0.74.1.dist-info → anthropic-0.75.0.dist-info}/WHEEL +0 -0
  61. {anthropic-0.74.1.dist-info → anthropic-0.75.0.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,11 @@
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__ = ["BetaDirectCaller"]
8
+
9
+
10
+ class BetaDirectCaller(BaseModel):
11
+ type: Literal["direct"]
@@ -0,0 +1,11 @@
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__ = ["BetaDirectCallerParam"]
8
+
9
+
10
+ class BetaDirectCallerParam(TypedDict, total=False):
11
+ type: Required[Literal["direct"]]
@@ -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 TypedDict
6
+
7
+ __all__ = ["BetaMCPToolConfigParam"]
8
+
9
+
10
+ class BetaMCPToolConfigParam(TypedDict, total=False):
11
+ defer_loading: bool
12
+
13
+ enabled: bool
@@ -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 TypedDict
6
+
7
+ __all__ = ["BetaMCPToolDefaultConfigParam"]
8
+
9
+
10
+ class BetaMCPToolDefaultConfigParam(TypedDict, total=False):
11
+ defer_loading: bool
12
+
13
+ enabled: bool
@@ -0,0 +1,28 @@
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 Dict, Optional
6
+ from typing_extensions import Literal, Required, TypedDict
7
+
8
+ from .beta_mcp_tool_config_param import BetaMCPToolConfigParam
9
+ from .beta_cache_control_ephemeral_param import BetaCacheControlEphemeralParam
10
+ from .beta_mcp_tool_default_config_param import BetaMCPToolDefaultConfigParam
11
+
12
+ __all__ = ["BetaMCPToolsetParam"]
13
+
14
+
15
+ class BetaMCPToolsetParam(TypedDict, total=False):
16
+ mcp_server_name: Required[str]
17
+ """Name of the MCP server to configure tools for"""
18
+
19
+ type: Required[Literal["mcp_toolset"]]
20
+
21
+ cache_control: Optional[BetaCacheControlEphemeralParam]
22
+ """Create a cache control breakpoint at this content block."""
23
+
24
+ configs: Optional[Dict[str, BetaMCPToolConfigParam]]
25
+ """Configuration overrides for specific tools, keyed by tool name"""
26
+
27
+ default_config: BetaMCPToolDefaultConfigParam
28
+ """Default configuration applied to all tools from this server"""
@@ -2,7 +2,7 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import Optional
5
+ from typing import Dict, List, Iterable, Optional
6
6
  from typing_extensions import Literal, Required, TypedDict
7
7
 
8
8
  from .beta_cache_control_ephemeral_param import BetaCacheControlEphemeralParam
@@ -19,7 +19,17 @@ class BetaMemoryTool20250818Param(TypedDict, total=False):
19
19
 
20
20
  type: Required[Literal["memory_20250818"]]
21
21
 
22
+ allowed_callers: List[Literal["direct", "code_execution_20250825"]]
23
+
22
24
  cache_control: Optional[BetaCacheControlEphemeralParam]
23
25
  """Create a cache control breakpoint at this content block."""
24
26
 
27
+ defer_loading: bool
28
+ """If true, tool will not be included in initial system prompt.
29
+
30
+ Only loaded when returned via tool_reference from tool search.
31
+ """
32
+
33
+ input_examples: Iterable[Dict[str, object]]
34
+
25
35
  strict: bool
@@ -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 import Optional
6
+ from typing_extensions import Literal, TypedDict
7
+
8
+ __all__ = ["BetaOutputConfigParam"]
9
+
10
+
11
+ class BetaOutputConfigParam(TypedDict, total=False):
12
+ effort: Optional[Literal["low", "medium", "high"]]
13
+ """All possible effort levels."""
@@ -15,6 +15,7 @@ from .beta_container_upload_block import BetaContainerUploadBlock
15
15
  from .beta_redacted_thinking_block import BetaRedactedThinkingBlock
16
16
  from .beta_web_fetch_tool_result_block import BetaWebFetchToolResultBlock
17
17
  from .beta_web_search_tool_result_block import BetaWebSearchToolResultBlock
18
+ from .beta_tool_search_tool_result_block import BetaToolSearchToolResultBlock
18
19
  from .beta_code_execution_tool_result_block import BetaCodeExecutionToolResultBlock
19
20
  from .beta_bash_code_execution_tool_result_block import BetaBashCodeExecutionToolResultBlock
20
21
  from .beta_text_editor_code_execution_tool_result_block import BetaTextEditorCodeExecutionToolResultBlock
@@ -33,6 +34,7 @@ ContentBlock: TypeAlias = Annotated[
33
34
  BetaCodeExecutionToolResultBlock,
34
35
  BetaBashCodeExecutionToolResultBlock,
35
36
  BetaTextEditorCodeExecutionToolResultBlock,
37
+ BetaToolSearchToolResultBlock,
36
38
  BetaMCPToolUseBlock,
37
39
  BetaMCPToolResultBlock,
38
40
  BetaContainerUploadBlock,
@@ -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__ = ["BetaServerToolCaller"]
8
+
9
+
10
+ class BetaServerToolCaller(BaseModel):
11
+ tool_id: str
12
+
13
+ type: Literal["code_execution_20250825"]
@@ -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__ = ["BetaServerToolCallerParam"]
8
+
9
+
10
+ class BetaServerToolCallerParam(TypedDict, total=False):
11
+ tool_id: Required[str]
12
+
13
+ type: Required[Literal["code_execution_20250825"]]
@@ -1,18 +1,34 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- from typing import Dict
4
- from typing_extensions import Literal
3
+ from typing import Dict, Union
4
+ from typing_extensions import Literal, Annotated, TypeAlias
5
5
 
6
+ from ..._utils import PropertyInfo
6
7
  from ..._models import BaseModel
8
+ from .beta_direct_caller import BetaDirectCaller
9
+ from .beta_server_tool_caller import BetaServerToolCaller
7
10
 
8
- __all__ = ["BetaServerToolUseBlock"]
11
+ __all__ = ["BetaServerToolUseBlock", "Caller"]
12
+
13
+ Caller: TypeAlias = Annotated[Union[BetaDirectCaller, BetaServerToolCaller], PropertyInfo(discriminator="type")]
9
14
 
10
15
 
11
16
  class BetaServerToolUseBlock(BaseModel):
12
17
  id: str
13
18
 
19
+ caller: Caller
20
+ """Tool invocation directly from the model."""
21
+
14
22
  input: Dict[str, object]
15
23
 
16
- name: Literal["web_search", "web_fetch", "code_execution", "bash_code_execution", "text_editor_code_execution"]
24
+ name: Literal[
25
+ "web_search",
26
+ "web_fetch",
27
+ "code_execution",
28
+ "bash_code_execution",
29
+ "text_editor_code_execution",
30
+ "tool_search_tool_regex",
31
+ "tool_search_tool_bm25",
32
+ ]
17
33
 
18
34
  type: Literal["server_tool_use"]
@@ -2,12 +2,16 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import Dict, Optional
6
- from typing_extensions import Literal, Required, TypedDict
5
+ from typing import Dict, Union, Optional
6
+ from typing_extensions import Literal, Required, TypeAlias, TypedDict
7
7
 
8
+ from .beta_direct_caller_param import BetaDirectCallerParam
9
+ from .beta_server_tool_caller_param import BetaServerToolCallerParam
8
10
  from .beta_cache_control_ephemeral_param import BetaCacheControlEphemeralParam
9
11
 
10
- __all__ = ["BetaServerToolUseBlockParam"]
12
+ __all__ = ["BetaServerToolUseBlockParam", "Caller"]
13
+
14
+ Caller: TypeAlias = Union[BetaDirectCallerParam, BetaServerToolCallerParam]
11
15
 
12
16
 
13
17
  class BetaServerToolUseBlockParam(TypedDict, total=False):
@@ -16,10 +20,21 @@ class BetaServerToolUseBlockParam(TypedDict, total=False):
16
20
  input: Required[Dict[str, object]]
17
21
 
18
22
  name: Required[
19
- Literal["web_search", "web_fetch", "code_execution", "bash_code_execution", "text_editor_code_execution"]
23
+ Literal[
24
+ "web_search",
25
+ "web_fetch",
26
+ "code_execution",
27
+ "bash_code_execution",
28
+ "text_editor_code_execution",
29
+ "tool_search_tool_regex",
30
+ "tool_search_tool_bm25",
31
+ ]
20
32
  ]
21
33
 
22
34
  type: Required[Literal["server_tool_use"]]
23
35
 
24
36
  cache_control: Optional[BetaCacheControlEphemeralParam]
25
37
  """Create a cache control breakpoint at this content block."""
38
+
39
+ caller: Caller
40
+ """Tool invocation directly from the model."""
@@ -2,7 +2,7 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import Optional
5
+ from typing import Dict, List, Iterable, Optional
6
6
  from typing_extensions import Literal, Required, TypedDict
7
7
 
8
8
  from .beta_cache_control_ephemeral_param import BetaCacheControlEphemeralParam
@@ -19,7 +19,17 @@ class BetaToolBash20241022Param(TypedDict, total=False):
19
19
 
20
20
  type: Required[Literal["bash_20241022"]]
21
21
 
22
+ allowed_callers: List[Literal["direct", "code_execution_20250825"]]
23
+
22
24
  cache_control: Optional[BetaCacheControlEphemeralParam]
23
25
  """Create a cache control breakpoint at this content block."""
24
26
 
27
+ defer_loading: bool
28
+ """If true, tool will not be included in initial system prompt.
29
+
30
+ Only loaded when returned via tool_reference from tool search.
31
+ """
32
+
33
+ input_examples: Iterable[Dict[str, object]]
34
+
25
35
  strict: bool
@@ -2,7 +2,7 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import Optional
5
+ from typing import Dict, List, Iterable, Optional
6
6
  from typing_extensions import Literal, Required, TypedDict
7
7
 
8
8
  from .beta_cache_control_ephemeral_param import BetaCacheControlEphemeralParam
@@ -19,7 +19,17 @@ class BetaToolBash20250124Param(TypedDict, total=False):
19
19
 
20
20
  type: Required[Literal["bash_20250124"]]
21
21
 
22
+ allowed_callers: List[Literal["direct", "code_execution_20250825"]]
23
+
22
24
  cache_control: Optional[BetaCacheControlEphemeralParam]
23
25
  """Create a cache control breakpoint at this content block."""
24
26
 
27
+ defer_loading: bool
28
+ """If true, tool will not be included in initial system prompt.
29
+
30
+ Only loaded when returned via tool_reference from tool search.
31
+ """
32
+
33
+ input_examples: Iterable[Dict[str, object]]
34
+
25
35
  strict: bool
@@ -2,7 +2,7 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import Optional
5
+ from typing import Dict, List, Iterable, Optional
6
6
  from typing_extensions import Literal, Required, TypedDict
7
7
 
8
8
  from .beta_cache_control_ephemeral_param import BetaCacheControlEphemeralParam
@@ -25,10 +25,20 @@ class BetaToolComputerUse20241022Param(TypedDict, total=False):
25
25
 
26
26
  type: Required[Literal["computer_20241022"]]
27
27
 
28
+ allowed_callers: List[Literal["direct", "code_execution_20250825"]]
29
+
28
30
  cache_control: Optional[BetaCacheControlEphemeralParam]
29
31
  """Create a cache control breakpoint at this content block."""
30
32
 
33
+ defer_loading: bool
34
+ """If true, tool will not be included in initial system prompt.
35
+
36
+ Only loaded when returned via tool_reference from tool search.
37
+ """
38
+
31
39
  display_number: Optional[int]
32
40
  """The X11 display number (e.g. 0, 1) for the display."""
33
41
 
42
+ input_examples: Iterable[Dict[str, object]]
43
+
34
44
  strict: bool
@@ -2,7 +2,7 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import Optional
5
+ from typing import Dict, List, Iterable, Optional
6
6
  from typing_extensions import Literal, Required, TypedDict
7
7
 
8
8
  from .beta_cache_control_ephemeral_param import BetaCacheControlEphemeralParam
@@ -25,10 +25,20 @@ class BetaToolComputerUse20250124Param(TypedDict, total=False):
25
25
 
26
26
  type: Required[Literal["computer_20250124"]]
27
27
 
28
+ allowed_callers: List[Literal["direct", "code_execution_20250825"]]
29
+
28
30
  cache_control: Optional[BetaCacheControlEphemeralParam]
29
31
  """Create a cache control breakpoint at this content block."""
30
32
 
33
+ defer_loading: bool
34
+ """If true, tool will not be included in initial system prompt.
35
+
36
+ Only loaded when returned via tool_reference from tool search.
37
+ """
38
+
31
39
  display_number: Optional[int]
32
40
  """The X11 display number (e.g. 0, 1) for the display."""
33
41
 
42
+ input_examples: Iterable[Dict[str, object]]
43
+
34
44
  strict: bool
@@ -0,0 +1,47 @@
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 Dict, List, Iterable, Optional
6
+ from typing_extensions import Literal, Required, TypedDict
7
+
8
+ from .beta_cache_control_ephemeral_param import BetaCacheControlEphemeralParam
9
+
10
+ __all__ = ["BetaToolComputerUse20251124Param"]
11
+
12
+
13
+ class BetaToolComputerUse20251124Param(TypedDict, total=False):
14
+ display_height_px: Required[int]
15
+ """The height of the display in pixels."""
16
+
17
+ display_width_px: Required[int]
18
+ """The width of the display in pixels."""
19
+
20
+ name: Required[Literal["computer"]]
21
+ """Name of the tool.
22
+
23
+ This is how the tool will be called by the model and in `tool_use` blocks.
24
+ """
25
+
26
+ type: Required[Literal["computer_20251124"]]
27
+
28
+ allowed_callers: List[Literal["direct", "code_execution_20250825"]]
29
+
30
+ cache_control: Optional[BetaCacheControlEphemeralParam]
31
+ """Create a cache control breakpoint at this content block."""
32
+
33
+ defer_loading: bool
34
+ """If true, tool will not be included in initial system prompt.
35
+
36
+ Only loaded when returned via tool_reference from tool search.
37
+ """
38
+
39
+ display_number: Optional[int]
40
+ """The X11 display number (e.g. 0, 1) for the display."""
41
+
42
+ enable_zoom: bool
43
+ """Whether to enable an action to take a zoomed-in screenshot of the screen."""
44
+
45
+ input_examples: Iterable[Dict[str, object]]
46
+
47
+ strict: bool
@@ -2,7 +2,7 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import Dict, Union, Optional
5
+ from typing import Dict, List, Union, Iterable, Optional
6
6
  from typing_extensions import Literal, Required, TypeAlias, TypedDict
7
7
 
8
8
  from ..._types import SequenceNotStr
@@ -36,9 +36,17 @@ class BetaToolParam(TypedDict, total=False):
36
36
  This is how the tool will be called by the model and in `tool_use` blocks.
37
37
  """
38
38
 
39
+ allowed_callers: List[Literal["direct", "code_execution_20250825"]]
40
+
39
41
  cache_control: Optional[BetaCacheControlEphemeralParam]
40
42
  """Create a cache control breakpoint at this content block."""
41
43
 
44
+ defer_loading: bool
45
+ """If true, tool will not be included in initial system prompt.
46
+
47
+ Only loaded when returned via tool_reference from tool search.
48
+ """
49
+
42
50
  description: str
43
51
  """Description of what this tool does.
44
52
 
@@ -48,6 +56,8 @@ class BetaToolParam(TypedDict, total=False):
48
56
  aspects of the tool input JSON schema.
49
57
  """
50
58
 
59
+ input_examples: Iterable[Dict[str, object]]
60
+
51
61
  strict: bool
52
62
 
53
63
  type: Optional[Literal["custom"]]
@@ -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__ = ["BetaToolReferenceBlock"]
8
+
9
+
10
+ class BetaToolReferenceBlock(BaseModel):
11
+ tool_name: str
12
+
13
+ type: Literal["tool_reference"]
@@ -0,0 +1,19 @@
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 Optional
6
+ from typing_extensions import Literal, Required, TypedDict
7
+
8
+ from .beta_cache_control_ephemeral_param import BetaCacheControlEphemeralParam
9
+
10
+ __all__ = ["BetaToolReferenceBlockParam"]
11
+
12
+
13
+ class BetaToolReferenceBlockParam(TypedDict, total=False):
14
+ tool_name: Required[str]
15
+
16
+ type: Required[Literal["tool_reference"]]
17
+
18
+ cache_control: Optional[BetaCacheControlEphemeralParam]
19
+ """Create a cache control breakpoint at this content block."""
@@ -8,13 +8,18 @@ from typing_extensions import Literal, Required, TypeAlias, TypedDict
8
8
  from .beta_text_block_param import BetaTextBlockParam
9
9
  from .beta_image_block_param import BetaImageBlockParam
10
10
  from .beta_search_result_block_param import BetaSearchResultBlockParam
11
+ from .beta_tool_reference_block_param import BetaToolReferenceBlockParam
11
12
  from .beta_request_document_block_param import BetaRequestDocumentBlockParam
12
13
  from .beta_cache_control_ephemeral_param import BetaCacheControlEphemeralParam
13
14
 
14
15
  __all__ = ["BetaToolResultBlockParam", "Content"]
15
16
 
16
17
  Content: TypeAlias = Union[
17
- BetaTextBlockParam, BetaImageBlockParam, BetaSearchResultBlockParam, BetaRequestDocumentBlockParam
18
+ BetaTextBlockParam,
19
+ BetaImageBlockParam,
20
+ BetaSearchResultBlockParam,
21
+ BetaRequestDocumentBlockParam,
22
+ BetaToolReferenceBlockParam,
18
23
  ]
19
24
 
20
25
 
@@ -0,0 +1,33 @@
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 .beta_cache_control_ephemeral_param import BetaCacheControlEphemeralParam
9
+
10
+ __all__ = ["BetaToolSearchToolBm25_20251119Param"]
11
+
12
+
13
+ class BetaToolSearchToolBm25_20251119Param(TypedDict, total=False):
14
+ name: Required[Literal["tool_search_tool_bm25"]]
15
+ """Name of the tool.
16
+
17
+ This is how the tool will be called by the model and in `tool_use` blocks.
18
+ """
19
+
20
+ type: Required[Literal["tool_search_tool_bm25_20251119", "tool_search_tool_bm25"]]
21
+
22
+ allowed_callers: List[Literal["direct", "code_execution_20250825"]]
23
+
24
+ cache_control: Optional[BetaCacheControlEphemeralParam]
25
+ """Create a cache control breakpoint at this content block."""
26
+
27
+ defer_loading: bool
28
+ """If true, tool will not be included in initial system prompt.
29
+
30
+ Only loaded when returned via tool_reference from tool search.
31
+ """
32
+
33
+ strict: bool
@@ -0,0 +1,33 @@
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 .beta_cache_control_ephemeral_param import BetaCacheControlEphemeralParam
9
+
10
+ __all__ = ["BetaToolSearchToolRegex20251119Param"]
11
+
12
+
13
+ class BetaToolSearchToolRegex20251119Param(TypedDict, total=False):
14
+ name: Required[Literal["tool_search_tool_regex"]]
15
+ """Name of the tool.
16
+
17
+ This is how the tool will be called by the model and in `tool_use` blocks.
18
+ """
19
+
20
+ type: Required[Literal["tool_search_tool_regex_20251119", "tool_search_tool_regex"]]
21
+
22
+ allowed_callers: List[Literal["direct", "code_execution_20250825"]]
23
+
24
+ cache_control: Optional[BetaCacheControlEphemeralParam]
25
+ """Create a cache control breakpoint at this content block."""
26
+
27
+ defer_loading: bool
28
+ """If true, tool will not be included in initial system prompt.
29
+
30
+ Only loaded when returned via tool_reference from tool search.
31
+ """
32
+
33
+ strict: bool
@@ -0,0 +1,20 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import Union
4
+ from typing_extensions import Literal, TypeAlias
5
+
6
+ from ..._models import BaseModel
7
+ from .beta_tool_search_tool_result_error import BetaToolSearchToolResultError
8
+ from .beta_tool_search_tool_search_result_block import BetaToolSearchToolSearchResultBlock
9
+
10
+ __all__ = ["BetaToolSearchToolResultBlock", "Content"]
11
+
12
+ Content: TypeAlias = Union[BetaToolSearchToolResultError, BetaToolSearchToolSearchResultBlock]
13
+
14
+
15
+ class BetaToolSearchToolResultBlock(BaseModel):
16
+ content: Content
17
+
18
+ tool_use_id: str
19
+
20
+ type: Literal["tool_search_tool_result"]
@@ -0,0 +1,25 @@
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 Union, Optional
6
+ from typing_extensions import Literal, Required, TypeAlias, TypedDict
7
+
8
+ from .beta_cache_control_ephemeral_param import BetaCacheControlEphemeralParam
9
+ from .beta_tool_search_tool_result_error_param import BetaToolSearchToolResultErrorParam
10
+ from .beta_tool_search_tool_search_result_block_param import BetaToolSearchToolSearchResultBlockParam
11
+
12
+ __all__ = ["BetaToolSearchToolResultBlockParam", "Content"]
13
+
14
+ Content: TypeAlias = Union[BetaToolSearchToolResultErrorParam, BetaToolSearchToolSearchResultBlockParam]
15
+
16
+
17
+ class BetaToolSearchToolResultBlockParam(TypedDict, total=False):
18
+ content: Required[Content]
19
+
20
+ tool_use_id: Required[str]
21
+
22
+ type: Required[Literal["tool_search_tool_result"]]
23
+
24
+ cache_control: Optional[BetaCacheControlEphemeralParam]
25
+ """Create a cache control breakpoint at this content block."""
@@ -0,0 +1,16 @@
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 ..._models import BaseModel
7
+
8
+ __all__ = ["BetaToolSearchToolResultError"]
9
+
10
+
11
+ class BetaToolSearchToolResultError(BaseModel):
12
+ error_code: Literal["invalid_tool_input", "unavailable", "too_many_requests", "execution_time_exceeded"]
13
+
14
+ error_message: Optional[str] = None
15
+
16
+ type: Literal["tool_search_tool_result_error"]
@@ -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__ = ["BetaToolSearchToolResultErrorParam"]
8
+
9
+
10
+ class BetaToolSearchToolResultErrorParam(TypedDict, total=False):
11
+ error_code: Required[Literal["invalid_tool_input", "unavailable", "too_many_requests", "execution_time_exceeded"]]
12
+
13
+ type: Required[Literal["tool_search_tool_result_error"]]