anthropic 1.7.0 → 1.8.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 +20 -0
- data/README.md +1 -1
- data/lib/anthropic/helpers/input_schema/array_of.rb +41 -0
- data/lib/anthropic/helpers/input_schema/base_model.rb +86 -0
- data/lib/anthropic/helpers/input_schema/boolean.rb +29 -0
- data/lib/anthropic/helpers/input_schema/enum_of.rb +63 -0
- data/lib/anthropic/helpers/input_schema/json_schema_converter.rb +199 -0
- data/lib/anthropic/helpers/input_schema/parsed_json.rb +39 -0
- data/lib/anthropic/helpers/input_schema/property_mapping.rb +47 -0
- data/lib/anthropic/helpers/input_schema/union_of.rb +56 -0
- data/lib/anthropic/helpers/input_schema.rb +16 -0
- data/lib/anthropic/helpers/streaming/message_stream.rb +41 -1
- data/lib/anthropic/input_schema.rb +10 -0
- data/lib/anthropic/internal/stream.rb +2 -1
- data/lib/anthropic/internal/transport/base_client.rb +1 -2
- data/lib/anthropic/internal/transport/pooled_net_requester.rb +1 -9
- data/lib/anthropic/internal/type/base_model.rb +2 -9
- data/lib/anthropic/internal/util.rb +1 -1
- data/lib/anthropic/models/beta/beta_bash_code_execution_output_block.rb +25 -0
- data/lib/anthropic/models/beta/beta_bash_code_execution_output_block_param.rb +25 -0
- data/lib/anthropic/models/beta/beta_bash_code_execution_result_block.rb +44 -0
- data/lib/anthropic/models/beta/beta_bash_code_execution_result_block_param.rb +44 -0
- data/lib/anthropic/models/beta/beta_bash_code_execution_tool_result_block.rb +43 -0
- data/lib/anthropic/models/beta/beta_bash_code_execution_tool_result_block_param.rb +53 -0
- data/lib/anthropic/models/beta/beta_bash_code_execution_tool_result_error.rb +39 -0
- data/lib/anthropic/models/beta/beta_bash_code_execution_tool_result_error_param.rb +39 -0
- data/lib/anthropic/models/beta/beta_code_execution_tool_20250825.rb +40 -0
- data/lib/anthropic/models/beta/beta_content_block.rb +6 -1
- data/lib/anthropic/models/beta/beta_content_block_param.rb +7 -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_raw_content_block_start_event.rb +8 -3
- data/lib/anthropic/models/beta/beta_server_tool_use_block.rb +2 -0
- data/lib/anthropic/models/beta/beta_server_tool_use_block_param.rb +2 -0
- data/lib/anthropic/models/beta/beta_text_editor_code_execution_create_result_block.rb +25 -0
- data/lib/anthropic/models/beta/beta_text_editor_code_execution_create_result_block_param.rb +26 -0
- data/lib/anthropic/models/beta/beta_text_editor_code_execution_str_replace_result_block.rb +49 -0
- data/lib/anthropic/models/beta/beta_text_editor_code_execution_str_replace_result_block_param.rb +50 -0
- data/lib/anthropic/models/beta/beta_text_editor_code_execution_tool_result_block.rb +47 -0
- data/lib/anthropic/models/beta/beta_text_editor_code_execution_tool_result_block_param.rb +57 -0
- data/lib/anthropic/models/beta/beta_text_editor_code_execution_tool_result_error.rb +45 -0
- data/lib/anthropic/models/beta/beta_text_editor_code_execution_tool_result_error_param.rb +46 -0
- data/lib/anthropic/models/beta/beta_text_editor_code_execution_view_result_block.rb +61 -0
- data/lib/anthropic/models/beta/beta_text_editor_code_execution_view_result_block_param.rb +62 -0
- data/lib/anthropic/models/beta/beta_tool_union.rb +3 -1
- data/lib/anthropic/models/beta/message_count_tokens_params.rb +7 -30
- data/lib/anthropic/models/beta/message_create_params.rb +3 -26
- data/lib/anthropic/models/beta/messages/batch_create_params.rb +6 -36
- data/lib/anthropic/models/beta/messages/beta_message_batch.rb +1 -4
- data/lib/anthropic/models/beta_error_response.rb +7 -1
- data/lib/anthropic/models/error_response.rb +7 -1
- data/lib/anthropic/models/message_count_tokens_params.rb +1 -24
- data/lib/anthropic/models/message_create_params.rb +1 -24
- data/lib/anthropic/models/messages/batch_create_params.rb +2 -28
- data/lib/anthropic/models/tool_use_block.rb +8 -0
- data/lib/anthropic/resources/beta/messages.rb +3 -3
- data/lib/anthropic/resources/messages.rb +85 -1
- data/lib/anthropic/version.rb +1 -1
- data/lib/anthropic.rb +29 -0
- data/rbi/anthropic/errors.rbi +2 -2
- data/rbi/anthropic/helpers/input_schema/array_of.rbi +16 -0
- data/rbi/anthropic/helpers/input_schema/base_model.rbi +21 -0
- data/rbi/anthropic/helpers/input_schema/boolean.rbi +11 -0
- data/rbi/anthropic/helpers/input_schema/enum_of.rbi +30 -0
- data/rbi/anthropic/helpers/input_schema/json_schema_converter.rbi +89 -0
- data/rbi/anthropic/helpers/input_schema/union_of.rbi +23 -0
- data/rbi/anthropic/helpers/structured_output.rbi +16 -0
- data/rbi/anthropic/input_schema.rbi +12 -0
- data/rbi/anthropic/models/beta/beta_bash_code_execution_output_block.rbi +33 -0
- data/rbi/anthropic/models/beta/beta_bash_code_execution_output_block_param.rbi +34 -0
- data/rbi/anthropic/models/beta/beta_bash_code_execution_result_block.rbi +72 -0
- data/rbi/anthropic/models/beta/beta_bash_code_execution_result_block_param.rbi +77 -0
- data/rbi/anthropic/models/beta/beta_bash_code_execution_tool_result_block.rbi +86 -0
- data/rbi/anthropic/models/beta/beta_bash_code_execution_tool_result_block_param.rbi +110 -0
- data/rbi/anthropic/models/beta/beta_bash_code_execution_tool_result_error.rbi +101 -0
- data/rbi/anthropic/models/beta/beta_bash_code_execution_tool_result_error_param.rbi +101 -0
- data/rbi/anthropic/models/beta/beta_code_execution_tool_20250825.rbi +72 -0
- data/rbi/anthropic/models/beta/beta_content_block.rbi +2 -0
- data/rbi/anthropic/models/beta/beta_content_block_param.rbi +2 -0
- data/rbi/anthropic/models/beta/beta_message.rbi +2 -0
- data/rbi/anthropic/models/beta/beta_raw_content_block_start_event.rbi +4 -0
- data/rbi/anthropic/models/beta/beta_server_tool_use_block.rbi +10 -0
- data/rbi/anthropic/models/beta/beta_server_tool_use_block_param.rbi +10 -0
- data/rbi/anthropic/models/beta/beta_text_editor_code_execution_create_result_block.rbi +41 -0
- data/rbi/anthropic/models/beta/beta_text_editor_code_execution_create_result_block_param.rbi +41 -0
- data/rbi/anthropic/models/beta/beta_text_editor_code_execution_str_replace_result_block.rbi +73 -0
- data/rbi/anthropic/models/beta/beta_text_editor_code_execution_str_replace_result_block_param.rbi +73 -0
- data/rbi/anthropic/models/beta/beta_text_editor_code_execution_tool_result_block.rbi +90 -0
- data/rbi/anthropic/models/beta/beta_text_editor_code_execution_tool_result_block_param.rbi +118 -0
- data/rbi/anthropic/models/beta/beta_text_editor_code_execution_tool_result_error.rbi +110 -0
- data/rbi/anthropic/models/beta/beta_text_editor_code_execution_tool_result_error_param.rbi +110 -0
- data/rbi/anthropic/models/beta/beta_text_editor_code_execution_view_result_block.rbi +118 -0
- data/rbi/anthropic/models/beta/beta_text_editor_code_execution_view_result_block_param.rbi +118 -0
- data/rbi/anthropic/models/beta/beta_tool_union.rbi +1 -0
- data/rbi/anthropic/models/beta/message_count_tokens_params.rbi +7 -48
- data/rbi/anthropic/models/beta/message_create_params.rbi +6 -48
- data/rbi/anthropic/models/beta/messages/batch_create_params.rbi +6 -48
- data/rbi/anthropic/models/beta_error_response.rbi +10 -2
- data/rbi/anthropic/models/error_response.rbi +10 -2
- data/rbi/anthropic/models/message_count_tokens_params.rbi +2 -48
- data/rbi/anthropic/models/message_create_params.rbi +2 -48
- data/rbi/anthropic/models/messages/batch_create_params.rbi +2 -48
- data/rbi/anthropic/resources/beta/messages.rbi +6 -72
- data/rbi/anthropic/resources/messages.rbi +3 -72
- data/sig/anthropic/models/beta/beta_bash_code_execution_output_block.rbs +23 -0
- data/sig/anthropic/models/beta/beta_bash_code_execution_output_block_param.rbs +23 -0
- data/sig/anthropic/models/beta/beta_bash_code_execution_result_block.rbs +44 -0
- data/sig/anthropic/models/beta/beta_bash_code_execution_result_block_param.rbs +44 -0
- data/sig/anthropic/models/beta/beta_bash_code_execution_tool_result_block.rbs +44 -0
- data/sig/anthropic/models/beta/beta_bash_code_execution_tool_result_block_param.rbs +49 -0
- data/sig/anthropic/models/beta/beta_bash_code_execution_tool_result_error.rbs +48 -0
- data/sig/anthropic/models/beta/beta_bash_code_execution_tool_result_error_param.rbs +48 -0
- data/sig/anthropic/models/beta/beta_code_execution_tool_20250825.rbs +34 -0
- data/sig/anthropic/models/beta/beta_content_block.rbs +2 -0
- data/sig/anthropic/models/beta/beta_content_block_param.rbs +2 -0
- data/sig/anthropic/models/beta/beta_raw_content_block_start_event.rbs +2 -0
- data/sig/anthropic/models/beta/beta_server_tool_use_block.rbs +7 -1
- data/sig/anthropic/models/beta/beta_server_tool_use_block_param.rbs +7 -1
- data/sig/anthropic/models/beta/beta_text_editor_code_execution_create_result_block.rbs +29 -0
- data/sig/anthropic/models/beta/beta_text_editor_code_execution_create_result_block_param.rbs +29 -0
- data/sig/anthropic/models/beta/beta_text_editor_code_execution_str_replace_result_block.rbs +49 -0
- data/sig/anthropic/models/beta/beta_text_editor_code_execution_str_replace_result_block_param.rbs +49 -0
- data/sig/anthropic/models/beta/beta_text_editor_code_execution_tool_result_block.rbs +46 -0
- data/sig/anthropic/models/beta/beta_text_editor_code_execution_tool_result_block_param.rbs +51 -0
- data/sig/anthropic/models/beta/beta_text_editor_code_execution_tool_result_error.rbs +53 -0
- data/sig/anthropic/models/beta/beta_text_editor_code_execution_tool_result_error_param.rbs +53 -0
- data/sig/anthropic/models/beta/beta_text_editor_code_execution_view_result_block.rbs +61 -0
- data/sig/anthropic/models/beta/beta_text_editor_code_execution_view_result_block_param.rbs +61 -0
- data/sig/anthropic/models/beta/beta_tool_union.rbs +1 -0
- data/sig/anthropic/models/beta/message_count_tokens_params.rbs +1 -0
- data/sig/anthropic/models/beta_error_response.rbs +13 -2
- data/sig/anthropic/models/error_response.rbs +13 -2
- metadata +77 -2
@@ -63,6 +63,7 @@ module Anthropic
|
|
63
63
|
# @return [Anthropic::Models::Message]
|
64
64
|
def accumulated_message
|
65
65
|
until_done
|
66
|
+
parse_tool_uses!(@accumated_message_snapshot) if @tool_models.any?
|
66
67
|
@accumated_message_snapshot
|
67
68
|
end
|
68
69
|
|
@@ -221,14 +222,53 @@ module Anthropic
|
|
221
222
|
events_to_yield
|
222
223
|
end
|
223
224
|
|
225
|
+
# @api private
|
226
|
+
#
|
227
|
+
# Parse tool use blocks in the message using the provided tool models.
|
228
|
+
#
|
229
|
+
# @param message [Anthropic::Models::Message] The message to parse
|
230
|
+
#
|
231
|
+
# @return [Anthropic::Models::Message] The message with parsed tool uses
|
232
|
+
private def parse_tool_uses!(message)
|
233
|
+
return message unless message&.content
|
234
|
+
|
235
|
+
message.content.each_with_index do |content, index|
|
236
|
+
next unless content.type == :tool_use
|
237
|
+
|
238
|
+
next unless (model = @tool_models[content.name])
|
239
|
+
|
240
|
+
parsed =
|
241
|
+
begin
|
242
|
+
parsed_input = content.input.is_a?(String) ? JSON.parse(content.input) : content.input
|
243
|
+
|
244
|
+
Anthropic::Internal::Type::Converter.coerce(model, parsed_input)
|
245
|
+
rescue StandardError => e
|
246
|
+
e
|
247
|
+
end
|
248
|
+
|
249
|
+
message.content[index] = Anthropic::Models::ToolUseBlock.new(
|
250
|
+
id: content.id,
|
251
|
+
input: content.input,
|
252
|
+
name: content.name,
|
253
|
+
type: content.type,
|
254
|
+
parsed: parsed
|
255
|
+
)
|
256
|
+
end
|
257
|
+
|
258
|
+
message
|
259
|
+
end
|
260
|
+
|
224
261
|
# @api private
|
225
262
|
#
|
226
263
|
# @param raw_stream [Anthropic::Internal::Type::BaseStream]
|
227
|
-
|
264
|
+
# @param tool_models [Hash{String=>Class}] Mapping of tool names to model classes
|
265
|
+
def initialize(raw_stream:, tool_models: {})
|
228
266
|
# The underlying Server-Sent Event stream from the Anthropic API.
|
229
267
|
@raw_stream = raw_stream
|
230
268
|
# Accumulated message state that builds up as events are processed.
|
231
269
|
@accumated_message_snapshot = nil
|
270
|
+
# Mapping of tool names to model classes for parsing.
|
271
|
+
@tool_models = tool_models
|
232
272
|
# Lazy enumerable that transforms raw events into consumable events.
|
233
273
|
@iterator = iterator
|
234
274
|
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Anthropic
|
4
|
+
InputSchema = Anthropic::Helpers::InputSchema
|
5
|
+
ArrayOf = Anthropic::Helpers::InputSchema::ArrayOf
|
6
|
+
BaseModel = Anthropic::Helpers::InputSchema::BaseModel
|
7
|
+
Boolean = Anthropic::Helpers::InputSchema::Boolean
|
8
|
+
EnumOf = Anthropic::Helpers::InputSchema::EnumOf
|
9
|
+
UnionOf = Anthropic::Helpers::InputSchema::UnionOf
|
10
|
+
end
|
@@ -40,13 +40,14 @@ module Anthropic
|
|
40
40
|
rescue JSON::ParserError
|
41
41
|
data
|
42
42
|
end
|
43
|
-
Anthropic::Errors::APIStatusError.for(
|
43
|
+
err = Anthropic::Errors::APIStatusError.for(
|
44
44
|
url: @url,
|
45
45
|
status: @status,
|
46
46
|
body: decoded,
|
47
47
|
request: nil,
|
48
48
|
response: @response
|
49
49
|
)
|
50
|
+
raise err
|
50
51
|
else
|
51
52
|
end
|
52
53
|
end
|
@@ -558,8 +558,7 @@ module Anthropic
|
|
558
558
|
),
|
559
559
|
page: T.nilable(T::Class[Anthropic::Internal::Type::BasePage[Anthropic::Internal::Type::BaseModel]]),
|
560
560
|
stream: T.nilable(
|
561
|
-
T::Class[Anthropic::Internal::Type::BaseStream[T.anything,
|
562
|
-
Anthropic::Internal::Type::BaseModel]]
|
561
|
+
T::Class[Anthropic::Internal::Type::BaseStream[T.anything, Anthropic::Internal::Type::BaseModel]]
|
563
562
|
),
|
564
563
|
model: T.nilable(Anthropic::Internal::Type::Converter::Input),
|
565
564
|
options: T.nilable(Anthropic::RequestOptions::OrHash)
|
@@ -193,15 +193,7 @@ module Anthropic
|
|
193
193
|
end
|
194
194
|
|
195
195
|
define_sorbet_constant!(:Request) do
|
196
|
-
T.type_alias
|
197
|
-
{
|
198
|
-
method: Symbol,
|
199
|
-
url: URI::Generic,
|
200
|
-
headers: T::Hash[String, String],
|
201
|
-
body: T.anything,
|
202
|
-
deadline: Float
|
203
|
-
}
|
204
|
-
end
|
196
|
+
T.type_alias { {method: Symbol, url: URI::Generic, headers: T::Hash[String, String], body: T.anything, deadline: Float} }
|
205
197
|
end
|
206
198
|
end
|
207
199
|
end
|
@@ -52,7 +52,6 @@ module Anthropic
|
|
52
52
|
#
|
53
53
|
# @option spec [Boolean] :"nil?"
|
54
54
|
private def add_field(name_sym, required:, type_info:, spec:)
|
55
|
-
meta = Anthropic::Internal::Type::Converter.meta_info(type_info, spec)
|
56
55
|
type_fn, info =
|
57
56
|
case type_info
|
58
57
|
in Proc | Anthropic::Internal::Type::Converter | Class
|
@@ -60,18 +59,12 @@ module Anthropic
|
|
60
59
|
in Hash
|
61
60
|
[Anthropic::Internal::Type::Converter.type_info(type_info), type_info]
|
62
61
|
end
|
62
|
+
meta = Anthropic::Internal::Type::Converter.meta_info(type_info, spec)
|
63
63
|
|
64
64
|
setter = :"#{name_sym}="
|
65
65
|
api_name = info.fetch(:api_name, name_sym)
|
66
66
|
nilable = info.fetch(:nil?, false)
|
67
|
-
const =
|
68
|
-
info.fetch(
|
69
|
-
:const,
|
70
|
-
Anthropic::Internal::OMIT
|
71
|
-
)
|
72
|
-
else
|
73
|
-
Anthropic::Internal::OMIT
|
74
|
-
end
|
67
|
+
const = required && !nilable ? info.fetch(:const, Anthropic::Internal::OMIT) : Anthropic::Internal::OMIT
|
75
68
|
|
76
69
|
[name_sym, setter].each { undef_method(_1) } if known_fields.key?(name_sym)
|
77
70
|
|
@@ -244,7 +244,7 @@ module Anthropic
|
|
244
244
|
#
|
245
245
|
# @return [String]
|
246
246
|
def uri_origin(uri)
|
247
|
-
"#{uri.scheme}://#{uri.host}#{uri.port
|
247
|
+
"#{uri.scheme}://#{uri.host}#{":#{uri.port}" unless uri.port == uri.default_port}"
|
248
248
|
end
|
249
249
|
|
250
250
|
# @api private
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Anthropic
|
4
|
+
module Models
|
5
|
+
module Beta
|
6
|
+
class BetaBashCodeExecutionOutputBlock < Anthropic::Internal::Type::BaseModel
|
7
|
+
# @!attribute file_id
|
8
|
+
#
|
9
|
+
# @return [String]
|
10
|
+
required :file_id, String
|
11
|
+
|
12
|
+
# @!attribute type
|
13
|
+
#
|
14
|
+
# @return [Symbol, :bash_code_execution_output]
|
15
|
+
required :type, const: :bash_code_execution_output
|
16
|
+
|
17
|
+
# @!method initialize(file_id:, type: :bash_code_execution_output)
|
18
|
+
# @param file_id [String]
|
19
|
+
# @param type [Symbol, :bash_code_execution_output]
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
BetaBashCodeExecutionOutputBlock = Beta::BetaBashCodeExecutionOutputBlock
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Anthropic
|
4
|
+
module Models
|
5
|
+
module Beta
|
6
|
+
class BetaBashCodeExecutionOutputBlockParam < Anthropic::Internal::Type::BaseModel
|
7
|
+
# @!attribute file_id
|
8
|
+
#
|
9
|
+
# @return [String]
|
10
|
+
required :file_id, String
|
11
|
+
|
12
|
+
# @!attribute type
|
13
|
+
#
|
14
|
+
# @return [Symbol, :bash_code_execution_output]
|
15
|
+
required :type, const: :bash_code_execution_output
|
16
|
+
|
17
|
+
# @!method initialize(file_id:, type: :bash_code_execution_output)
|
18
|
+
# @param file_id [String]
|
19
|
+
# @param type [Symbol, :bash_code_execution_output]
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
BetaBashCodeExecutionOutputBlockParam = Beta::BetaBashCodeExecutionOutputBlockParam
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Anthropic
|
4
|
+
module Models
|
5
|
+
module Beta
|
6
|
+
class BetaBashCodeExecutionResultBlock < Anthropic::Internal::Type::BaseModel
|
7
|
+
# @!attribute content
|
8
|
+
#
|
9
|
+
# @return [Array<Anthropic::Models::Beta::BetaBashCodeExecutionOutputBlock>]
|
10
|
+
required :content,
|
11
|
+
-> { Anthropic::Internal::Type::ArrayOf[Anthropic::Beta::BetaBashCodeExecutionOutputBlock] }
|
12
|
+
|
13
|
+
# @!attribute return_code
|
14
|
+
#
|
15
|
+
# @return [Integer]
|
16
|
+
required :return_code, Integer
|
17
|
+
|
18
|
+
# @!attribute stderr
|
19
|
+
#
|
20
|
+
# @return [String]
|
21
|
+
required :stderr, String
|
22
|
+
|
23
|
+
# @!attribute stdout
|
24
|
+
#
|
25
|
+
# @return [String]
|
26
|
+
required :stdout, String
|
27
|
+
|
28
|
+
# @!attribute type
|
29
|
+
#
|
30
|
+
# @return [Symbol, :bash_code_execution_result]
|
31
|
+
required :type, const: :bash_code_execution_result
|
32
|
+
|
33
|
+
# @!method initialize(content:, return_code:, stderr:, stdout:, type: :bash_code_execution_result)
|
34
|
+
# @param content [Array<Anthropic::Models::Beta::BetaBashCodeExecutionOutputBlock>]
|
35
|
+
# @param return_code [Integer]
|
36
|
+
# @param stderr [String]
|
37
|
+
# @param stdout [String]
|
38
|
+
# @param type [Symbol, :bash_code_execution_result]
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
BetaBashCodeExecutionResultBlock = Beta::BetaBashCodeExecutionResultBlock
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Anthropic
|
4
|
+
module Models
|
5
|
+
module Beta
|
6
|
+
class BetaBashCodeExecutionResultBlockParam < Anthropic::Internal::Type::BaseModel
|
7
|
+
# @!attribute content
|
8
|
+
#
|
9
|
+
# @return [Array<Anthropic::Models::Beta::BetaBashCodeExecutionOutputBlockParam>]
|
10
|
+
required :content,
|
11
|
+
-> { Anthropic::Internal::Type::ArrayOf[Anthropic::Beta::BetaBashCodeExecutionOutputBlockParam] }
|
12
|
+
|
13
|
+
# @!attribute return_code
|
14
|
+
#
|
15
|
+
# @return [Integer]
|
16
|
+
required :return_code, Integer
|
17
|
+
|
18
|
+
# @!attribute stderr
|
19
|
+
#
|
20
|
+
# @return [String]
|
21
|
+
required :stderr, String
|
22
|
+
|
23
|
+
# @!attribute stdout
|
24
|
+
#
|
25
|
+
# @return [String]
|
26
|
+
required :stdout, String
|
27
|
+
|
28
|
+
# @!attribute type
|
29
|
+
#
|
30
|
+
# @return [Symbol, :bash_code_execution_result]
|
31
|
+
required :type, const: :bash_code_execution_result
|
32
|
+
|
33
|
+
# @!method initialize(content:, return_code:, stderr:, stdout:, type: :bash_code_execution_result)
|
34
|
+
# @param content [Array<Anthropic::Models::Beta::BetaBashCodeExecutionOutputBlockParam>]
|
35
|
+
# @param return_code [Integer]
|
36
|
+
# @param stderr [String]
|
37
|
+
# @param stdout [String]
|
38
|
+
# @param type [Symbol, :bash_code_execution_result]
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
BetaBashCodeExecutionResultBlockParam = Beta::BetaBashCodeExecutionResultBlockParam
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Anthropic
|
4
|
+
module Models
|
5
|
+
module Beta
|
6
|
+
class BetaBashCodeExecutionToolResultBlock < Anthropic::Internal::Type::BaseModel
|
7
|
+
# @!attribute content
|
8
|
+
#
|
9
|
+
# @return [Anthropic::Models::Beta::BetaBashCodeExecutionToolResultError, Anthropic::Models::Beta::BetaBashCodeExecutionResultBlock]
|
10
|
+
required :content, union: -> { Anthropic::Beta::BetaBashCodeExecutionToolResultBlock::Content }
|
11
|
+
|
12
|
+
# @!attribute tool_use_id
|
13
|
+
#
|
14
|
+
# @return [String]
|
15
|
+
required :tool_use_id, String
|
16
|
+
|
17
|
+
# @!attribute type
|
18
|
+
#
|
19
|
+
# @return [Symbol, :bash_code_execution_tool_result]
|
20
|
+
required :type, const: :bash_code_execution_tool_result
|
21
|
+
|
22
|
+
# @!method initialize(content:, tool_use_id:, type: :bash_code_execution_tool_result)
|
23
|
+
# @param content [Anthropic::Models::Beta::BetaBashCodeExecutionToolResultError, Anthropic::Models::Beta::BetaBashCodeExecutionResultBlock]
|
24
|
+
# @param tool_use_id [String]
|
25
|
+
# @param type [Symbol, :bash_code_execution_tool_result]
|
26
|
+
|
27
|
+
# @see Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlock#content
|
28
|
+
module Content
|
29
|
+
extend Anthropic::Internal::Type::Union
|
30
|
+
|
31
|
+
variant -> { Anthropic::Beta::BetaBashCodeExecutionToolResultError }
|
32
|
+
|
33
|
+
variant -> { Anthropic::Beta::BetaBashCodeExecutionResultBlock }
|
34
|
+
|
35
|
+
# @!method self.variants
|
36
|
+
# @return [Array(Anthropic::Models::Beta::BetaBashCodeExecutionToolResultError, Anthropic::Models::Beta::BetaBashCodeExecutionResultBlock)]
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
BetaBashCodeExecutionToolResultBlock = Beta::BetaBashCodeExecutionToolResultBlock
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Anthropic
|
4
|
+
module Models
|
5
|
+
module Beta
|
6
|
+
class BetaBashCodeExecutionToolResultBlockParam < Anthropic::Internal::Type::BaseModel
|
7
|
+
# @!attribute content
|
8
|
+
#
|
9
|
+
# @return [Anthropic::Models::Beta::BetaBashCodeExecutionToolResultErrorParam, Anthropic::Models::Beta::BetaBashCodeExecutionResultBlockParam]
|
10
|
+
required :content, union: -> { Anthropic::Beta::BetaBashCodeExecutionToolResultBlockParam::Content }
|
11
|
+
|
12
|
+
# @!attribute tool_use_id
|
13
|
+
#
|
14
|
+
# @return [String]
|
15
|
+
required :tool_use_id, String
|
16
|
+
|
17
|
+
# @!attribute type
|
18
|
+
#
|
19
|
+
# @return [Symbol, :bash_code_execution_tool_result]
|
20
|
+
required :type, const: :bash_code_execution_tool_result
|
21
|
+
|
22
|
+
# @!attribute cache_control
|
23
|
+
# Create a cache control breakpoint at this content block.
|
24
|
+
#
|
25
|
+
# @return [Anthropic::Models::Beta::BetaCacheControlEphemeral, nil]
|
26
|
+
optional :cache_control, -> { Anthropic::Beta::BetaCacheControlEphemeral }, nil?: true
|
27
|
+
|
28
|
+
# @!method initialize(content:, tool_use_id:, cache_control: nil, type: :bash_code_execution_tool_result)
|
29
|
+
# @param content [Anthropic::Models::Beta::BetaBashCodeExecutionToolResultErrorParam, Anthropic::Models::Beta::BetaBashCodeExecutionResultBlockParam]
|
30
|
+
#
|
31
|
+
# @param tool_use_id [String]
|
32
|
+
#
|
33
|
+
# @param cache_control [Anthropic::Models::Beta::BetaCacheControlEphemeral, nil] Create a cache control breakpoint at this content block.
|
34
|
+
#
|
35
|
+
# @param type [Symbol, :bash_code_execution_tool_result]
|
36
|
+
|
37
|
+
# @see Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlockParam#content
|
38
|
+
module Content
|
39
|
+
extend Anthropic::Internal::Type::Union
|
40
|
+
|
41
|
+
variant -> { Anthropic::Beta::BetaBashCodeExecutionToolResultErrorParam }
|
42
|
+
|
43
|
+
variant -> { Anthropic::Beta::BetaBashCodeExecutionResultBlockParam }
|
44
|
+
|
45
|
+
# @!method self.variants
|
46
|
+
# @return [Array(Anthropic::Models::Beta::BetaBashCodeExecutionToolResultErrorParam, Anthropic::Models::Beta::BetaBashCodeExecutionResultBlockParam)]
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
BetaBashCodeExecutionToolResultBlockParam = Beta::BetaBashCodeExecutionToolResultBlockParam
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Anthropic
|
4
|
+
module Models
|
5
|
+
module Beta
|
6
|
+
class BetaBashCodeExecutionToolResultError < Anthropic::Internal::Type::BaseModel
|
7
|
+
# @!attribute error_code
|
8
|
+
#
|
9
|
+
# @return [Symbol, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultError::ErrorCode]
|
10
|
+
required :error_code, enum: -> { Anthropic::Beta::BetaBashCodeExecutionToolResultError::ErrorCode }
|
11
|
+
|
12
|
+
# @!attribute type
|
13
|
+
#
|
14
|
+
# @return [Symbol, :bash_code_execution_tool_result_error]
|
15
|
+
required :type, const: :bash_code_execution_tool_result_error
|
16
|
+
|
17
|
+
# @!method initialize(error_code:, type: :bash_code_execution_tool_result_error)
|
18
|
+
# @param error_code [Symbol, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultError::ErrorCode]
|
19
|
+
# @param type [Symbol, :bash_code_execution_tool_result_error]
|
20
|
+
|
21
|
+
# @see Anthropic::Models::Beta::BetaBashCodeExecutionToolResultError#error_code
|
22
|
+
module ErrorCode
|
23
|
+
extend Anthropic::Internal::Type::Enum
|
24
|
+
|
25
|
+
INVALID_TOOL_INPUT = :invalid_tool_input
|
26
|
+
UNAVAILABLE = :unavailable
|
27
|
+
TOO_MANY_REQUESTS = :too_many_requests
|
28
|
+
EXECUTION_TIME_EXCEEDED = :execution_time_exceeded
|
29
|
+
OUTPUT_FILE_TOO_LARGE = :output_file_too_large
|
30
|
+
|
31
|
+
# @!method self.values
|
32
|
+
# @return [Array<Symbol>]
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
BetaBashCodeExecutionToolResultError = Beta::BetaBashCodeExecutionToolResultError
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Anthropic
|
4
|
+
module Models
|
5
|
+
module Beta
|
6
|
+
class BetaBashCodeExecutionToolResultErrorParam < Anthropic::Internal::Type::BaseModel
|
7
|
+
# @!attribute error_code
|
8
|
+
#
|
9
|
+
# @return [Symbol, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultErrorParam::ErrorCode]
|
10
|
+
required :error_code, enum: -> { Anthropic::Beta::BetaBashCodeExecutionToolResultErrorParam::ErrorCode }
|
11
|
+
|
12
|
+
# @!attribute type
|
13
|
+
#
|
14
|
+
# @return [Symbol, :bash_code_execution_tool_result_error]
|
15
|
+
required :type, const: :bash_code_execution_tool_result_error
|
16
|
+
|
17
|
+
# @!method initialize(error_code:, type: :bash_code_execution_tool_result_error)
|
18
|
+
# @param error_code [Symbol, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultErrorParam::ErrorCode]
|
19
|
+
# @param type [Symbol, :bash_code_execution_tool_result_error]
|
20
|
+
|
21
|
+
# @see Anthropic::Models::Beta::BetaBashCodeExecutionToolResultErrorParam#error_code
|
22
|
+
module ErrorCode
|
23
|
+
extend Anthropic::Internal::Type::Enum
|
24
|
+
|
25
|
+
INVALID_TOOL_INPUT = :invalid_tool_input
|
26
|
+
UNAVAILABLE = :unavailable
|
27
|
+
TOO_MANY_REQUESTS = :too_many_requests
|
28
|
+
EXECUTION_TIME_EXCEEDED = :execution_time_exceeded
|
29
|
+
OUTPUT_FILE_TOO_LARGE = :output_file_too_large
|
30
|
+
|
31
|
+
# @!method self.values
|
32
|
+
# @return [Array<Symbol>]
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
BetaBashCodeExecutionToolResultErrorParam = Beta::BetaBashCodeExecutionToolResultErrorParam
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Anthropic
|
4
|
+
module Models
|
5
|
+
module Beta
|
6
|
+
class BetaCodeExecutionTool20250825 < Anthropic::Internal::Type::BaseModel
|
7
|
+
# @!attribute name
|
8
|
+
# Name of the tool.
|
9
|
+
#
|
10
|
+
# This is how the tool will be called by the model and in `tool_use` blocks.
|
11
|
+
#
|
12
|
+
# @return [Symbol, :code_execution]
|
13
|
+
required :name, const: :code_execution
|
14
|
+
|
15
|
+
# @!attribute type
|
16
|
+
#
|
17
|
+
# @return [Symbol, :code_execution_20250825]
|
18
|
+
required :type, const: :code_execution_20250825
|
19
|
+
|
20
|
+
# @!attribute cache_control
|
21
|
+
# Create a cache control breakpoint at this content block.
|
22
|
+
#
|
23
|
+
# @return [Anthropic::Models::Beta::BetaCacheControlEphemeral, nil]
|
24
|
+
optional :cache_control, -> { Anthropic::Beta::BetaCacheControlEphemeral }, nil?: true
|
25
|
+
|
26
|
+
# @!method initialize(cache_control: nil, name: :code_execution, type: :code_execution_20250825)
|
27
|
+
# Some parameter documentations has been truncated, see
|
28
|
+
# {Anthropic::Models::Beta::BetaCodeExecutionTool20250825} for more details.
|
29
|
+
#
|
30
|
+
# @param cache_control [Anthropic::Models::Beta::BetaCacheControlEphemeral, nil] Create a cache control breakpoint at this content block.
|
31
|
+
#
|
32
|
+
# @param name [Symbol, :code_execution] Name of the tool.
|
33
|
+
#
|
34
|
+
# @param type [Symbol, :code_execution_20250825]
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
BetaCodeExecutionTool20250825 = Beta::BetaCodeExecutionTool20250825
|
39
|
+
end
|
40
|
+
end
|
@@ -23,6 +23,11 @@ module Anthropic
|
|
23
23
|
|
24
24
|
variant :code_execution_tool_result, -> { Anthropic::Beta::BetaCodeExecutionToolResultBlock }
|
25
25
|
|
26
|
+
variant :bash_code_execution_tool_result, -> { Anthropic::Beta::BetaBashCodeExecutionToolResultBlock }
|
27
|
+
|
28
|
+
variant :text_editor_code_execution_tool_result,
|
29
|
+
-> { Anthropic::Beta::BetaTextEditorCodeExecutionToolResultBlock }
|
30
|
+
|
26
31
|
variant :mcp_tool_use, -> { Anthropic::Beta::BetaMCPToolUseBlock }
|
27
32
|
|
28
33
|
variant :mcp_tool_result, -> { Anthropic::Beta::BetaMCPToolResultBlock }
|
@@ -31,7 +36,7 @@ module Anthropic
|
|
31
36
|
variant :container_upload, -> { Anthropic::Beta::BetaContainerUploadBlock }
|
32
37
|
|
33
38
|
# @!method self.variants
|
34
|
-
# @return [Array(Anthropic::Models::Beta::BetaTextBlock, Anthropic::Models::Beta::BetaThinkingBlock, Anthropic::Models::Beta::BetaRedactedThinkingBlock, Anthropic::Models::Beta::BetaToolUseBlock, Anthropic::Models::Beta::BetaServerToolUseBlock, Anthropic::Models::Beta::BetaWebSearchToolResultBlock, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaMCPToolUseBlock, Anthropic::Models::Beta::BetaMCPToolResultBlock, Anthropic::Models::Beta::BetaContainerUploadBlock)]
|
39
|
+
# @return [Array(Anthropic::Models::Beta::BetaTextBlock, Anthropic::Models::Beta::BetaThinkingBlock, Anthropic::Models::Beta::BetaRedactedThinkingBlock, Anthropic::Models::Beta::BetaToolUseBlock, Anthropic::Models::Beta::BetaServerToolUseBlock, Anthropic::Models::Beta::BetaWebSearchToolResultBlock, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaMCPToolUseBlock, Anthropic::Models::Beta::BetaMCPToolResultBlock, Anthropic::Models::Beta::BetaContainerUploadBlock)]
|
35
40
|
end
|
36
41
|
end
|
37
42
|
|
@@ -39,6 +39,12 @@ module Anthropic
|
|
39
39
|
|
40
40
|
variant :code_execution_tool_result, -> { Anthropic::Beta::BetaCodeExecutionToolResultBlockParam }
|
41
41
|
|
42
|
+
variant :bash_code_execution_tool_result,
|
43
|
+
-> { Anthropic::Beta::BetaBashCodeExecutionToolResultBlockParam }
|
44
|
+
|
45
|
+
variant :text_editor_code_execution_tool_result,
|
46
|
+
-> { Anthropic::Beta::BetaTextEditorCodeExecutionToolResultBlockParam }
|
47
|
+
|
42
48
|
variant :mcp_tool_use, -> { Anthropic::Beta::BetaMCPToolUseBlockParam }
|
43
49
|
|
44
50
|
variant :mcp_tool_result, -> { Anthropic::Beta::BetaRequestMCPToolResultBlockParam }
|
@@ -48,7 +54,7 @@ module Anthropic
|
|
48
54
|
variant :container_upload, -> { Anthropic::Beta::BetaContainerUploadBlockParam }
|
49
55
|
|
50
56
|
# @!method self.variants
|
51
|
-
# @return [Array(Anthropic::Models::Beta::BetaTextBlockParam, Anthropic::Models::Beta::BetaImageBlockParam, Anthropic::Models::Beta::BetaRequestDocumentBlock, Anthropic::Models::Beta::BetaSearchResultBlockParam, Anthropic::Models::Beta::BetaThinkingBlockParam, Anthropic::Models::Beta::BetaRedactedThinkingBlockParam, Anthropic::Models::Beta::BetaToolUseBlockParam, Anthropic::Models::Beta::BetaToolResultBlockParam, Anthropic::Models::Beta::BetaServerToolUseBlockParam, Anthropic::Models::Beta::BetaWebSearchToolResultBlockParam, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaMCPToolUseBlockParam, Anthropic::Models::Beta::BetaRequestMCPToolResultBlockParam, Anthropic::Models::Beta::BetaContainerUploadBlockParam)]
|
57
|
+
# @return [Array(Anthropic::Models::Beta::BetaTextBlockParam, Anthropic::Models::Beta::BetaImageBlockParam, Anthropic::Models::Beta::BetaRequestDocumentBlock, Anthropic::Models::Beta::BetaSearchResultBlockParam, Anthropic::Models::Beta::BetaThinkingBlockParam, Anthropic::Models::Beta::BetaRedactedThinkingBlockParam, Anthropic::Models::Beta::BetaToolUseBlockParam, Anthropic::Models::Beta::BetaToolResultBlockParam, Anthropic::Models::Beta::BetaServerToolUseBlockParam, Anthropic::Models::Beta::BetaWebSearchToolResultBlockParam, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaMCPToolUseBlockParam, Anthropic::Models::Beta::BetaRequestMCPToolResultBlockParam, Anthropic::Models::Beta::BetaContainerUploadBlockParam)]
|
52
58
|
end
|
53
59
|
end
|
54
60
|
|
@@ -56,7 +56,7 @@ module Anthropic
|
|
56
56
|
# [{ "type": "text", "text": "B)" }]
|
57
57
|
# ```
|
58
58
|
#
|
59
|
-
# @return [Array<Anthropic::Models::Beta::BetaTextBlock, Anthropic::Models::Beta::BetaThinkingBlock, Anthropic::Models::Beta::BetaRedactedThinkingBlock, Anthropic::Models::Beta::BetaToolUseBlock, Anthropic::Models::Beta::BetaServerToolUseBlock, Anthropic::Models::Beta::BetaWebSearchToolResultBlock, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaMCPToolUseBlock, Anthropic::Models::Beta::BetaMCPToolResultBlock, Anthropic::Models::Beta::BetaContainerUploadBlock>]
|
59
|
+
# @return [Array<Anthropic::Models::Beta::BetaTextBlock, Anthropic::Models::Beta::BetaThinkingBlock, Anthropic::Models::Beta::BetaRedactedThinkingBlock, Anthropic::Models::Beta::BetaToolUseBlock, Anthropic::Models::Beta::BetaServerToolUseBlock, Anthropic::Models::Beta::BetaWebSearchToolResultBlock, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaMCPToolUseBlock, Anthropic::Models::Beta::BetaMCPToolResultBlock, Anthropic::Models::Beta::BetaContainerUploadBlock>]
|
60
60
|
required :content, -> { Anthropic::Internal::Type::ArrayOf[union: Anthropic::Beta::BetaContentBlock] }
|
61
61
|
|
62
62
|
# @!attribute model
|
@@ -140,7 +140,7 @@ module Anthropic
|
|
140
140
|
#
|
141
141
|
# @param container [Anthropic::Models::Beta::BetaContainer, nil] Information about the container used in the request (for the code execution tool
|
142
142
|
#
|
143
|
-
# @param content [Array<Anthropic::Models::Beta::BetaTextBlock, Anthropic::Models::Beta::BetaThinkingBlock, Anthropic::Models::Beta::BetaRedactedThinkingBlock, Anthropic::Models::Beta::BetaToolUseBlock, Anthropic::Models::Beta::BetaServerToolUseBlock, Anthropic::Models::Beta::BetaWebSearchToolResultBlock, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaMCPToolUseBlock, Anthropic::Models::Beta::BetaMCPToolResultBlock, Anthropic::Models::Beta::BetaContainerUploadBlock>] Content generated by the model.
|
143
|
+
# @param content [Array<Anthropic::Models::Beta::BetaTextBlock, Anthropic::Models::Beta::BetaThinkingBlock, Anthropic::Models::Beta::BetaRedactedThinkingBlock, Anthropic::Models::Beta::BetaToolUseBlock, Anthropic::Models::Beta::BetaServerToolUseBlock, Anthropic::Models::Beta::BetaWebSearchToolResultBlock, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaMCPToolUseBlock, Anthropic::Models::Beta::BetaMCPToolResultBlock, Anthropic::Models::Beta::BetaContainerUploadBlock>] Content generated by the model.
|
144
144
|
#
|
145
145
|
# @param model [Symbol, String, Anthropic::Models::Model] The model that will complete your prompt.\n\nSee [models](https://docs.anthropic
|
146
146
|
#
|
@@ -6,7 +6,7 @@ module Anthropic
|
|
6
6
|
class BetaMessageParam < Anthropic::Internal::Type::BaseModel
|
7
7
|
# @!attribute content
|
8
8
|
#
|
9
|
-
# @return [String, Array<Anthropic::Models::Beta::BetaTextBlockParam, Anthropic::Models::Beta::BetaImageBlockParam, Anthropic::Models::Beta::BetaRequestDocumentBlock, Anthropic::Models::Beta::BetaSearchResultBlockParam, Anthropic::Models::Beta::BetaThinkingBlockParam, Anthropic::Models::Beta::BetaRedactedThinkingBlockParam, Anthropic::Models::Beta::BetaToolUseBlockParam, Anthropic::Models::Beta::BetaToolResultBlockParam, Anthropic::Models::Beta::BetaServerToolUseBlockParam, Anthropic::Models::Beta::BetaWebSearchToolResultBlockParam, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaMCPToolUseBlockParam, Anthropic::Models::Beta::BetaRequestMCPToolResultBlockParam, Anthropic::Models::Beta::BetaContainerUploadBlockParam>]
|
9
|
+
# @return [String, Array<Anthropic::Models::Beta::BetaTextBlockParam, Anthropic::Models::Beta::BetaImageBlockParam, Anthropic::Models::Beta::BetaRequestDocumentBlock, Anthropic::Models::Beta::BetaSearchResultBlockParam, Anthropic::Models::Beta::BetaThinkingBlockParam, Anthropic::Models::Beta::BetaRedactedThinkingBlockParam, Anthropic::Models::Beta::BetaToolUseBlockParam, Anthropic::Models::Beta::BetaToolResultBlockParam, Anthropic::Models::Beta::BetaServerToolUseBlockParam, Anthropic::Models::Beta::BetaWebSearchToolResultBlockParam, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaMCPToolUseBlockParam, Anthropic::Models::Beta::BetaRequestMCPToolResultBlockParam, Anthropic::Models::Beta::BetaContainerUploadBlockParam>]
|
10
10
|
required :content, union: -> { Anthropic::Beta::BetaMessageParam::Content }
|
11
11
|
|
12
12
|
# @!attribute role
|
@@ -15,7 +15,7 @@ module Anthropic
|
|
15
15
|
required :role, enum: -> { Anthropic::Beta::BetaMessageParam::Role }
|
16
16
|
|
17
17
|
# @!method initialize(content:, role:)
|
18
|
-
# @param content [String, Array<Anthropic::Models::Beta::BetaTextBlockParam, Anthropic::Models::Beta::BetaImageBlockParam, Anthropic::Models::Beta::BetaRequestDocumentBlock, Anthropic::Models::Beta::BetaSearchResultBlockParam, Anthropic::Models::Beta::BetaThinkingBlockParam, Anthropic::Models::Beta::BetaRedactedThinkingBlockParam, Anthropic::Models::Beta::BetaToolUseBlockParam, Anthropic::Models::Beta::BetaToolResultBlockParam, Anthropic::Models::Beta::BetaServerToolUseBlockParam, Anthropic::Models::Beta::BetaWebSearchToolResultBlockParam, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaMCPToolUseBlockParam, Anthropic::Models::Beta::BetaRequestMCPToolResultBlockParam, Anthropic::Models::Beta::BetaContainerUploadBlockParam>]
|
18
|
+
# @param content [String, Array<Anthropic::Models::Beta::BetaTextBlockParam, Anthropic::Models::Beta::BetaImageBlockParam, Anthropic::Models::Beta::BetaRequestDocumentBlock, Anthropic::Models::Beta::BetaSearchResultBlockParam, Anthropic::Models::Beta::BetaThinkingBlockParam, Anthropic::Models::Beta::BetaRedactedThinkingBlockParam, Anthropic::Models::Beta::BetaToolUseBlockParam, Anthropic::Models::Beta::BetaToolResultBlockParam, Anthropic::Models::Beta::BetaServerToolUseBlockParam, Anthropic::Models::Beta::BetaWebSearchToolResultBlockParam, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaMCPToolUseBlockParam, Anthropic::Models::Beta::BetaRequestMCPToolResultBlockParam, Anthropic::Models::Beta::BetaContainerUploadBlockParam>]
|
19
19
|
# @param role [Symbol, Anthropic::Models::Beta::BetaMessageParam::Role]
|
20
20
|
|
21
21
|
# @see Anthropic::Models::Beta::BetaMessageParam#content
|
@@ -27,7 +27,7 @@ module Anthropic
|
|
27
27
|
variant -> { Anthropic::Models::Beta::BetaMessageParam::Content::BetaContentBlockParamArray }
|
28
28
|
|
29
29
|
# @!method self.variants
|
30
|
-
# @return [Array(String, Array<Anthropic::Models::Beta::BetaTextBlockParam, Anthropic::Models::Beta::BetaImageBlockParam, Anthropic::Models::Beta::BetaRequestDocumentBlock, Anthropic::Models::Beta::BetaSearchResultBlockParam, Anthropic::Models::Beta::BetaThinkingBlockParam, Anthropic::Models::Beta::BetaRedactedThinkingBlockParam, Anthropic::Models::Beta::BetaToolUseBlockParam, Anthropic::Models::Beta::BetaToolResultBlockParam, Anthropic::Models::Beta::BetaServerToolUseBlockParam, Anthropic::Models::Beta::BetaWebSearchToolResultBlockParam, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaMCPToolUseBlockParam, Anthropic::Models::Beta::BetaRequestMCPToolResultBlockParam, Anthropic::Models::Beta::BetaContainerUploadBlockParam>)]
|
30
|
+
# @return [Array(String, Array<Anthropic::Models::Beta::BetaTextBlockParam, Anthropic::Models::Beta::BetaImageBlockParam, Anthropic::Models::Beta::BetaRequestDocumentBlock, Anthropic::Models::Beta::BetaSearchResultBlockParam, Anthropic::Models::Beta::BetaThinkingBlockParam, Anthropic::Models::Beta::BetaRedactedThinkingBlockParam, Anthropic::Models::Beta::BetaToolUseBlockParam, Anthropic::Models::Beta::BetaToolResultBlockParam, Anthropic::Models::Beta::BetaServerToolUseBlockParam, Anthropic::Models::Beta::BetaWebSearchToolResultBlockParam, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaMCPToolUseBlockParam, Anthropic::Models::Beta::BetaRequestMCPToolResultBlockParam, Anthropic::Models::Beta::BetaContainerUploadBlockParam>)]
|
31
31
|
|
32
32
|
# @type [Anthropic::Internal::Type::Converter]
|
33
33
|
BetaContentBlockParamArray =
|