anthropic 1.15.2 → 1.16.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -0
- data/README.md +10 -10
- data/lib/anthropic/helpers/tools/compaction_control.rb +105 -0
- data/lib/anthropic/helpers/tools/runner.rb +126 -13
- data/lib/anthropic/models/anthropic_beta.rb +3 -0
- data/lib/anthropic/models/beta/beta_code_execution_tool_20250522.rb +28 -1
- data/lib/anthropic/models/beta/beta_code_execution_tool_20250825.rb +28 -1
- data/lib/anthropic/models/beta/beta_content_block.rb +3 -1
- data/lib/anthropic/models/beta/beta_content_block_param.rb +3 -1
- data/lib/anthropic/models/beta/beta_direct_caller.rb +21 -0
- data/lib/anthropic/models/beta/beta_mcp_tool_config.rb +27 -0
- data/lib/anthropic/models/beta/beta_mcp_tool_default_config.rb +27 -0
- data/lib/anthropic/models/beta/beta_mcp_toolset.rb +58 -0
- data/lib/anthropic/models/beta/beta_memory_tool_20250818.rb +36 -1
- data/lib/anthropic/models/beta/beta_message.rb +2 -2
- data/lib/anthropic/models/beta/beta_message_param.rb +3 -3
- data/lib/anthropic/models/beta/beta_output_config.rb +34 -0
- data/lib/anthropic/models/beta/beta_raw_content_block_start_event.rb +5 -3
- data/lib/anthropic/models/beta/beta_server_tool_caller.rb +27 -0
- data/lib/anthropic/models/beta/beta_server_tool_use_block.rb +32 -1
- data/lib/anthropic/models/beta/beta_server_tool_use_block_param.rb +33 -1
- data/lib/anthropic/models/beta/beta_tool.rb +36 -1
- data/lib/anthropic/models/beta/beta_tool_bash_20241022.rb +36 -1
- data/lib/anthropic/models/beta/beta_tool_bash_20250124.rb +36 -1
- data/lib/anthropic/models/beta/beta_tool_computer_use_20241022.rb +36 -1
- data/lib/anthropic/models/beta/beta_tool_computer_use_20250124.rb +36 -1
- data/lib/anthropic/models/beta/beta_tool_computer_use_20251124.rb +114 -0
- data/lib/anthropic/models/beta/beta_tool_reference_block.rb +25 -0
- data/lib/anthropic/models/beta/beta_tool_reference_block_param.rb +36 -0
- data/lib/anthropic/models/beta/beta_tool_result_block_param.rb +8 -4
- data/lib/anthropic/models/beta/beta_tool_search_tool_bm25_20251119.rb +85 -0
- data/lib/anthropic/models/beta/beta_tool_search_tool_regex_20251119.rb +85 -0
- data/lib/anthropic/models/beta/beta_tool_search_tool_result_block.rb +43 -0
- data/lib/anthropic/models/beta/beta_tool_search_tool_result_block_param.rb +53 -0
- data/lib/anthropic/models/beta/beta_tool_search_tool_result_error.rb +44 -0
- data/lib/anthropic/models/beta/beta_tool_search_tool_result_error_param.rb +38 -0
- data/lib/anthropic/models/beta/beta_tool_search_tool_search_result_block.rb +26 -0
- data/lib/anthropic/models/beta/beta_tool_search_tool_search_result_block_param.rb +26 -0
- data/lib/anthropic/models/beta/beta_tool_text_editor_20241022.rb +36 -1
- data/lib/anthropic/models/beta/beta_tool_text_editor_20250124.rb +36 -1
- data/lib/anthropic/models/beta/beta_tool_text_editor_20250429.rb +36 -1
- data/lib/anthropic/models/beta/beta_tool_text_editor_20250728.rb +36 -1
- data/lib/anthropic/models/beta/beta_tool_union.rb +17 -1
- data/lib/anthropic/models/beta/beta_tool_use_block.rb +30 -1
- data/lib/anthropic/models/beta/beta_tool_use_block_param.rb +27 -1
- data/lib/anthropic/models/beta/beta_web_fetch_tool_20250910.rb +28 -1
- data/lib/anthropic/models/beta/beta_web_search_tool_20250305.rb +28 -1
- data/lib/anthropic/models/beta/message_count_tokens_params.rb +29 -4
- data/lib/anthropic/models/beta/message_create_params.rb +12 -3
- data/lib/anthropic/models/beta/messages/batch_create_params.rb +16 -7
- data/lib/anthropic/models/messages/batch_create_params.rb +4 -4
- data/lib/anthropic/models/model.rb +10 -0
- data/lib/anthropic/resources/beta/messages.rb +26 -11
- data/lib/anthropic/resources/messages.rb +8 -2
- data/lib/anthropic/version.rb +1 -1
- data/lib/anthropic.rb +19 -0
- data/manifest.yaml +1 -0
- data/rbi/anthropic/models/anthropic_beta.rbi +2 -0
- data/rbi/anthropic/models/beta/beta_code_execution_tool_20250522.rbi +77 -0
- data/rbi/anthropic/models/beta/beta_code_execution_tool_20250825.rbi +77 -0
- data/rbi/anthropic/models/beta/beta_content_block.rbi +1 -0
- data/rbi/anthropic/models/beta/beta_content_block_param.rbi +1 -0
- data/rbi/anthropic/models/beta/beta_direct_caller.rbi +31 -0
- data/rbi/anthropic/models/beta/beta_mcp_tool_config.rbi +46 -0
- data/rbi/anthropic/models/beta/beta_mcp_tool_default_config.rbi +46 -0
- data/rbi/anthropic/models/beta/beta_mcp_toolset.rbi +100 -0
- data/rbi/anthropic/models/beta/beta_memory_tool_20250818.rbi +88 -0
- data/rbi/anthropic/models/beta/beta_message.rbi +1 -0
- data/rbi/anthropic/models/beta/beta_output_config.rbi +82 -0
- data/rbi/anthropic/models/beta/beta_raw_content_block_start_event.rbi +2 -0
- data/rbi/anthropic/models/beta/beta_server_tool_caller.rbi +34 -0
- data/rbi/anthropic/models/beta/beta_server_tool_use_block.rbi +54 -1
- data/rbi/anthropic/models/beta/beta_server_tool_use_block_param.rbi +70 -1
- data/rbi/anthropic/models/beta/beta_tool.rbi +75 -0
- data/rbi/anthropic/models/beta/beta_tool_bash_20241022.rbi +88 -0
- data/rbi/anthropic/models/beta/beta_tool_bash_20250124.rbi +88 -0
- data/rbi/anthropic/models/beta/beta_tool_computer_use_20241022.rbi +88 -0
- data/rbi/anthropic/models/beta/beta_tool_computer_use_20250124.rbi +88 -0
- data/rbi/anthropic/models/beta/beta_tool_computer_use_20251124.rbi +204 -0
- data/rbi/anthropic/models/beta/beta_tool_reference_block.rbi +35 -0
- data/rbi/anthropic/models/beta/beta_tool_reference_block_param.rbi +67 -0
- data/rbi/anthropic/models/beta/beta_tool_result_block_param.rbi +3 -1
- data/rbi/anthropic/models/beta/beta_tool_search_tool_bm25_20251119.rbi +198 -0
- data/rbi/anthropic/models/beta/beta_tool_search_tool_regex_20251119.rbi +198 -0
- data/rbi/anthropic/models/beta/beta_tool_search_tool_result_block.rbi +81 -0
- data/rbi/anthropic/models/beta/beta_tool_search_tool_result_block_param.rbi +110 -0
- data/rbi/anthropic/models/beta/beta_tool_search_tool_result_error.rbi +104 -0
- data/rbi/anthropic/models/beta/beta_tool_search_tool_result_error_param.rbi +96 -0
- data/rbi/anthropic/models/beta/beta_tool_search_tool_search_result_block.rbi +48 -0
- data/rbi/anthropic/models/beta/beta_tool_search_tool_search_result_block_param.rbi +48 -0
- data/rbi/anthropic/models/beta/beta_tool_text_editor_20241022.rbi +88 -0
- data/rbi/anthropic/models/beta/beta_tool_text_editor_20250124.rbi +88 -0
- data/rbi/anthropic/models/beta/beta_tool_text_editor_20250429.rbi +88 -0
- data/rbi/anthropic/models/beta/beta_tool_text_editor_20250728.rbi +88 -0
- data/rbi/anthropic/models/beta/beta_tool_union.rbi +9 -1
- data/rbi/anthropic/models/beta/beta_tool_use_block.rbi +55 -2
- data/rbi/anthropic/models/beta/beta_tool_use_block_param.rbi +58 -1
- data/rbi/anthropic/models/beta/beta_web_fetch_tool_20250910.rbi +77 -0
- data/rbi/anthropic/models/beta/beta_web_search_tool_20250305.rbi +77 -0
- data/rbi/anthropic/models/beta/message_count_tokens_params.rbi +44 -5
- data/rbi/anthropic/models/beta/message_create_params.rbi +35 -4
- data/rbi/anthropic/models/beta/messages/batch_create_params.rbi +43 -10
- data/rbi/anthropic/models/messages/batch_create_params.rbi +6 -6
- data/rbi/anthropic/models/model.rbi +8 -0
- data/rbi/anthropic/resources/beta/messages.rbi +29 -3
- data/sig/anthropic/models/anthropic_beta.rbs +2 -0
- data/sig/anthropic/models/beta/beta_code_execution_tool_20250522.rbs +27 -0
- data/sig/anthropic/models/beta/beta_code_execution_tool_20250825.rbs +27 -0
- data/sig/anthropic/models/beta/beta_content_block.rbs +1 -0
- data/sig/anthropic/models/beta/beta_content_block_param.rbs +1 -0
- data/sig/anthropic/models/beta/beta_direct_caller.rbs +17 -0
- data/sig/anthropic/models/beta/beta_mcp_tool_config.rbs +23 -0
- data/sig/anthropic/models/beta/beta_mcp_tool_default_config.rbs +23 -0
- data/sig/anthropic/models/beta/beta_mcp_toolset.rbs +48 -0
- data/sig/anthropic/models/beta/beta_memory_tool_20250818.rbs +36 -0
- data/sig/anthropic/models/beta/beta_output_config.rbs +34 -0
- data/sig/anthropic/models/beta/beta_raw_content_block_start_event.rbs +1 -0
- data/sig/anthropic/models/beta/beta_server_tool_caller.rbs +23 -0
- data/sig/anthropic/models/beta/beta_server_tool_use_block.rbs +19 -0
- data/sig/anthropic/models/beta/beta_server_tool_use_block_param.rbs +25 -2
- data/sig/anthropic/models/beta/beta_tool.rbs +36 -0
- data/sig/anthropic/models/beta/beta_tool_bash_20241022.rbs +36 -0
- data/sig/anthropic/models/beta/beta_tool_bash_20250124.rbs +36 -0
- data/sig/anthropic/models/beta/beta_tool_computer_use_20241022.rbs +36 -0
- data/sig/anthropic/models/beta/beta_tool_computer_use_20250124.rbs +36 -0
- data/sig/anthropic/models/beta/beta_tool_computer_use_20251124.rbs +99 -0
- data/sig/anthropic/models/beta/beta_tool_reference_block.rbs +20 -0
- data/sig/anthropic/models/beta/beta_tool_reference_block_param.rbs +34 -0
- data/sig/anthropic/models/beta/beta_tool_result_block_param.rbs +1 -0
- data/sig/anthropic/models/beta/beta_tool_search_tool_bm25_20251119.rbs +79 -0
- data/sig/anthropic/models/beta/beta_tool_search_tool_regex_20251119.rbs +79 -0
- data/sig/anthropic/models/beta/beta_tool_search_tool_result_block.rbs +44 -0
- data/sig/anthropic/models/beta/beta_tool_search_tool_result_block_param.rbs +49 -0
- data/sig/anthropic/models/beta/beta_tool_search_tool_result_error.rbs +51 -0
- data/sig/anthropic/models/beta/beta_tool_search_tool_result_error_param.rbs +46 -0
- data/sig/anthropic/models/beta/beta_tool_search_tool_search_result_block.rbs +29 -0
- data/sig/anthropic/models/beta/beta_tool_search_tool_search_result_block_param.rbs +29 -0
- data/sig/anthropic/models/beta/beta_tool_text_editor_20241022.rbs +36 -0
- data/sig/anthropic/models/beta/beta_tool_text_editor_20250124.rbs +36 -0
- data/sig/anthropic/models/beta/beta_tool_text_editor_20250429.rbs +36 -0
- data/sig/anthropic/models/beta/beta_tool_text_editor_20250728.rbs +36 -0
- data/sig/anthropic/models/beta/beta_tool_union.rbs +4 -0
- data/sig/anthropic/models/beta/beta_tool_use_block.rbs +21 -2
- data/sig/anthropic/models/beta/beta_tool_use_block_param.rbs +21 -2
- data/sig/anthropic/models/beta/beta_web_fetch_tool_20250910.rbs +27 -0
- data/sig/anthropic/models/beta/beta_web_search_tool_20250305.rbs +27 -0
- data/sig/anthropic/models/beta/message_count_tokens_params.rbs +13 -0
- data/sig/anthropic/models/beta/message_create_params.rbs +9 -0
- data/sig/anthropic/models/beta/messages/batch_create_params.rbs +9 -0
- data/sig/anthropic/models/model.rbs +9 -1
- data/sig/anthropic/resources/beta/messages.rbs +3 -0
- metadata +54 -2
|
@@ -23,6 +23,27 @@ module Anthropic
|
|
|
23
23
|
sig { returns(Symbol) }
|
|
24
24
|
attr_accessor :type
|
|
25
25
|
|
|
26
|
+
sig do
|
|
27
|
+
returns(
|
|
28
|
+
T.nilable(
|
|
29
|
+
T::Array[
|
|
30
|
+
Anthropic::Beta::BetaToolTextEditor20250728::AllowedCaller::OrSymbol
|
|
31
|
+
]
|
|
32
|
+
)
|
|
33
|
+
)
|
|
34
|
+
end
|
|
35
|
+
attr_reader :allowed_callers
|
|
36
|
+
|
|
37
|
+
sig do
|
|
38
|
+
params(
|
|
39
|
+
allowed_callers:
|
|
40
|
+
T::Array[
|
|
41
|
+
Anthropic::Beta::BetaToolTextEditor20250728::AllowedCaller::OrSymbol
|
|
42
|
+
]
|
|
43
|
+
).void
|
|
44
|
+
end
|
|
45
|
+
attr_writer :allowed_callers
|
|
46
|
+
|
|
26
47
|
# Create a cache control breakpoint at this content block.
|
|
27
48
|
sig { returns(T.nilable(Anthropic::Beta::BetaCacheControlEphemeral)) }
|
|
28
49
|
attr_reader :cache_control
|
|
@@ -35,6 +56,22 @@ module Anthropic
|
|
|
35
56
|
end
|
|
36
57
|
attr_writer :cache_control
|
|
37
58
|
|
|
59
|
+
# If true, tool will not be included in initial system prompt. Only loaded when
|
|
60
|
+
# returned via tool_reference from tool search.
|
|
61
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
62
|
+
attr_reader :defer_loading
|
|
63
|
+
|
|
64
|
+
sig { params(defer_loading: T::Boolean).void }
|
|
65
|
+
attr_writer :defer_loading
|
|
66
|
+
|
|
67
|
+
sig { returns(T.nilable(T::Array[T::Hash[Symbol, T.anything]])) }
|
|
68
|
+
attr_reader :input_examples
|
|
69
|
+
|
|
70
|
+
sig do
|
|
71
|
+
params(input_examples: T::Array[T::Hash[Symbol, T.anything]]).void
|
|
72
|
+
end
|
|
73
|
+
attr_writer :input_examples
|
|
74
|
+
|
|
38
75
|
# Maximum number of characters to display when viewing a file. If not specified,
|
|
39
76
|
# defaults to displaying the full file.
|
|
40
77
|
sig { returns(T.nilable(Integer)) }
|
|
@@ -48,8 +85,14 @@ module Anthropic
|
|
|
48
85
|
|
|
49
86
|
sig do
|
|
50
87
|
params(
|
|
88
|
+
allowed_callers:
|
|
89
|
+
T::Array[
|
|
90
|
+
Anthropic::Beta::BetaToolTextEditor20250728::AllowedCaller::OrSymbol
|
|
91
|
+
],
|
|
51
92
|
cache_control:
|
|
52
93
|
T.nilable(Anthropic::Beta::BetaCacheControlEphemeral::OrHash),
|
|
94
|
+
defer_loading: T::Boolean,
|
|
95
|
+
input_examples: T::Array[T::Hash[Symbol, T.anything]],
|
|
53
96
|
max_characters: T.nilable(Integer),
|
|
54
97
|
strict: T::Boolean,
|
|
55
98
|
name: Symbol,
|
|
@@ -57,8 +100,13 @@ module Anthropic
|
|
|
57
100
|
).returns(T.attached_class)
|
|
58
101
|
end
|
|
59
102
|
def self.new(
|
|
103
|
+
allowed_callers: nil,
|
|
60
104
|
# Create a cache control breakpoint at this content block.
|
|
61
105
|
cache_control: nil,
|
|
106
|
+
# If true, tool will not be included in initial system prompt. Only loaded when
|
|
107
|
+
# returned via tool_reference from tool search.
|
|
108
|
+
defer_loading: nil,
|
|
109
|
+
input_examples: nil,
|
|
62
110
|
# Maximum number of characters to display when viewing a file. If not specified,
|
|
63
111
|
# defaults to displaying the full file.
|
|
64
112
|
max_characters: nil,
|
|
@@ -76,8 +124,14 @@ module Anthropic
|
|
|
76
124
|
{
|
|
77
125
|
name: Symbol,
|
|
78
126
|
type: Symbol,
|
|
127
|
+
allowed_callers:
|
|
128
|
+
T::Array[
|
|
129
|
+
Anthropic::Beta::BetaToolTextEditor20250728::AllowedCaller::OrSymbol
|
|
130
|
+
],
|
|
79
131
|
cache_control:
|
|
80
132
|
T.nilable(Anthropic::Beta::BetaCacheControlEphemeral),
|
|
133
|
+
defer_loading: T::Boolean,
|
|
134
|
+
input_examples: T::Array[T::Hash[Symbol, T.anything]],
|
|
81
135
|
max_characters: T.nilable(Integer),
|
|
82
136
|
strict: T::Boolean
|
|
83
137
|
}
|
|
@@ -85,6 +139,40 @@ module Anthropic
|
|
|
85
139
|
end
|
|
86
140
|
def to_hash
|
|
87
141
|
end
|
|
142
|
+
|
|
143
|
+
module AllowedCaller
|
|
144
|
+
extend Anthropic::Internal::Type::Enum
|
|
145
|
+
|
|
146
|
+
TaggedSymbol =
|
|
147
|
+
T.type_alias do
|
|
148
|
+
T.all(
|
|
149
|
+
Symbol,
|
|
150
|
+
Anthropic::Beta::BetaToolTextEditor20250728::AllowedCaller
|
|
151
|
+
)
|
|
152
|
+
end
|
|
153
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
154
|
+
|
|
155
|
+
DIRECT =
|
|
156
|
+
T.let(
|
|
157
|
+
:direct,
|
|
158
|
+
Anthropic::Beta::BetaToolTextEditor20250728::AllowedCaller::TaggedSymbol
|
|
159
|
+
)
|
|
160
|
+
CODE_EXECUTION_20250825 =
|
|
161
|
+
T.let(
|
|
162
|
+
:code_execution_20250825,
|
|
163
|
+
Anthropic::Beta::BetaToolTextEditor20250728::AllowedCaller::TaggedSymbol
|
|
164
|
+
)
|
|
165
|
+
|
|
166
|
+
sig do
|
|
167
|
+
override.returns(
|
|
168
|
+
T::Array[
|
|
169
|
+
Anthropic::Beta::BetaToolTextEditor20250728::AllowedCaller::TaggedSymbol
|
|
170
|
+
]
|
|
171
|
+
)
|
|
172
|
+
end
|
|
173
|
+
def self.values
|
|
174
|
+
end
|
|
175
|
+
end
|
|
88
176
|
end
|
|
89
177
|
end
|
|
90
178
|
end
|
|
@@ -5,6 +5,10 @@ module Anthropic
|
|
|
5
5
|
BetaToolUnion = Beta::BetaToolUnion
|
|
6
6
|
|
|
7
7
|
module Beta
|
|
8
|
+
# Configuration for a group of tools from an MCP server.
|
|
9
|
+
#
|
|
10
|
+
# Allows configuring enabled status and defer_loading for all tools from an MCP
|
|
11
|
+
# server, with optional per-tool overrides.
|
|
8
12
|
module BetaToolUnion
|
|
9
13
|
extend Anthropic::Internal::Type::Union
|
|
10
14
|
|
|
@@ -20,11 +24,15 @@ module Anthropic
|
|
|
20
24
|
Anthropic::Beta::BetaMemoryTool20250818,
|
|
21
25
|
Anthropic::Beta::BetaToolComputerUse20250124,
|
|
22
26
|
Anthropic::Beta::BetaToolTextEditor20241022,
|
|
27
|
+
Anthropic::Beta::BetaToolComputerUse20251124,
|
|
23
28
|
Anthropic::Beta::BetaToolTextEditor20250124,
|
|
24
29
|
Anthropic::Beta::BetaToolTextEditor20250429,
|
|
25
30
|
Anthropic::Beta::BetaToolTextEditor20250728,
|
|
26
31
|
Anthropic::Beta::BetaWebSearchTool20250305,
|
|
27
|
-
Anthropic::Beta::BetaWebFetchTool20250910
|
|
32
|
+
Anthropic::Beta::BetaWebFetchTool20250910,
|
|
33
|
+
Anthropic::Beta::BetaToolSearchToolBm25_20251119,
|
|
34
|
+
Anthropic::Beta::BetaToolSearchToolRegex20251119,
|
|
35
|
+
Anthropic::Beta::BetaMCPToolset
|
|
28
36
|
)
|
|
29
37
|
end
|
|
30
38
|
|
|
@@ -26,15 +26,46 @@ module Anthropic
|
|
|
26
26
|
sig { returns(Symbol) }
|
|
27
27
|
attr_accessor :type
|
|
28
28
|
|
|
29
|
+
# Tool invocation directly from the model.
|
|
30
|
+
sig do
|
|
31
|
+
returns(
|
|
32
|
+
T.nilable(Anthropic::Beta::BetaToolUseBlock::Caller::Variants)
|
|
33
|
+
)
|
|
34
|
+
end
|
|
35
|
+
attr_reader :caller_
|
|
36
|
+
|
|
37
|
+
sig do
|
|
38
|
+
params(
|
|
39
|
+
caller_:
|
|
40
|
+
T.any(
|
|
41
|
+
Anthropic::Beta::BetaDirectCaller::OrHash,
|
|
42
|
+
Anthropic::Beta::BetaServerToolCaller::OrHash
|
|
43
|
+
)
|
|
44
|
+
).void
|
|
45
|
+
end
|
|
46
|
+
attr_writer :caller_
|
|
47
|
+
|
|
29
48
|
sig do
|
|
30
49
|
params(
|
|
31
50
|
id: String,
|
|
32
51
|
input: T::Hash[Symbol, T.anything],
|
|
33
52
|
name: String,
|
|
53
|
+
caller_:
|
|
54
|
+
T.any(
|
|
55
|
+
Anthropic::Beta::BetaDirectCaller::OrHash,
|
|
56
|
+
Anthropic::Beta::BetaServerToolCaller::OrHash
|
|
57
|
+
),
|
|
34
58
|
type: Symbol
|
|
35
59
|
).returns(T.attached_class)
|
|
36
60
|
end
|
|
37
|
-
def self.new(
|
|
61
|
+
def self.new(
|
|
62
|
+
id:,
|
|
63
|
+
input:,
|
|
64
|
+
name:,
|
|
65
|
+
# Tool invocation directly from the model.
|
|
66
|
+
caller_: nil,
|
|
67
|
+
type: :tool_use
|
|
68
|
+
)
|
|
38
69
|
end
|
|
39
70
|
|
|
40
71
|
sig do
|
|
@@ -43,12 +74,34 @@ module Anthropic
|
|
|
43
74
|
id: String,
|
|
44
75
|
input: T::Hash[Symbol, T.anything],
|
|
45
76
|
name: String,
|
|
46
|
-
type: Symbol
|
|
77
|
+
type: Symbol,
|
|
78
|
+
caller_: Anthropic::Beta::BetaToolUseBlock::Caller::Variants
|
|
47
79
|
}
|
|
48
80
|
)
|
|
49
81
|
end
|
|
50
82
|
def to_hash
|
|
51
83
|
end
|
|
84
|
+
|
|
85
|
+
# Tool invocation directly from the model.
|
|
86
|
+
module Caller
|
|
87
|
+
extend Anthropic::Internal::Type::Union
|
|
88
|
+
|
|
89
|
+
Variants =
|
|
90
|
+
T.type_alias do
|
|
91
|
+
T.any(
|
|
92
|
+
Anthropic::Beta::BetaDirectCaller,
|
|
93
|
+
Anthropic::Beta::BetaServerToolCaller
|
|
94
|
+
)
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
sig do
|
|
98
|
+
override.returns(
|
|
99
|
+
T::Array[Anthropic::Beta::BetaToolUseBlock::Caller::Variants]
|
|
100
|
+
)
|
|
101
|
+
end
|
|
102
|
+
def self.variants
|
|
103
|
+
end
|
|
104
|
+
end
|
|
52
105
|
end
|
|
53
106
|
end
|
|
54
107
|
end
|
|
@@ -38,6 +38,30 @@ module Anthropic
|
|
|
38
38
|
end
|
|
39
39
|
attr_writer :cache_control
|
|
40
40
|
|
|
41
|
+
# Tool invocation directly from the model.
|
|
42
|
+
sig do
|
|
43
|
+
returns(
|
|
44
|
+
T.nilable(
|
|
45
|
+
T.any(
|
|
46
|
+
Anthropic::Beta::BetaDirectCaller,
|
|
47
|
+
Anthropic::Beta::BetaServerToolCaller
|
|
48
|
+
)
|
|
49
|
+
)
|
|
50
|
+
)
|
|
51
|
+
end
|
|
52
|
+
attr_reader :caller_
|
|
53
|
+
|
|
54
|
+
sig do
|
|
55
|
+
params(
|
|
56
|
+
caller_:
|
|
57
|
+
T.any(
|
|
58
|
+
Anthropic::Beta::BetaDirectCaller::OrHash,
|
|
59
|
+
Anthropic::Beta::BetaServerToolCaller::OrHash
|
|
60
|
+
)
|
|
61
|
+
).void
|
|
62
|
+
end
|
|
63
|
+
attr_writer :caller_
|
|
64
|
+
|
|
41
65
|
sig do
|
|
42
66
|
params(
|
|
43
67
|
id: String,
|
|
@@ -45,6 +69,11 @@ module Anthropic
|
|
|
45
69
|
name: String,
|
|
46
70
|
cache_control:
|
|
47
71
|
T.nilable(Anthropic::Beta::BetaCacheControlEphemeral::OrHash),
|
|
72
|
+
caller_:
|
|
73
|
+
T.any(
|
|
74
|
+
Anthropic::Beta::BetaDirectCaller::OrHash,
|
|
75
|
+
Anthropic::Beta::BetaServerToolCaller::OrHash
|
|
76
|
+
),
|
|
48
77
|
type: Symbol
|
|
49
78
|
).returns(T.attached_class)
|
|
50
79
|
end
|
|
@@ -54,6 +83,8 @@ module Anthropic
|
|
|
54
83
|
name:,
|
|
55
84
|
# Create a cache control breakpoint at this content block.
|
|
56
85
|
cache_control: nil,
|
|
86
|
+
# Tool invocation directly from the model.
|
|
87
|
+
caller_: nil,
|
|
57
88
|
type: :tool_use
|
|
58
89
|
)
|
|
59
90
|
end
|
|
@@ -66,12 +97,38 @@ module Anthropic
|
|
|
66
97
|
name: String,
|
|
67
98
|
type: Symbol,
|
|
68
99
|
cache_control:
|
|
69
|
-
T.nilable(Anthropic::Beta::BetaCacheControlEphemeral)
|
|
100
|
+
T.nilable(Anthropic::Beta::BetaCacheControlEphemeral),
|
|
101
|
+
caller_:
|
|
102
|
+
T.any(
|
|
103
|
+
Anthropic::Beta::BetaDirectCaller,
|
|
104
|
+
Anthropic::Beta::BetaServerToolCaller
|
|
105
|
+
)
|
|
70
106
|
}
|
|
71
107
|
)
|
|
72
108
|
end
|
|
73
109
|
def to_hash
|
|
74
110
|
end
|
|
111
|
+
|
|
112
|
+
# Tool invocation directly from the model.
|
|
113
|
+
module Caller
|
|
114
|
+
extend Anthropic::Internal::Type::Union
|
|
115
|
+
|
|
116
|
+
Variants =
|
|
117
|
+
T.type_alias do
|
|
118
|
+
T.any(
|
|
119
|
+
Anthropic::Beta::BetaDirectCaller,
|
|
120
|
+
Anthropic::Beta::BetaServerToolCaller
|
|
121
|
+
)
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
sig do
|
|
125
|
+
override.returns(
|
|
126
|
+
T::Array[Anthropic::Beta::BetaToolUseBlockParam::Caller::Variants]
|
|
127
|
+
)
|
|
128
|
+
end
|
|
129
|
+
def self.variants
|
|
130
|
+
end
|
|
131
|
+
end
|
|
75
132
|
end
|
|
76
133
|
end
|
|
77
134
|
end
|
|
@@ -23,6 +23,27 @@ module Anthropic
|
|
|
23
23
|
sig { returns(Symbol) }
|
|
24
24
|
attr_accessor :type
|
|
25
25
|
|
|
26
|
+
sig do
|
|
27
|
+
returns(
|
|
28
|
+
T.nilable(
|
|
29
|
+
T::Array[
|
|
30
|
+
Anthropic::Beta::BetaWebFetchTool20250910::AllowedCaller::OrSymbol
|
|
31
|
+
]
|
|
32
|
+
)
|
|
33
|
+
)
|
|
34
|
+
end
|
|
35
|
+
attr_reader :allowed_callers
|
|
36
|
+
|
|
37
|
+
sig do
|
|
38
|
+
params(
|
|
39
|
+
allowed_callers:
|
|
40
|
+
T::Array[
|
|
41
|
+
Anthropic::Beta::BetaWebFetchTool20250910::AllowedCaller::OrSymbol
|
|
42
|
+
]
|
|
43
|
+
).void
|
|
44
|
+
end
|
|
45
|
+
attr_writer :allowed_callers
|
|
46
|
+
|
|
26
47
|
# List of domains to allow fetching from
|
|
27
48
|
sig { returns(T.nilable(T::Array[String])) }
|
|
28
49
|
attr_accessor :allowed_domains
|
|
@@ -56,6 +77,14 @@ module Anthropic
|
|
|
56
77
|
end
|
|
57
78
|
attr_writer :citations
|
|
58
79
|
|
|
80
|
+
# If true, tool will not be included in initial system prompt. Only loaded when
|
|
81
|
+
# returned via tool_reference from tool search.
|
|
82
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
83
|
+
attr_reader :defer_loading
|
|
84
|
+
|
|
85
|
+
sig { params(defer_loading: T::Boolean).void }
|
|
86
|
+
attr_writer :defer_loading
|
|
87
|
+
|
|
59
88
|
# Maximum number of tokens used by including web page text content in the context.
|
|
60
89
|
# The limit is approximate and does not apply to binary content such as PDFs.
|
|
61
90
|
sig { returns(T.nilable(Integer)) }
|
|
@@ -73,12 +102,17 @@ module Anthropic
|
|
|
73
102
|
|
|
74
103
|
sig do
|
|
75
104
|
params(
|
|
105
|
+
allowed_callers:
|
|
106
|
+
T::Array[
|
|
107
|
+
Anthropic::Beta::BetaWebFetchTool20250910::AllowedCaller::OrSymbol
|
|
108
|
+
],
|
|
76
109
|
allowed_domains: T.nilable(T::Array[String]),
|
|
77
110
|
blocked_domains: T.nilable(T::Array[String]),
|
|
78
111
|
cache_control:
|
|
79
112
|
T.nilable(Anthropic::Beta::BetaCacheControlEphemeral::OrHash),
|
|
80
113
|
citations:
|
|
81
114
|
T.nilable(Anthropic::Beta::BetaCitationsConfigParam::OrHash),
|
|
115
|
+
defer_loading: T::Boolean,
|
|
82
116
|
max_content_tokens: T.nilable(Integer),
|
|
83
117
|
max_uses: T.nilable(Integer),
|
|
84
118
|
strict: T::Boolean,
|
|
@@ -87,6 +121,7 @@ module Anthropic
|
|
|
87
121
|
).returns(T.attached_class)
|
|
88
122
|
end
|
|
89
123
|
def self.new(
|
|
124
|
+
allowed_callers: nil,
|
|
90
125
|
# List of domains to allow fetching from
|
|
91
126
|
allowed_domains: nil,
|
|
92
127
|
# List of domains to block fetching from
|
|
@@ -96,6 +131,9 @@ module Anthropic
|
|
|
96
131
|
# Citations configuration for fetched documents. Citations are disabled by
|
|
97
132
|
# default.
|
|
98
133
|
citations: nil,
|
|
134
|
+
# If true, tool will not be included in initial system prompt. Only loaded when
|
|
135
|
+
# returned via tool_reference from tool search.
|
|
136
|
+
defer_loading: nil,
|
|
99
137
|
# Maximum number of tokens used by including web page text content in the context.
|
|
100
138
|
# The limit is approximate and does not apply to binary content such as PDFs.
|
|
101
139
|
max_content_tokens: nil,
|
|
@@ -115,11 +153,16 @@ module Anthropic
|
|
|
115
153
|
{
|
|
116
154
|
name: Symbol,
|
|
117
155
|
type: Symbol,
|
|
156
|
+
allowed_callers:
|
|
157
|
+
T::Array[
|
|
158
|
+
Anthropic::Beta::BetaWebFetchTool20250910::AllowedCaller::OrSymbol
|
|
159
|
+
],
|
|
118
160
|
allowed_domains: T.nilable(T::Array[String]),
|
|
119
161
|
blocked_domains: T.nilable(T::Array[String]),
|
|
120
162
|
cache_control:
|
|
121
163
|
T.nilable(Anthropic::Beta::BetaCacheControlEphemeral),
|
|
122
164
|
citations: T.nilable(Anthropic::Beta::BetaCitationsConfigParam),
|
|
165
|
+
defer_loading: T::Boolean,
|
|
123
166
|
max_content_tokens: T.nilable(Integer),
|
|
124
167
|
max_uses: T.nilable(Integer),
|
|
125
168
|
strict: T::Boolean
|
|
@@ -128,6 +171,40 @@ module Anthropic
|
|
|
128
171
|
end
|
|
129
172
|
def to_hash
|
|
130
173
|
end
|
|
174
|
+
|
|
175
|
+
module AllowedCaller
|
|
176
|
+
extend Anthropic::Internal::Type::Enum
|
|
177
|
+
|
|
178
|
+
TaggedSymbol =
|
|
179
|
+
T.type_alias do
|
|
180
|
+
T.all(
|
|
181
|
+
Symbol,
|
|
182
|
+
Anthropic::Beta::BetaWebFetchTool20250910::AllowedCaller
|
|
183
|
+
)
|
|
184
|
+
end
|
|
185
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
186
|
+
|
|
187
|
+
DIRECT =
|
|
188
|
+
T.let(
|
|
189
|
+
:direct,
|
|
190
|
+
Anthropic::Beta::BetaWebFetchTool20250910::AllowedCaller::TaggedSymbol
|
|
191
|
+
)
|
|
192
|
+
CODE_EXECUTION_20250825 =
|
|
193
|
+
T.let(
|
|
194
|
+
:code_execution_20250825,
|
|
195
|
+
Anthropic::Beta::BetaWebFetchTool20250910::AllowedCaller::TaggedSymbol
|
|
196
|
+
)
|
|
197
|
+
|
|
198
|
+
sig do
|
|
199
|
+
override.returns(
|
|
200
|
+
T::Array[
|
|
201
|
+
Anthropic::Beta::BetaWebFetchTool20250910::AllowedCaller::TaggedSymbol
|
|
202
|
+
]
|
|
203
|
+
)
|
|
204
|
+
end
|
|
205
|
+
def self.values
|
|
206
|
+
end
|
|
207
|
+
end
|
|
131
208
|
end
|
|
132
209
|
end
|
|
133
210
|
end
|
|
@@ -23,6 +23,27 @@ module Anthropic
|
|
|
23
23
|
sig { returns(Symbol) }
|
|
24
24
|
attr_accessor :type
|
|
25
25
|
|
|
26
|
+
sig do
|
|
27
|
+
returns(
|
|
28
|
+
T.nilable(
|
|
29
|
+
T::Array[
|
|
30
|
+
Anthropic::Beta::BetaWebSearchTool20250305::AllowedCaller::OrSymbol
|
|
31
|
+
]
|
|
32
|
+
)
|
|
33
|
+
)
|
|
34
|
+
end
|
|
35
|
+
attr_reader :allowed_callers
|
|
36
|
+
|
|
37
|
+
sig do
|
|
38
|
+
params(
|
|
39
|
+
allowed_callers:
|
|
40
|
+
T::Array[
|
|
41
|
+
Anthropic::Beta::BetaWebSearchTool20250305::AllowedCaller::OrSymbol
|
|
42
|
+
]
|
|
43
|
+
).void
|
|
44
|
+
end
|
|
45
|
+
attr_writer :allowed_callers
|
|
46
|
+
|
|
26
47
|
# If provided, only these domains will be included in results. Cannot be used
|
|
27
48
|
# alongside `blocked_domains`.
|
|
28
49
|
sig { returns(T.nilable(T::Array[String])) }
|
|
@@ -45,6 +66,14 @@ module Anthropic
|
|
|
45
66
|
end
|
|
46
67
|
attr_writer :cache_control
|
|
47
68
|
|
|
69
|
+
# If true, tool will not be included in initial system prompt. Only loaded when
|
|
70
|
+
# returned via tool_reference from tool search.
|
|
71
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
72
|
+
attr_reader :defer_loading
|
|
73
|
+
|
|
74
|
+
sig { params(defer_loading: T::Boolean).void }
|
|
75
|
+
attr_writer :defer_loading
|
|
76
|
+
|
|
48
77
|
# Maximum number of times the tool can be used in the API request.
|
|
49
78
|
sig { returns(T.nilable(Integer)) }
|
|
50
79
|
attr_accessor :max_uses
|
|
@@ -76,10 +105,15 @@ module Anthropic
|
|
|
76
105
|
|
|
77
106
|
sig do
|
|
78
107
|
params(
|
|
108
|
+
allowed_callers:
|
|
109
|
+
T::Array[
|
|
110
|
+
Anthropic::Beta::BetaWebSearchTool20250305::AllowedCaller::OrSymbol
|
|
111
|
+
],
|
|
79
112
|
allowed_domains: T.nilable(T::Array[String]),
|
|
80
113
|
blocked_domains: T.nilable(T::Array[String]),
|
|
81
114
|
cache_control:
|
|
82
115
|
T.nilable(Anthropic::Beta::BetaCacheControlEphemeral::OrHash),
|
|
116
|
+
defer_loading: T::Boolean,
|
|
83
117
|
max_uses: T.nilable(Integer),
|
|
84
118
|
strict: T::Boolean,
|
|
85
119
|
user_location:
|
|
@@ -91,6 +125,7 @@ module Anthropic
|
|
|
91
125
|
).returns(T.attached_class)
|
|
92
126
|
end
|
|
93
127
|
def self.new(
|
|
128
|
+
allowed_callers: nil,
|
|
94
129
|
# If provided, only these domains will be included in results. Cannot be used
|
|
95
130
|
# alongside `blocked_domains`.
|
|
96
131
|
allowed_domains: nil,
|
|
@@ -99,6 +134,9 @@ module Anthropic
|
|
|
99
134
|
blocked_domains: nil,
|
|
100
135
|
# Create a cache control breakpoint at this content block.
|
|
101
136
|
cache_control: nil,
|
|
137
|
+
# If true, tool will not be included in initial system prompt. Only loaded when
|
|
138
|
+
# returned via tool_reference from tool search.
|
|
139
|
+
defer_loading: nil,
|
|
102
140
|
# Maximum number of times the tool can be used in the API request.
|
|
103
141
|
max_uses: nil,
|
|
104
142
|
strict: nil,
|
|
@@ -118,10 +156,15 @@ module Anthropic
|
|
|
118
156
|
{
|
|
119
157
|
name: Symbol,
|
|
120
158
|
type: Symbol,
|
|
159
|
+
allowed_callers:
|
|
160
|
+
T::Array[
|
|
161
|
+
Anthropic::Beta::BetaWebSearchTool20250305::AllowedCaller::OrSymbol
|
|
162
|
+
],
|
|
121
163
|
allowed_domains: T.nilable(T::Array[String]),
|
|
122
164
|
blocked_domains: T.nilable(T::Array[String]),
|
|
123
165
|
cache_control:
|
|
124
166
|
T.nilable(Anthropic::Beta::BetaCacheControlEphemeral),
|
|
167
|
+
defer_loading: T::Boolean,
|
|
125
168
|
max_uses: T.nilable(Integer),
|
|
126
169
|
strict: T::Boolean,
|
|
127
170
|
user_location:
|
|
@@ -134,6 +177,40 @@ module Anthropic
|
|
|
134
177
|
def to_hash
|
|
135
178
|
end
|
|
136
179
|
|
|
180
|
+
module AllowedCaller
|
|
181
|
+
extend Anthropic::Internal::Type::Enum
|
|
182
|
+
|
|
183
|
+
TaggedSymbol =
|
|
184
|
+
T.type_alias do
|
|
185
|
+
T.all(
|
|
186
|
+
Symbol,
|
|
187
|
+
Anthropic::Beta::BetaWebSearchTool20250305::AllowedCaller
|
|
188
|
+
)
|
|
189
|
+
end
|
|
190
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
191
|
+
|
|
192
|
+
DIRECT =
|
|
193
|
+
T.let(
|
|
194
|
+
:direct,
|
|
195
|
+
Anthropic::Beta::BetaWebSearchTool20250305::AllowedCaller::TaggedSymbol
|
|
196
|
+
)
|
|
197
|
+
CODE_EXECUTION_20250825 =
|
|
198
|
+
T.let(
|
|
199
|
+
:code_execution_20250825,
|
|
200
|
+
Anthropic::Beta::BetaWebSearchTool20250305::AllowedCaller::TaggedSymbol
|
|
201
|
+
)
|
|
202
|
+
|
|
203
|
+
sig do
|
|
204
|
+
override.returns(
|
|
205
|
+
T::Array[
|
|
206
|
+
Anthropic::Beta::BetaWebSearchTool20250305::AllowedCaller::TaggedSymbol
|
|
207
|
+
]
|
|
208
|
+
)
|
|
209
|
+
end
|
|
210
|
+
def self.values
|
|
211
|
+
end
|
|
212
|
+
end
|
|
213
|
+
|
|
137
214
|
class UserLocation < Anthropic::Internal::Type::BaseModel
|
|
138
215
|
OrHash =
|
|
139
216
|
T.type_alias do
|