anthropic 1.11.0 → 1.12.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 +8 -0
- data/README.md +1 -1
- data/lib/anthropic/internal/page_cursor.rb +92 -0
- data/lib/anthropic/internal/token_page.rb +92 -0
- data/lib/anthropic/models/anthropic_beta.rb +3 -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 +0 -2
- data/lib/anthropic/models/beta/beta_context_management_response.rb +0 -2
- 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_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/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/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/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 +23 -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_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 +0 -1
- data/rbi/anthropic/models/beta/beta_context_management_response.rbi +0 -1
- 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_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/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/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/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_container.rbs +18 -3
- data/sig/anthropic/models/beta/beta_container_params.rbs +26 -0
- 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/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/stop_reason.rbs +0 -2
- 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 +71 -2
@@ -16,7 +16,7 @@ module Anthropic
|
|
16
16
|
# only specifies the absolute maximum number of tokens to generate.
|
17
17
|
#
|
18
18
|
# Different models have different maximum values for this parameter. See
|
19
|
-
# [models](https://docs.
|
19
|
+
# [models](https://docs.claude.com/en/docs/models-overview) for details.
|
20
20
|
#
|
21
21
|
# @return [Integer]
|
22
22
|
required :max_tokens, Integer
|
@@ -79,12 +79,12 @@ module Anthropic
|
|
79
79
|
# { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
|
80
80
|
# ```
|
81
81
|
#
|
82
|
-
# See [input examples](https://docs.
|
82
|
+
# See [input examples](https://docs.claude.com/en/api/messages-examples).
|
83
83
|
#
|
84
84
|
# Note that if you want to include a
|
85
|
-
# [system prompt](https://docs.
|
86
|
-
#
|
87
|
-
#
|
85
|
+
# [system prompt](https://docs.claude.com/en/docs/system-prompts), you can use the
|
86
|
+
# top-level `system` parameter — there is no `"system"` role for input messages in
|
87
|
+
# the Messages API.
|
88
88
|
#
|
89
89
|
# There is a limit of 100,000 messages in a single request.
|
90
90
|
#
|
@@ -110,7 +110,7 @@ module Anthropic
|
|
110
110
|
# for this request.
|
111
111
|
#
|
112
112
|
# Anthropic offers different levels of service for your API requests. See
|
113
|
-
# [service-tiers](https://docs.
|
113
|
+
# [service-tiers](https://docs.claude.com/en/api/service-tiers) for details.
|
114
114
|
#
|
115
115
|
# @return [Symbol, Anthropic::Models::MessageCreateParams::ServiceTier, nil]
|
116
116
|
optional :service_tier, enum: -> { Anthropic::MessageCreateParams::ServiceTier }
|
@@ -134,7 +134,7 @@ module Anthropic
|
|
134
134
|
#
|
135
135
|
# A system prompt is a way of providing context and instructions to Claude, such
|
136
136
|
# as specifying a particular goal or role. See our
|
137
|
-
# [guide to system prompts](https://docs.
|
137
|
+
# [guide to system prompts](https://docs.claude.com/en/docs/system-prompts).
|
138
138
|
#
|
139
139
|
# @return [String, Array<Anthropic::Models::TextBlockParam>, nil]
|
140
140
|
optional :system_, union: -> { Anthropic::MessageCreateParams::System }, api_name: :system
|
@@ -160,7 +160,7 @@ module Anthropic
|
|
160
160
|
# tokens and counts towards your `max_tokens` limit.
|
161
161
|
#
|
162
162
|
# See
|
163
|
-
# [extended thinking](https://docs.
|
163
|
+
# [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking)
|
164
164
|
# for details.
|
165
165
|
#
|
166
166
|
# @return [Anthropic::Models::ThinkingConfigEnabled, Anthropic::Models::ThinkingConfigDisabled, nil]
|
@@ -183,9 +183,9 @@ module Anthropic
|
|
183
183
|
#
|
184
184
|
# There are two types of tools: **client tools** and **server tools**. The
|
185
185
|
# behavior described below applies to client tools. For
|
186
|
-
# [server tools](https://docs.
|
186
|
+
# [server tools](https://docs.claude.com/en/docs/agents-and-tools/tool-use/overview#server-tools),
|
187
187
|
# see their individual documentation as each has its own behavior (e.g., the
|
188
|
-
# [web search tool](https://docs.
|
188
|
+
# [web search tool](https://docs.claude.com/en/docs/agents-and-tools/tool-use/web-search-tool)).
|
189
189
|
#
|
190
190
|
# Each tool definition includes:
|
191
191
|
#
|
@@ -248,7 +248,7 @@ module Anthropic
|
|
248
248
|
# functions, or more generally whenever you want the model to produce a particular
|
249
249
|
# JSON structure of output.
|
250
250
|
#
|
251
|
-
# See our [guide](https://docs.
|
251
|
+
# See our [guide](https://docs.claude.com/en/docs/tool-use) for more details.
|
252
252
|
#
|
253
253
|
# @return [Array<Anthropic::Models::Tool, Anthropic::Models::ToolBash20250124, Anthropic::Models::ToolTextEditor20250124, Anthropic::Models::ToolTextEditor20250429, Anthropic::Models::ToolTextEditor20250728, Anthropic::Models::WebSearchTool20250305>, nil]
|
254
254
|
optional :tools, -> { Anthropic::Internal::Type::ArrayOf[union: Anthropic::ToolUnion] }
|
@@ -315,7 +315,7 @@ module Anthropic
|
|
315
315
|
# for this request.
|
316
316
|
#
|
317
317
|
# Anthropic offers different levels of service for your API requests. See
|
318
|
-
# [service-tiers](https://docs.
|
318
|
+
# [service-tiers](https://docs.claude.com/en/api/service-tiers) for details.
|
319
319
|
module ServiceTier
|
320
320
|
extend Anthropic::Internal::Type::Enum
|
321
321
|
|
@@ -330,7 +330,7 @@ module Anthropic
|
|
330
330
|
#
|
331
331
|
# A system prompt is a way of providing context and instructions to Claude, such
|
332
332
|
# as specifying a particular goal or role. See our
|
333
|
-
# [guide to system prompts](https://docs.
|
333
|
+
# [guide to system prompts](https://docs.claude.com/en/docs/system-prompts).
|
334
334
|
module System
|
335
335
|
extend Anthropic::Internal::Type::Union
|
336
336
|
|
@@ -60,7 +60,7 @@ module Anthropic
|
|
60
60
|
# only specifies the absolute maximum number of tokens to generate.
|
61
61
|
#
|
62
62
|
# Different models have different maximum values for this parameter. See
|
63
|
-
# [models](https://docs.
|
63
|
+
# [models](https://docs.claude.com/en/docs/models-overview) for details.
|
64
64
|
#
|
65
65
|
# @return [Integer]
|
66
66
|
required :max_tokens, Integer
|
@@ -123,12 +123,12 @@ module Anthropic
|
|
123
123
|
# { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
|
124
124
|
# ```
|
125
125
|
#
|
126
|
-
# See [input examples](https://docs.
|
126
|
+
# See [input examples](https://docs.claude.com/en/api/messages-examples).
|
127
127
|
#
|
128
128
|
# Note that if you want to include a
|
129
|
-
# [system prompt](https://docs.
|
130
|
-
#
|
131
|
-
#
|
129
|
+
# [system prompt](https://docs.claude.com/en/docs/system-prompts), you can use the
|
130
|
+
# top-level `system` parameter — there is no `"system"` role for input messages in
|
131
|
+
# the Messages API.
|
132
132
|
#
|
133
133
|
# There is a limit of 100,000 messages in a single request.
|
134
134
|
#
|
@@ -154,7 +154,7 @@ module Anthropic
|
|
154
154
|
# for this request.
|
155
155
|
#
|
156
156
|
# Anthropic offers different levels of service for your API requests. See
|
157
|
-
# [service-tiers](https://docs.
|
157
|
+
# [service-tiers](https://docs.claude.com/en/api/service-tiers) for details.
|
158
158
|
#
|
159
159
|
# @return [Symbol, Anthropic::Models::Messages::BatchCreateParams::Request::Params::ServiceTier, nil]
|
160
160
|
optional :service_tier, enum: -> { Anthropic::Messages::BatchCreateParams::Request::Params::ServiceTier }
|
@@ -176,8 +176,7 @@ module Anthropic
|
|
176
176
|
# @!attribute stream
|
177
177
|
# Whether to incrementally stream the response using server-sent events.
|
178
178
|
#
|
179
|
-
# See [streaming](https://docs.
|
180
|
-
# details.
|
179
|
+
# See [streaming](https://docs.claude.com/en/api/messages-streaming) for details.
|
181
180
|
#
|
182
181
|
# @return [Boolean, nil]
|
183
182
|
optional :stream, Anthropic::Internal::Type::Boolean
|
@@ -187,7 +186,7 @@ module Anthropic
|
|
187
186
|
#
|
188
187
|
# A system prompt is a way of providing context and instructions to Claude, such
|
189
188
|
# as specifying a particular goal or role. See our
|
190
|
-
# [guide to system prompts](https://docs.
|
189
|
+
# [guide to system prompts](https://docs.claude.com/en/docs/system-prompts).
|
191
190
|
#
|
192
191
|
# @return [String, Array<Anthropic::Models::TextBlockParam>, nil]
|
193
192
|
optional :system_,
|
@@ -215,7 +214,7 @@ module Anthropic
|
|
215
214
|
# tokens and counts towards your `max_tokens` limit.
|
216
215
|
#
|
217
216
|
# See
|
218
|
-
# [extended thinking](https://docs.
|
217
|
+
# [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking)
|
219
218
|
# for details.
|
220
219
|
#
|
221
220
|
# @return [Anthropic::Models::ThinkingConfigEnabled, Anthropic::Models::ThinkingConfigDisabled, nil]
|
@@ -238,9 +237,9 @@ module Anthropic
|
|
238
237
|
#
|
239
238
|
# There are two types of tools: **client tools** and **server tools**. The
|
240
239
|
# behavior described below applies to client tools. For
|
241
|
-
# [server tools](https://docs.
|
240
|
+
# [server tools](https://docs.claude.com/en/docs/agents-and-tools/tool-use/overview#server-tools),
|
242
241
|
# see their individual documentation as each has its own behavior (e.g., the
|
243
|
-
# [web search tool](https://docs.
|
242
|
+
# [web search tool](https://docs.claude.com/en/docs/agents-and-tools/tool-use/web-search-tool)).
|
244
243
|
#
|
245
244
|
# Each tool definition includes:
|
246
245
|
#
|
@@ -303,7 +302,7 @@ module Anthropic
|
|
303
302
|
# functions, or more generally whenever you want the model to produce a particular
|
304
303
|
# JSON structure of output.
|
305
304
|
#
|
306
|
-
# See our [guide](https://docs.
|
305
|
+
# See our [guide](https://docs.claude.com/en/docs/tool-use) for more details.
|
307
306
|
#
|
308
307
|
# @return [Array<Anthropic::Models::Tool, Anthropic::Models::ToolBash20250124, Anthropic::Models::ToolTextEditor20250124, Anthropic::Models::ToolTextEditor20250429, Anthropic::Models::ToolTextEditor20250728, Anthropic::Models::WebSearchTool20250305>, nil]
|
309
308
|
optional :tools, -> { Anthropic::Internal::Type::ArrayOf[union: Anthropic::ToolUnion] }
|
@@ -376,7 +375,7 @@ module Anthropic
|
|
376
375
|
# for this request.
|
377
376
|
#
|
378
377
|
# Anthropic offers different levels of service for your API requests. See
|
379
|
-
# [service-tiers](https://docs.
|
378
|
+
# [service-tiers](https://docs.claude.com/en/api/service-tiers) for details.
|
380
379
|
#
|
381
380
|
# @see Anthropic::Models::Messages::BatchCreateParams::Request::Params#service_tier
|
382
381
|
module ServiceTier
|
@@ -393,7 +392,7 @@ module Anthropic
|
|
393
392
|
#
|
394
393
|
# A system prompt is a way of providing context and instructions to Claude, such
|
395
394
|
# as specifying a particular goal or role. See our
|
396
|
-
# [guide to system prompts](https://docs.
|
395
|
+
# [guide to system prompts](https://docs.claude.com/en/docs/system-prompts).
|
397
396
|
#
|
398
397
|
# @see Anthropic::Models::Messages::BatchCreateParams::Request::Params#system_
|
399
398
|
module System
|
@@ -11,7 +11,7 @@ module Anthropic
|
|
11
11
|
# Must be ≥1024 and less than `max_tokens`.
|
12
12
|
#
|
13
13
|
# See
|
14
|
-
# [extended thinking](https://docs.
|
14
|
+
# [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking)
|
15
15
|
# for details.
|
16
16
|
#
|
17
17
|
# @return [Integer]
|
@@ -9,7 +9,7 @@ module Anthropic
|
|
9
9
|
# tokens and counts towards your `max_tokens` limit.
|
10
10
|
#
|
11
11
|
# See
|
12
|
-
# [extended thinking](https://docs.
|
12
|
+
# [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking)
|
13
13
|
# for details.
|
14
14
|
module ThinkingConfigParam
|
15
15
|
extend Anthropic::Internal::Type::Union
|
@@ -28,9 +28,9 @@ module Anthropic
|
|
28
28
|
#
|
29
29
|
# @param model [Symbol, String, Anthropic::Models::Model] Body param: The model that will complete your prompt.\n\nSee [models](https://do
|
30
30
|
#
|
31
|
-
# @param container [String, nil] Body param: Container identifier for reuse across requests.
|
31
|
+
# @param container [Anthropic::Models::Beta::BetaContainerParams, String, nil] Body param: Container identifier for reuse across requests.
|
32
32
|
#
|
33
|
-
# @param context_management [Anthropic::Models::Beta::BetaContextManagementConfig, nil] Body param:
|
33
|
+
# @param context_management [Anthropic::Models::Beta::BetaContextManagementConfig, nil] Body param: Context management configuration.
|
34
34
|
#
|
35
35
|
# @param mcp_servers [Array<Anthropic::Models::Beta::BetaRequestMCPServerURLDefinition>] Body param: MCP servers to be utilized in this request
|
36
36
|
#
|
@@ -112,9 +112,9 @@ module Anthropic
|
|
112
112
|
#
|
113
113
|
# @param model [Symbol, String, Anthropic::Models::Model] Body param: The model that will complete your prompt.\n\nSee [models](https://do
|
114
114
|
#
|
115
|
-
# @param container [String, nil] Body param: Container identifier for reuse across requests.
|
115
|
+
# @param container [Anthropic::Models::Beta::BetaContainerParams, String, nil] Body param: Container identifier for reuse across requests.
|
116
116
|
#
|
117
|
-
# @param context_management [Anthropic::Models::Beta::BetaContextManagementConfig, nil] Body param:
|
117
|
+
# @param context_management [Anthropic::Models::Beta::BetaContextManagementConfig, nil] Body param: Context management configuration.
|
118
118
|
#
|
119
119
|
# @param mcp_servers [Array<Anthropic::Models::Beta::BetaRequestMCPServerURLDefinition>] Body param: MCP servers to be utilized in this request
|
120
120
|
#
|
@@ -255,7 +255,7 @@ module Anthropic
|
|
255
255
|
#
|
256
256
|
# @param model [Symbol, String, Anthropic::Models::Model] Body param: The model that will complete your prompt.\n\nSee [models](https://do
|
257
257
|
#
|
258
|
-
# @param context_management [Anthropic::Models::Beta::BetaContextManagementConfig, nil] Body param:
|
258
|
+
# @param context_management [Anthropic::Models::Beta::BetaContextManagementConfig, nil] Body param: Context management configuration.
|
259
259
|
#
|
260
260
|
# @param mcp_servers [Array<Anthropic::Models::Beta::BetaRequestMCPServerURLDefinition>] Body param: MCP servers to be utilized in this request
|
261
261
|
#
|
@@ -0,0 +1,154 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Anthropic
|
4
|
+
module Resources
|
5
|
+
class Beta
|
6
|
+
class Skills
|
7
|
+
class Versions
|
8
|
+
# Some parameter documentations has been truncated, see
|
9
|
+
# {Anthropic::Models::Beta::Skills::VersionCreateParams} for more details.
|
10
|
+
#
|
11
|
+
# Create Skill Version
|
12
|
+
#
|
13
|
+
# @overload create(skill_id, files: nil, betas: nil, request_options: {})
|
14
|
+
#
|
15
|
+
# @param skill_id [String] Path param: Unique identifier for the skill.
|
16
|
+
#
|
17
|
+
# @param files [Array<Pathname, StringIO, IO, String, Anthropic::FilePart>, nil] Body param: Files to upload for the skill.
|
18
|
+
#
|
19
|
+
# @param betas [Array<String, Symbol, Anthropic::Models::AnthropicBeta>] Header param: Optional header to specify the beta version(s) you want to use.
|
20
|
+
#
|
21
|
+
# @param request_options [Anthropic::RequestOptions, Hash{Symbol=>Object}, nil]
|
22
|
+
#
|
23
|
+
# @return [Anthropic::Models::Beta::Skills::VersionCreateResponse]
|
24
|
+
#
|
25
|
+
# @see Anthropic::Models::Beta::Skills::VersionCreateParams
|
26
|
+
def create(skill_id, params = {})
|
27
|
+
parsed, options = Anthropic::Beta::Skills::VersionCreateParams.dump_request(params)
|
28
|
+
header_params = {betas: "anthropic-beta"}
|
29
|
+
@client.request(
|
30
|
+
method: :post,
|
31
|
+
path: ["v1/skills/%1$s/versions?beta=true", skill_id],
|
32
|
+
headers: {
|
33
|
+
"content-type" => "multipart/form-data",
|
34
|
+
**parsed.slice(*header_params.keys)
|
35
|
+
}.transform_keys(
|
36
|
+
header_params
|
37
|
+
),
|
38
|
+
body: parsed.except(*header_params.keys),
|
39
|
+
model: Anthropic::Models::Beta::Skills::VersionCreateResponse,
|
40
|
+
options: {extra_headers: {"anthropic-beta" => "skills-2025-10-02"}, **options}
|
41
|
+
)
|
42
|
+
end
|
43
|
+
|
44
|
+
# Some parameter documentations has been truncated, see
|
45
|
+
# {Anthropic::Models::Beta::Skills::VersionRetrieveParams} for more details.
|
46
|
+
#
|
47
|
+
# Get Skill Version
|
48
|
+
#
|
49
|
+
# @overload retrieve(version, skill_id:, betas: nil, request_options: {})
|
50
|
+
#
|
51
|
+
# @param version [String] Path param: Version identifier for the skill.
|
52
|
+
#
|
53
|
+
# @param skill_id [String] Path param: Unique identifier for the skill.
|
54
|
+
#
|
55
|
+
# @param betas [Array<String, Symbol, Anthropic::Models::AnthropicBeta>] Header param: Optional header to specify the beta version(s) you want to use.
|
56
|
+
#
|
57
|
+
# @param request_options [Anthropic::RequestOptions, Hash{Symbol=>Object}, nil]
|
58
|
+
#
|
59
|
+
# @return [Anthropic::Models::Beta::Skills::VersionRetrieveResponse]
|
60
|
+
#
|
61
|
+
# @see Anthropic::Models::Beta::Skills::VersionRetrieveParams
|
62
|
+
def retrieve(version, params)
|
63
|
+
parsed, options = Anthropic::Beta::Skills::VersionRetrieveParams.dump_request(params)
|
64
|
+
skill_id =
|
65
|
+
parsed.delete(:skill_id) do
|
66
|
+
raise ArgumentError.new("missing required path argument #{_1}")
|
67
|
+
end
|
68
|
+
@client.request(
|
69
|
+
method: :get,
|
70
|
+
path: ["v1/skills/%1$s/versions/%2$s?beta=true", skill_id, version],
|
71
|
+
headers: parsed.transform_keys(betas: "anthropic-beta"),
|
72
|
+
model: Anthropic::Models::Beta::Skills::VersionRetrieveResponse,
|
73
|
+
options: {extra_headers: {"anthropic-beta" => "skills-2025-10-02"}, **options}
|
74
|
+
)
|
75
|
+
end
|
76
|
+
|
77
|
+
# Some parameter documentations has been truncated, see
|
78
|
+
# {Anthropic::Models::Beta::Skills::VersionListParams} for more details.
|
79
|
+
#
|
80
|
+
# List Skill Versions
|
81
|
+
#
|
82
|
+
# @overload list(skill_id, limit: nil, page: nil, betas: nil, request_options: {})
|
83
|
+
#
|
84
|
+
# @param skill_id [String] Path param: Unique identifier for the skill.
|
85
|
+
#
|
86
|
+
# @param limit [Integer, nil] Query param: Number of items to return per page.
|
87
|
+
#
|
88
|
+
# @param page [String, nil] Query param: Optionally set to the `next_page` token from the previous response.
|
89
|
+
#
|
90
|
+
# @param betas [Array<String, Symbol, Anthropic::Models::AnthropicBeta>] Header param: Optional header to specify the beta version(s) you want to use.
|
91
|
+
#
|
92
|
+
# @param request_options [Anthropic::RequestOptions, Hash{Symbol=>Object}, nil]
|
93
|
+
#
|
94
|
+
# @return [Anthropic::Internal::PageCursor<Anthropic::Models::Beta::Skills::VersionListResponse>]
|
95
|
+
#
|
96
|
+
# @see Anthropic::Models::Beta::Skills::VersionListParams
|
97
|
+
def list(skill_id, params = {})
|
98
|
+
parsed, options = Anthropic::Beta::Skills::VersionListParams.dump_request(params)
|
99
|
+
query_params = [:limit, :page]
|
100
|
+
@client.request(
|
101
|
+
method: :get,
|
102
|
+
path: ["v1/skills/%1$s/versions?beta=true", skill_id],
|
103
|
+
query: parsed.slice(*query_params),
|
104
|
+
headers: parsed.except(*query_params).transform_keys(betas: "anthropic-beta"),
|
105
|
+
page: Anthropic::Internal::PageCursor,
|
106
|
+
model: Anthropic::Models::Beta::Skills::VersionListResponse,
|
107
|
+
options: {extra_headers: {"anthropic-beta" => "skills-2025-10-02"}, **options}
|
108
|
+
)
|
109
|
+
end
|
110
|
+
|
111
|
+
# Some parameter documentations has been truncated, see
|
112
|
+
# {Anthropic::Models::Beta::Skills::VersionDeleteParams} for more details.
|
113
|
+
#
|
114
|
+
# Delete Skill Version
|
115
|
+
#
|
116
|
+
# @overload delete(version, skill_id:, betas: nil, request_options: {})
|
117
|
+
#
|
118
|
+
# @param version [String] Path param: Version identifier for the skill.
|
119
|
+
#
|
120
|
+
# @param skill_id [String] Path param: Unique identifier for the skill.
|
121
|
+
#
|
122
|
+
# @param betas [Array<String, Symbol, Anthropic::Models::AnthropicBeta>] Header param: Optional header to specify the beta version(s) you want to use.
|
123
|
+
#
|
124
|
+
# @param request_options [Anthropic::RequestOptions, Hash{Symbol=>Object}, nil]
|
125
|
+
#
|
126
|
+
# @return [Anthropic::Models::Beta::Skills::VersionDeleteResponse]
|
127
|
+
#
|
128
|
+
# @see Anthropic::Models::Beta::Skills::VersionDeleteParams
|
129
|
+
def delete(version, params)
|
130
|
+
parsed, options = Anthropic::Beta::Skills::VersionDeleteParams.dump_request(params)
|
131
|
+
skill_id =
|
132
|
+
parsed.delete(:skill_id) do
|
133
|
+
raise ArgumentError.new("missing required path argument #{_1}")
|
134
|
+
end
|
135
|
+
@client.request(
|
136
|
+
method: :delete,
|
137
|
+
path: ["v1/skills/%1$s/versions/%2$s?beta=true", skill_id, version],
|
138
|
+
headers: parsed.transform_keys(betas: "anthropic-beta"),
|
139
|
+
model: Anthropic::Models::Beta::Skills::VersionDeleteResponse,
|
140
|
+
options: {extra_headers: {"anthropic-beta" => "skills-2025-10-02"}, **options}
|
141
|
+
)
|
142
|
+
end
|
143
|
+
|
144
|
+
# @api private
|
145
|
+
#
|
146
|
+
# @param client [Anthropic::Client]
|
147
|
+
def initialize(client:)
|
148
|
+
@client = client
|
149
|
+
end
|
150
|
+
end
|
151
|
+
end
|
152
|
+
end
|
153
|
+
end
|
154
|
+
end
|
@@ -0,0 +1,144 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Anthropic
|
4
|
+
module Resources
|
5
|
+
class Beta
|
6
|
+
class Skills
|
7
|
+
# @return [Anthropic::Resources::Beta::Skills::Versions]
|
8
|
+
attr_reader :versions
|
9
|
+
|
10
|
+
# Some parameter documentations has been truncated, see
|
11
|
+
# {Anthropic::Models::Beta::SkillCreateParams} for more details.
|
12
|
+
#
|
13
|
+
# Create Skill
|
14
|
+
#
|
15
|
+
# @overload create(display_title: nil, files: nil, betas: nil, request_options: {})
|
16
|
+
#
|
17
|
+
# @param display_title [String, nil] Body param: Display title for the skill.
|
18
|
+
#
|
19
|
+
# @param files [Array<Pathname, StringIO, IO, String, Anthropic::FilePart>, nil] Body param: Files to upload for the skill.
|
20
|
+
#
|
21
|
+
# @param betas [Array<String, Symbol, Anthropic::Models::AnthropicBeta>] Header param: Optional header to specify the beta version(s) you want to use.
|
22
|
+
#
|
23
|
+
# @param request_options [Anthropic::RequestOptions, Hash{Symbol=>Object}, nil]
|
24
|
+
#
|
25
|
+
# @return [Anthropic::Models::Beta::SkillCreateResponse]
|
26
|
+
#
|
27
|
+
# @see Anthropic::Models::Beta::SkillCreateParams
|
28
|
+
def create(params = {})
|
29
|
+
parsed, options = Anthropic::Beta::SkillCreateParams.dump_request(params)
|
30
|
+
header_params = {betas: "anthropic-beta"}
|
31
|
+
@client.request(
|
32
|
+
method: :post,
|
33
|
+
path: "v1/skills?beta=true",
|
34
|
+
headers: {
|
35
|
+
"content-type" => "multipart/form-data",
|
36
|
+
**parsed.slice(*header_params.keys)
|
37
|
+
}.transform_keys(
|
38
|
+
header_params
|
39
|
+
),
|
40
|
+
body: parsed.except(*header_params.keys),
|
41
|
+
model: Anthropic::Models::Beta::SkillCreateResponse,
|
42
|
+
options: {extra_headers: {"anthropic-beta" => "skills-2025-10-02"}, **options}
|
43
|
+
)
|
44
|
+
end
|
45
|
+
|
46
|
+
# Some parameter documentations has been truncated, see
|
47
|
+
# {Anthropic::Models::Beta::SkillRetrieveParams} for more details.
|
48
|
+
#
|
49
|
+
# Get Skill
|
50
|
+
#
|
51
|
+
# @overload retrieve(skill_id, betas: nil, request_options: {})
|
52
|
+
#
|
53
|
+
# @param skill_id [String] Unique identifier for the skill.
|
54
|
+
#
|
55
|
+
# @param betas [Array<String, Symbol, Anthropic::Models::AnthropicBeta>] Optional header to specify the beta version(s) you want to use.
|
56
|
+
#
|
57
|
+
# @param request_options [Anthropic::RequestOptions, Hash{Symbol=>Object}, nil]
|
58
|
+
#
|
59
|
+
# @return [Anthropic::Models::Beta::SkillRetrieveResponse]
|
60
|
+
#
|
61
|
+
# @see Anthropic::Models::Beta::SkillRetrieveParams
|
62
|
+
def retrieve(skill_id, params = {})
|
63
|
+
parsed, options = Anthropic::Beta::SkillRetrieveParams.dump_request(params)
|
64
|
+
@client.request(
|
65
|
+
method: :get,
|
66
|
+
path: ["v1/skills/%1$s?beta=true", skill_id],
|
67
|
+
headers: parsed.transform_keys(betas: "anthropic-beta"),
|
68
|
+
model: Anthropic::Models::Beta::SkillRetrieveResponse,
|
69
|
+
options: {extra_headers: {"anthropic-beta" => "skills-2025-10-02"}, **options}
|
70
|
+
)
|
71
|
+
end
|
72
|
+
|
73
|
+
# Some parameter documentations has been truncated, see
|
74
|
+
# {Anthropic::Models::Beta::SkillListParams} for more details.
|
75
|
+
#
|
76
|
+
# List Skills
|
77
|
+
#
|
78
|
+
# @overload list(limit: nil, page: nil, source: nil, betas: nil, request_options: {})
|
79
|
+
#
|
80
|
+
# @param limit [Integer] Query param: Number of results to return per page.
|
81
|
+
#
|
82
|
+
# @param page [String, nil] Query param: Pagination token for fetching a specific page of results.
|
83
|
+
#
|
84
|
+
# @param source [String, nil] Query param: Filter skills by source.
|
85
|
+
#
|
86
|
+
# @param betas [Array<String, Symbol, Anthropic::Models::AnthropicBeta>] Header param: Optional header to specify the beta version(s) you want to use.
|
87
|
+
#
|
88
|
+
# @param request_options [Anthropic::RequestOptions, Hash{Symbol=>Object}, nil]
|
89
|
+
#
|
90
|
+
# @return [Anthropic::Internal::PageCursor<Anthropic::Models::Beta::SkillListResponse>]
|
91
|
+
#
|
92
|
+
# @see Anthropic::Models::Beta::SkillListParams
|
93
|
+
def list(params = {})
|
94
|
+
parsed, options = Anthropic::Beta::SkillListParams.dump_request(params)
|
95
|
+
query_params = [:limit, :page, :source]
|
96
|
+
@client.request(
|
97
|
+
method: :get,
|
98
|
+
path: "v1/skills?beta=true",
|
99
|
+
query: parsed.slice(*query_params),
|
100
|
+
headers: parsed.except(*query_params).transform_keys(betas: "anthropic-beta"),
|
101
|
+
page: Anthropic::Internal::PageCursor,
|
102
|
+
model: Anthropic::Models::Beta::SkillListResponse,
|
103
|
+
options: {extra_headers: {"anthropic-beta" => "skills-2025-10-02"}, **options}
|
104
|
+
)
|
105
|
+
end
|
106
|
+
|
107
|
+
# Some parameter documentations has been truncated, see
|
108
|
+
# {Anthropic::Models::Beta::SkillDeleteParams} for more details.
|
109
|
+
#
|
110
|
+
# Delete Skill
|
111
|
+
#
|
112
|
+
# @overload delete(skill_id, betas: nil, request_options: {})
|
113
|
+
#
|
114
|
+
# @param skill_id [String] Unique identifier for the skill.
|
115
|
+
#
|
116
|
+
# @param betas [Array<String, Symbol, Anthropic::Models::AnthropicBeta>] Optional header to specify the beta version(s) you want to use.
|
117
|
+
#
|
118
|
+
# @param request_options [Anthropic::RequestOptions, Hash{Symbol=>Object}, nil]
|
119
|
+
#
|
120
|
+
# @return [Anthropic::Models::Beta::SkillDeleteResponse]
|
121
|
+
#
|
122
|
+
# @see Anthropic::Models::Beta::SkillDeleteParams
|
123
|
+
def delete(skill_id, params = {})
|
124
|
+
parsed, options = Anthropic::Beta::SkillDeleteParams.dump_request(params)
|
125
|
+
@client.request(
|
126
|
+
method: :delete,
|
127
|
+
path: ["v1/skills/%1$s?beta=true", skill_id],
|
128
|
+
headers: parsed.transform_keys(betas: "anthropic-beta"),
|
129
|
+
model: Anthropic::Models::Beta::SkillDeleteResponse,
|
130
|
+
options: {extra_headers: {"anthropic-beta" => "skills-2025-10-02"}, **options}
|
131
|
+
)
|
132
|
+
end
|
133
|
+
|
134
|
+
# @api private
|
135
|
+
#
|
136
|
+
# @param client [Anthropic::Client]
|
137
|
+
def initialize(client:)
|
138
|
+
@client = client
|
139
|
+
@versions = Anthropic::Resources::Beta::Skills::Versions.new(client: client)
|
140
|
+
end
|
141
|
+
end
|
142
|
+
end
|
143
|
+
end
|
144
|
+
end
|
@@ -12,6 +12,9 @@ module Anthropic
|
|
12
12
|
# @return [Anthropic::Resources::Beta::Files]
|
13
13
|
attr_reader :files
|
14
14
|
|
15
|
+
# @return [Anthropic::Resources::Beta::Skills]
|
16
|
+
attr_reader :skills
|
17
|
+
|
15
18
|
# @api private
|
16
19
|
#
|
17
20
|
# @param client [Anthropic::Client]
|
@@ -20,6 +23,7 @@ module Anthropic
|
|
20
23
|
@models = Anthropic::Resources::Beta::Models.new(client: client)
|
21
24
|
@messages = Anthropic::Resources::Beta::Messages.new(client: client)
|
22
25
|
@files = Anthropic::Resources::Beta::Files.new(client: client)
|
26
|
+
@skills = Anthropic::Resources::Beta::Skills.new(client: client)
|
23
27
|
end
|
24
28
|
end
|
25
29
|
end
|
@@ -12,10 +12,10 @@ module Anthropic
|
|
12
12
|
# [Legacy] Create a Text Completion.
|
13
13
|
#
|
14
14
|
# The Text Completions API is a legacy API. We recommend using the
|
15
|
-
# [Messages API](https://docs.
|
15
|
+
# [Messages API](https://docs.claude.com/en/api/messages) going forward.
|
16
16
|
#
|
17
17
|
# Future models and features will not be compatible with Text Completions. See our
|
18
|
-
# [migration guide](https://docs.
|
18
|
+
# [migration guide](https://docs.claude.com/en/api/migrating-from-text-completions-to-messages)
|
19
19
|
# for guidance in migrating from Text Completions to Messages.
|
20
20
|
#
|
21
21
|
# @overload create(max_tokens_to_sample:, model:, prompt:, metadata: nil, stop_sequences: nil, temperature: nil, top_k: nil, top_p: nil, betas: nil, request_options: {})
|
@@ -68,10 +68,10 @@ module Anthropic
|
|
68
68
|
# [Legacy] Create a Text Completion.
|
69
69
|
#
|
70
70
|
# The Text Completions API is a legacy API. We recommend using the
|
71
|
-
# [Messages API](https://docs.
|
71
|
+
# [Messages API](https://docs.claude.com/en/api/messages) going forward.
|
72
72
|
#
|
73
73
|
# Future models and features will not be compatible with Text Completions. See our
|
74
|
-
# [migration guide](https://docs.
|
74
|
+
# [migration guide](https://docs.claude.com/en/api/migrating-from-text-completions-to-messages)
|
75
75
|
# for guidance in migrating from Text Completions to Messages.
|
76
76
|
#
|
77
77
|
# @overload create_streaming(max_tokens_to_sample:, model:, prompt:, metadata: nil, stop_sequences: nil, temperature: nil, top_k: nil, top_p: nil, betas: nil, request_options: {})
|
data/lib/anthropic/version.rb
CHANGED