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
@@ -0,0 +1,110 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Anthropic
|
4
|
+
module Models
|
5
|
+
BetaTextEditorCodeExecutionToolResultError =
|
6
|
+
Beta::BetaTextEditorCodeExecutionToolResultError
|
7
|
+
|
8
|
+
module Beta
|
9
|
+
class BetaTextEditorCodeExecutionToolResultError < Anthropic::Internal::Type::BaseModel
|
10
|
+
OrHash =
|
11
|
+
T.type_alias do
|
12
|
+
T.any(
|
13
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultError,
|
14
|
+
Anthropic::Internal::AnyHash
|
15
|
+
)
|
16
|
+
end
|
17
|
+
|
18
|
+
sig do
|
19
|
+
returns(
|
20
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultError::ErrorCode::TaggedSymbol
|
21
|
+
)
|
22
|
+
end
|
23
|
+
attr_accessor :error_code
|
24
|
+
|
25
|
+
sig { returns(T.nilable(String)) }
|
26
|
+
attr_accessor :error_message
|
27
|
+
|
28
|
+
sig { returns(Symbol) }
|
29
|
+
attr_accessor :type
|
30
|
+
|
31
|
+
sig do
|
32
|
+
params(
|
33
|
+
error_code:
|
34
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultError::ErrorCode::OrSymbol,
|
35
|
+
error_message: T.nilable(String),
|
36
|
+
type: Symbol
|
37
|
+
).returns(T.attached_class)
|
38
|
+
end
|
39
|
+
def self.new(
|
40
|
+
error_code:,
|
41
|
+
error_message:,
|
42
|
+
type: :text_editor_code_execution_tool_result_error
|
43
|
+
)
|
44
|
+
end
|
45
|
+
|
46
|
+
sig do
|
47
|
+
override.returns(
|
48
|
+
{
|
49
|
+
error_code:
|
50
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultError::ErrorCode::TaggedSymbol,
|
51
|
+
error_message: T.nilable(String),
|
52
|
+
type: Symbol
|
53
|
+
}
|
54
|
+
)
|
55
|
+
end
|
56
|
+
def to_hash
|
57
|
+
end
|
58
|
+
|
59
|
+
module ErrorCode
|
60
|
+
extend Anthropic::Internal::Type::Enum
|
61
|
+
|
62
|
+
TaggedSymbol =
|
63
|
+
T.type_alias do
|
64
|
+
T.all(
|
65
|
+
Symbol,
|
66
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultError::ErrorCode
|
67
|
+
)
|
68
|
+
end
|
69
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
70
|
+
|
71
|
+
INVALID_TOOL_INPUT =
|
72
|
+
T.let(
|
73
|
+
:invalid_tool_input,
|
74
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultError::ErrorCode::TaggedSymbol
|
75
|
+
)
|
76
|
+
UNAVAILABLE =
|
77
|
+
T.let(
|
78
|
+
:unavailable,
|
79
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultError::ErrorCode::TaggedSymbol
|
80
|
+
)
|
81
|
+
TOO_MANY_REQUESTS =
|
82
|
+
T.let(
|
83
|
+
:too_many_requests,
|
84
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultError::ErrorCode::TaggedSymbol
|
85
|
+
)
|
86
|
+
EXECUTION_TIME_EXCEEDED =
|
87
|
+
T.let(
|
88
|
+
:execution_time_exceeded,
|
89
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultError::ErrorCode::TaggedSymbol
|
90
|
+
)
|
91
|
+
FILE_NOT_FOUND =
|
92
|
+
T.let(
|
93
|
+
:file_not_found,
|
94
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultError::ErrorCode::TaggedSymbol
|
95
|
+
)
|
96
|
+
|
97
|
+
sig do
|
98
|
+
override.returns(
|
99
|
+
T::Array[
|
100
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultError::ErrorCode::TaggedSymbol
|
101
|
+
]
|
102
|
+
)
|
103
|
+
end
|
104
|
+
def self.values
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
@@ -0,0 +1,110 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Anthropic
|
4
|
+
module Models
|
5
|
+
BetaTextEditorCodeExecutionToolResultErrorParam =
|
6
|
+
Beta::BetaTextEditorCodeExecutionToolResultErrorParam
|
7
|
+
|
8
|
+
module Beta
|
9
|
+
class BetaTextEditorCodeExecutionToolResultErrorParam < Anthropic::Internal::Type::BaseModel
|
10
|
+
OrHash =
|
11
|
+
T.type_alias do
|
12
|
+
T.any(
|
13
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultErrorParam,
|
14
|
+
Anthropic::Internal::AnyHash
|
15
|
+
)
|
16
|
+
end
|
17
|
+
|
18
|
+
sig do
|
19
|
+
returns(
|
20
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultErrorParam::ErrorCode::OrSymbol
|
21
|
+
)
|
22
|
+
end
|
23
|
+
attr_accessor :error_code
|
24
|
+
|
25
|
+
sig { returns(Symbol) }
|
26
|
+
attr_accessor :type
|
27
|
+
|
28
|
+
sig { returns(T.nilable(String)) }
|
29
|
+
attr_accessor :error_message
|
30
|
+
|
31
|
+
sig do
|
32
|
+
params(
|
33
|
+
error_code:
|
34
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultErrorParam::ErrorCode::OrSymbol,
|
35
|
+
error_message: T.nilable(String),
|
36
|
+
type: Symbol
|
37
|
+
).returns(T.attached_class)
|
38
|
+
end
|
39
|
+
def self.new(
|
40
|
+
error_code:,
|
41
|
+
error_message: nil,
|
42
|
+
type: :text_editor_code_execution_tool_result_error
|
43
|
+
)
|
44
|
+
end
|
45
|
+
|
46
|
+
sig do
|
47
|
+
override.returns(
|
48
|
+
{
|
49
|
+
error_code:
|
50
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultErrorParam::ErrorCode::OrSymbol,
|
51
|
+
type: Symbol,
|
52
|
+
error_message: T.nilable(String)
|
53
|
+
}
|
54
|
+
)
|
55
|
+
end
|
56
|
+
def to_hash
|
57
|
+
end
|
58
|
+
|
59
|
+
module ErrorCode
|
60
|
+
extend Anthropic::Internal::Type::Enum
|
61
|
+
|
62
|
+
TaggedSymbol =
|
63
|
+
T.type_alias do
|
64
|
+
T.all(
|
65
|
+
Symbol,
|
66
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultErrorParam::ErrorCode
|
67
|
+
)
|
68
|
+
end
|
69
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
70
|
+
|
71
|
+
INVALID_TOOL_INPUT =
|
72
|
+
T.let(
|
73
|
+
:invalid_tool_input,
|
74
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultErrorParam::ErrorCode::TaggedSymbol
|
75
|
+
)
|
76
|
+
UNAVAILABLE =
|
77
|
+
T.let(
|
78
|
+
:unavailable,
|
79
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultErrorParam::ErrorCode::TaggedSymbol
|
80
|
+
)
|
81
|
+
TOO_MANY_REQUESTS =
|
82
|
+
T.let(
|
83
|
+
:too_many_requests,
|
84
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultErrorParam::ErrorCode::TaggedSymbol
|
85
|
+
)
|
86
|
+
EXECUTION_TIME_EXCEEDED =
|
87
|
+
T.let(
|
88
|
+
:execution_time_exceeded,
|
89
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultErrorParam::ErrorCode::TaggedSymbol
|
90
|
+
)
|
91
|
+
FILE_NOT_FOUND =
|
92
|
+
T.let(
|
93
|
+
:file_not_found,
|
94
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultErrorParam::ErrorCode::TaggedSymbol
|
95
|
+
)
|
96
|
+
|
97
|
+
sig do
|
98
|
+
override.returns(
|
99
|
+
T::Array[
|
100
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultErrorParam::ErrorCode::TaggedSymbol
|
101
|
+
]
|
102
|
+
)
|
103
|
+
end
|
104
|
+
def self.values
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
@@ -0,0 +1,118 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Anthropic
|
4
|
+
module Models
|
5
|
+
BetaTextEditorCodeExecutionViewResultBlock =
|
6
|
+
Beta::BetaTextEditorCodeExecutionViewResultBlock
|
7
|
+
|
8
|
+
module Beta
|
9
|
+
class BetaTextEditorCodeExecutionViewResultBlock < Anthropic::Internal::Type::BaseModel
|
10
|
+
OrHash =
|
11
|
+
T.type_alias do
|
12
|
+
T.any(
|
13
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionViewResultBlock,
|
14
|
+
Anthropic::Internal::AnyHash
|
15
|
+
)
|
16
|
+
end
|
17
|
+
|
18
|
+
sig { returns(String) }
|
19
|
+
attr_accessor :content
|
20
|
+
|
21
|
+
sig do
|
22
|
+
returns(
|
23
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionViewResultBlock::FileType::TaggedSymbol
|
24
|
+
)
|
25
|
+
end
|
26
|
+
attr_accessor :file_type
|
27
|
+
|
28
|
+
sig { returns(T.nilable(Integer)) }
|
29
|
+
attr_accessor :num_lines
|
30
|
+
|
31
|
+
sig { returns(T.nilable(Integer)) }
|
32
|
+
attr_accessor :start_line
|
33
|
+
|
34
|
+
sig { returns(T.nilable(Integer)) }
|
35
|
+
attr_accessor :total_lines
|
36
|
+
|
37
|
+
sig { returns(Symbol) }
|
38
|
+
attr_accessor :type
|
39
|
+
|
40
|
+
sig do
|
41
|
+
params(
|
42
|
+
content: String,
|
43
|
+
file_type:
|
44
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionViewResultBlock::FileType::OrSymbol,
|
45
|
+
num_lines: T.nilable(Integer),
|
46
|
+
start_line: T.nilable(Integer),
|
47
|
+
total_lines: T.nilable(Integer),
|
48
|
+
type: Symbol
|
49
|
+
).returns(T.attached_class)
|
50
|
+
end
|
51
|
+
def self.new(
|
52
|
+
content:,
|
53
|
+
file_type:,
|
54
|
+
num_lines:,
|
55
|
+
start_line:,
|
56
|
+
total_lines:,
|
57
|
+
type: :text_editor_code_execution_view_result
|
58
|
+
)
|
59
|
+
end
|
60
|
+
|
61
|
+
sig do
|
62
|
+
override.returns(
|
63
|
+
{
|
64
|
+
content: String,
|
65
|
+
file_type:
|
66
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionViewResultBlock::FileType::TaggedSymbol,
|
67
|
+
num_lines: T.nilable(Integer),
|
68
|
+
start_line: T.nilable(Integer),
|
69
|
+
total_lines: T.nilable(Integer),
|
70
|
+
type: Symbol
|
71
|
+
}
|
72
|
+
)
|
73
|
+
end
|
74
|
+
def to_hash
|
75
|
+
end
|
76
|
+
|
77
|
+
module FileType
|
78
|
+
extend Anthropic::Internal::Type::Enum
|
79
|
+
|
80
|
+
TaggedSymbol =
|
81
|
+
T.type_alias do
|
82
|
+
T.all(
|
83
|
+
Symbol,
|
84
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionViewResultBlock::FileType
|
85
|
+
)
|
86
|
+
end
|
87
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
88
|
+
|
89
|
+
TEXT =
|
90
|
+
T.let(
|
91
|
+
:text,
|
92
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionViewResultBlock::FileType::TaggedSymbol
|
93
|
+
)
|
94
|
+
IMAGE =
|
95
|
+
T.let(
|
96
|
+
:image,
|
97
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionViewResultBlock::FileType::TaggedSymbol
|
98
|
+
)
|
99
|
+
PDF =
|
100
|
+
T.let(
|
101
|
+
:pdf,
|
102
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionViewResultBlock::FileType::TaggedSymbol
|
103
|
+
)
|
104
|
+
|
105
|
+
sig do
|
106
|
+
override.returns(
|
107
|
+
T::Array[
|
108
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionViewResultBlock::FileType::TaggedSymbol
|
109
|
+
]
|
110
|
+
)
|
111
|
+
end
|
112
|
+
def self.values
|
113
|
+
end
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|
@@ -0,0 +1,118 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Anthropic
|
4
|
+
module Models
|
5
|
+
BetaTextEditorCodeExecutionViewResultBlockParam =
|
6
|
+
Beta::BetaTextEditorCodeExecutionViewResultBlockParam
|
7
|
+
|
8
|
+
module Beta
|
9
|
+
class BetaTextEditorCodeExecutionViewResultBlockParam < Anthropic::Internal::Type::BaseModel
|
10
|
+
OrHash =
|
11
|
+
T.type_alias do
|
12
|
+
T.any(
|
13
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionViewResultBlockParam,
|
14
|
+
Anthropic::Internal::AnyHash
|
15
|
+
)
|
16
|
+
end
|
17
|
+
|
18
|
+
sig { returns(String) }
|
19
|
+
attr_accessor :content
|
20
|
+
|
21
|
+
sig do
|
22
|
+
returns(
|
23
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionViewResultBlockParam::FileType::OrSymbol
|
24
|
+
)
|
25
|
+
end
|
26
|
+
attr_accessor :file_type
|
27
|
+
|
28
|
+
sig { returns(Symbol) }
|
29
|
+
attr_accessor :type
|
30
|
+
|
31
|
+
sig { returns(T.nilable(Integer)) }
|
32
|
+
attr_accessor :num_lines
|
33
|
+
|
34
|
+
sig { returns(T.nilable(Integer)) }
|
35
|
+
attr_accessor :start_line
|
36
|
+
|
37
|
+
sig { returns(T.nilable(Integer)) }
|
38
|
+
attr_accessor :total_lines
|
39
|
+
|
40
|
+
sig do
|
41
|
+
params(
|
42
|
+
content: String,
|
43
|
+
file_type:
|
44
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionViewResultBlockParam::FileType::OrSymbol,
|
45
|
+
num_lines: T.nilable(Integer),
|
46
|
+
start_line: T.nilable(Integer),
|
47
|
+
total_lines: T.nilable(Integer),
|
48
|
+
type: Symbol
|
49
|
+
).returns(T.attached_class)
|
50
|
+
end
|
51
|
+
def self.new(
|
52
|
+
content:,
|
53
|
+
file_type:,
|
54
|
+
num_lines: nil,
|
55
|
+
start_line: nil,
|
56
|
+
total_lines: nil,
|
57
|
+
type: :text_editor_code_execution_view_result
|
58
|
+
)
|
59
|
+
end
|
60
|
+
|
61
|
+
sig do
|
62
|
+
override.returns(
|
63
|
+
{
|
64
|
+
content: String,
|
65
|
+
file_type:
|
66
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionViewResultBlockParam::FileType::OrSymbol,
|
67
|
+
type: Symbol,
|
68
|
+
num_lines: T.nilable(Integer),
|
69
|
+
start_line: T.nilable(Integer),
|
70
|
+
total_lines: T.nilable(Integer)
|
71
|
+
}
|
72
|
+
)
|
73
|
+
end
|
74
|
+
def to_hash
|
75
|
+
end
|
76
|
+
|
77
|
+
module FileType
|
78
|
+
extend Anthropic::Internal::Type::Enum
|
79
|
+
|
80
|
+
TaggedSymbol =
|
81
|
+
T.type_alias do
|
82
|
+
T.all(
|
83
|
+
Symbol,
|
84
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionViewResultBlockParam::FileType
|
85
|
+
)
|
86
|
+
end
|
87
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
88
|
+
|
89
|
+
TEXT =
|
90
|
+
T.let(
|
91
|
+
:text,
|
92
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionViewResultBlockParam::FileType::TaggedSymbol
|
93
|
+
)
|
94
|
+
IMAGE =
|
95
|
+
T.let(
|
96
|
+
:image,
|
97
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionViewResultBlockParam::FileType::TaggedSymbol
|
98
|
+
)
|
99
|
+
PDF =
|
100
|
+
T.let(
|
101
|
+
:pdf,
|
102
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionViewResultBlockParam::FileType::TaggedSymbol
|
103
|
+
)
|
104
|
+
|
105
|
+
sig do
|
106
|
+
override.returns(
|
107
|
+
T::Array[
|
108
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionViewResultBlockParam::FileType::TaggedSymbol
|
109
|
+
]
|
110
|
+
)
|
111
|
+
end
|
112
|
+
def self.values
|
113
|
+
end
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|
@@ -15,6 +15,7 @@ module Anthropic
|
|
15
15
|
Anthropic::Beta::BetaToolBash20241022,
|
16
16
|
Anthropic::Beta::BetaToolBash20250124,
|
17
17
|
Anthropic::Beta::BetaCodeExecutionTool20250522,
|
18
|
+
Anthropic::Beta::BetaCodeExecutionTool20250825,
|
18
19
|
Anthropic::Beta::BetaToolComputerUse20241022,
|
19
20
|
Anthropic::Beta::BetaToolComputerUse20250124,
|
20
21
|
Anthropic::Beta::BetaToolTextEditor20241022,
|
@@ -72,30 +72,7 @@ module Anthropic
|
|
72
72
|
# { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
|
73
73
|
# ```
|
74
74
|
#
|
75
|
-
#
|
76
|
-
#
|
77
|
-
# ```json
|
78
|
-
# {
|
79
|
-
# "role": "user",
|
80
|
-
# "content": [
|
81
|
-
# {
|
82
|
-
# "type": "image",
|
83
|
-
# "source": {
|
84
|
-
# "type": "base64",
|
85
|
-
# "media_type": "image/jpeg",
|
86
|
-
# "data": "/9j/4AAQSkZJRg..."
|
87
|
-
# }
|
88
|
-
# },
|
89
|
-
# { "type": "text", "text": "What is in this image?" }
|
90
|
-
# ]
|
91
|
-
# }
|
92
|
-
# ```
|
93
|
-
#
|
94
|
-
# We currently support the `base64` source type for images, and the `image/jpeg`,
|
95
|
-
# `image/png`, `image/gif`, and `image/webp` media types.
|
96
|
-
#
|
97
|
-
# See [examples](https://docs.anthropic.com/en/api/messages-examples#vision) for
|
98
|
-
# more input examples.
|
75
|
+
# See [input examples](https://docs.anthropic.com/en/api/messages-examples).
|
99
76
|
#
|
100
77
|
# Note that if you want to include a
|
101
78
|
# [system prompt](https://docs.anthropic.com/en/docs/system-prompts), you can use
|
@@ -298,6 +275,7 @@ module Anthropic
|
|
298
275
|
Anthropic::Beta::BetaToolBash20241022,
|
299
276
|
Anthropic::Beta::BetaToolBash20250124,
|
300
277
|
Anthropic::Beta::BetaCodeExecutionTool20250522,
|
278
|
+
Anthropic::Beta::BetaCodeExecutionTool20250825,
|
301
279
|
Anthropic::Beta::BetaToolComputerUse20241022,
|
302
280
|
Anthropic::Beta::BetaToolComputerUse20250124,
|
303
281
|
Anthropic::Beta::BetaToolTextEditor20241022,
|
@@ -321,6 +299,7 @@ module Anthropic
|
|
321
299
|
Anthropic::Beta::BetaToolBash20241022::OrHash,
|
322
300
|
Anthropic::Beta::BetaToolBash20250124::OrHash,
|
323
301
|
Anthropic::Beta::BetaCodeExecutionTool20250522::OrHash,
|
302
|
+
Anthropic::Beta::BetaCodeExecutionTool20250825::OrHash,
|
324
303
|
Anthropic::Beta::BetaToolComputerUse20241022::OrHash,
|
325
304
|
Anthropic::Beta::BetaToolComputerUse20250124::OrHash,
|
326
305
|
Anthropic::Beta::BetaToolTextEditor20241022::OrHash,
|
@@ -380,6 +359,7 @@ module Anthropic
|
|
380
359
|
Anthropic::Beta::BetaToolBash20241022::OrHash,
|
381
360
|
Anthropic::Beta::BetaToolBash20250124::OrHash,
|
382
361
|
Anthropic::Beta::BetaCodeExecutionTool20250522::OrHash,
|
362
|
+
Anthropic::Beta::BetaCodeExecutionTool20250825::OrHash,
|
383
363
|
Anthropic::Beta::BetaToolComputerUse20241022::OrHash,
|
384
364
|
Anthropic::Beta::BetaToolComputerUse20250124::OrHash,
|
385
365
|
Anthropic::Beta::BetaToolTextEditor20241022::OrHash,
|
@@ -451,30 +431,7 @@ module Anthropic
|
|
451
431
|
# { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
|
452
432
|
# ```
|
453
433
|
#
|
454
|
-
#
|
455
|
-
#
|
456
|
-
# ```json
|
457
|
-
# {
|
458
|
-
# "role": "user",
|
459
|
-
# "content": [
|
460
|
-
# {
|
461
|
-
# "type": "image",
|
462
|
-
# "source": {
|
463
|
-
# "type": "base64",
|
464
|
-
# "media_type": "image/jpeg",
|
465
|
-
# "data": "/9j/4AAQSkZJRg..."
|
466
|
-
# }
|
467
|
-
# },
|
468
|
-
# { "type": "text", "text": "What is in this image?" }
|
469
|
-
# ]
|
470
|
-
# }
|
471
|
-
# ```
|
472
|
-
#
|
473
|
-
# We currently support the `base64` source type for images, and the `image/jpeg`,
|
474
|
-
# `image/png`, `image/gif`, and `image/webp` media types.
|
475
|
-
#
|
476
|
-
# See [examples](https://docs.anthropic.com/en/api/messages-examples#vision) for
|
477
|
-
# more input examples.
|
434
|
+
# See [input examples](https://docs.anthropic.com/en/api/messages-examples).
|
478
435
|
#
|
479
436
|
# Note that if you want to include a
|
480
437
|
# [system prompt](https://docs.anthropic.com/en/docs/system-prompts), you can use
|
@@ -618,6 +575,7 @@ module Anthropic
|
|
618
575
|
Anthropic::Beta::BetaToolBash20241022,
|
619
576
|
Anthropic::Beta::BetaToolBash20250124,
|
620
577
|
Anthropic::Beta::BetaCodeExecutionTool20250522,
|
578
|
+
Anthropic::Beta::BetaCodeExecutionTool20250825,
|
621
579
|
Anthropic::Beta::BetaToolComputerUse20241022,
|
622
580
|
Anthropic::Beta::BetaToolComputerUse20250124,
|
623
581
|
Anthropic::Beta::BetaToolTextEditor20241022,
|
@@ -678,6 +636,7 @@ module Anthropic
|
|
678
636
|
Anthropic::Beta::BetaToolBash20241022,
|
679
637
|
Anthropic::Beta::BetaToolBash20250124,
|
680
638
|
Anthropic::Beta::BetaCodeExecutionTool20250522,
|
639
|
+
Anthropic::Beta::BetaCodeExecutionTool20250825,
|
681
640
|
Anthropic::Beta::BetaToolComputerUse20241022,
|
682
641
|
Anthropic::Beta::BetaToolComputerUse20250124,
|
683
642
|
Anthropic::Beta::BetaToolTextEditor20241022,
|
@@ -82,30 +82,7 @@ module Anthropic
|
|
82
82
|
# { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
|
83
83
|
# ```
|
84
84
|
#
|
85
|
-
#
|
86
|
-
#
|
87
|
-
# ```json
|
88
|
-
# {
|
89
|
-
# "role": "user",
|
90
|
-
# "content": [
|
91
|
-
# {
|
92
|
-
# "type": "image",
|
93
|
-
# "source": {
|
94
|
-
# "type": "base64",
|
95
|
-
# "media_type": "image/jpeg",
|
96
|
-
# "data": "/9j/4AAQSkZJRg..."
|
97
|
-
# }
|
98
|
-
# },
|
99
|
-
# { "type": "text", "text": "What is in this image?" }
|
100
|
-
# ]
|
101
|
-
# }
|
102
|
-
# ```
|
103
|
-
#
|
104
|
-
# We currently support the `base64` source type for images, and the `image/jpeg`,
|
105
|
-
# `image/png`, `image/gif`, and `image/webp` media types.
|
106
|
-
#
|
107
|
-
# See [examples](https://docs.anthropic.com/en/api/messages-examples#vision) for
|
108
|
-
# more input examples.
|
85
|
+
# See [input examples](https://docs.anthropic.com/en/api/messages-examples).
|
109
86
|
#
|
110
87
|
# Note that if you want to include a
|
111
88
|
# [system prompt](https://docs.anthropic.com/en/docs/system-prompts), you can use
|
@@ -368,6 +345,7 @@ module Anthropic
|
|
368
345
|
Anthropic::Beta::BetaToolBash20241022,
|
369
346
|
Anthropic::Beta::BetaToolBash20250124,
|
370
347
|
Anthropic::Beta::BetaCodeExecutionTool20250522,
|
348
|
+
Anthropic::Beta::BetaCodeExecutionTool20250825,
|
371
349
|
Anthropic::Beta::BetaToolComputerUse20241022,
|
372
350
|
Anthropic::Beta::BetaToolComputerUse20250124,
|
373
351
|
Anthropic::Beta::BetaToolTextEditor20241022,
|
@@ -391,6 +369,7 @@ module Anthropic
|
|
391
369
|
Anthropic::Beta::BetaToolBash20241022::OrHash,
|
392
370
|
Anthropic::Beta::BetaToolBash20250124::OrHash,
|
393
371
|
Anthropic::Beta::BetaCodeExecutionTool20250522::OrHash,
|
372
|
+
Anthropic::Beta::BetaCodeExecutionTool20250825::OrHash,
|
394
373
|
Anthropic::Beta::BetaToolComputerUse20241022::OrHash,
|
395
374
|
Anthropic::Beta::BetaToolComputerUse20250124::OrHash,
|
396
375
|
Anthropic::Beta::BetaToolTextEditor20241022::OrHash,
|
@@ -484,6 +463,7 @@ module Anthropic
|
|
484
463
|
Anthropic::Beta::BetaToolBash20241022::OrHash,
|
485
464
|
Anthropic::Beta::BetaToolBash20250124::OrHash,
|
486
465
|
Anthropic::Beta::BetaCodeExecutionTool20250522::OrHash,
|
466
|
+
Anthropic::Beta::BetaCodeExecutionTool20250825::OrHash,
|
487
467
|
Anthropic::Beta::BetaToolComputerUse20241022::OrHash,
|
488
468
|
Anthropic::Beta::BetaToolComputerUse20250124::OrHash,
|
489
469
|
Anthropic::Beta::BetaToolTextEditor20241022::OrHash,
|
@@ -565,30 +545,7 @@ module Anthropic
|
|
565
545
|
# { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
|
566
546
|
# ```
|
567
547
|
#
|
568
|
-
#
|
569
|
-
#
|
570
|
-
# ```json
|
571
|
-
# {
|
572
|
-
# "role": "user",
|
573
|
-
# "content": [
|
574
|
-
# {
|
575
|
-
# "type": "image",
|
576
|
-
# "source": {
|
577
|
-
# "type": "base64",
|
578
|
-
# "media_type": "image/jpeg",
|
579
|
-
# "data": "/9j/4AAQSkZJRg..."
|
580
|
-
# }
|
581
|
-
# },
|
582
|
-
# { "type": "text", "text": "What is in this image?" }
|
583
|
-
# ]
|
584
|
-
# }
|
585
|
-
# ```
|
586
|
-
#
|
587
|
-
# We currently support the `base64` source type for images, and the `image/jpeg`,
|
588
|
-
# `image/png`, `image/gif`, and `image/webp` media types.
|
589
|
-
#
|
590
|
-
# See [examples](https://docs.anthropic.com/en/api/messages-examples#vision) for
|
591
|
-
# more input examples.
|
548
|
+
# See [input examples](https://docs.anthropic.com/en/api/messages-examples).
|
592
549
|
#
|
593
550
|
# Note that if you want to include a
|
594
551
|
# [system prompt](https://docs.anthropic.com/en/docs/system-prompts), you can use
|
@@ -785,6 +742,7 @@ module Anthropic
|
|
785
742
|
Anthropic::Beta::BetaToolBash20241022,
|
786
743
|
Anthropic::Beta::BetaToolBash20250124,
|
787
744
|
Anthropic::Beta::BetaCodeExecutionTool20250522,
|
745
|
+
Anthropic::Beta::BetaCodeExecutionTool20250825,
|
788
746
|
Anthropic::Beta::BetaToolComputerUse20241022,
|
789
747
|
Anthropic::Beta::BetaToolComputerUse20250124,
|
790
748
|
Anthropic::Beta::BetaToolTextEditor20241022,
|