anthropic 1.9.0 → 1.10.1
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 +44 -0
- data/README.md +12 -12
- data/lib/anthropic/errors.rb +25 -11
- data/lib/anthropic/file_part.rb +10 -7
- data/lib/anthropic/helpers/bedrock/client.rb +8 -24
- data/lib/anthropic/internal/page.rb +1 -1
- data/lib/anthropic/internal/stream.rb +1 -0
- data/lib/anthropic/internal/transport/base_client.rb +16 -12
- data/lib/anthropic/internal/transport/pooled_net_requester.rb +7 -10
- data/lib/anthropic/internal/type/base_page.rb +1 -1
- data/lib/anthropic/internal/type/base_stream.rb +8 -17
- data/lib/anthropic/internal/type/file_input.rb +7 -4
- data/lib/anthropic/internal/util.rb +2 -1
- data/lib/anthropic/models/anthropic_beta.rb +6 -0
- data/lib/anthropic/models/beta/beta_clear_tool_uses_20250919_edit.rb +98 -0
- data/lib/anthropic/models/beta/beta_clear_tool_uses_20250919_edit_response.rb +38 -0
- data/lib/anthropic/models/beta/beta_context_management_config.rb +22 -0
- data/lib/anthropic/models/beta/beta_context_management_response.rb +23 -0
- data/lib/anthropic/models/beta/beta_count_tokens_context_management_response.rb +20 -0
- data/lib/anthropic/models/beta/beta_input_tokens_clear_at_least.rb +25 -0
- data/lib/anthropic/models/beta/beta_input_tokens_trigger.rb +25 -0
- data/lib/anthropic/models/beta/beta_memory_tool_20250818.rb +40 -0
- data/lib/anthropic/models/beta/beta_memory_tool_20250818_command.rb +30 -0
- data/lib/anthropic/models/beta/beta_memory_tool_20250818_create_command.rb +36 -0
- data/lib/anthropic/models/beta/beta_memory_tool_20250818_delete_command.rb +28 -0
- data/lib/anthropic/models/beta/beta_memory_tool_20250818_insert_command.rb +44 -0
- data/lib/anthropic/models/beta/beta_memory_tool_20250818_rename_command.rb +36 -0
- data/lib/anthropic/models/beta/beta_memory_tool_20250818_str_replace_command.rb +44 -0
- data/lib/anthropic/models/beta/beta_memory_tool_20250818_view_command.rb +36 -0
- data/lib/anthropic/models/beta/beta_message.rb +9 -1
- data/lib/anthropic/models/beta/beta_message_tokens_count.rb +13 -1
- data/lib/anthropic/models/beta/beta_raw_message_delta_event.rb +9 -1
- data/lib/anthropic/models/beta/beta_stop_reason.rb +1 -0
- data/lib/anthropic/models/beta/beta_tool_union.rb +3 -1
- data/lib/anthropic/models/beta/beta_tool_uses_keep.rb +25 -0
- data/lib/anthropic/models/beta/beta_tool_uses_trigger.rb +25 -0
- data/lib/anthropic/models/beta/message_count_tokens_params.rb +14 -4
- data/lib/anthropic/models/beta/message_create_params.rb +11 -3
- data/lib/anthropic/models/beta/messages/batch_create_params.rb +11 -3
- data/lib/anthropic/models/model.rb +10 -0
- data/lib/anthropic/models/stop_reason.rb +1 -0
- data/lib/anthropic/resources/beta/messages.rb +12 -6
- data/lib/anthropic/version.rb +1 -1
- data/lib/anthropic.rb +17 -0
- data/rbi/anthropic/errors.rbi +29 -2
- data/rbi/anthropic/file_part.rbi +1 -1
- data/rbi/anthropic/internal/transport/base_client.rbi +4 -5
- data/rbi/anthropic/internal/type/base_page.rbi +1 -1
- data/rbi/anthropic/internal/type/base_stream.rbi +15 -15
- data/rbi/anthropic/internal/util.rbi +1 -1
- data/rbi/anthropic/models/anthropic_beta.rbi +10 -0
- data/rbi/anthropic/models/beta/beta_clear_tool_uses_20250919_edit.rbi +183 -0
- data/rbi/anthropic/models/beta/beta_clear_tool_uses_20250919_edit_response.rbi +62 -0
- data/rbi/anthropic/models/beta/beta_context_management_config.rbi +56 -0
- data/rbi/anthropic/models/beta/beta_context_management_response.rbi +53 -0
- data/rbi/anthropic/models/beta/beta_count_tokens_context_management_response.rbi +35 -0
- data/rbi/anthropic/models/beta/beta_input_tokens_clear_at_least.rbi +33 -0
- data/rbi/anthropic/models/beta/beta_input_tokens_trigger.rbi +33 -0
- data/rbi/anthropic/models/beta/beta_memory_tool_20250818.rbi +72 -0
- data/rbi/anthropic/models/beta/beta_memory_tool_20250818_command.rbi +33 -0
- data/rbi/anthropic/models/beta/beta_memory_tool_20250818_create_command.rbi +53 -0
- data/rbi/anthropic/models/beta/beta_memory_tool_20250818_delete_command.rbi +41 -0
- data/rbi/anthropic/models/beta/beta_memory_tool_20250818_insert_command.rbi +69 -0
- data/rbi/anthropic/models/beta/beta_memory_tool_20250818_rename_command.rbi +55 -0
- data/rbi/anthropic/models/beta/beta_memory_tool_20250818_str_replace_command.rbi +64 -0
- data/rbi/anthropic/models/beta/beta_memory_tool_20250818_view_command.rbi +59 -0
- data/rbi/anthropic/models/beta/beta_message.rbi +20 -0
- data/rbi/anthropic/models/beta/beta_message_tokens_count.rbi +40 -2
- data/rbi/anthropic/models/beta/beta_raw_message_delta_event.rbi +20 -0
- data/rbi/anthropic/models/beta/beta_stop_reason.rbi +5 -0
- data/rbi/anthropic/models/beta/beta_tool_union.rbi +1 -0
- data/rbi/anthropic/models/beta/beta_tool_uses_keep.rbi +33 -0
- data/rbi/anthropic/models/beta/beta_tool_uses_trigger.rbi +33 -0
- data/rbi/anthropic/models/beta/message_count_tokens_params.rbi +23 -0
- data/rbi/anthropic/models/beta/message_create_params.rbi +22 -0
- data/rbi/anthropic/models/beta/messages/batch_create_params.rbi +28 -0
- data/rbi/anthropic/models/model.rbi +8 -0
- data/rbi/anthropic/models/stop_reason.rbi +5 -0
- data/rbi/anthropic/resources/beta/messages.rbi +15 -0
- data/sig/anthropic/errors.rbs +7 -0
- data/sig/anthropic/file_part.rbs +1 -1
- data/sig/anthropic/internal/type/base_stream.rbs +4 -3
- data/sig/anthropic/models/anthropic_beta.rbs +4 -0
- data/sig/anthropic/models/beta/beta_clear_tool_uses_20250919_edit.rbs +77 -0
- data/sig/anthropic/models/beta/beta_clear_tool_uses_20250919_edit_response.rbs +34 -0
- data/sig/anthropic/models/beta/beta_context_management_config.rbs +26 -0
- data/sig/anthropic/models/beta/beta_context_management_response.rbs +24 -0
- data/sig/anthropic/models/beta/beta_count_tokens_context_management_response.rbs +18 -0
- data/sig/anthropic/models/beta/beta_input_tokens_clear_at_least.rbs +20 -0
- data/sig/anthropic/models/beta/beta_input_tokens_trigger.rbs +19 -0
- data/sig/anthropic/models/beta/beta_memory_tool_20250818.rbs +34 -0
- data/sig/anthropic/models/beta/beta_memory_tool_20250818_command.rbs +21 -0
- data/sig/anthropic/models/beta/beta_memory_tool_20250818_create_command.rbs +26 -0
- data/sig/anthropic/models/beta/beta_memory_tool_20250818_delete_command.rbs +20 -0
- data/sig/anthropic/models/beta/beta_memory_tool_20250818_insert_command.rbs +39 -0
- data/sig/anthropic/models/beta/beta_memory_tool_20250818_rename_command.rbs +26 -0
- data/sig/anthropic/models/beta/beta_memory_tool_20250818_str_replace_command.rbs +39 -0
- data/sig/anthropic/models/beta/beta_memory_tool_20250818_view_command.rbs +32 -0
- data/sig/anthropic/models/beta/beta_message.rbs +5 -0
- data/sig/anthropic/models/beta/beta_message_tokens_count.rbs +15 -3
- data/sig/anthropic/models/beta/beta_raw_message_delta_event.rbs +5 -0
- data/sig/anthropic/models/beta/beta_stop_reason.rbs +2 -0
- data/sig/anthropic/models/beta/beta_tool_union.rbs +1 -0
- data/sig/anthropic/models/beta/beta_tool_uses_keep.rbs +19 -0
- data/sig/anthropic/models/beta/beta_tool_uses_trigger.rbs +19 -0
- data/sig/anthropic/models/beta/message_count_tokens_params.rbs +6 -0
- data/sig/anthropic/models/beta/message_create_params.rbs +5 -0
- data/sig/anthropic/models/beta/messages/batch_create_params.rbs +5 -0
- data/sig/anthropic/models/model.rbs +8 -0
- data/sig/anthropic/models/stop_reason.rbs +2 -0
- data/sig/anthropic/resources/beta/messages.rbs +3 -0
- metadata +53 -2
|
@@ -75,6 +75,16 @@ module Anthropic
|
|
|
75
75
|
)
|
|
76
76
|
CONTEXT_1M_2025_08_07 =
|
|
77
77
|
T.let(:"context-1m-2025-08-07", Anthropic::AnthropicBeta::TaggedSymbol)
|
|
78
|
+
CONTEXT_MANAGEMENT_2025_06_27 =
|
|
79
|
+
T.let(
|
|
80
|
+
:"context-management-2025-06-27",
|
|
81
|
+
Anthropic::AnthropicBeta::TaggedSymbol
|
|
82
|
+
)
|
|
83
|
+
MODEL_CONTEXT_WINDOW_EXCEEDED_2025_08_26 =
|
|
84
|
+
T.let(
|
|
85
|
+
:"model-context-window-exceeded-2025-08-26",
|
|
86
|
+
Anthropic::AnthropicBeta::TaggedSymbol
|
|
87
|
+
)
|
|
78
88
|
end
|
|
79
89
|
end
|
|
80
90
|
end
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
BetaClearToolUses20250919Edit = Beta::BetaClearToolUses20250919Edit
|
|
6
|
+
|
|
7
|
+
module Beta
|
|
8
|
+
class BetaClearToolUses20250919Edit < Anthropic::Internal::Type::BaseModel
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
Anthropic::Beta::BetaClearToolUses20250919Edit,
|
|
13
|
+
Anthropic::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
sig { returns(Symbol) }
|
|
18
|
+
attr_accessor :type
|
|
19
|
+
|
|
20
|
+
# Minimum number of tokens that must be cleared when triggered. Context will only
|
|
21
|
+
# be modified if at least this many tokens can be removed.
|
|
22
|
+
sig { returns(T.nilable(Anthropic::Beta::BetaInputTokensClearAtLeast)) }
|
|
23
|
+
attr_reader :clear_at_least
|
|
24
|
+
|
|
25
|
+
sig do
|
|
26
|
+
params(
|
|
27
|
+
clear_at_least:
|
|
28
|
+
T.nilable(Anthropic::Beta::BetaInputTokensClearAtLeast::OrHash)
|
|
29
|
+
).void
|
|
30
|
+
end
|
|
31
|
+
attr_writer :clear_at_least
|
|
32
|
+
|
|
33
|
+
# Whether to clear all tool inputs (bool) or specific tool inputs to clear (list)
|
|
34
|
+
sig do
|
|
35
|
+
returns(
|
|
36
|
+
T.nilable(
|
|
37
|
+
Anthropic::Beta::BetaClearToolUses20250919Edit::ClearToolInputs::Variants
|
|
38
|
+
)
|
|
39
|
+
)
|
|
40
|
+
end
|
|
41
|
+
attr_accessor :clear_tool_inputs
|
|
42
|
+
|
|
43
|
+
# Tool names whose uses are preserved from clearing
|
|
44
|
+
sig { returns(T.nilable(T::Array[String])) }
|
|
45
|
+
attr_accessor :exclude_tools
|
|
46
|
+
|
|
47
|
+
# Number of tool uses to retain in the conversation
|
|
48
|
+
sig { returns(T.nilable(Anthropic::Beta::BetaToolUsesKeep)) }
|
|
49
|
+
attr_reader :keep
|
|
50
|
+
|
|
51
|
+
sig { params(keep: Anthropic::Beta::BetaToolUsesKeep::OrHash).void }
|
|
52
|
+
attr_writer :keep
|
|
53
|
+
|
|
54
|
+
# Condition that triggers the context management strategy
|
|
55
|
+
sig do
|
|
56
|
+
returns(
|
|
57
|
+
T.nilable(
|
|
58
|
+
T.any(
|
|
59
|
+
Anthropic::Beta::BetaInputTokensTrigger,
|
|
60
|
+
Anthropic::Beta::BetaToolUsesTrigger
|
|
61
|
+
)
|
|
62
|
+
)
|
|
63
|
+
)
|
|
64
|
+
end
|
|
65
|
+
attr_reader :trigger
|
|
66
|
+
|
|
67
|
+
sig do
|
|
68
|
+
params(
|
|
69
|
+
trigger:
|
|
70
|
+
T.any(
|
|
71
|
+
Anthropic::Beta::BetaInputTokensTrigger::OrHash,
|
|
72
|
+
Anthropic::Beta::BetaToolUsesTrigger::OrHash
|
|
73
|
+
)
|
|
74
|
+
).void
|
|
75
|
+
end
|
|
76
|
+
attr_writer :trigger
|
|
77
|
+
|
|
78
|
+
sig do
|
|
79
|
+
params(
|
|
80
|
+
clear_at_least:
|
|
81
|
+
T.nilable(Anthropic::Beta::BetaInputTokensClearAtLeast::OrHash),
|
|
82
|
+
clear_tool_inputs:
|
|
83
|
+
T.nilable(
|
|
84
|
+
Anthropic::Beta::BetaClearToolUses20250919Edit::ClearToolInputs::Variants
|
|
85
|
+
),
|
|
86
|
+
exclude_tools: T.nilable(T::Array[String]),
|
|
87
|
+
keep: Anthropic::Beta::BetaToolUsesKeep::OrHash,
|
|
88
|
+
trigger:
|
|
89
|
+
T.any(
|
|
90
|
+
Anthropic::Beta::BetaInputTokensTrigger::OrHash,
|
|
91
|
+
Anthropic::Beta::BetaToolUsesTrigger::OrHash
|
|
92
|
+
),
|
|
93
|
+
type: Symbol
|
|
94
|
+
).returns(T.attached_class)
|
|
95
|
+
end
|
|
96
|
+
def self.new(
|
|
97
|
+
# Minimum number of tokens that must be cleared when triggered. Context will only
|
|
98
|
+
# be modified if at least this many tokens can be removed.
|
|
99
|
+
clear_at_least: nil,
|
|
100
|
+
# Whether to clear all tool inputs (bool) or specific tool inputs to clear (list)
|
|
101
|
+
clear_tool_inputs: nil,
|
|
102
|
+
# Tool names whose uses are preserved from clearing
|
|
103
|
+
exclude_tools: nil,
|
|
104
|
+
# Number of tool uses to retain in the conversation
|
|
105
|
+
keep: nil,
|
|
106
|
+
# Condition that triggers the context management strategy
|
|
107
|
+
trigger: nil,
|
|
108
|
+
type: :clear_tool_uses_20250919
|
|
109
|
+
)
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
sig do
|
|
113
|
+
override.returns(
|
|
114
|
+
{
|
|
115
|
+
type: Symbol,
|
|
116
|
+
clear_at_least:
|
|
117
|
+
T.nilable(Anthropic::Beta::BetaInputTokensClearAtLeast),
|
|
118
|
+
clear_tool_inputs:
|
|
119
|
+
T.nilable(
|
|
120
|
+
Anthropic::Beta::BetaClearToolUses20250919Edit::ClearToolInputs::Variants
|
|
121
|
+
),
|
|
122
|
+
exclude_tools: T.nilable(T::Array[String]),
|
|
123
|
+
keep: Anthropic::Beta::BetaToolUsesKeep,
|
|
124
|
+
trigger:
|
|
125
|
+
T.any(
|
|
126
|
+
Anthropic::Beta::BetaInputTokensTrigger,
|
|
127
|
+
Anthropic::Beta::BetaToolUsesTrigger
|
|
128
|
+
)
|
|
129
|
+
}
|
|
130
|
+
)
|
|
131
|
+
end
|
|
132
|
+
def to_hash
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# Whether to clear all tool inputs (bool) or specific tool inputs to clear (list)
|
|
136
|
+
module ClearToolInputs
|
|
137
|
+
extend Anthropic::Internal::Type::Union
|
|
138
|
+
|
|
139
|
+
Variants = T.type_alias { T.any(T::Boolean, T::Array[String]) }
|
|
140
|
+
|
|
141
|
+
sig do
|
|
142
|
+
override.returns(
|
|
143
|
+
T::Array[
|
|
144
|
+
Anthropic::Beta::BetaClearToolUses20250919Edit::ClearToolInputs::Variants
|
|
145
|
+
]
|
|
146
|
+
)
|
|
147
|
+
end
|
|
148
|
+
def self.variants
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
StringArray =
|
|
152
|
+
T.let(
|
|
153
|
+
Anthropic::Internal::Type::ArrayOf[String],
|
|
154
|
+
Anthropic::Internal::Type::Converter
|
|
155
|
+
)
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
# Condition that triggers the context management strategy
|
|
159
|
+
module Trigger
|
|
160
|
+
extend Anthropic::Internal::Type::Union
|
|
161
|
+
|
|
162
|
+
Variants =
|
|
163
|
+
T.type_alias do
|
|
164
|
+
T.any(
|
|
165
|
+
Anthropic::Beta::BetaInputTokensTrigger,
|
|
166
|
+
Anthropic::Beta::BetaToolUsesTrigger
|
|
167
|
+
)
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
sig do
|
|
171
|
+
override.returns(
|
|
172
|
+
T::Array[
|
|
173
|
+
Anthropic::Beta::BetaClearToolUses20250919Edit::Trigger::Variants
|
|
174
|
+
]
|
|
175
|
+
)
|
|
176
|
+
end
|
|
177
|
+
def self.variants
|
|
178
|
+
end
|
|
179
|
+
end
|
|
180
|
+
end
|
|
181
|
+
end
|
|
182
|
+
end
|
|
183
|
+
end
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
BetaClearToolUses20250919EditResponse =
|
|
6
|
+
Beta::BetaClearToolUses20250919EditResponse
|
|
7
|
+
|
|
8
|
+
module Beta
|
|
9
|
+
class BetaClearToolUses20250919EditResponse < Anthropic::Internal::Type::BaseModel
|
|
10
|
+
OrHash =
|
|
11
|
+
T.type_alias do
|
|
12
|
+
T.any(
|
|
13
|
+
Anthropic::Beta::BetaClearToolUses20250919EditResponse,
|
|
14
|
+
Anthropic::Internal::AnyHash
|
|
15
|
+
)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
# Number of input tokens cleared by this edit.
|
|
19
|
+
sig { returns(Integer) }
|
|
20
|
+
attr_accessor :cleared_input_tokens
|
|
21
|
+
|
|
22
|
+
# Number of tool uses that were cleared.
|
|
23
|
+
sig { returns(Integer) }
|
|
24
|
+
attr_accessor :cleared_tool_uses
|
|
25
|
+
|
|
26
|
+
# The type of context management edit applied.
|
|
27
|
+
sig { returns(Symbol) }
|
|
28
|
+
attr_accessor :type
|
|
29
|
+
|
|
30
|
+
# Results for clear_tool_uses_20250919 edit.
|
|
31
|
+
sig do
|
|
32
|
+
params(
|
|
33
|
+
cleared_input_tokens: Integer,
|
|
34
|
+
cleared_tool_uses: Integer,
|
|
35
|
+
type: Symbol
|
|
36
|
+
).returns(T.attached_class)
|
|
37
|
+
end
|
|
38
|
+
def self.new(
|
|
39
|
+
# Number of input tokens cleared by this edit.
|
|
40
|
+
cleared_input_tokens:,
|
|
41
|
+
# Number of tool uses that were cleared.
|
|
42
|
+
cleared_tool_uses:,
|
|
43
|
+
# The type of context management edit applied.
|
|
44
|
+
type: :clear_tool_uses_20250919
|
|
45
|
+
)
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
sig do
|
|
49
|
+
override.returns(
|
|
50
|
+
{
|
|
51
|
+
cleared_input_tokens: Integer,
|
|
52
|
+
cleared_tool_uses: Integer,
|
|
53
|
+
type: Symbol
|
|
54
|
+
}
|
|
55
|
+
)
|
|
56
|
+
end
|
|
57
|
+
def to_hash
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
BetaContextManagementConfig = Beta::BetaContextManagementConfig
|
|
6
|
+
|
|
7
|
+
module Beta
|
|
8
|
+
class BetaContextManagementConfig < Anthropic::Internal::Type::BaseModel
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
Anthropic::Beta::BetaContextManagementConfig,
|
|
13
|
+
Anthropic::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# List of context management edits to apply
|
|
18
|
+
sig do
|
|
19
|
+
returns(
|
|
20
|
+
T.nilable(T::Array[Anthropic::Beta::BetaClearToolUses20250919Edit])
|
|
21
|
+
)
|
|
22
|
+
end
|
|
23
|
+
attr_reader :edits
|
|
24
|
+
|
|
25
|
+
sig do
|
|
26
|
+
params(
|
|
27
|
+
edits:
|
|
28
|
+
T::Array[Anthropic::Beta::BetaClearToolUses20250919Edit::OrHash]
|
|
29
|
+
).void
|
|
30
|
+
end
|
|
31
|
+
attr_writer :edits
|
|
32
|
+
|
|
33
|
+
# Configuration for context management operations.
|
|
34
|
+
sig do
|
|
35
|
+
params(
|
|
36
|
+
edits:
|
|
37
|
+
T::Array[Anthropic::Beta::BetaClearToolUses20250919Edit::OrHash]
|
|
38
|
+
).returns(T.attached_class)
|
|
39
|
+
end
|
|
40
|
+
def self.new(
|
|
41
|
+
# List of context management edits to apply
|
|
42
|
+
edits: nil
|
|
43
|
+
)
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
sig do
|
|
47
|
+
override.returns(
|
|
48
|
+
{ edits: T::Array[Anthropic::Beta::BetaClearToolUses20250919Edit] }
|
|
49
|
+
)
|
|
50
|
+
end
|
|
51
|
+
def to_hash
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
BetaContextManagementResponse = Beta::BetaContextManagementResponse
|
|
6
|
+
|
|
7
|
+
module Beta
|
|
8
|
+
class BetaContextManagementResponse < Anthropic::Internal::Type::BaseModel
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
Anthropic::Beta::BetaContextManagementResponse,
|
|
13
|
+
Anthropic::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# List of context management edits that were applied.
|
|
18
|
+
sig do
|
|
19
|
+
returns(
|
|
20
|
+
T::Array[Anthropic::Beta::BetaClearToolUses20250919EditResponse]
|
|
21
|
+
)
|
|
22
|
+
end
|
|
23
|
+
attr_accessor :applied_edits
|
|
24
|
+
|
|
25
|
+
# Information about context management operations applied during the request.
|
|
26
|
+
sig do
|
|
27
|
+
params(
|
|
28
|
+
applied_edits:
|
|
29
|
+
T::Array[
|
|
30
|
+
Anthropic::Beta::BetaClearToolUses20250919EditResponse::OrHash
|
|
31
|
+
]
|
|
32
|
+
).returns(T.attached_class)
|
|
33
|
+
end
|
|
34
|
+
def self.new(
|
|
35
|
+
# List of context management edits that were applied.
|
|
36
|
+
applied_edits:
|
|
37
|
+
)
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
sig do
|
|
41
|
+
override.returns(
|
|
42
|
+
{
|
|
43
|
+
applied_edits:
|
|
44
|
+
T::Array[Anthropic::Beta::BetaClearToolUses20250919EditResponse]
|
|
45
|
+
}
|
|
46
|
+
)
|
|
47
|
+
end
|
|
48
|
+
def to_hash
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
BetaCountTokensContextManagementResponse =
|
|
6
|
+
Beta::BetaCountTokensContextManagementResponse
|
|
7
|
+
|
|
8
|
+
module Beta
|
|
9
|
+
class BetaCountTokensContextManagementResponse < Anthropic::Internal::Type::BaseModel
|
|
10
|
+
OrHash =
|
|
11
|
+
T.type_alias do
|
|
12
|
+
T.any(
|
|
13
|
+
Anthropic::Beta::BetaCountTokensContextManagementResponse,
|
|
14
|
+
Anthropic::Internal::AnyHash
|
|
15
|
+
)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
# The original token count before context management was applied
|
|
19
|
+
sig { returns(Integer) }
|
|
20
|
+
attr_accessor :original_input_tokens
|
|
21
|
+
|
|
22
|
+
sig { params(original_input_tokens: Integer).returns(T.attached_class) }
|
|
23
|
+
def self.new(
|
|
24
|
+
# The original token count before context management was applied
|
|
25
|
+
original_input_tokens:
|
|
26
|
+
)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
sig { override.returns({ original_input_tokens: Integer }) }
|
|
30
|
+
def to_hash
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
BetaInputTokensClearAtLeast = Beta::BetaInputTokensClearAtLeast
|
|
6
|
+
|
|
7
|
+
module Beta
|
|
8
|
+
class BetaInputTokensClearAtLeast < Anthropic::Internal::Type::BaseModel
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
Anthropic::Beta::BetaInputTokensClearAtLeast,
|
|
13
|
+
Anthropic::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
sig { returns(Symbol) }
|
|
18
|
+
attr_accessor :type
|
|
19
|
+
|
|
20
|
+
sig { returns(Integer) }
|
|
21
|
+
attr_accessor :value
|
|
22
|
+
|
|
23
|
+
sig { params(value: Integer, type: Symbol).returns(T.attached_class) }
|
|
24
|
+
def self.new(value:, type: :input_tokens)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
sig { override.returns({ type: Symbol, value: Integer }) }
|
|
28
|
+
def to_hash
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
BetaInputTokensTrigger = Beta::BetaInputTokensTrigger
|
|
6
|
+
|
|
7
|
+
module Beta
|
|
8
|
+
class BetaInputTokensTrigger < Anthropic::Internal::Type::BaseModel
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
Anthropic::Beta::BetaInputTokensTrigger,
|
|
13
|
+
Anthropic::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
sig { returns(Symbol) }
|
|
18
|
+
attr_accessor :type
|
|
19
|
+
|
|
20
|
+
sig { returns(Integer) }
|
|
21
|
+
attr_accessor :value
|
|
22
|
+
|
|
23
|
+
sig { params(value: Integer, type: Symbol).returns(T.attached_class) }
|
|
24
|
+
def self.new(value:, type: :input_tokens)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
sig { override.returns({ type: Symbol, value: Integer }) }
|
|
28
|
+
def to_hash
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
BetaMemoryTool20250818 = Beta::BetaMemoryTool20250818
|
|
6
|
+
|
|
7
|
+
module Beta
|
|
8
|
+
class BetaMemoryTool20250818 < Anthropic::Internal::Type::BaseModel
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
Anthropic::Beta::BetaMemoryTool20250818,
|
|
13
|
+
Anthropic::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# Name of the tool.
|
|
18
|
+
#
|
|
19
|
+
# This is how the tool will be called by the model and in `tool_use` blocks.
|
|
20
|
+
sig { returns(Symbol) }
|
|
21
|
+
attr_accessor :name
|
|
22
|
+
|
|
23
|
+
sig { returns(Symbol) }
|
|
24
|
+
attr_accessor :type
|
|
25
|
+
|
|
26
|
+
# Create a cache control breakpoint at this content block.
|
|
27
|
+
sig { returns(T.nilable(Anthropic::Beta::BetaCacheControlEphemeral)) }
|
|
28
|
+
attr_reader :cache_control
|
|
29
|
+
|
|
30
|
+
sig do
|
|
31
|
+
params(
|
|
32
|
+
cache_control:
|
|
33
|
+
T.nilable(Anthropic::Beta::BetaCacheControlEphemeral::OrHash)
|
|
34
|
+
).void
|
|
35
|
+
end
|
|
36
|
+
attr_writer :cache_control
|
|
37
|
+
|
|
38
|
+
sig do
|
|
39
|
+
params(
|
|
40
|
+
cache_control:
|
|
41
|
+
T.nilable(Anthropic::Beta::BetaCacheControlEphemeral::OrHash),
|
|
42
|
+
name: Symbol,
|
|
43
|
+
type: Symbol
|
|
44
|
+
).returns(T.attached_class)
|
|
45
|
+
end
|
|
46
|
+
def self.new(
|
|
47
|
+
# Create a cache control breakpoint at this content block.
|
|
48
|
+
cache_control: nil,
|
|
49
|
+
# Name of the tool.
|
|
50
|
+
#
|
|
51
|
+
# This is how the tool will be called by the model and in `tool_use` blocks.
|
|
52
|
+
name: :memory,
|
|
53
|
+
type: :memory_20250818
|
|
54
|
+
)
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
sig do
|
|
58
|
+
override.returns(
|
|
59
|
+
{
|
|
60
|
+
name: Symbol,
|
|
61
|
+
type: Symbol,
|
|
62
|
+
cache_control:
|
|
63
|
+
T.nilable(Anthropic::Beta::BetaCacheControlEphemeral)
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
end
|
|
67
|
+
def to_hash
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
BetaMemoryTool20250818Command = Beta::BetaMemoryTool20250818Command
|
|
6
|
+
|
|
7
|
+
module Beta
|
|
8
|
+
module BetaMemoryTool20250818Command
|
|
9
|
+
extend Anthropic::Internal::Type::Union
|
|
10
|
+
|
|
11
|
+
Variants =
|
|
12
|
+
T.type_alias do
|
|
13
|
+
T.any(
|
|
14
|
+
Anthropic::Beta::BetaMemoryTool20250818ViewCommand,
|
|
15
|
+
Anthropic::Beta::BetaMemoryTool20250818CreateCommand,
|
|
16
|
+
Anthropic::Beta::BetaMemoryTool20250818StrReplaceCommand,
|
|
17
|
+
Anthropic::Beta::BetaMemoryTool20250818InsertCommand,
|
|
18
|
+
Anthropic::Beta::BetaMemoryTool20250818DeleteCommand,
|
|
19
|
+
Anthropic::Beta::BetaMemoryTool20250818RenameCommand
|
|
20
|
+
)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
sig do
|
|
24
|
+
override.returns(
|
|
25
|
+
T::Array[Anthropic::Beta::BetaMemoryTool20250818Command::Variants]
|
|
26
|
+
)
|
|
27
|
+
end
|
|
28
|
+
def self.variants
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
BetaMemoryTool20250818CreateCommand =
|
|
6
|
+
Beta::BetaMemoryTool20250818CreateCommand
|
|
7
|
+
|
|
8
|
+
module Beta
|
|
9
|
+
class BetaMemoryTool20250818CreateCommand < Anthropic::Internal::Type::BaseModel
|
|
10
|
+
OrHash =
|
|
11
|
+
T.type_alias do
|
|
12
|
+
T.any(
|
|
13
|
+
Anthropic::Beta::BetaMemoryTool20250818CreateCommand,
|
|
14
|
+
Anthropic::Internal::AnyHash
|
|
15
|
+
)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
# Command type identifier
|
|
19
|
+
sig { returns(Symbol) }
|
|
20
|
+
attr_accessor :command
|
|
21
|
+
|
|
22
|
+
# Content to write to the file
|
|
23
|
+
sig { returns(String) }
|
|
24
|
+
attr_accessor :file_text
|
|
25
|
+
|
|
26
|
+
# Path where the file should be created
|
|
27
|
+
sig { returns(String) }
|
|
28
|
+
attr_accessor :path
|
|
29
|
+
|
|
30
|
+
sig do
|
|
31
|
+
params(file_text: String, path: String, command: Symbol).returns(
|
|
32
|
+
T.attached_class
|
|
33
|
+
)
|
|
34
|
+
end
|
|
35
|
+
def self.new(
|
|
36
|
+
# Content to write to the file
|
|
37
|
+
file_text:,
|
|
38
|
+
# Path where the file should be created
|
|
39
|
+
path:,
|
|
40
|
+
# Command type identifier
|
|
41
|
+
command: :create
|
|
42
|
+
)
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
sig do
|
|
46
|
+
override.returns({ command: Symbol, file_text: String, path: String })
|
|
47
|
+
end
|
|
48
|
+
def to_hash
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
BetaMemoryTool20250818DeleteCommand =
|
|
6
|
+
Beta::BetaMemoryTool20250818DeleteCommand
|
|
7
|
+
|
|
8
|
+
module Beta
|
|
9
|
+
class BetaMemoryTool20250818DeleteCommand < Anthropic::Internal::Type::BaseModel
|
|
10
|
+
OrHash =
|
|
11
|
+
T.type_alias do
|
|
12
|
+
T.any(
|
|
13
|
+
Anthropic::Beta::BetaMemoryTool20250818DeleteCommand,
|
|
14
|
+
Anthropic::Internal::AnyHash
|
|
15
|
+
)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
# Command type identifier
|
|
19
|
+
sig { returns(Symbol) }
|
|
20
|
+
attr_accessor :command
|
|
21
|
+
|
|
22
|
+
# Path to the file or directory to delete
|
|
23
|
+
sig { returns(String) }
|
|
24
|
+
attr_accessor :path
|
|
25
|
+
|
|
26
|
+
sig { params(path: String, command: Symbol).returns(T.attached_class) }
|
|
27
|
+
def self.new(
|
|
28
|
+
# Path to the file or directory to delete
|
|
29
|
+
path:,
|
|
30
|
+
# Command type identifier
|
|
31
|
+
command: :delete
|
|
32
|
+
)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
sig { override.returns({ command: Symbol, path: String }) }
|
|
36
|
+
def to_hash
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|