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
@@ -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
|
|
@@ -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
|