anthropic 1.2.0 → 1.4.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 +41 -0
- data/README.md +1 -1
- data/lib/anthropic/client.rb +5 -2
- data/lib/anthropic/internal/transport/base_client.rb +1 -1
- data/lib/anthropic/models/beta/beta_citation_char_location.rb +7 -1
- data/lib/anthropic/models/beta/beta_citation_content_block_location.rb +7 -1
- data/lib/anthropic/models/beta/beta_citation_page_location.rb +7 -1
- data/lib/anthropic/models/beta/beta_tool_text_editor_20250728.rb +49 -0
- data/lib/anthropic/models/beta/beta_tool_union.rb +3 -1
- data/lib/anthropic/models/beta/message_count_tokens_params.rb +5 -3
- data/lib/anthropic/models/beta/message_create_params.rb +2 -2
- data/lib/anthropic/models/beta/messages/batch_create_params.rb +2 -2
- data/lib/anthropic/models/citation_char_location.rb +7 -1
- data/lib/anthropic/models/citation_content_block_location.rb +7 -1
- data/lib/anthropic/models/citation_page_location.rb +7 -1
- data/lib/anthropic/models/message_count_tokens_params.rb +2 -2
- data/lib/anthropic/models/message_count_tokens_tool.rb +4 -34
- data/lib/anthropic/models/message_create_params.rb +2 -2
- data/lib/anthropic/models/messages/batch_create_params.rb +2 -2
- data/lib/anthropic/models/model.rb +5 -22
- data/lib/anthropic/models/tool_text_editor_20250429.rb +36 -0
- data/lib/anthropic/models/tool_text_editor_20250728.rb +45 -0
- data/lib/anthropic/models/tool_union.rb +4 -33
- data/lib/anthropic/models.rb +4 -0
- data/lib/anthropic/resources/beta/messages.rb +70 -3
- data/lib/anthropic/resources/messages.rb +3 -3
- data/lib/anthropic/version.rb +1 -1
- data/lib/anthropic.rb +3 -0
- data/rbi/anthropic/helpers/bedrock/client.rbi +17 -6
- data/rbi/anthropic/helpers/streaming/events.rbi +12 -2
- data/rbi/anthropic/helpers/streaming/message_stream.rbi +48 -34
- data/rbi/anthropic/helpers/vertex/client.rbi +17 -6
- data/rbi/anthropic/internal/transport/base_client.rbi +1 -1
- data/rbi/anthropic/models/beta/beta_citation_char_location.rbi +6 -0
- data/rbi/anthropic/models/beta/beta_citation_content_block_location.rbi +6 -0
- data/rbi/anthropic/models/beta/beta_citation_page_location.rbi +6 -0
- data/rbi/anthropic/models/beta/beta_tool_text_editor_20250728.rbi +82 -0
- data/rbi/anthropic/models/beta/beta_tool_union.rbi +1 -0
- data/rbi/anthropic/models/beta/message_count_tokens_params.rbi +5 -0
- data/rbi/anthropic/models/beta/message_create_params.rbi +4 -0
- data/rbi/anthropic/models/beta/messages/batch_create_params.rbi +4 -0
- data/rbi/anthropic/models/citation_char_location.rbi +6 -0
- data/rbi/anthropic/models/citation_content_block_location.rbi +6 -0
- data/rbi/anthropic/models/citation_page_location.rbi +6 -0
- data/rbi/anthropic/models/message_count_tokens_params.rbi +8 -4
- data/rbi/anthropic/models/message_count_tokens_tool.rbi +2 -61
- data/rbi/anthropic/models/message_create_params.rbi +8 -4
- data/rbi/anthropic/models/messages/batch_create_params.rbi +8 -4
- data/rbi/anthropic/models/model.rbi +4 -8
- data/rbi/anthropic/models/tool_text_editor_20250429.rbi +62 -0
- data/rbi/anthropic/models/tool_text_editor_20250728.rbi +72 -0
- data/rbi/anthropic/models/tool_union.rbi +2 -61
- data/rbi/anthropic/models.rbi +4 -0
- data/rbi/anthropic/resources/beta/messages.rbi +3 -0
- data/rbi/anthropic/resources/messages.rbi +53 -28
- data/sig/anthropic/helpers/streaming/events.rbs +30 -32
- data/sig/anthropic/helpers/streaming/message_stream.rbs +4 -2
- data/sig/anthropic/internal/transport/base_client.rbs +1 -1
- data/sig/anthropic/models/beta/beta_citation_char_location.rbs +5 -0
- data/sig/anthropic/models/beta/beta_citation_content_block_location.rbs +5 -0
- data/sig/anthropic/models/beta/beta_citation_page_location.rbs +5 -0
- data/sig/anthropic/models/beta/beta_tool_text_editor_20250728.rbs +39 -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/citation_char_location.rbs +5 -0
- data/sig/anthropic/models/citation_content_block_location.rbs +5 -0
- data/sig/anthropic/models/citation_page_location.rbs +5 -0
- data/sig/anthropic/models/message_count_tokens_tool.rbs +2 -28
- data/sig/anthropic/models/model.rbs +4 -10
- data/sig/anthropic/models/tool_text_editor_20250429.rbs +30 -0
- data/sig/anthropic/models/tool_text_editor_20250728.rbs +35 -0
- data/sig/anthropic/models/tool_union.rbs +2 -28
- data/sig/anthropic/models.rbs +4 -0
- metadata +11 -2
@@ -11,71 +11,12 @@ module Anthropic
|
|
11
11
|
Anthropic::Tool,
|
12
12
|
Anthropic::ToolBash20250124,
|
13
13
|
Anthropic::ToolTextEditor20250124,
|
14
|
-
Anthropic::
|
14
|
+
Anthropic::ToolTextEditor20250429,
|
15
|
+
Anthropic::ToolTextEditor20250728,
|
15
16
|
Anthropic::WebSearchTool20250305
|
16
17
|
)
|
17
18
|
end
|
18
19
|
|
19
|
-
class TextEditor20250429 < Anthropic::Internal::Type::BaseModel
|
20
|
-
OrHash =
|
21
|
-
T.type_alias do
|
22
|
-
T.any(
|
23
|
-
Anthropic::ToolUnion::TextEditor20250429,
|
24
|
-
Anthropic::Internal::AnyHash
|
25
|
-
)
|
26
|
-
end
|
27
|
-
|
28
|
-
# Name of the tool.
|
29
|
-
#
|
30
|
-
# This is how the tool will be called by the model and in `tool_use` blocks.
|
31
|
-
sig { returns(Symbol) }
|
32
|
-
attr_accessor :name
|
33
|
-
|
34
|
-
sig { returns(Symbol) }
|
35
|
-
attr_accessor :type
|
36
|
-
|
37
|
-
# Create a cache control breakpoint at this content block.
|
38
|
-
sig { returns(T.nilable(Anthropic::CacheControlEphemeral)) }
|
39
|
-
attr_reader :cache_control
|
40
|
-
|
41
|
-
sig do
|
42
|
-
params(
|
43
|
-
cache_control: T.nilable(Anthropic::CacheControlEphemeral::OrHash)
|
44
|
-
).void
|
45
|
-
end
|
46
|
-
attr_writer :cache_control
|
47
|
-
|
48
|
-
sig do
|
49
|
-
params(
|
50
|
-
cache_control: T.nilable(Anthropic::CacheControlEphemeral::OrHash),
|
51
|
-
name: Symbol,
|
52
|
-
type: Symbol
|
53
|
-
).returns(T.attached_class)
|
54
|
-
end
|
55
|
-
def self.new(
|
56
|
-
# Create a cache control breakpoint at this content block.
|
57
|
-
cache_control: nil,
|
58
|
-
# Name of the tool.
|
59
|
-
#
|
60
|
-
# This is how the tool will be called by the model and in `tool_use` blocks.
|
61
|
-
name: :str_replace_based_edit_tool,
|
62
|
-
type: :text_editor_20250429
|
63
|
-
)
|
64
|
-
end
|
65
|
-
|
66
|
-
sig do
|
67
|
-
override.returns(
|
68
|
-
{
|
69
|
-
name: Symbol,
|
70
|
-
type: Symbol,
|
71
|
-
cache_control: T.nilable(Anthropic::CacheControlEphemeral)
|
72
|
-
}
|
73
|
-
)
|
74
|
-
end
|
75
|
-
def to_hash
|
76
|
-
end
|
77
|
-
end
|
78
|
-
|
79
20
|
sig { override.returns(T::Array[Anthropic::ToolUnion::Variants]) }
|
80
21
|
def self.variants
|
81
22
|
end
|
data/rbi/anthropic/models.rbi
CHANGED
@@ -194,6 +194,10 @@ module Anthropic
|
|
194
194
|
|
195
195
|
ToolTextEditor20250124 = Anthropic::Models::ToolTextEditor20250124
|
196
196
|
|
197
|
+
ToolTextEditor20250429 = Anthropic::Models::ToolTextEditor20250429
|
198
|
+
|
199
|
+
ToolTextEditor20250728 = Anthropic::Models::ToolTextEditor20250728
|
200
|
+
|
197
201
|
ToolUnion = Anthropic::Models::ToolUnion
|
198
202
|
|
199
203
|
ToolUseBlock = Anthropic::Models::ToolUseBlock
|
@@ -56,6 +56,7 @@ module Anthropic
|
|
56
56
|
Anthropic::Beta::BetaToolTextEditor20241022::OrHash,
|
57
57
|
Anthropic::Beta::BetaToolTextEditor20250124::OrHash,
|
58
58
|
Anthropic::Beta::BetaToolTextEditor20250429::OrHash,
|
59
|
+
Anthropic::Beta::BetaToolTextEditor20250728::OrHash,
|
59
60
|
Anthropic::Beta::BetaWebSearchTool20250305::OrHash
|
60
61
|
)
|
61
62
|
],
|
@@ -370,6 +371,7 @@ module Anthropic
|
|
370
371
|
Anthropic::Beta::BetaToolTextEditor20241022::OrHash,
|
371
372
|
Anthropic::Beta::BetaToolTextEditor20250124::OrHash,
|
372
373
|
Anthropic::Beta::BetaToolTextEditor20250429::OrHash,
|
374
|
+
Anthropic::Beta::BetaToolTextEditor20250728::OrHash,
|
373
375
|
Anthropic::Beta::BetaWebSearchTool20250305::OrHash
|
374
376
|
)
|
375
377
|
],
|
@@ -680,6 +682,7 @@ module Anthropic
|
|
680
682
|
Anthropic::Beta::BetaToolTextEditor20241022::OrHash,
|
681
683
|
Anthropic::Beta::BetaToolTextEditor20250124::OrHash,
|
682
684
|
Anthropic::Beta::BetaToolTextEditor20250429::OrHash,
|
685
|
+
Anthropic::Beta::BetaToolTextEditor20250728::OrHash,
|
683
686
|
Anthropic::Beta::BetaWebSearchTool20250305::OrHash
|
684
687
|
)
|
685
688
|
],
|
@@ -43,7 +43,8 @@ module Anthropic
|
|
43
43
|
Anthropic::Tool::OrHash,
|
44
44
|
Anthropic::ToolBash20250124::OrHash,
|
45
45
|
Anthropic::ToolTextEditor20250124::OrHash,
|
46
|
-
Anthropic::
|
46
|
+
Anthropic::ToolTextEditor20250429::OrHash,
|
47
|
+
Anthropic::ToolTextEditor20250728::OrHash,
|
47
48
|
Anthropic::WebSearchTool20250305::OrHash
|
48
49
|
)
|
49
50
|
],
|
@@ -314,38 +315,59 @@ module Anthropic
|
|
314
315
|
sig do
|
315
316
|
params(
|
316
317
|
max_tokens: Integer,
|
317
|
-
messages:
|
318
|
+
messages:
|
319
|
+
T::Array[
|
320
|
+
T.any(
|
321
|
+
Anthropic::Models::MessageParam,
|
322
|
+
Anthropic::Internal::AnyHash
|
323
|
+
)
|
324
|
+
],
|
318
325
|
model: T.any(Anthropic::Models::Model::OrSymbol, String),
|
319
|
-
metadata:
|
326
|
+
metadata:
|
327
|
+
T.any(Anthropic::Models::Metadata, Anthropic::Internal::AnyHash),
|
320
328
|
stop_sequences: T::Array[String],
|
321
|
-
system_:
|
329
|
+
system_:
|
330
|
+
T.any(
|
331
|
+
String,
|
332
|
+
T::Array[
|
333
|
+
T.any(
|
334
|
+
Anthropic::Models::TextBlockParam,
|
335
|
+
Anthropic::Internal::AnyHash
|
336
|
+
)
|
337
|
+
]
|
338
|
+
),
|
322
339
|
temperature: Float,
|
323
|
-
thinking:
|
324
|
-
Anthropic::Models::ThinkingConfigEnabled,
|
325
|
-
Anthropic::Internal::AnyHash,
|
326
|
-
Anthropic::Models::ThinkingConfigDisabled
|
327
|
-
),
|
328
|
-
tool_choice: T.any(
|
329
|
-
Anthropic::Models::ToolChoiceAuto,
|
330
|
-
Anthropic::Internal::AnyHash,
|
331
|
-
Anthropic::Models::ToolChoiceAny,
|
332
|
-
Anthropic::Models::ToolChoiceTool,
|
333
|
-
Anthropic::Models::ToolChoiceNone
|
334
|
-
),
|
335
|
-
tools: T::Array[
|
340
|
+
thinking:
|
336
341
|
T.any(
|
337
|
-
Anthropic::Models::
|
342
|
+
Anthropic::Models::ThinkingConfigEnabled,
|
338
343
|
Anthropic::Internal::AnyHash,
|
339
|
-
Anthropic::Models::
|
340
|
-
|
341
|
-
|
342
|
-
|
344
|
+
Anthropic::Models::ThinkingConfigDisabled
|
345
|
+
),
|
346
|
+
tool_choice:
|
347
|
+
T.any(
|
348
|
+
Anthropic::Models::ToolChoiceAuto,
|
349
|
+
Anthropic::Internal::AnyHash,
|
350
|
+
Anthropic::Models::ToolChoiceAny,
|
351
|
+
Anthropic::Models::ToolChoiceTool,
|
352
|
+
Anthropic::Models::ToolChoiceNone
|
353
|
+
),
|
354
|
+
tools:
|
355
|
+
T::Array[
|
356
|
+
T.any(
|
357
|
+
Anthropic::Models::Tool,
|
358
|
+
Anthropic::Internal::AnyHash,
|
359
|
+
Anthropic::Models::ToolBash20250124,
|
360
|
+
Anthropic::Models::ToolTextEditor20250124
|
361
|
+
)
|
362
|
+
],
|
343
363
|
top_k: Integer,
|
344
364
|
top_p: Float,
|
345
365
|
stream: T.noreturn,
|
346
|
-
request_options:
|
347
|
-
|
348
|
-
|
366
|
+
request_options:
|
367
|
+
T.nilable(
|
368
|
+
T.any(Anthropic::RequestOptions, Anthropic::Internal::AnyHash)
|
369
|
+
)
|
370
|
+
).returns(Anthropic::Helpers::Streaming::MessageStream)
|
349
371
|
end
|
350
372
|
def stream(
|
351
373
|
# The maximum number of tokens to generate before stopping.
|
@@ -579,7 +601,8 @@ module Anthropic
|
|
579
601
|
# for streaming and non-streaming use cases, respectively.
|
580
602
|
stream: true,
|
581
603
|
request_options: {}
|
582
|
-
)
|
604
|
+
)
|
605
|
+
end
|
583
606
|
sig do
|
584
607
|
params(
|
585
608
|
max_tokens: Integer,
|
@@ -608,7 +631,8 @@ module Anthropic
|
|
608
631
|
Anthropic::Tool::OrHash,
|
609
632
|
Anthropic::ToolBash20250124::OrHash,
|
610
633
|
Anthropic::ToolTextEditor20250124::OrHash,
|
611
|
-
Anthropic::
|
634
|
+
Anthropic::ToolTextEditor20250429::OrHash,
|
635
|
+
Anthropic::ToolTextEditor20250728::OrHash,
|
612
636
|
Anthropic::WebSearchTool20250305::OrHash
|
613
637
|
)
|
614
638
|
],
|
@@ -901,7 +925,8 @@ module Anthropic
|
|
901
925
|
Anthropic::Tool::OrHash,
|
902
926
|
Anthropic::ToolBash20250124::OrHash,
|
903
927
|
Anthropic::ToolTextEditor20250124::OrHash,
|
904
|
-
Anthropic::
|
928
|
+
Anthropic::ToolTextEditor20250429::OrHash,
|
929
|
+
Anthropic::ToolTextEditor20250728::OrHash,
|
905
930
|
Anthropic::WebSearchTool20250305::OrHash
|
906
931
|
)
|
907
932
|
],
|
@@ -10,18 +10,15 @@ module Anthropic
|
|
10
10
|
|
11
11
|
attr_accessor snapshot: String
|
12
12
|
|
13
|
-
def initialize: (
|
14
|
-
?type: :text,
|
15
|
-
text: String,
|
16
|
-
snapshot: String
|
17
|
-
) -> void
|
13
|
+
def initialize: (text: String, snapshot: String, ?type: :text) -> void
|
18
14
|
end
|
19
15
|
|
20
|
-
type citation_event =
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
16
|
+
type citation_event =
|
17
|
+
{
|
18
|
+
type: :citation,
|
19
|
+
citation: Anthropic::Models::CitationsDelta::citation,
|
20
|
+
snapshot: ::Array[Anthropic::Models::CitationsDelta::citation]
|
21
|
+
}
|
25
22
|
|
26
23
|
class CitationEvent < Anthropic::Internal::Type::BaseModel
|
27
24
|
attr_accessor type: :citation
|
@@ -31,13 +28,14 @@ module Anthropic
|
|
31
28
|
attr_accessor snapshot: ::Array[Anthropic::Models::CitationsDelta::citation]
|
32
29
|
|
33
30
|
def initialize: (
|
34
|
-
?type: :citation,
|
35
31
|
citation: Anthropic::Models::CitationsDelta::citation,
|
36
|
-
snapshot: ::Array[Anthropic::Models::CitationsDelta::citation]
|
32
|
+
snapshot: ::Array[Anthropic::Models::CitationsDelta::citation],
|
33
|
+
?type: :citation
|
37
34
|
) -> void
|
38
35
|
end
|
39
36
|
|
40
|
-
type thinking_event =
|
37
|
+
type thinking_event =
|
38
|
+
{ type: :thinking, thinking: String, snapshot: String }
|
41
39
|
|
42
40
|
class ThinkingEvent < Anthropic::Internal::Type::BaseModel
|
43
41
|
attr_accessor type: :thinking
|
@@ -47,9 +45,9 @@ module Anthropic
|
|
47
45
|
attr_accessor snapshot: String
|
48
46
|
|
49
47
|
def initialize: (
|
50
|
-
?type: :thinking,
|
51
48
|
thinking: String,
|
52
|
-
snapshot: String
|
49
|
+
snapshot: String,
|
50
|
+
?type: :thinking
|
53
51
|
) -> void
|
54
52
|
end
|
55
53
|
|
@@ -60,13 +58,11 @@ module Anthropic
|
|
60
58
|
|
61
59
|
attr_accessor signature: String
|
62
60
|
|
63
|
-
def initialize: (
|
64
|
-
?type: :signature,
|
65
|
-
signature: String
|
66
|
-
) -> void
|
61
|
+
def initialize: (signature: String, ?type: :signature) -> void
|
67
62
|
end
|
68
63
|
|
69
|
-
type input_json_event =
|
64
|
+
type input_json_event =
|
65
|
+
{ type: :input_json, partial_json: String, snapshot: untyped }
|
70
66
|
|
71
67
|
class InputJsonEvent < Anthropic::Internal::Type::BaseModel
|
72
68
|
attr_accessor type: :input_json
|
@@ -76,13 +72,14 @@ module Anthropic
|
|
76
72
|
attr_accessor snapshot: untyped
|
77
73
|
|
78
74
|
def initialize: (
|
79
|
-
?type: :input_json,
|
80
75
|
partial_json: String,
|
81
|
-
snapshot: untyped
|
76
|
+
snapshot: untyped,
|
77
|
+
?type: :input_json
|
82
78
|
) -> void
|
83
79
|
end
|
84
80
|
|
85
|
-
type message_stop_event =
|
81
|
+
type message_stop_event =
|
82
|
+
{ type: :message_stop, message: Anthropic::Models::message }
|
86
83
|
|
87
84
|
class MessageStopEvent < Anthropic::Models::RawMessageStopEvent
|
88
85
|
attr_accessor type: :message_stop
|
@@ -90,16 +87,17 @@ module Anthropic
|
|
90
87
|
attr_accessor message: Anthropic::Models::message
|
91
88
|
|
92
89
|
def initialize: (
|
93
|
-
|
94
|
-
|
90
|
+
message: Anthropic::Models::message,
|
91
|
+
?type: :message_stop
|
95
92
|
) -> void
|
96
93
|
end
|
97
94
|
|
98
|
-
type content_block_stop_event =
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
95
|
+
type content_block_stop_event =
|
96
|
+
{
|
97
|
+
type: :content_block_stop,
|
98
|
+
index: Integer,
|
99
|
+
content_block: Anthropic::Models::content_block
|
100
|
+
}
|
103
101
|
|
104
102
|
class ContentBlockStopEvent < Anthropic::Models::RawContentBlockStopEvent
|
105
103
|
attr_accessor type: :content_block_stop
|
@@ -109,9 +107,9 @@ module Anthropic
|
|
109
107
|
attr_accessor content_block: Anthropic::Models::content_block
|
110
108
|
|
111
109
|
def initialize: (
|
112
|
-
?type: :content_block_stop,
|
113
110
|
index: Integer,
|
114
|
-
content_block: Anthropic::Models::content_block
|
111
|
+
content_block: Anthropic::Models::content_block,
|
112
|
+
?type: :content_block_stop
|
115
113
|
) -> void
|
116
114
|
end
|
117
115
|
end
|
@@ -26,7 +26,9 @@ module Anthropic
|
|
26
26
|
@accumated_message_snapshot: Anthropic::Models::message?
|
27
27
|
@iterator: Enumerable[stream_event]?
|
28
28
|
|
29
|
-
def initialize: (
|
29
|
+
def initialize: (
|
30
|
+
raw_stream: Anthropic::Internal::Stream[raw_message_event]
|
31
|
+
) -> void
|
30
32
|
|
31
33
|
def until_done: -> void
|
32
34
|
|
@@ -52,4 +54,4 @@ module Anthropic
|
|
52
54
|
end
|
53
55
|
end
|
54
56
|
end
|
55
|
-
end
|
57
|
+
end
|
@@ -9,6 +9,7 @@ module Anthropic
|
|
9
9
|
document_index: Integer,
|
10
10
|
document_title: String?,
|
11
11
|
end_char_index: Integer,
|
12
|
+
file_id: String?,
|
12
13
|
start_char_index: Integer,
|
13
14
|
type: :char_location
|
14
15
|
}
|
@@ -22,6 +23,8 @@ module Anthropic
|
|
22
23
|
|
23
24
|
attr_accessor end_char_index: Integer
|
24
25
|
|
26
|
+
attr_accessor file_id: String?
|
27
|
+
|
25
28
|
attr_accessor start_char_index: Integer
|
26
29
|
|
27
30
|
attr_accessor type: :char_location
|
@@ -31,6 +34,7 @@ module Anthropic
|
|
31
34
|
document_index: Integer,
|
32
35
|
document_title: String?,
|
33
36
|
end_char_index: Integer,
|
37
|
+
file_id: String?,
|
34
38
|
start_char_index: Integer,
|
35
39
|
?type: :char_location
|
36
40
|
) -> void
|
@@ -40,6 +44,7 @@ module Anthropic
|
|
40
44
|
document_index: Integer,
|
41
45
|
document_title: String?,
|
42
46
|
end_char_index: Integer,
|
47
|
+
file_id: String?,
|
43
48
|
start_char_index: Integer,
|
44
49
|
type: :char_location
|
45
50
|
}
|
@@ -9,6 +9,7 @@ module Anthropic
|
|
9
9
|
document_index: Integer,
|
10
10
|
document_title: String?,
|
11
11
|
end_block_index: Integer,
|
12
|
+
file_id: String?,
|
12
13
|
start_block_index: Integer,
|
13
14
|
type: :content_block_location
|
14
15
|
}
|
@@ -22,6 +23,8 @@ module Anthropic
|
|
22
23
|
|
23
24
|
attr_accessor end_block_index: Integer
|
24
25
|
|
26
|
+
attr_accessor file_id: String?
|
27
|
+
|
25
28
|
attr_accessor start_block_index: Integer
|
26
29
|
|
27
30
|
attr_accessor type: :content_block_location
|
@@ -31,6 +34,7 @@ module Anthropic
|
|
31
34
|
document_index: Integer,
|
32
35
|
document_title: String?,
|
33
36
|
end_block_index: Integer,
|
37
|
+
file_id: String?,
|
34
38
|
start_block_index: Integer,
|
35
39
|
?type: :content_block_location
|
36
40
|
) -> void
|
@@ -40,6 +44,7 @@ module Anthropic
|
|
40
44
|
document_index: Integer,
|
41
45
|
document_title: String?,
|
42
46
|
end_block_index: Integer,
|
47
|
+
file_id: String?,
|
43
48
|
start_block_index: Integer,
|
44
49
|
type: :content_block_location
|
45
50
|
}
|
@@ -9,6 +9,7 @@ module Anthropic
|
|
9
9
|
document_index: Integer,
|
10
10
|
document_title: String?,
|
11
11
|
end_page_number: Integer,
|
12
|
+
file_id: String?,
|
12
13
|
start_page_number: Integer,
|
13
14
|
type: :page_location
|
14
15
|
}
|
@@ -22,6 +23,8 @@ module Anthropic
|
|
22
23
|
|
23
24
|
attr_accessor end_page_number: Integer
|
24
25
|
|
26
|
+
attr_accessor file_id: String?
|
27
|
+
|
25
28
|
attr_accessor start_page_number: Integer
|
26
29
|
|
27
30
|
attr_accessor type: :page_location
|
@@ -31,6 +34,7 @@ module Anthropic
|
|
31
34
|
document_index: Integer,
|
32
35
|
document_title: String?,
|
33
36
|
end_page_number: Integer,
|
37
|
+
file_id: String?,
|
34
38
|
start_page_number: Integer,
|
35
39
|
?type: :page_location
|
36
40
|
) -> void
|
@@ -40,6 +44,7 @@ module Anthropic
|
|
40
44
|
document_index: Integer,
|
41
45
|
document_title: String?,
|
42
46
|
end_page_number: Integer,
|
47
|
+
file_id: String?,
|
43
48
|
start_page_number: Integer,
|
44
49
|
type: :page_location
|
45
50
|
}
|
@@ -0,0 +1,39 @@
|
|
1
|
+
module Anthropic
|
2
|
+
module Models
|
3
|
+
class BetaToolTextEditor20250728 = Beta::BetaToolTextEditor20250728
|
4
|
+
|
5
|
+
module Beta
|
6
|
+
type beta_tool_text_editor20250728 =
|
7
|
+
{
|
8
|
+
name: :str_replace_based_edit_tool,
|
9
|
+
type: :text_editor_20250728,
|
10
|
+
cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
|
11
|
+
max_characters: Integer?
|
12
|
+
}
|
13
|
+
|
14
|
+
class BetaToolTextEditor20250728 < Anthropic::Internal::Type::BaseModel
|
15
|
+
attr_accessor name: :str_replace_based_edit_tool
|
16
|
+
|
17
|
+
attr_accessor type: :text_editor_20250728
|
18
|
+
|
19
|
+
attr_accessor cache_control: Anthropic::Beta::BetaCacheControlEphemeral?
|
20
|
+
|
21
|
+
attr_accessor max_characters: Integer?
|
22
|
+
|
23
|
+
def initialize: (
|
24
|
+
?cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
|
25
|
+
?max_characters: Integer?,
|
26
|
+
?name: :str_replace_based_edit_tool,
|
27
|
+
?type: :text_editor_20250728
|
28
|
+
) -> void
|
29
|
+
|
30
|
+
def to_hash: -> {
|
31
|
+
name: :str_replace_based_edit_tool,
|
32
|
+
type: :text_editor_20250728,
|
33
|
+
cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
|
34
|
+
max_characters: Integer?
|
35
|
+
}
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -13,6 +13,7 @@ module Anthropic
|
|
13
13
|
| Anthropic::Beta::BetaToolTextEditor20241022
|
14
14
|
| Anthropic::Beta::BetaToolTextEditor20250124
|
15
15
|
| Anthropic::Beta::BetaToolTextEditor20250429
|
16
|
+
| Anthropic::Beta::BetaToolTextEditor20250728
|
16
17
|
| Anthropic::Beta::BetaWebSearchTool20250305
|
17
18
|
|
18
19
|
module BetaToolUnion
|
@@ -102,6 +102,7 @@ module Anthropic
|
|
102
102
|
| Anthropic::Beta::BetaToolTextEditor20241022
|
103
103
|
| Anthropic::Beta::BetaToolTextEditor20250124
|
104
104
|
| Anthropic::Beta::BetaToolTextEditor20250429
|
105
|
+
| Anthropic::Beta::BetaToolTextEditor20250728
|
105
106
|
| Anthropic::Beta::BetaWebSearchTool20250305
|
106
107
|
|
107
108
|
module Tool
|
@@ -6,6 +6,7 @@ module Anthropic
|
|
6
6
|
document_index: Integer,
|
7
7
|
document_title: String?,
|
8
8
|
end_char_index: Integer,
|
9
|
+
file_id: String?,
|
9
10
|
start_char_index: Integer,
|
10
11
|
type: :char_location
|
11
12
|
}
|
@@ -19,6 +20,8 @@ module Anthropic
|
|
19
20
|
|
20
21
|
attr_accessor end_char_index: Integer
|
21
22
|
|
23
|
+
attr_accessor file_id: String?
|
24
|
+
|
22
25
|
attr_accessor start_char_index: Integer
|
23
26
|
|
24
27
|
attr_accessor type: :char_location
|
@@ -28,6 +31,7 @@ module Anthropic
|
|
28
31
|
document_index: Integer,
|
29
32
|
document_title: String?,
|
30
33
|
end_char_index: Integer,
|
34
|
+
file_id: String?,
|
31
35
|
start_char_index: Integer,
|
32
36
|
?type: :char_location
|
33
37
|
) -> void
|
@@ -37,6 +41,7 @@ module Anthropic
|
|
37
41
|
document_index: Integer,
|
38
42
|
document_title: String?,
|
39
43
|
end_char_index: Integer,
|
44
|
+
file_id: String?,
|
40
45
|
start_char_index: Integer,
|
41
46
|
type: :char_location
|
42
47
|
}
|
@@ -6,6 +6,7 @@ module Anthropic
|
|
6
6
|
document_index: Integer,
|
7
7
|
document_title: String?,
|
8
8
|
end_block_index: Integer,
|
9
|
+
file_id: String?,
|
9
10
|
start_block_index: Integer,
|
10
11
|
type: :content_block_location
|
11
12
|
}
|
@@ -19,6 +20,8 @@ module Anthropic
|
|
19
20
|
|
20
21
|
attr_accessor end_block_index: Integer
|
21
22
|
|
23
|
+
attr_accessor file_id: String?
|
24
|
+
|
22
25
|
attr_accessor start_block_index: Integer
|
23
26
|
|
24
27
|
attr_accessor type: :content_block_location
|
@@ -28,6 +31,7 @@ module Anthropic
|
|
28
31
|
document_index: Integer,
|
29
32
|
document_title: String?,
|
30
33
|
end_block_index: Integer,
|
34
|
+
file_id: String?,
|
31
35
|
start_block_index: Integer,
|
32
36
|
?type: :content_block_location
|
33
37
|
) -> void
|
@@ -37,6 +41,7 @@ module Anthropic
|
|
37
41
|
document_index: Integer,
|
38
42
|
document_title: String?,
|
39
43
|
end_block_index: Integer,
|
44
|
+
file_id: String?,
|
40
45
|
start_block_index: Integer,
|
41
46
|
type: :content_block_location
|
42
47
|
}
|
@@ -6,6 +6,7 @@ module Anthropic
|
|
6
6
|
document_index: Integer,
|
7
7
|
document_title: String?,
|
8
8
|
end_page_number: Integer,
|
9
|
+
file_id: String?,
|
9
10
|
start_page_number: Integer,
|
10
11
|
type: :page_location
|
11
12
|
}
|
@@ -19,6 +20,8 @@ module Anthropic
|
|
19
20
|
|
20
21
|
attr_accessor end_page_number: Integer
|
21
22
|
|
23
|
+
attr_accessor file_id: String?
|
24
|
+
|
22
25
|
attr_accessor start_page_number: Integer
|
23
26
|
|
24
27
|
attr_accessor type: :page_location
|
@@ -28,6 +31,7 @@ module Anthropic
|
|
28
31
|
document_index: Integer,
|
29
32
|
document_title: String?,
|
30
33
|
end_page_number: Integer,
|
34
|
+
file_id: String?,
|
31
35
|
start_page_number: Integer,
|
32
36
|
?type: :page_location
|
33
37
|
) -> void
|
@@ -37,6 +41,7 @@ module Anthropic
|
|
37
41
|
document_index: Integer,
|
38
42
|
document_title: String?,
|
39
43
|
end_page_number: Integer,
|
44
|
+
file_id: String?,
|
40
45
|
start_page_number: Integer,
|
41
46
|
type: :page_location
|
42
47
|
}
|
@@ -4,39 +4,13 @@ module Anthropic
|
|
4
4
|
Anthropic::Tool
|
5
5
|
| Anthropic::ToolBash20250124
|
6
6
|
| Anthropic::ToolTextEditor20250124
|
7
|
-
| Anthropic::
|
7
|
+
| Anthropic::ToolTextEditor20250429
|
8
|
+
| Anthropic::ToolTextEditor20250728
|
8
9
|
| Anthropic::WebSearchTool20250305
|
9
10
|
|
10
11
|
module MessageCountTokensTool
|
11
12
|
extend Anthropic::Internal::Type::Union
|
12
13
|
|
13
|
-
type text_editor20250429 =
|
14
|
-
{
|
15
|
-
name: :str_replace_based_edit_tool,
|
16
|
-
type: :text_editor_20250429,
|
17
|
-
cache_control: Anthropic::CacheControlEphemeral?
|
18
|
-
}
|
19
|
-
|
20
|
-
class TextEditor20250429 < Anthropic::Internal::Type::BaseModel
|
21
|
-
attr_accessor name: :str_replace_based_edit_tool
|
22
|
-
|
23
|
-
attr_accessor type: :text_editor_20250429
|
24
|
-
|
25
|
-
attr_accessor cache_control: Anthropic::CacheControlEphemeral?
|
26
|
-
|
27
|
-
def initialize: (
|
28
|
-
?cache_control: Anthropic::CacheControlEphemeral?,
|
29
|
-
?name: :str_replace_based_edit_tool,
|
30
|
-
?type: :text_editor_20250429
|
31
|
-
) -> void
|
32
|
-
|
33
|
-
def to_hash: -> {
|
34
|
-
name: :str_replace_based_edit_tool,
|
35
|
-
type: :text_editor_20250429,
|
36
|
-
cache_control: Anthropic::CacheControlEphemeral?
|
37
|
-
}
|
38
|
-
end
|
39
|
-
|
40
14
|
def self?.variants: -> ::Array[Anthropic::Models::message_count_tokens_tool]
|
41
15
|
end
|
42
16
|
end
|