anthropic 1.11.0 → 1.13.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 +29 -0
- data/README.md +1 -1
- data/lib/anthropic/helpers/streaming/message_stream.rb +3 -0
- data/lib/anthropic/internal/page_cursor.rb +92 -0
- data/lib/anthropic/internal/token_page.rb +92 -0
- data/lib/anthropic/internal/transport/pooled_net_requester.rb +30 -24
- data/lib/anthropic/models/anthropic_beta.rb +3 -0
- data/lib/anthropic/models/beta/beta_all_thinking_turns.rb +19 -0
- data/lib/anthropic/models/beta/beta_clear_thinking_20251015_edit.rb +48 -0
- data/lib/anthropic/models/beta/beta_clear_thinking_20251015_edit_response.rb +36 -0
- data/lib/anthropic/models/beta/beta_clear_tool_uses_20250919_edit_response.rb +0 -2
- data/lib/anthropic/models/beta/beta_container.rb +9 -1
- data/lib/anthropic/models/beta/beta_container_params.rb +34 -0
- data/lib/anthropic/models/beta/beta_context_management_config.rb +17 -5
- data/lib/anthropic/models/beta/beta_context_management_response.rb +16 -5
- data/lib/anthropic/models/beta/beta_mcp_tool_use_block_param.rb +3 -3
- data/lib/anthropic/models/beta/beta_message.rb +4 -2
- data/lib/anthropic/models/beta/beta_raw_message_delta_event.rb +2 -2
- data/lib/anthropic/models/beta/beta_server_tool_use_block_param.rb +3 -3
- data/lib/anthropic/models/beta/beta_skill.rb +51 -0
- data/lib/anthropic/models/beta/beta_skill_params.rb +51 -0
- data/lib/anthropic/models/beta/beta_thinking_config_enabled.rb +1 -1
- data/lib/anthropic/models/beta/beta_thinking_config_param.rb +1 -1
- data/lib/anthropic/models/beta/beta_thinking_turns.rb +25 -0
- data/lib/anthropic/models/beta/beta_tool.rb +5 -3
- data/lib/anthropic/models/beta/beta_tool_use_block_param.rb +3 -3
- data/lib/anthropic/models/beta/message_count_tokens_params.rb +15 -12
- data/lib/anthropic/models/beta/message_create_params.rb +34 -18
- data/lib/anthropic/models/beta/messages/batch_create_params.rb +39 -20
- data/lib/anthropic/models/beta/skill_create_params.rb +49 -0
- data/lib/anthropic/models/beta/skill_create_response.rb +84 -0
- data/lib/anthropic/models/beta/skill_delete_params.rb +24 -0
- data/lib/anthropic/models/beta/skill_delete_response.rb +34 -0
- data/lib/anthropic/models/beta/skill_list_params.rb +61 -0
- data/lib/anthropic/models/beta/skill_list_response.rb +84 -0
- data/lib/anthropic/models/beta/skill_retrieve_params.rb +24 -0
- data/lib/anthropic/models/beta/skill_retrieve_response.rb +84 -0
- data/lib/anthropic/models/beta/skills/version_create_params.rb +42 -0
- data/lib/anthropic/models/beta/skills/version_create_response.rb +92 -0
- data/lib/anthropic/models/beta/skills/version_delete_params.rb +39 -0
- data/lib/anthropic/models/beta/skills/version_delete_response.rb +36 -0
- data/lib/anthropic/models/beta/skills/version_list_params.rb +47 -0
- data/lib/anthropic/models/beta/skills/version_list_response.rb +92 -0
- data/lib/anthropic/models/beta/skills/version_retrieve_params.rb +39 -0
- data/lib/anthropic/models/beta/skills/version_retrieve_response.rb +92 -0
- data/lib/anthropic/models/completion_create_params.rb +3 -4
- data/lib/anthropic/models/message_count_tokens_params.rb +10 -10
- data/lib/anthropic/models/message_create_params.rb +13 -13
- data/lib/anthropic/models/messages/batch_create_params.rb +14 -15
- data/lib/anthropic/models/model.rb +6 -20
- data/lib/anthropic/models/server_tool_use_block_param.rb +3 -3
- data/lib/anthropic/models/stop_reason.rb +0 -1
- data/lib/anthropic/models/thinking_config_enabled.rb +1 -1
- data/lib/anthropic/models/thinking_config_param.rb +1 -1
- data/lib/anthropic/models/tool.rb +5 -3
- data/lib/anthropic/models/tool_use_block_param.rb +3 -3
- data/lib/anthropic/resources/beta/messages.rb +5 -5
- data/lib/anthropic/resources/beta/skills/versions.rb +154 -0
- data/lib/anthropic/resources/beta/skills.rb +144 -0
- data/lib/anthropic/resources/beta.rb +4 -0
- data/lib/anthropic/resources/completions.rb +4 -4
- data/lib/anthropic/version.rb +1 -1
- data/lib/anthropic.rb +27 -0
- data/rbi/anthropic/internal/page_cursor.rbi +25 -0
- data/rbi/anthropic/internal/token_page.rbi +25 -0
- data/rbi/anthropic/models/anthropic_beta.rbi +2 -0
- data/rbi/anthropic/models/beta/beta_all_thinking_turns.rbi +30 -0
- data/rbi/anthropic/models/beta/beta_clear_thinking_20251015_edit.rbi +109 -0
- data/rbi/anthropic/models/beta/beta_clear_thinking_20251015_edit_response.rbi +61 -0
- data/rbi/anthropic/models/beta/beta_clear_tool_uses_20250919_edit_response.rbi +0 -1
- data/rbi/anthropic/models/beta/beta_container.rbi +23 -3
- data/rbi/anthropic/models/beta/beta_container_params.rbi +54 -0
- data/rbi/anthropic/models/beta/beta_context_management_config.rbi +51 -5
- data/rbi/anthropic/models/beta/beta_context_management_response.rbi +32 -4
- data/rbi/anthropic/models/beta/beta_mcp_tool_use_block.rbi +3 -3
- data/rbi/anthropic/models/beta/beta_mcp_tool_use_block_param.rbi +3 -3
- data/rbi/anthropic/models/beta/beta_message.rbi +6 -2
- data/rbi/anthropic/models/beta/beta_raw_message_delta_event.rbi +2 -2
- data/rbi/anthropic/models/beta/beta_server_tool_use_block.rbi +3 -3
- data/rbi/anthropic/models/beta/beta_server_tool_use_block_param.rbi +3 -3
- data/rbi/anthropic/models/beta/beta_skill.rbi +80 -0
- data/rbi/anthropic/models/beta/beta_skill_params.rbi +91 -0
- data/rbi/anthropic/models/beta/beta_thinking_config_enabled.rbi +2 -2
- data/rbi/anthropic/models/beta/beta_thinking_config_param.rbi +1 -1
- data/rbi/anthropic/models/beta/beta_thinking_turns.rbi +33 -0
- data/rbi/anthropic/models/beta/beta_tool.rbi +3 -3
- data/rbi/anthropic/models/beta/beta_tool_use_block.rbi +8 -3
- data/rbi/anthropic/models/beta/beta_tool_use_block_param.rbi +3 -3
- data/rbi/anthropic/models/beta/message_count_tokens_params.rbi +27 -21
- data/rbi/anthropic/models/beta/message_create_params.rbi +61 -29
- data/rbi/anthropic/models/beta/messages/batch_create_params.rbi +70 -33
- data/rbi/anthropic/models/beta/skill_create_params.rbi +90 -0
- data/rbi/anthropic/models/beta/skill_create_response.rbi +118 -0
- data/rbi/anthropic/models/beta/skill_delete_params.rbi +62 -0
- data/rbi/anthropic/models/beta/skill_delete_response.rbi +46 -0
- data/rbi/anthropic/models/beta/skill_list_params.rbi +109 -0
- data/rbi/anthropic/models/beta/skill_list_response.rbi +118 -0
- data/rbi/anthropic/models/beta/skill_retrieve_params.rbi +62 -0
- data/rbi/anthropic/models/beta/skill_retrieve_response.rbi +118 -0
- data/rbi/anthropic/models/beta/skills/version_create_params.rbi +79 -0
- data/rbi/anthropic/models/beta/skills/version_create_response.rbi +124 -0
- data/rbi/anthropic/models/beta/skills/version_delete_params.rbi +77 -0
- data/rbi/anthropic/models/beta/skills/version_delete_response.rbi +48 -0
- data/rbi/anthropic/models/beta/skills/version_list_params.rbi +85 -0
- data/rbi/anthropic/models/beta/skills/version_list_response.rbi +124 -0
- data/rbi/anthropic/models/beta/skills/version_retrieve_params.rbi +77 -0
- data/rbi/anthropic/models/beta/skills/version_retrieve_response.rbi +124 -0
- data/rbi/anthropic/models/completion_create_params.rbi +6 -8
- data/rbi/anthropic/models/message_count_tokens_params.rbi +19 -19
- data/rbi/anthropic/models/message_create_params.rbi +24 -24
- data/rbi/anthropic/models/messages/batch_create_params.rbi +26 -28
- data/rbi/anthropic/models/model.rbi +0 -11
- data/rbi/anthropic/models/server_tool_use_block.rbi +8 -3
- data/rbi/anthropic/models/server_tool_use_block_param.rbi +3 -3
- data/rbi/anthropic/models/stop_reason.rbi +0 -5
- data/rbi/anthropic/models/thinking_config_enabled.rbi +2 -2
- data/rbi/anthropic/models/thinking_config_param.rbi +1 -1
- data/rbi/anthropic/models/tool.rbi +3 -3
- data/rbi/anthropic/models/tool_use_block.rbi +8 -3
- data/rbi/anthropic/models/tool_use_block_param.rbi +3 -3
- data/rbi/anthropic/resources/beta/messages.rbi +51 -36
- data/rbi/anthropic/resources/beta/skills/versions.rbi +124 -0
- data/rbi/anthropic/resources/beta/skills.rbi +118 -0
- data/rbi/anthropic/resources/beta.rbi +3 -0
- data/rbi/anthropic/resources/completions.rbi +10 -12
- data/rbi/anthropic/resources/messages.rbi +31 -31
- data/sig/anthropic/internal/page_cursor.rbs +15 -0
- data/sig/anthropic/internal/token_page.rbs +15 -0
- data/sig/anthropic/models/anthropic_beta.rbs +2 -0
- data/sig/anthropic/models/beta/beta_all_thinking_turns.rbs +17 -0
- data/sig/anthropic/models/beta/beta_clear_thinking_20251015_edit.rbs +44 -0
- data/sig/anthropic/models/beta/beta_clear_thinking_20251015_edit_response.rbs +34 -0
- data/sig/anthropic/models/beta/beta_container.rbs +18 -3
- data/sig/anthropic/models/beta/beta_container_params.rbs +26 -0
- data/sig/anthropic/models/beta/beta_context_management_config.rbs +18 -6
- data/sig/anthropic/models/beta/beta_context_management_response.rbs +14 -4
- data/sig/anthropic/models/beta/beta_mcp_tool_use_block.rbs +4 -4
- data/sig/anthropic/models/beta/beta_mcp_tool_use_block_param.rbs +4 -4
- data/sig/anthropic/models/beta/beta_server_tool_use_block.rbs +4 -4
- data/sig/anthropic/models/beta/beta_server_tool_use_block_param.rbs +4 -4
- data/sig/anthropic/models/beta/beta_skill.rbs +45 -0
- data/sig/anthropic/models/beta/beta_skill_params.rbs +47 -0
- data/sig/anthropic/models/beta/beta_thinking_turns.rbs +19 -0
- data/sig/anthropic/models/beta/beta_tool.rbs +8 -4
- data/sig/anthropic/models/beta/beta_tool_use_block.rbs +9 -4
- data/sig/anthropic/models/beta/beta_tool_use_block_param.rbs +4 -4
- data/sig/anthropic/models/beta/message_create_params.rbs +12 -4
- data/sig/anthropic/models/beta/messages/batch_create_params.rbs +12 -4
- data/sig/anthropic/models/beta/skill_create_params.rbs +42 -0
- data/sig/anthropic/models/beta/skill_create_response.rbs +52 -0
- data/sig/anthropic/models/beta/skill_delete_params.rbs +30 -0
- data/sig/anthropic/models/beta/skill_delete_response.rbs +17 -0
- data/sig/anthropic/models/beta/skill_list_params.rbs +49 -0
- data/sig/anthropic/models/beta/skill_list_response.rbs +52 -0
- data/sig/anthropic/models/beta/skill_retrieve_params.rbs +30 -0
- data/sig/anthropic/models/beta/skill_retrieve_response.rbs +52 -0
- data/sig/anthropic/models/beta/skills/version_create_params.rbs +39 -0
- data/sig/anthropic/models/beta/skills/version_create_response.rbs +59 -0
- data/sig/anthropic/models/beta/skills/version_delete_params.rbs +39 -0
- data/sig/anthropic/models/beta/skills/version_delete_response.rbs +19 -0
- data/sig/anthropic/models/beta/skills/version_list_params.rbs +44 -0
- data/sig/anthropic/models/beta/skills/version_list_response.rbs +59 -0
- data/sig/anthropic/models/beta/skills/version_retrieve_params.rbs +39 -0
- data/sig/anthropic/models/beta/skills/version_retrieve_response.rbs +59 -0
- data/sig/anthropic/models/model.rbs +0 -11
- data/sig/anthropic/models/server_tool_use_block.rbs +9 -4
- data/sig/anthropic/models/server_tool_use_block_param.rbs +4 -4
- data/sig/anthropic/models/stop_reason.rbs +0 -2
- data/sig/anthropic/models/tool.rbs +8 -4
- data/sig/anthropic/models/tool_use_block.rbs +9 -4
- data/sig/anthropic/models/tool_use_block_param.rbs +4 -4
- data/sig/anthropic/resources/beta/messages.rbs +2 -2
- data/sig/anthropic/resources/beta/skills/versions.rbs +40 -0
- data/sig/anthropic/resources/beta/skills.rbs +38 -0
- data/sig/anthropic/resources/beta.rbs +2 -0
- metadata +83 -2
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
BetaThinkingTurns = Beta::BetaThinkingTurns
|
|
6
|
+
|
|
7
|
+
module Beta
|
|
8
|
+
class BetaThinkingTurns < Anthropic::Internal::Type::BaseModel
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
Anthropic::Beta::BetaThinkingTurns,
|
|
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: :thinking_turns)
|
|
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
|
|
@@ -118,7 +118,7 @@ module Anthropic
|
|
|
118
118
|
sig { returns(Symbol) }
|
|
119
119
|
attr_accessor :type
|
|
120
120
|
|
|
121
|
-
sig { returns(T.nilable(T.anything)) }
|
|
121
|
+
sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
|
|
122
122
|
attr_accessor :properties
|
|
123
123
|
|
|
124
124
|
sig { returns(T.nilable(T::Array[String])) }
|
|
@@ -130,7 +130,7 @@ module Anthropic
|
|
|
130
130
|
# will produce.
|
|
131
131
|
sig do
|
|
132
132
|
params(
|
|
133
|
-
properties: T.nilable(T.anything),
|
|
133
|
+
properties: T.nilable(T::Hash[Symbol, T.anything]),
|
|
134
134
|
required: T.nilable(T::Array[String]),
|
|
135
135
|
type: Symbol
|
|
136
136
|
).returns(T.attached_class)
|
|
@@ -142,7 +142,7 @@ module Anthropic
|
|
|
142
142
|
override.returns(
|
|
143
143
|
{
|
|
144
144
|
type: Symbol,
|
|
145
|
-
properties: T.nilable(T.anything),
|
|
145
|
+
properties: T.nilable(T::Hash[Symbol, T.anything]),
|
|
146
146
|
required: T.nilable(T::Array[String])
|
|
147
147
|
}
|
|
148
148
|
)
|
|
@@ -17,7 +17,7 @@ module Anthropic
|
|
|
17
17
|
sig { returns(String) }
|
|
18
18
|
attr_accessor :id
|
|
19
19
|
|
|
20
|
-
sig { returns(T.anything) }
|
|
20
|
+
sig { returns(T::Hash[Symbol, T.anything]) }
|
|
21
21
|
attr_accessor :input
|
|
22
22
|
|
|
23
23
|
sig { returns(String) }
|
|
@@ -29,7 +29,7 @@ module Anthropic
|
|
|
29
29
|
sig do
|
|
30
30
|
params(
|
|
31
31
|
id: String,
|
|
32
|
-
input: T.anything,
|
|
32
|
+
input: T::Hash[Symbol, T.anything],
|
|
33
33
|
name: String,
|
|
34
34
|
type: Symbol
|
|
35
35
|
).returns(T.attached_class)
|
|
@@ -39,7 +39,12 @@ module Anthropic
|
|
|
39
39
|
|
|
40
40
|
sig do
|
|
41
41
|
override.returns(
|
|
42
|
-
{
|
|
42
|
+
{
|
|
43
|
+
id: String,
|
|
44
|
+
input: T::Hash[Symbol, T.anything],
|
|
45
|
+
name: String,
|
|
46
|
+
type: Symbol
|
|
47
|
+
}
|
|
43
48
|
)
|
|
44
49
|
end
|
|
45
50
|
def to_hash
|
|
@@ -17,7 +17,7 @@ module Anthropic
|
|
|
17
17
|
sig { returns(String) }
|
|
18
18
|
attr_accessor :id
|
|
19
19
|
|
|
20
|
-
sig { returns(T.anything) }
|
|
20
|
+
sig { returns(T::Hash[Symbol, T.anything]) }
|
|
21
21
|
attr_accessor :input
|
|
22
22
|
|
|
23
23
|
sig { returns(String) }
|
|
@@ -41,7 +41,7 @@ module Anthropic
|
|
|
41
41
|
sig do
|
|
42
42
|
params(
|
|
43
43
|
id: String,
|
|
44
|
-
input: T.anything,
|
|
44
|
+
input: T::Hash[Symbol, T.anything],
|
|
45
45
|
name: String,
|
|
46
46
|
cache_control:
|
|
47
47
|
T.nilable(Anthropic::Beta::BetaCacheControlEphemeral::OrHash),
|
|
@@ -62,7 +62,7 @@ module Anthropic
|
|
|
62
62
|
override.returns(
|
|
63
63
|
{
|
|
64
64
|
id: String,
|
|
65
|
-
input: T.anything,
|
|
65
|
+
input: T::Hash[Symbol, T.anything],
|
|
66
66
|
name: String,
|
|
67
67
|
type: Symbol,
|
|
68
68
|
cache_control:
|
|
@@ -72,12 +72,12 @@ module Anthropic
|
|
|
72
72
|
# { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
|
|
73
73
|
# ```
|
|
74
74
|
#
|
|
75
|
-
# See [input examples](https://docs.
|
|
75
|
+
# See [input examples](https://docs.claude.com/en/api/messages-examples).
|
|
76
76
|
#
|
|
77
77
|
# Note that if you want to include a
|
|
78
|
-
# [system prompt](https://docs.
|
|
79
|
-
#
|
|
80
|
-
#
|
|
78
|
+
# [system prompt](https://docs.claude.com/en/docs/system-prompts), you can use the
|
|
79
|
+
# top-level `system` parameter — there is no `"system"` role for input messages in
|
|
80
|
+
# the Messages API.
|
|
81
81
|
#
|
|
82
82
|
# There is a limit of 100,000 messages in a single request.
|
|
83
83
|
sig { returns(T::Array[Anthropic::Beta::BetaMessageParam]) }
|
|
@@ -89,7 +89,10 @@ module Anthropic
|
|
|
89
89
|
sig { returns(T.any(Anthropic::Model::OrSymbol, String)) }
|
|
90
90
|
attr_accessor :model
|
|
91
91
|
|
|
92
|
-
#
|
|
92
|
+
# Context management configuration.
|
|
93
|
+
#
|
|
94
|
+
# This allows you to control how Claude manages context across multiple requests,
|
|
95
|
+
# such as whether to clear function results or not.
|
|
93
96
|
sig { returns(T.nilable(Anthropic::Beta::BetaContextManagementConfig)) }
|
|
94
97
|
attr_reader :context_management
|
|
95
98
|
|
|
@@ -125,7 +128,7 @@ module Anthropic
|
|
|
125
128
|
#
|
|
126
129
|
# A system prompt is a way of providing context and instructions to Claude, such
|
|
127
130
|
# as specifying a particular goal or role. See our
|
|
128
|
-
# [guide to system prompts](https://docs.
|
|
131
|
+
# [guide to system prompts](https://docs.claude.com/en/docs/system-prompts).
|
|
129
132
|
sig do
|
|
130
133
|
returns(
|
|
131
134
|
T.nilable(
|
|
@@ -149,7 +152,7 @@ module Anthropic
|
|
|
149
152
|
# tokens and counts towards your `max_tokens` limit.
|
|
150
153
|
#
|
|
151
154
|
# See
|
|
152
|
-
# [extended thinking](https://docs.
|
|
155
|
+
# [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking)
|
|
153
156
|
# for details.
|
|
154
157
|
sig do
|
|
155
158
|
returns(
|
|
@@ -212,9 +215,9 @@ module Anthropic
|
|
|
212
215
|
#
|
|
213
216
|
# There are two types of tools: **client tools** and **server tools**. The
|
|
214
217
|
# behavior described below applies to client tools. For
|
|
215
|
-
# [server tools](https://docs.
|
|
218
|
+
# [server tools](https://docs.claude.com/en/docs/agents-and-tools/tool-use/overview#server-tools),
|
|
216
219
|
# see their individual documentation as each has its own behavior (e.g., the
|
|
217
|
-
# [web search tool](https://docs.
|
|
220
|
+
# [web search tool](https://docs.claude.com/en/docs/agents-and-tools/tool-use/web-search-tool)).
|
|
218
221
|
#
|
|
219
222
|
# Each tool definition includes:
|
|
220
223
|
#
|
|
@@ -277,7 +280,7 @@ module Anthropic
|
|
|
277
280
|
# functions, or more generally whenever you want the model to produce a particular
|
|
278
281
|
# JSON structure of output.
|
|
279
282
|
#
|
|
280
|
-
# See our [guide](https://docs.
|
|
283
|
+
# See our [guide](https://docs.claude.com/en/docs/tool-use) for more details.
|
|
281
284
|
sig do
|
|
282
285
|
returns(
|
|
283
286
|
T.nilable(
|
|
@@ -451,12 +454,12 @@ module Anthropic
|
|
|
451
454
|
# { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
|
|
452
455
|
# ```
|
|
453
456
|
#
|
|
454
|
-
# See [input examples](https://docs.
|
|
457
|
+
# See [input examples](https://docs.claude.com/en/api/messages-examples).
|
|
455
458
|
#
|
|
456
459
|
# Note that if you want to include a
|
|
457
|
-
# [system prompt](https://docs.
|
|
458
|
-
#
|
|
459
|
-
#
|
|
460
|
+
# [system prompt](https://docs.claude.com/en/docs/system-prompts), you can use the
|
|
461
|
+
# top-level `system` parameter — there is no `"system"` role for input messages in
|
|
462
|
+
# the Messages API.
|
|
460
463
|
#
|
|
461
464
|
# There is a limit of 100,000 messages in a single request.
|
|
462
465
|
messages:,
|
|
@@ -464,7 +467,10 @@ module Anthropic
|
|
|
464
467
|
# [models](https://docs.anthropic.com/en/docs/models-overview) for additional
|
|
465
468
|
# details and options.
|
|
466
469
|
model:,
|
|
467
|
-
#
|
|
470
|
+
# Context management configuration.
|
|
471
|
+
#
|
|
472
|
+
# This allows you to control how Claude manages context across multiple requests,
|
|
473
|
+
# such as whether to clear function results or not.
|
|
468
474
|
context_management: nil,
|
|
469
475
|
# MCP servers to be utilized in this request
|
|
470
476
|
mcp_servers: nil,
|
|
@@ -472,7 +478,7 @@ module Anthropic
|
|
|
472
478
|
#
|
|
473
479
|
# A system prompt is a way of providing context and instructions to Claude, such
|
|
474
480
|
# as specifying a particular goal or role. See our
|
|
475
|
-
# [guide to system prompts](https://docs.
|
|
481
|
+
# [guide to system prompts](https://docs.claude.com/en/docs/system-prompts).
|
|
476
482
|
system_: nil,
|
|
477
483
|
# Configuration for enabling Claude's extended thinking.
|
|
478
484
|
#
|
|
@@ -481,7 +487,7 @@ module Anthropic
|
|
|
481
487
|
# tokens and counts towards your `max_tokens` limit.
|
|
482
488
|
#
|
|
483
489
|
# See
|
|
484
|
-
# [extended thinking](https://docs.
|
|
490
|
+
# [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking)
|
|
485
491
|
# for details.
|
|
486
492
|
thinking: nil,
|
|
487
493
|
# How the model should use the provided tools. The model can use a specific tool,
|
|
@@ -496,9 +502,9 @@ module Anthropic
|
|
|
496
502
|
#
|
|
497
503
|
# There are two types of tools: **client tools** and **server tools**. The
|
|
498
504
|
# behavior described below applies to client tools. For
|
|
499
|
-
# [server tools](https://docs.
|
|
505
|
+
# [server tools](https://docs.claude.com/en/docs/agents-and-tools/tool-use/overview#server-tools),
|
|
500
506
|
# see their individual documentation as each has its own behavior (e.g., the
|
|
501
|
-
# [web search tool](https://docs.
|
|
507
|
+
# [web search tool](https://docs.claude.com/en/docs/agents-and-tools/tool-use/web-search-tool)).
|
|
502
508
|
#
|
|
503
509
|
# Each tool definition includes:
|
|
504
510
|
#
|
|
@@ -561,7 +567,7 @@ module Anthropic
|
|
|
561
567
|
# functions, or more generally whenever you want the model to produce a particular
|
|
562
568
|
# JSON structure of output.
|
|
563
569
|
#
|
|
564
|
-
# See our [guide](https://docs.
|
|
570
|
+
# See our [guide](https://docs.claude.com/en/docs/tool-use) for more details.
|
|
565
571
|
tools: nil,
|
|
566
572
|
# Optional header to specify the beta version(s) you want to use.
|
|
567
573
|
betas: nil,
|
|
@@ -624,7 +630,7 @@ module Anthropic
|
|
|
624
630
|
#
|
|
625
631
|
# A system prompt is a way of providing context and instructions to Claude, such
|
|
626
632
|
# as specifying a particular goal or role. See our
|
|
627
|
-
# [guide to system prompts](https://docs.
|
|
633
|
+
# [guide to system prompts](https://docs.claude.com/en/docs/system-prompts).
|
|
628
634
|
module System
|
|
629
635
|
extend Anthropic::Internal::Type::Union
|
|
630
636
|
|
|
@@ -21,7 +21,7 @@ module Anthropic
|
|
|
21
21
|
# only specifies the absolute maximum number of tokens to generate.
|
|
22
22
|
#
|
|
23
23
|
# Different models have different maximum values for this parameter. See
|
|
24
|
-
# [models](https://docs.
|
|
24
|
+
# [models](https://docs.claude.com/en/docs/models-overview) for details.
|
|
25
25
|
sig { returns(Integer) }
|
|
26
26
|
attr_accessor :max_tokens
|
|
27
27
|
|
|
@@ -82,12 +82,12 @@ module Anthropic
|
|
|
82
82
|
# { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
|
|
83
83
|
# ```
|
|
84
84
|
#
|
|
85
|
-
# See [input examples](https://docs.
|
|
85
|
+
# See [input examples](https://docs.claude.com/en/api/messages-examples).
|
|
86
86
|
#
|
|
87
87
|
# Note that if you want to include a
|
|
88
|
-
# [system prompt](https://docs.
|
|
89
|
-
#
|
|
90
|
-
#
|
|
88
|
+
# [system prompt](https://docs.claude.com/en/docs/system-prompts), you can use the
|
|
89
|
+
# top-level `system` parameter — there is no `"system"` role for input messages in
|
|
90
|
+
# the Messages API.
|
|
91
91
|
#
|
|
92
92
|
# There is a limit of 100,000 messages in a single request.
|
|
93
93
|
sig { returns(T::Array[Anthropic::Beta::BetaMessageParam]) }
|
|
@@ -100,10 +100,17 @@ module Anthropic
|
|
|
100
100
|
attr_accessor :model
|
|
101
101
|
|
|
102
102
|
# Container identifier for reuse across requests.
|
|
103
|
-
sig
|
|
103
|
+
sig do
|
|
104
|
+
returns(
|
|
105
|
+
T.nilable(T.any(Anthropic::Beta::BetaContainerParams, String))
|
|
106
|
+
)
|
|
107
|
+
end
|
|
104
108
|
attr_accessor :container
|
|
105
109
|
|
|
106
|
-
#
|
|
110
|
+
# Context management configuration.
|
|
111
|
+
#
|
|
112
|
+
# This allows you to control how Claude manages context across multiple requests,
|
|
113
|
+
# such as whether to clear function results or not.
|
|
107
114
|
sig { returns(T.nilable(Anthropic::Beta::BetaContextManagementConfig)) }
|
|
108
115
|
attr_reader :context_management
|
|
109
116
|
|
|
@@ -146,7 +153,7 @@ module Anthropic
|
|
|
146
153
|
# for this request.
|
|
147
154
|
#
|
|
148
155
|
# Anthropic offers different levels of service for your API requests. See
|
|
149
|
-
# [service-tiers](https://docs.
|
|
156
|
+
# [service-tiers](https://docs.claude.com/en/api/service-tiers) for details.
|
|
150
157
|
sig do
|
|
151
158
|
returns(
|
|
152
159
|
T.nilable(
|
|
@@ -183,7 +190,7 @@ module Anthropic
|
|
|
183
190
|
#
|
|
184
191
|
# A system prompt is a way of providing context and instructions to Claude, such
|
|
185
192
|
# as specifying a particular goal or role. See our
|
|
186
|
-
# [guide to system prompts](https://docs.
|
|
193
|
+
# [guide to system prompts](https://docs.claude.com/en/docs/system-prompts).
|
|
187
194
|
sig do
|
|
188
195
|
returns(
|
|
189
196
|
T.nilable(Anthropic::Beta::MessageCreateParams::System::Variants)
|
|
@@ -219,7 +226,7 @@ module Anthropic
|
|
|
219
226
|
# tokens and counts towards your `max_tokens` limit.
|
|
220
227
|
#
|
|
221
228
|
# See
|
|
222
|
-
# [extended thinking](https://docs.
|
|
229
|
+
# [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking)
|
|
223
230
|
# for details.
|
|
224
231
|
sig do
|
|
225
232
|
returns(
|
|
@@ -282,9 +289,9 @@ module Anthropic
|
|
|
282
289
|
#
|
|
283
290
|
# There are two types of tools: **client tools** and **server tools**. The
|
|
284
291
|
# behavior described below applies to client tools. For
|
|
285
|
-
# [server tools](https://docs.
|
|
292
|
+
# [server tools](https://docs.claude.com/en/docs/agents-and-tools/tool-use/overview#server-tools),
|
|
286
293
|
# see their individual documentation as each has its own behavior (e.g., the
|
|
287
|
-
# [web search tool](https://docs.
|
|
294
|
+
# [web search tool](https://docs.claude.com/en/docs/agents-and-tools/tool-use/web-search-tool)).
|
|
288
295
|
#
|
|
289
296
|
# Each tool definition includes:
|
|
290
297
|
#
|
|
@@ -347,7 +354,7 @@ module Anthropic
|
|
|
347
354
|
# functions, or more generally whenever you want the model to produce a particular
|
|
348
355
|
# JSON structure of output.
|
|
349
356
|
#
|
|
350
|
-
# See our [guide](https://docs.
|
|
357
|
+
# See our [guide](https://docs.claude.com/en/docs/tool-use) for more details.
|
|
351
358
|
sig do
|
|
352
359
|
returns(
|
|
353
360
|
T.nilable(
|
|
@@ -449,7 +456,10 @@ module Anthropic
|
|
|
449
456
|
max_tokens: Integer,
|
|
450
457
|
messages: T::Array[Anthropic::Beta::BetaMessageParam::OrHash],
|
|
451
458
|
model: T.any(Anthropic::Model::OrSymbol, String),
|
|
452
|
-
container:
|
|
459
|
+
container:
|
|
460
|
+
T.nilable(
|
|
461
|
+
T.any(Anthropic::Beta::BetaContainerParams::OrHash, String)
|
|
462
|
+
),
|
|
453
463
|
context_management:
|
|
454
464
|
T.nilable(Anthropic::Beta::BetaContextManagementConfig::OrHash),
|
|
455
465
|
mcp_servers:
|
|
@@ -506,7 +516,7 @@ module Anthropic
|
|
|
506
516
|
# only specifies the absolute maximum number of tokens to generate.
|
|
507
517
|
#
|
|
508
518
|
# Different models have different maximum values for this parameter. See
|
|
509
|
-
# [models](https://docs.
|
|
519
|
+
# [models](https://docs.claude.com/en/docs/models-overview) for details.
|
|
510
520
|
max_tokens:,
|
|
511
521
|
# Input messages.
|
|
512
522
|
#
|
|
@@ -565,12 +575,12 @@ module Anthropic
|
|
|
565
575
|
# { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
|
|
566
576
|
# ```
|
|
567
577
|
#
|
|
568
|
-
# See [input examples](https://docs.
|
|
578
|
+
# See [input examples](https://docs.claude.com/en/api/messages-examples).
|
|
569
579
|
#
|
|
570
580
|
# Note that if you want to include a
|
|
571
|
-
# [system prompt](https://docs.
|
|
572
|
-
#
|
|
573
|
-
#
|
|
581
|
+
# [system prompt](https://docs.claude.com/en/docs/system-prompts), you can use the
|
|
582
|
+
# top-level `system` parameter — there is no `"system"` role for input messages in
|
|
583
|
+
# the Messages API.
|
|
574
584
|
#
|
|
575
585
|
# There is a limit of 100,000 messages in a single request.
|
|
576
586
|
messages:,
|
|
@@ -580,7 +590,10 @@ module Anthropic
|
|
|
580
590
|
model:,
|
|
581
591
|
# Container identifier for reuse across requests.
|
|
582
592
|
container: nil,
|
|
583
|
-
#
|
|
593
|
+
# Context management configuration.
|
|
594
|
+
#
|
|
595
|
+
# This allows you to control how Claude manages context across multiple requests,
|
|
596
|
+
# such as whether to clear function results or not.
|
|
584
597
|
context_management: nil,
|
|
585
598
|
# MCP servers to be utilized in this request
|
|
586
599
|
mcp_servers: nil,
|
|
@@ -590,7 +603,7 @@ module Anthropic
|
|
|
590
603
|
# for this request.
|
|
591
604
|
#
|
|
592
605
|
# Anthropic offers different levels of service for your API requests. See
|
|
593
|
-
# [service-tiers](https://docs.
|
|
606
|
+
# [service-tiers](https://docs.claude.com/en/api/service-tiers) for details.
|
|
594
607
|
service_tier: nil,
|
|
595
608
|
# Custom text sequences that will cause the model to stop generating.
|
|
596
609
|
#
|
|
@@ -606,7 +619,7 @@ module Anthropic
|
|
|
606
619
|
#
|
|
607
620
|
# A system prompt is a way of providing context and instructions to Claude, such
|
|
608
621
|
# as specifying a particular goal or role. See our
|
|
609
|
-
# [guide to system prompts](https://docs.
|
|
622
|
+
# [guide to system prompts](https://docs.claude.com/en/docs/system-prompts).
|
|
610
623
|
system_: nil,
|
|
611
624
|
# Amount of randomness injected into the response.
|
|
612
625
|
#
|
|
@@ -624,7 +637,7 @@ module Anthropic
|
|
|
624
637
|
# tokens and counts towards your `max_tokens` limit.
|
|
625
638
|
#
|
|
626
639
|
# See
|
|
627
|
-
# [extended thinking](https://docs.
|
|
640
|
+
# [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking)
|
|
628
641
|
# for details.
|
|
629
642
|
thinking: nil,
|
|
630
643
|
# How the model should use the provided tools. The model can use a specific tool,
|
|
@@ -639,9 +652,9 @@ module Anthropic
|
|
|
639
652
|
#
|
|
640
653
|
# There are two types of tools: **client tools** and **server tools**. The
|
|
641
654
|
# behavior described below applies to client tools. For
|
|
642
|
-
# [server tools](https://docs.
|
|
655
|
+
# [server tools](https://docs.claude.com/en/docs/agents-and-tools/tool-use/overview#server-tools),
|
|
643
656
|
# see their individual documentation as each has its own behavior (e.g., the
|
|
644
|
-
# [web search tool](https://docs.
|
|
657
|
+
# [web search tool](https://docs.claude.com/en/docs/agents-and-tools/tool-use/web-search-tool)).
|
|
645
658
|
#
|
|
646
659
|
# Each tool definition includes:
|
|
647
660
|
#
|
|
@@ -704,7 +717,7 @@ module Anthropic
|
|
|
704
717
|
# functions, or more generally whenever you want the model to produce a particular
|
|
705
718
|
# JSON structure of output.
|
|
706
719
|
#
|
|
707
|
-
# See our [guide](https://docs.
|
|
720
|
+
# See our [guide](https://docs.claude.com/en/docs/tool-use) for more details.
|
|
708
721
|
tools: nil,
|
|
709
722
|
# Only sample from the top K options for each subsequent token.
|
|
710
723
|
#
|
|
@@ -736,7 +749,8 @@ module Anthropic
|
|
|
736
749
|
max_tokens: Integer,
|
|
737
750
|
messages: T::Array[Anthropic::Beta::BetaMessageParam],
|
|
738
751
|
model: T.any(Anthropic::Model::OrSymbol, String),
|
|
739
|
-
container:
|
|
752
|
+
container:
|
|
753
|
+
T.nilable(T.any(Anthropic::Beta::BetaContainerParams, String)),
|
|
740
754
|
context_management:
|
|
741
755
|
T.nilable(Anthropic::Beta::BetaContextManagementConfig),
|
|
742
756
|
mcp_servers:
|
|
@@ -789,11 +803,29 @@ module Anthropic
|
|
|
789
803
|
def to_hash
|
|
790
804
|
end
|
|
791
805
|
|
|
806
|
+
# Container identifier for reuse across requests.
|
|
807
|
+
module Container
|
|
808
|
+
extend Anthropic::Internal::Type::Union
|
|
809
|
+
|
|
810
|
+
Variants =
|
|
811
|
+
T.type_alias { T.any(Anthropic::Beta::BetaContainerParams, String) }
|
|
812
|
+
|
|
813
|
+
sig do
|
|
814
|
+
override.returns(
|
|
815
|
+
T::Array[
|
|
816
|
+
Anthropic::Beta::MessageCreateParams::Container::Variants
|
|
817
|
+
]
|
|
818
|
+
)
|
|
819
|
+
end
|
|
820
|
+
def self.variants
|
|
821
|
+
end
|
|
822
|
+
end
|
|
823
|
+
|
|
792
824
|
# Determines whether to use priority capacity (if available) or standard capacity
|
|
793
825
|
# for this request.
|
|
794
826
|
#
|
|
795
827
|
# Anthropic offers different levels of service for your API requests. See
|
|
796
|
-
# [service-tiers](https://docs.
|
|
828
|
+
# [service-tiers](https://docs.claude.com/en/api/service-tiers) for details.
|
|
797
829
|
module ServiceTier
|
|
798
830
|
extend Anthropic::Internal::Type::Enum
|
|
799
831
|
|
|
@@ -829,7 +861,7 @@ module Anthropic
|
|
|
829
861
|
#
|
|
830
862
|
# A system prompt is a way of providing context and instructions to Claude, such
|
|
831
863
|
# as specifying a particular goal or role. See our
|
|
832
|
-
# [guide to system prompts](https://docs.
|
|
864
|
+
# [guide to system prompts](https://docs.claude.com/en/docs/system-prompts).
|
|
833
865
|
module System
|
|
834
866
|
extend Anthropic::Internal::Type::Union
|
|
835
867
|
|