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
|
@@ -162,7 +162,7 @@ module Anthropic
|
|
|
162
162
|
# only specifies the absolute maximum number of tokens to generate.
|
|
163
163
|
#
|
|
164
164
|
# Different models have different maximum values for this parameter. See
|
|
165
|
-
# [models](https://docs.
|
|
165
|
+
# [models](https://docs.claude.com/en/docs/models-overview) for details.
|
|
166
166
|
sig { returns(Integer) }
|
|
167
167
|
attr_accessor :max_tokens
|
|
168
168
|
|
|
@@ -223,12 +223,12 @@ module Anthropic
|
|
|
223
223
|
# { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
|
|
224
224
|
# ```
|
|
225
225
|
#
|
|
226
|
-
# See [input examples](https://docs.
|
|
226
|
+
# See [input examples](https://docs.claude.com/en/api/messages-examples).
|
|
227
227
|
#
|
|
228
228
|
# Note that if you want to include a
|
|
229
|
-
# [system prompt](https://docs.
|
|
230
|
-
#
|
|
231
|
-
#
|
|
229
|
+
# [system prompt](https://docs.claude.com/en/docs/system-prompts), you can use the
|
|
230
|
+
# top-level `system` parameter — there is no `"system"` role for input messages in
|
|
231
|
+
# the Messages API.
|
|
232
232
|
#
|
|
233
233
|
# There is a limit of 100,000 messages in a single request.
|
|
234
234
|
sig { returns(T::Array[Anthropic::Beta::BetaMessageParam]) }
|
|
@@ -241,10 +241,17 @@ module Anthropic
|
|
|
241
241
|
attr_accessor :model
|
|
242
242
|
|
|
243
243
|
# Container identifier for reuse across requests.
|
|
244
|
-
sig
|
|
244
|
+
sig do
|
|
245
|
+
returns(
|
|
246
|
+
T.nilable(T.any(Anthropic::Beta::BetaContainerParams, String))
|
|
247
|
+
)
|
|
248
|
+
end
|
|
245
249
|
attr_accessor :container
|
|
246
250
|
|
|
247
|
-
#
|
|
251
|
+
# Context management configuration.
|
|
252
|
+
#
|
|
253
|
+
# This allows you to control how Claude manages context across multiple requests,
|
|
254
|
+
# such as whether to clear function results or not.
|
|
248
255
|
sig do
|
|
249
256
|
returns(T.nilable(Anthropic::Beta::BetaContextManagementConfig))
|
|
250
257
|
end
|
|
@@ -293,7 +300,7 @@ module Anthropic
|
|
|
293
300
|
# for this request.
|
|
294
301
|
#
|
|
295
302
|
# Anthropic offers different levels of service for your API requests. See
|
|
296
|
-
# [service-tiers](https://docs.
|
|
303
|
+
# [service-tiers](https://docs.claude.com/en/api/service-tiers) for details.
|
|
297
304
|
sig do
|
|
298
305
|
returns(
|
|
299
306
|
T.nilable(
|
|
@@ -328,8 +335,7 @@ module Anthropic
|
|
|
328
335
|
|
|
329
336
|
# Whether to incrementally stream the response using server-sent events.
|
|
330
337
|
#
|
|
331
|
-
# See [streaming](https://docs.
|
|
332
|
-
# details.
|
|
338
|
+
# See [streaming](https://docs.claude.com/en/api/messages-streaming) for details.
|
|
333
339
|
sig { returns(T.nilable(T::Boolean)) }
|
|
334
340
|
attr_reader :stream
|
|
335
341
|
|
|
@@ -340,7 +346,7 @@ module Anthropic
|
|
|
340
346
|
#
|
|
341
347
|
# A system prompt is a way of providing context and instructions to Claude, such
|
|
342
348
|
# as specifying a particular goal or role. See our
|
|
343
|
-
# [guide to system prompts](https://docs.
|
|
349
|
+
# [guide to system prompts](https://docs.claude.com/en/docs/system-prompts).
|
|
344
350
|
sig do
|
|
345
351
|
returns(
|
|
346
352
|
T.nilable(
|
|
@@ -379,7 +385,7 @@ module Anthropic
|
|
|
379
385
|
# tokens and counts towards your `max_tokens` limit.
|
|
380
386
|
#
|
|
381
387
|
# See
|
|
382
|
-
# [extended thinking](https://docs.
|
|
388
|
+
# [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking)
|
|
383
389
|
# for details.
|
|
384
390
|
sig do
|
|
385
391
|
returns(
|
|
@@ -442,9 +448,9 @@ module Anthropic
|
|
|
442
448
|
#
|
|
443
449
|
# There are two types of tools: **client tools** and **server tools**. The
|
|
444
450
|
# behavior described below applies to client tools. For
|
|
445
|
-
# [server tools](https://docs.
|
|
451
|
+
# [server tools](https://docs.claude.com/en/docs/agents-and-tools/tool-use/overview#server-tools),
|
|
446
452
|
# see their individual documentation as each has its own behavior (e.g., the
|
|
447
|
-
# [web search tool](https://docs.
|
|
453
|
+
# [web search tool](https://docs.claude.com/en/docs/agents-and-tools/tool-use/web-search-tool)).
|
|
448
454
|
#
|
|
449
455
|
# Each tool definition includes:
|
|
450
456
|
#
|
|
@@ -507,7 +513,7 @@ module Anthropic
|
|
|
507
513
|
# functions, or more generally whenever you want the model to produce a particular
|
|
508
514
|
# JSON structure of output.
|
|
509
515
|
#
|
|
510
|
-
# See our [guide](https://docs.
|
|
516
|
+
# See our [guide](https://docs.claude.com/en/docs/tool-use) for more details.
|
|
511
517
|
sig do
|
|
512
518
|
returns(
|
|
513
519
|
T.nilable(
|
|
@@ -596,7 +602,13 @@ module Anthropic
|
|
|
596
602
|
max_tokens: Integer,
|
|
597
603
|
messages: T::Array[Anthropic::Beta::BetaMessageParam::OrHash],
|
|
598
604
|
model: T.any(Anthropic::Model::OrSymbol, String),
|
|
599
|
-
container:
|
|
605
|
+
container:
|
|
606
|
+
T.nilable(
|
|
607
|
+
T.any(
|
|
608
|
+
Anthropic::Beta::BetaContainerParams::OrHash,
|
|
609
|
+
String
|
|
610
|
+
)
|
|
611
|
+
),
|
|
600
612
|
context_management:
|
|
601
613
|
T.nilable(
|
|
602
614
|
Anthropic::Beta::BetaContextManagementConfig::OrHash
|
|
@@ -655,7 +667,7 @@ module Anthropic
|
|
|
655
667
|
# only specifies the absolute maximum number of tokens to generate.
|
|
656
668
|
#
|
|
657
669
|
# Different models have different maximum values for this parameter. See
|
|
658
|
-
# [models](https://docs.
|
|
670
|
+
# [models](https://docs.claude.com/en/docs/models-overview) for details.
|
|
659
671
|
max_tokens:,
|
|
660
672
|
# Input messages.
|
|
661
673
|
#
|
|
@@ -714,12 +726,12 @@ module Anthropic
|
|
|
714
726
|
# { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
|
|
715
727
|
# ```
|
|
716
728
|
#
|
|
717
|
-
# See [input examples](https://docs.
|
|
729
|
+
# See [input examples](https://docs.claude.com/en/api/messages-examples).
|
|
718
730
|
#
|
|
719
731
|
# Note that if you want to include a
|
|
720
|
-
# [system prompt](https://docs.
|
|
721
|
-
#
|
|
722
|
-
#
|
|
732
|
+
# [system prompt](https://docs.claude.com/en/docs/system-prompts), you can use the
|
|
733
|
+
# top-level `system` parameter — there is no `"system"` role for input messages in
|
|
734
|
+
# the Messages API.
|
|
723
735
|
#
|
|
724
736
|
# There is a limit of 100,000 messages in a single request.
|
|
725
737
|
messages:,
|
|
@@ -729,7 +741,10 @@ module Anthropic
|
|
|
729
741
|
model:,
|
|
730
742
|
# Container identifier for reuse across requests.
|
|
731
743
|
container: nil,
|
|
732
|
-
#
|
|
744
|
+
# Context management configuration.
|
|
745
|
+
#
|
|
746
|
+
# This allows you to control how Claude manages context across multiple requests,
|
|
747
|
+
# such as whether to clear function results or not.
|
|
733
748
|
context_management: nil,
|
|
734
749
|
# MCP servers to be utilized in this request
|
|
735
750
|
mcp_servers: nil,
|
|
@@ -739,7 +754,7 @@ module Anthropic
|
|
|
739
754
|
# for this request.
|
|
740
755
|
#
|
|
741
756
|
# Anthropic offers different levels of service for your API requests. See
|
|
742
|
-
# [service-tiers](https://docs.
|
|
757
|
+
# [service-tiers](https://docs.claude.com/en/api/service-tiers) for details.
|
|
743
758
|
service_tier: nil,
|
|
744
759
|
# Custom text sequences that will cause the model to stop generating.
|
|
745
760
|
#
|
|
@@ -753,14 +768,13 @@ module Anthropic
|
|
|
753
768
|
stop_sequences: nil,
|
|
754
769
|
# Whether to incrementally stream the response using server-sent events.
|
|
755
770
|
#
|
|
756
|
-
# See [streaming](https://docs.
|
|
757
|
-
# details.
|
|
771
|
+
# See [streaming](https://docs.claude.com/en/api/messages-streaming) for details.
|
|
758
772
|
stream: nil,
|
|
759
773
|
# System prompt.
|
|
760
774
|
#
|
|
761
775
|
# A system prompt is a way of providing context and instructions to Claude, such
|
|
762
776
|
# as specifying a particular goal or role. See our
|
|
763
|
-
# [guide to system prompts](https://docs.
|
|
777
|
+
# [guide to system prompts](https://docs.claude.com/en/docs/system-prompts).
|
|
764
778
|
system_: nil,
|
|
765
779
|
# Amount of randomness injected into the response.
|
|
766
780
|
#
|
|
@@ -778,7 +792,7 @@ module Anthropic
|
|
|
778
792
|
# tokens and counts towards your `max_tokens` limit.
|
|
779
793
|
#
|
|
780
794
|
# See
|
|
781
|
-
# [extended thinking](https://docs.
|
|
795
|
+
# [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking)
|
|
782
796
|
# for details.
|
|
783
797
|
thinking: nil,
|
|
784
798
|
# How the model should use the provided tools. The model can use a specific tool,
|
|
@@ -793,9 +807,9 @@ module Anthropic
|
|
|
793
807
|
#
|
|
794
808
|
# There are two types of tools: **client tools** and **server tools**. The
|
|
795
809
|
# behavior described below applies to client tools. For
|
|
796
|
-
# [server tools](https://docs.
|
|
810
|
+
# [server tools](https://docs.claude.com/en/docs/agents-and-tools/tool-use/overview#server-tools),
|
|
797
811
|
# see their individual documentation as each has its own behavior (e.g., the
|
|
798
|
-
# [web search tool](https://docs.
|
|
812
|
+
# [web search tool](https://docs.claude.com/en/docs/agents-and-tools/tool-use/web-search-tool)).
|
|
799
813
|
#
|
|
800
814
|
# Each tool definition includes:
|
|
801
815
|
#
|
|
@@ -858,7 +872,7 @@ module Anthropic
|
|
|
858
872
|
# functions, or more generally whenever you want the model to produce a particular
|
|
859
873
|
# JSON structure of output.
|
|
860
874
|
#
|
|
861
|
-
# See our [guide](https://docs.
|
|
875
|
+
# See our [guide](https://docs.claude.com/en/docs/tool-use) for more details.
|
|
862
876
|
tools: nil,
|
|
863
877
|
# Only sample from the top K options for each subsequent token.
|
|
864
878
|
#
|
|
@@ -887,7 +901,10 @@ module Anthropic
|
|
|
887
901
|
max_tokens: Integer,
|
|
888
902
|
messages: T::Array[Anthropic::Beta::BetaMessageParam],
|
|
889
903
|
model: T.any(Anthropic::Model::OrSymbol, String),
|
|
890
|
-
container:
|
|
904
|
+
container:
|
|
905
|
+
T.nilable(
|
|
906
|
+
T.any(Anthropic::Beta::BetaContainerParams, String)
|
|
907
|
+
),
|
|
891
908
|
context_management:
|
|
892
909
|
T.nilable(Anthropic::Beta::BetaContextManagementConfig),
|
|
893
910
|
mcp_servers:
|
|
@@ -941,11 +958,31 @@ module Anthropic
|
|
|
941
958
|
def to_hash
|
|
942
959
|
end
|
|
943
960
|
|
|
961
|
+
# Container identifier for reuse across requests.
|
|
962
|
+
module Container
|
|
963
|
+
extend Anthropic::Internal::Type::Union
|
|
964
|
+
|
|
965
|
+
Variants =
|
|
966
|
+
T.type_alias do
|
|
967
|
+
T.any(Anthropic::Beta::BetaContainerParams, String)
|
|
968
|
+
end
|
|
969
|
+
|
|
970
|
+
sig do
|
|
971
|
+
override.returns(
|
|
972
|
+
T::Array[
|
|
973
|
+
Anthropic::Beta::Messages::BatchCreateParams::Request::Params::Container::Variants
|
|
974
|
+
]
|
|
975
|
+
)
|
|
976
|
+
end
|
|
977
|
+
def self.variants
|
|
978
|
+
end
|
|
979
|
+
end
|
|
980
|
+
|
|
944
981
|
# Determines whether to use priority capacity (if available) or standard capacity
|
|
945
982
|
# for this request.
|
|
946
983
|
#
|
|
947
984
|
# Anthropic offers different levels of service for your API requests. See
|
|
948
|
-
# [service-tiers](https://docs.
|
|
985
|
+
# [service-tiers](https://docs.claude.com/en/api/service-tiers) for details.
|
|
949
986
|
module ServiceTier
|
|
950
987
|
extend Anthropic::Internal::Type::Enum
|
|
951
988
|
|
|
@@ -984,7 +1021,7 @@ module Anthropic
|
|
|
984
1021
|
#
|
|
985
1022
|
# A system prompt is a way of providing context and instructions to Claude, such
|
|
986
1023
|
# as specifying a particular goal or role. See our
|
|
987
|
-
# [guide to system prompts](https://docs.
|
|
1024
|
+
# [guide to system prompts](https://docs.claude.com/en/docs/system-prompts).
|
|
988
1025
|
module System
|
|
989
1026
|
extend Anthropic::Internal::Type::Union
|
|
990
1027
|
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
module Beta
|
|
6
|
+
class SkillCreateParams < Anthropic::Internal::Type::BaseModel
|
|
7
|
+
extend Anthropic::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Anthropic::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
OrHash =
|
|
11
|
+
T.type_alias do
|
|
12
|
+
T.any(
|
|
13
|
+
Anthropic::Beta::SkillCreateParams,
|
|
14
|
+
Anthropic::Internal::AnyHash
|
|
15
|
+
)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
# Display title for the skill.
|
|
19
|
+
#
|
|
20
|
+
# This is a human-readable label that is not included in the prompt sent to the
|
|
21
|
+
# model.
|
|
22
|
+
sig { returns(T.nilable(String)) }
|
|
23
|
+
attr_accessor :display_title
|
|
24
|
+
|
|
25
|
+
# Files to upload for the skill.
|
|
26
|
+
#
|
|
27
|
+
# All files must be in the same top-level directory and must include a SKILL.md
|
|
28
|
+
# file at the root of that directory.
|
|
29
|
+
sig { returns(T.nilable(T::Array[Anthropic::Internal::FileInput])) }
|
|
30
|
+
attr_accessor :files
|
|
31
|
+
|
|
32
|
+
# Optional header to specify the beta version(s) you want to use.
|
|
33
|
+
sig do
|
|
34
|
+
returns(
|
|
35
|
+
T.nilable(
|
|
36
|
+
T::Array[T.any(String, Anthropic::AnthropicBeta::OrSymbol)]
|
|
37
|
+
)
|
|
38
|
+
)
|
|
39
|
+
end
|
|
40
|
+
attr_reader :betas
|
|
41
|
+
|
|
42
|
+
sig do
|
|
43
|
+
params(
|
|
44
|
+
betas: T::Array[T.any(String, Anthropic::AnthropicBeta::OrSymbol)]
|
|
45
|
+
).void
|
|
46
|
+
end
|
|
47
|
+
attr_writer :betas
|
|
48
|
+
|
|
49
|
+
sig do
|
|
50
|
+
params(
|
|
51
|
+
display_title: T.nilable(String),
|
|
52
|
+
files: T.nilable(T::Array[Anthropic::Internal::FileInput]),
|
|
53
|
+
betas: T::Array[T.any(String, Anthropic::AnthropicBeta::OrSymbol)],
|
|
54
|
+
request_options: Anthropic::RequestOptions::OrHash
|
|
55
|
+
).returns(T.attached_class)
|
|
56
|
+
end
|
|
57
|
+
def self.new(
|
|
58
|
+
# Display title for the skill.
|
|
59
|
+
#
|
|
60
|
+
# This is a human-readable label that is not included in the prompt sent to the
|
|
61
|
+
# model.
|
|
62
|
+
display_title: nil,
|
|
63
|
+
# Files to upload for the skill.
|
|
64
|
+
#
|
|
65
|
+
# All files must be in the same top-level directory and must include a SKILL.md
|
|
66
|
+
# file at the root of that directory.
|
|
67
|
+
files: nil,
|
|
68
|
+
# Optional header to specify the beta version(s) you want to use.
|
|
69
|
+
betas: nil,
|
|
70
|
+
request_options: {}
|
|
71
|
+
)
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
sig do
|
|
75
|
+
override.returns(
|
|
76
|
+
{
|
|
77
|
+
display_title: T.nilable(String),
|
|
78
|
+
files: T.nilable(T::Array[Anthropic::Internal::FileInput]),
|
|
79
|
+
betas:
|
|
80
|
+
T::Array[T.any(String, Anthropic::AnthropicBeta::OrSymbol)],
|
|
81
|
+
request_options: Anthropic::RequestOptions
|
|
82
|
+
}
|
|
83
|
+
)
|
|
84
|
+
end
|
|
85
|
+
def to_hash
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
end
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
module Beta
|
|
6
|
+
class SkillCreateResponse < Anthropic::Internal::Type::BaseModel
|
|
7
|
+
OrHash =
|
|
8
|
+
T.type_alias do
|
|
9
|
+
T.any(
|
|
10
|
+
Anthropic::Models::Beta::SkillCreateResponse,
|
|
11
|
+
Anthropic::Internal::AnyHash
|
|
12
|
+
)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# Unique identifier for the skill.
|
|
16
|
+
#
|
|
17
|
+
# The format and length of IDs may change over time.
|
|
18
|
+
sig { returns(String) }
|
|
19
|
+
attr_accessor :id
|
|
20
|
+
|
|
21
|
+
# ISO 8601 timestamp of when the skill was created.
|
|
22
|
+
sig { returns(String) }
|
|
23
|
+
attr_accessor :created_at
|
|
24
|
+
|
|
25
|
+
# Display title for the skill.
|
|
26
|
+
#
|
|
27
|
+
# This is a human-readable label that is not included in the prompt sent to the
|
|
28
|
+
# model.
|
|
29
|
+
sig { returns(T.nilable(String)) }
|
|
30
|
+
attr_accessor :display_title
|
|
31
|
+
|
|
32
|
+
# The latest version identifier for the skill.
|
|
33
|
+
#
|
|
34
|
+
# This represents the most recent version of the skill that has been created.
|
|
35
|
+
sig { returns(T.nilable(String)) }
|
|
36
|
+
attr_accessor :latest_version
|
|
37
|
+
|
|
38
|
+
# Source of the skill.
|
|
39
|
+
#
|
|
40
|
+
# This may be one of the following values:
|
|
41
|
+
#
|
|
42
|
+
# - `"custom"`: the skill was created by a user
|
|
43
|
+
# - `"anthropic"`: the skill was created by Anthropic
|
|
44
|
+
sig { returns(String) }
|
|
45
|
+
attr_accessor :source
|
|
46
|
+
|
|
47
|
+
# Object type.
|
|
48
|
+
#
|
|
49
|
+
# For Skills, this is always `"skill"`.
|
|
50
|
+
sig { returns(String) }
|
|
51
|
+
attr_accessor :type
|
|
52
|
+
|
|
53
|
+
# ISO 8601 timestamp of when the skill was last updated.
|
|
54
|
+
sig { returns(String) }
|
|
55
|
+
attr_accessor :updated_at
|
|
56
|
+
|
|
57
|
+
sig do
|
|
58
|
+
params(
|
|
59
|
+
id: String,
|
|
60
|
+
created_at: String,
|
|
61
|
+
display_title: T.nilable(String),
|
|
62
|
+
latest_version: T.nilable(String),
|
|
63
|
+
source: String,
|
|
64
|
+
type: String,
|
|
65
|
+
updated_at: String
|
|
66
|
+
).returns(T.attached_class)
|
|
67
|
+
end
|
|
68
|
+
def self.new(
|
|
69
|
+
# Unique identifier for the skill.
|
|
70
|
+
#
|
|
71
|
+
# The format and length of IDs may change over time.
|
|
72
|
+
id:,
|
|
73
|
+
# ISO 8601 timestamp of when the skill was created.
|
|
74
|
+
created_at:,
|
|
75
|
+
# Display title for the skill.
|
|
76
|
+
#
|
|
77
|
+
# This is a human-readable label that is not included in the prompt sent to the
|
|
78
|
+
# model.
|
|
79
|
+
display_title:,
|
|
80
|
+
# The latest version identifier for the skill.
|
|
81
|
+
#
|
|
82
|
+
# This represents the most recent version of the skill that has been created.
|
|
83
|
+
latest_version:,
|
|
84
|
+
# Source of the skill.
|
|
85
|
+
#
|
|
86
|
+
# This may be one of the following values:
|
|
87
|
+
#
|
|
88
|
+
# - `"custom"`: the skill was created by a user
|
|
89
|
+
# - `"anthropic"`: the skill was created by Anthropic
|
|
90
|
+
source:,
|
|
91
|
+
# Object type.
|
|
92
|
+
#
|
|
93
|
+
# For Skills, this is always `"skill"`.
|
|
94
|
+
type:,
|
|
95
|
+
# ISO 8601 timestamp of when the skill was last updated.
|
|
96
|
+
updated_at:
|
|
97
|
+
)
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
sig do
|
|
101
|
+
override.returns(
|
|
102
|
+
{
|
|
103
|
+
id: String,
|
|
104
|
+
created_at: String,
|
|
105
|
+
display_title: T.nilable(String),
|
|
106
|
+
latest_version: T.nilable(String),
|
|
107
|
+
source: String,
|
|
108
|
+
type: String,
|
|
109
|
+
updated_at: String
|
|
110
|
+
}
|
|
111
|
+
)
|
|
112
|
+
end
|
|
113
|
+
def to_hash
|
|
114
|
+
end
|
|
115
|
+
end
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
end
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
module Beta
|
|
6
|
+
class SkillDeleteParams < Anthropic::Internal::Type::BaseModel
|
|
7
|
+
extend Anthropic::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Anthropic::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
OrHash =
|
|
11
|
+
T.type_alias do
|
|
12
|
+
T.any(
|
|
13
|
+
Anthropic::Beta::SkillDeleteParams,
|
|
14
|
+
Anthropic::Internal::AnyHash
|
|
15
|
+
)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
# Optional header to specify the beta version(s) you want to use.
|
|
19
|
+
sig do
|
|
20
|
+
returns(
|
|
21
|
+
T.nilable(
|
|
22
|
+
T::Array[T.any(String, Anthropic::AnthropicBeta::OrSymbol)]
|
|
23
|
+
)
|
|
24
|
+
)
|
|
25
|
+
end
|
|
26
|
+
attr_reader :betas
|
|
27
|
+
|
|
28
|
+
sig do
|
|
29
|
+
params(
|
|
30
|
+
betas: T::Array[T.any(String, Anthropic::AnthropicBeta::OrSymbol)]
|
|
31
|
+
).void
|
|
32
|
+
end
|
|
33
|
+
attr_writer :betas
|
|
34
|
+
|
|
35
|
+
sig do
|
|
36
|
+
params(
|
|
37
|
+
betas: T::Array[T.any(String, Anthropic::AnthropicBeta::OrSymbol)],
|
|
38
|
+
request_options: Anthropic::RequestOptions::OrHash
|
|
39
|
+
).returns(T.attached_class)
|
|
40
|
+
end
|
|
41
|
+
def self.new(
|
|
42
|
+
# Optional header to specify the beta version(s) you want to use.
|
|
43
|
+
betas: nil,
|
|
44
|
+
request_options: {}
|
|
45
|
+
)
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
sig do
|
|
49
|
+
override.returns(
|
|
50
|
+
{
|
|
51
|
+
betas:
|
|
52
|
+
T::Array[T.any(String, Anthropic::AnthropicBeta::OrSymbol)],
|
|
53
|
+
request_options: Anthropic::RequestOptions
|
|
54
|
+
}
|
|
55
|
+
)
|
|
56
|
+
end
|
|
57
|
+
def to_hash
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
module Beta
|
|
6
|
+
class SkillDeleteResponse < Anthropic::Internal::Type::BaseModel
|
|
7
|
+
OrHash =
|
|
8
|
+
T.type_alias do
|
|
9
|
+
T.any(
|
|
10
|
+
Anthropic::Models::Beta::SkillDeleteResponse,
|
|
11
|
+
Anthropic::Internal::AnyHash
|
|
12
|
+
)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# Unique identifier for the skill.
|
|
16
|
+
#
|
|
17
|
+
# The format and length of IDs may change over time.
|
|
18
|
+
sig { returns(String) }
|
|
19
|
+
attr_accessor :id
|
|
20
|
+
|
|
21
|
+
# Deleted object type.
|
|
22
|
+
#
|
|
23
|
+
# For Skills, this is always `"skill_deleted"`.
|
|
24
|
+
sig { returns(String) }
|
|
25
|
+
attr_accessor :type
|
|
26
|
+
|
|
27
|
+
sig { params(id: String, type: String).returns(T.attached_class) }
|
|
28
|
+
def self.new(
|
|
29
|
+
# Unique identifier for the skill.
|
|
30
|
+
#
|
|
31
|
+
# The format and length of IDs may change over time.
|
|
32
|
+
id:,
|
|
33
|
+
# Deleted object type.
|
|
34
|
+
#
|
|
35
|
+
# For Skills, this is always `"skill_deleted"`.
|
|
36
|
+
type:
|
|
37
|
+
)
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
sig { override.returns({ id: String, type: String }) }
|
|
41
|
+
def to_hash
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
module Beta
|
|
6
|
+
class SkillListParams < Anthropic::Internal::Type::BaseModel
|
|
7
|
+
extend Anthropic::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Anthropic::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
OrHash =
|
|
11
|
+
T.type_alias do
|
|
12
|
+
T.any(
|
|
13
|
+
Anthropic::Beta::SkillListParams,
|
|
14
|
+
Anthropic::Internal::AnyHash
|
|
15
|
+
)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
# Number of results to return per page.
|
|
19
|
+
#
|
|
20
|
+
# Maximum value is 100. Defaults to 20.
|
|
21
|
+
sig { returns(T.nilable(Integer)) }
|
|
22
|
+
attr_reader :limit
|
|
23
|
+
|
|
24
|
+
sig { params(limit: Integer).void }
|
|
25
|
+
attr_writer :limit
|
|
26
|
+
|
|
27
|
+
# Pagination token for fetching a specific page of results.
|
|
28
|
+
#
|
|
29
|
+
# Pass the value from a previous response's `next_page` field to get the next page
|
|
30
|
+
# of results.
|
|
31
|
+
sig { returns(T.nilable(String)) }
|
|
32
|
+
attr_accessor :page
|
|
33
|
+
|
|
34
|
+
# Filter skills by source.
|
|
35
|
+
#
|
|
36
|
+
# If provided, only skills from the specified source will be returned:
|
|
37
|
+
#
|
|
38
|
+
# - `"custom"`: only return user-created skills
|
|
39
|
+
# - `"anthropic"`: only return Anthropic-created skills
|
|
40
|
+
sig { returns(T.nilable(String)) }
|
|
41
|
+
attr_accessor :source
|
|
42
|
+
|
|
43
|
+
# Optional header to specify the beta version(s) you want to use.
|
|
44
|
+
sig do
|
|
45
|
+
returns(
|
|
46
|
+
T.nilable(
|
|
47
|
+
T::Array[T.any(String, Anthropic::AnthropicBeta::OrSymbol)]
|
|
48
|
+
)
|
|
49
|
+
)
|
|
50
|
+
end
|
|
51
|
+
attr_reader :betas
|
|
52
|
+
|
|
53
|
+
sig do
|
|
54
|
+
params(
|
|
55
|
+
betas: T::Array[T.any(String, Anthropic::AnthropicBeta::OrSymbol)]
|
|
56
|
+
).void
|
|
57
|
+
end
|
|
58
|
+
attr_writer :betas
|
|
59
|
+
|
|
60
|
+
sig do
|
|
61
|
+
params(
|
|
62
|
+
limit: Integer,
|
|
63
|
+
page: T.nilable(String),
|
|
64
|
+
source: T.nilable(String),
|
|
65
|
+
betas: T::Array[T.any(String, Anthropic::AnthropicBeta::OrSymbol)],
|
|
66
|
+
request_options: Anthropic::RequestOptions::OrHash
|
|
67
|
+
).returns(T.attached_class)
|
|
68
|
+
end
|
|
69
|
+
def self.new(
|
|
70
|
+
# Number of results to return per page.
|
|
71
|
+
#
|
|
72
|
+
# Maximum value is 100. Defaults to 20.
|
|
73
|
+
limit: nil,
|
|
74
|
+
# Pagination token for fetching a specific page of results.
|
|
75
|
+
#
|
|
76
|
+
# Pass the value from a previous response's `next_page` field to get the next page
|
|
77
|
+
# of results.
|
|
78
|
+
page: nil,
|
|
79
|
+
# Filter skills by source.
|
|
80
|
+
#
|
|
81
|
+
# If provided, only skills from the specified source will be returned:
|
|
82
|
+
#
|
|
83
|
+
# - `"custom"`: only return user-created skills
|
|
84
|
+
# - `"anthropic"`: only return Anthropic-created skills
|
|
85
|
+
source: nil,
|
|
86
|
+
# Optional header to specify the beta version(s) you want to use.
|
|
87
|
+
betas: nil,
|
|
88
|
+
request_options: {}
|
|
89
|
+
)
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
sig do
|
|
93
|
+
override.returns(
|
|
94
|
+
{
|
|
95
|
+
limit: Integer,
|
|
96
|
+
page: T.nilable(String),
|
|
97
|
+
source: T.nilable(String),
|
|
98
|
+
betas:
|
|
99
|
+
T::Array[T.any(String, Anthropic::AnthropicBeta::OrSymbol)],
|
|
100
|
+
request_options: Anthropic::RequestOptions
|
|
101
|
+
}
|
|
102
|
+
)
|
|
103
|
+
end
|
|
104
|
+
def to_hash
|
|
105
|
+
end
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
end
|
|
109
|
+
end
|