anthropic 1.22.0 → 1.23.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.
Files changed (29) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +14 -0
  3. data/README.md +1 -1
  4. data/lib/anthropic/models/beta/message_count_tokens_params.rb +10 -1
  5. data/lib/anthropic/models/beta/message_create_params.rb +10 -1
  6. data/lib/anthropic/models/beta/messages/batch_create_params.rb +10 -1
  7. data/lib/anthropic/models/message_count_tokens_params.rb +10 -1
  8. data/lib/anthropic/models/message_create_params.rb +10 -1
  9. data/lib/anthropic/models/messages/batch_create_params.rb +10 -1
  10. data/lib/anthropic/resources/beta/messages.rb +9 -3
  11. data/lib/anthropic/resources/messages.rb +9 -3
  12. data/lib/anthropic/version.rb +1 -1
  13. data/rbi/anthropic/models/beta/message_count_tokens_params.rbi +20 -0
  14. data/rbi/anthropic/models/beta/message_create_params.rbi +20 -0
  15. data/rbi/anthropic/models/beta/messages/batch_create_params.rbi +26 -0
  16. data/rbi/anthropic/models/message_count_tokens_params.rbi +17 -0
  17. data/rbi/anthropic/models/message_create_params.rbi +17 -0
  18. data/rbi/anthropic/models/messages/batch_create_params.rbi +19 -0
  19. data/rbi/anthropic/resources/beta/messages.rbi +15 -0
  20. data/rbi/anthropic/resources/messages.rbi +12 -0
  21. data/sig/anthropic/models/beta/message_count_tokens_params.rbs +5 -0
  22. data/sig/anthropic/models/beta/message_create_params.rbs +5 -0
  23. data/sig/anthropic/models/beta/messages/batch_create_params.rbs +5 -0
  24. data/sig/anthropic/models/message_count_tokens_params.rbs +5 -0
  25. data/sig/anthropic/models/message_create_params.rbs +5 -0
  26. data/sig/anthropic/models/messages/batch_create_params.rbs +5 -0
  27. data/sig/anthropic/resources/beta/messages.rbs +3 -0
  28. data/sig/anthropic/resources/messages.rbs +3 -0
  29. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a0996202a97866aa77581bea57874600ea56b6c5732a86016bcc019e81e8af9f
4
- data.tar.gz: 8301fcd9d00b52e4debc7c379ed286009e3251dd3ec8168e69044f4b7bcfce88
3
+ metadata.gz: 5e7f34d5d181c452996ffe49befe4bea248cd67a952eb8853cabf5d0ced185ef
4
+ data.tar.gz: 6945acf587c974e918efdbac79a408b1e3dfc787925037ca938f90cb4b601743
5
5
  SHA512:
6
- metadata.gz: 7ffb5be3bb3a8396f11b911d2e48d6b444ac0699c55633492118228f21f800aceb8dc2347c01c4f2995a970657c71aa975d6f359790aa5c418dd3d8ba541be4e
7
- data.tar.gz: d49e253f5fd6c083790d8ff878bfb8cee1e3e968b5c44dc2b370def67bb684a0bae7c756e426526157315e6590870bb35370d42bbb26a5f5472b13b6f3a34b5e
6
+ metadata.gz: f1f562c0d5bfa17193f8d4952cdf91b2ed68777f87d7a72ed4ce993a457acbdcee4bb9256329a97b4a49513216c077e404b93b06f58241344174a52d956dd84f
7
+ data.tar.gz: 8e28e293264fa8cf7cd2611211a98f99e524df4485f9d16455b0a6a53e7a6cab3423859c3168b6ab1ea6b18ee071f1761880592c37d4944aa99feb9ea22ec012
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.23.0 (2026-02-19)
4
+
5
+ Full Changelog: [v1.22.0...v1.23.0](https://github.com/anthropics/anthropic-sdk-ruby/compare/v1.22.0...v1.23.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** Add top-level cache control (automatic caching) ([612806b](https://github.com/anthropics/anthropic-sdk-ruby/commit/612806bddee36afc3976fa6a4723b0c6df7e6012))
10
+ * **api:** Deprecate haiku-3 ([66ac4a8](https://github.com/anthropics/anthropic-sdk-ruby/commit/66ac4a8ceca44fc2b4d3a68c1ce87c0c05bea5f5))
11
+
12
+
13
+ ### Chores
14
+
15
+ * update mock server docs ([56f16bd](https://github.com/anthropics/anthropic-sdk-ruby/commit/56f16bd36802f804fb6a62735c330ebc22a11fe0))
16
+
3
17
  ## 1.22.0 (2026-02-18)
4
18
 
5
19
  Full Changelog: [v1.21.0...v1.22.0](https://github.com/anthropics/anthropic-sdk-ruby/compare/v1.21.0...v1.22.0)
data/README.md CHANGED
@@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application
15
15
  <!-- x-release-please-start-version -->
16
16
 
17
17
  ```ruby
18
- gem "anthropic", "~> 1.22.0"
18
+ gem "anthropic", "~> 1.23.0"
19
19
  ```
20
20
 
21
21
  <!-- x-release-please-end -->
@@ -86,6 +86,13 @@ module Anthropic
86
86
  # @return [Symbol, String, Anthropic::Models::Model]
87
87
  required :model, union: -> { Anthropic::Model }
88
88
 
89
+ # @!attribute cache_control
90
+ # Top-level cache control automatically applies a cache_control marker to the last
91
+ # cacheable block in the request.
92
+ #
93
+ # @return [Anthropic::Models::Beta::BetaCacheControlEphemeral, nil]
94
+ optional :cache_control, -> { Anthropic::Beta::BetaCacheControlEphemeral }, nil?: true
95
+
89
96
  # @!attribute context_management
90
97
  # Context management configuration.
91
98
  #
@@ -245,7 +252,7 @@ module Anthropic
245
252
  # @return [Array<String, Symbol, Anthropic::Models::AnthropicBeta>, nil]
246
253
  optional :betas, -> { Anthropic::Internal::Type::ArrayOf[union: Anthropic::AnthropicBeta] }
247
254
 
248
- # @!method initialize(messages:, model:, context_management: nil, mcp_servers: nil, output_config: nil, output_format: nil, speed: nil, system_: nil, thinking: nil, tool_choice: nil, tools: nil, betas: nil, request_options: {})
255
+ # @!method initialize(messages:, model:, cache_control: nil, context_management: nil, mcp_servers: nil, output_config: nil, output_format: nil, speed: nil, system_: nil, thinking: nil, tool_choice: nil, tools: nil, betas: nil, request_options: {})
249
256
  # Some parameter documentations has been truncated, see
250
257
  # {Anthropic::Models::Beta::MessageCountTokensParams} for more details.
251
258
  #
@@ -253,6 +260,8 @@ module Anthropic
253
260
  #
254
261
  # @param model [Symbol, String, Anthropic::Models::Model] The model that will complete your prompt.\n\nSee [models](https://docs.anthropic
255
262
  #
263
+ # @param cache_control [Anthropic::Models::Beta::BetaCacheControlEphemeral, nil] Top-level cache control automatically applies a cache_control marker to the last
264
+ #
256
265
  # @param context_management [Anthropic::Models::Beta::BetaContextManagementConfig, nil] Context management configuration.
257
266
  #
258
267
  # @param mcp_servers [Array<Anthropic::Models::Beta::BetaRequestMCPServerURLDefinition>] MCP servers to be utilized in this request
@@ -100,6 +100,13 @@ module Anthropic
100
100
  # @return [Symbol, String, Anthropic::Models::Model]
101
101
  required :model, union: -> { Anthropic::Model }
102
102
 
103
+ # @!attribute cache_control
104
+ # Top-level cache control automatically applies a cache_control marker to the last
105
+ # cacheable block in the request.
106
+ #
107
+ # @return [Anthropic::Models::Beta::BetaCacheControlEphemeral, nil]
108
+ optional :cache_control, -> { Anthropic::Beta::BetaCacheControlEphemeral }, nil?: true
109
+
103
110
  # @!attribute container
104
111
  # Container identifier for reuse across requests.
105
112
  #
@@ -340,7 +347,7 @@ module Anthropic
340
347
  # @return [Array<String, Symbol, Anthropic::Models::AnthropicBeta>, nil]
341
348
  optional :betas, -> { Anthropic::Internal::Type::ArrayOf[union: Anthropic::AnthropicBeta] }
342
349
 
343
- # @!method initialize(max_tokens:, messages:, model:, container: nil, context_management: nil, inference_geo: nil, mcp_servers: nil, metadata: nil, output_config: nil, output_format: nil, service_tier: nil, speed: nil, stop_sequences: nil, system_: nil, temperature: nil, thinking: nil, tool_choice: nil, tools: nil, top_k: nil, top_p: nil, betas: nil, request_options: {})
350
+ # @!method initialize(max_tokens:, messages:, model:, cache_control: nil, container: nil, context_management: nil, inference_geo: nil, mcp_servers: nil, metadata: nil, output_config: nil, output_format: nil, service_tier: nil, speed: nil, stop_sequences: nil, system_: nil, temperature: nil, thinking: nil, tool_choice: nil, tools: nil, top_k: nil, top_p: nil, betas: nil, request_options: {})
344
351
  # Some parameter documentations has been truncated, see
345
352
  # {Anthropic::Models::Beta::MessageCreateParams} for more details.
346
353
  #
@@ -350,6 +357,8 @@ module Anthropic
350
357
  #
351
358
  # @param model [Symbol, String, Anthropic::Models::Model] The model that will complete your prompt.\n\nSee [models](https://docs.anthropic
352
359
  #
360
+ # @param cache_control [Anthropic::Models::Beta::BetaCacheControlEphemeral, nil] Top-level cache control automatically applies a cache_control marker to the last
361
+ #
353
362
  # @param container [Anthropic::Models::Beta::BetaContainerParams, String, nil] Container identifier for reuse across requests.
354
363
  #
355
364
  # @param context_management [Anthropic::Models::Beta::BetaContextManagementConfig, nil] Context management configuration.
@@ -153,6 +153,13 @@ module Anthropic
153
153
  # @return [Symbol, String, Anthropic::Models::Model]
154
154
  required :model, union: -> { Anthropic::Model }
155
155
 
156
+ # @!attribute cache_control
157
+ # Top-level cache control automatically applies a cache_control marker to the last
158
+ # cacheable block in the request.
159
+ #
160
+ # @return [Anthropic::Models::Beta::BetaCacheControlEphemeral, nil]
161
+ optional :cache_control, -> { Anthropic::Beta::BetaCacheControlEphemeral }, nil?: true
162
+
156
163
  # @!attribute container
157
164
  # Container identifier for reuse across requests.
158
165
  #
@@ -402,7 +409,7 @@ module Anthropic
402
409
  # @return [Float, nil]
403
410
  optional :top_p, Float
404
411
 
405
- # @!method initialize(max_tokens:, messages:, model:, container: nil, context_management: nil, inference_geo: nil, mcp_servers: nil, metadata: nil, output_config: nil, output_format: nil, service_tier: nil, speed: nil, stop_sequences: nil, stream: nil, system_: nil, temperature: nil, thinking: nil, tool_choice: nil, tools: nil, top_k: nil, top_p: nil)
412
+ # @!method initialize(max_tokens:, messages:, model:, cache_control: nil, container: nil, context_management: nil, inference_geo: nil, mcp_servers: nil, metadata: nil, output_config: nil, output_format: nil, service_tier: nil, speed: nil, stop_sequences: nil, stream: nil, system_: nil, temperature: nil, thinking: nil, tool_choice: nil, tools: nil, top_k: nil, top_p: nil)
406
413
  # Some parameter documentations has been truncated, see
407
414
  # {Anthropic::Models::Beta::Messages::BatchCreateParams::Request::Params} for more
408
415
  # details.
@@ -418,6 +425,8 @@ module Anthropic
418
425
  #
419
426
  # @param model [Symbol, String, Anthropic::Models::Model] The model that will complete your prompt.\n\nSee [models](https://docs.anthropic
420
427
  #
428
+ # @param cache_control [Anthropic::Models::Beta::BetaCacheControlEphemeral, nil] Top-level cache control automatically applies a cache_control marker to the last
429
+ #
421
430
  # @param container [Anthropic::Models::Beta::BetaContainerParams, String, nil] Container identifier for reuse across requests.
422
431
  #
423
432
  # @param context_management [Anthropic::Models::Beta::BetaContextManagementConfig, nil] Context management configuration.
@@ -85,6 +85,13 @@ module Anthropic
85
85
  # @return [Symbol, String, Anthropic::Models::Model]
86
86
  required :model, union: -> { Anthropic::Model }
87
87
 
88
+ # @!attribute cache_control
89
+ # Top-level cache control automatically applies a cache_control marker to the last
90
+ # cacheable block in the request.
91
+ #
92
+ # @return [Anthropic::Models::CacheControlEphemeral, nil]
93
+ optional :cache_control, -> { Anthropic::CacheControlEphemeral }, nil?: true
94
+
88
95
  # @!attribute output_config
89
96
  # Configuration options for the model's output, such as the output format.
90
97
  #
@@ -202,7 +209,7 @@ module Anthropic
202
209
  # @return [Array<Anthropic::Models::Tool, Anthropic::Models::ToolBash20250124, Anthropic::Models::CodeExecutionTool20250522, Anthropic::Models::CodeExecutionTool20250825, Anthropic::Models::CodeExecutionTool20260120, Anthropic::Models::MemoryTool20250818, Anthropic::Models::ToolTextEditor20250124, Anthropic::Models::ToolTextEditor20250429, Anthropic::Models::ToolTextEditor20250728, Anthropic::Models::WebSearchTool20250305, Anthropic::Models::WebFetchTool20250910, Anthropic::Models::WebSearchTool20260209, Anthropic::Models::WebFetchTool20260209, Anthropic::Models::ToolSearchToolBm25_20251119, Anthropic::Models::ToolSearchToolRegex20251119>, nil]
203
210
  optional :tools, -> { Anthropic::Internal::Type::ArrayOf[union: Anthropic::MessageCountTokensTool] }
204
211
 
205
- # @!method initialize(messages:, model:, output_config: nil, system_: nil, thinking: nil, tool_choice: nil, tools: nil, request_options: {})
212
+ # @!method initialize(messages:, model:, cache_control: nil, output_config: nil, system_: nil, thinking: nil, tool_choice: nil, tools: nil, request_options: {})
206
213
  # Some parameter documentations has been truncated, see
207
214
  # {Anthropic::Models::MessageCountTokensParams} for more details.
208
215
  #
@@ -210,6 +217,8 @@ module Anthropic
210
217
  #
211
218
  # @param model [Symbol, String, Anthropic::Models::Model] The model that will complete your prompt.\n\nSee [models](https://docs.anthropic
212
219
  #
220
+ # @param cache_control [Anthropic::Models::CacheControlEphemeral, nil] Top-level cache control automatically applies a cache_control marker to the last
221
+ #
213
222
  # @param output_config [Anthropic::Models::OutputConfig] Configuration options for the model's output, such as the output format.
214
223
  #
215
224
  # @param system_ [String, Array<Anthropic::Models::TextBlockParam>] System prompt.
@@ -99,6 +99,13 @@ module Anthropic
99
99
  # @return [Symbol, String, Anthropic::Models::Model]
100
100
  required :model, union: -> { Anthropic::Model }
101
101
 
102
+ # @!attribute cache_control
103
+ # Top-level cache control automatically applies a cache_control marker to the last
104
+ # cacheable block in the request.
105
+ #
106
+ # @return [Anthropic::Models::CacheControlEphemeral, nil]
107
+ optional :cache_control, -> { Anthropic::CacheControlEphemeral }, nil?: true
108
+
102
109
  # @!attribute container
103
110
  # Container identifier for reuse across requests.
104
111
  #
@@ -298,7 +305,7 @@ module Anthropic
298
305
  # @return [Float, nil]
299
306
  optional :top_p, Float
300
307
 
301
- # @!method initialize(max_tokens:, messages:, model:, container: nil, inference_geo: nil, metadata: nil, output_config: nil, service_tier: nil, stop_sequences: nil, system_: nil, temperature: nil, thinking: nil, tool_choice: nil, tools: nil, top_k: nil, top_p: nil, request_options: {})
308
+ # @!method initialize(max_tokens:, messages:, model:, cache_control: nil, container: nil, inference_geo: nil, metadata: nil, output_config: nil, service_tier: nil, stop_sequences: nil, system_: nil, temperature: nil, thinking: nil, tool_choice: nil, tools: nil, top_k: nil, top_p: nil, request_options: {})
302
309
  # Some parameter documentations has been truncated, see
303
310
  # {Anthropic::Models::MessageCreateParams} for more details.
304
311
  #
@@ -308,6 +315,8 @@ module Anthropic
308
315
  #
309
316
  # @param model [Symbol, String, Anthropic::Models::Model] The model that will complete your prompt.\n\nSee [models](https://docs.anthropic
310
317
  #
318
+ # @param cache_control [Anthropic::Models::CacheControlEphemeral, nil] Top-level cache control automatically applies a cache_control marker to the last
319
+ #
311
320
  # @param container [String, nil] Container identifier for reuse across requests.
312
321
  #
313
322
  # @param inference_geo [String, nil] Specifies the geographic region for inference processing. If not specified, the
@@ -143,6 +143,13 @@ module Anthropic
143
143
  # @return [Symbol, String, Anthropic::Models::Model]
144
144
  required :model, union: -> { Anthropic::Model }
145
145
 
146
+ # @!attribute cache_control
147
+ # Top-level cache control automatically applies a cache_control marker to the last
148
+ # cacheable block in the request.
149
+ #
150
+ # @return [Anthropic::Models::CacheControlEphemeral, nil]
151
+ optional :cache_control, -> { Anthropic::CacheControlEphemeral }, nil?: true
152
+
146
153
  # @!attribute container
147
154
  # Container identifier for reuse across requests.
148
155
  #
@@ -352,7 +359,7 @@ module Anthropic
352
359
  # @return [Float, nil]
353
360
  optional :top_p, Float
354
361
 
355
- # @!method initialize(max_tokens:, messages:, model:, container: nil, inference_geo: nil, metadata: nil, output_config: nil, service_tier: nil, stop_sequences: nil, stream: nil, system_: nil, temperature: nil, thinking: nil, tool_choice: nil, tools: nil, top_k: nil, top_p: nil)
362
+ # @!method initialize(max_tokens:, messages:, model:, cache_control: nil, container: nil, inference_geo: nil, metadata: nil, output_config: nil, service_tier: nil, stop_sequences: nil, stream: nil, system_: nil, temperature: nil, thinking: nil, tool_choice: nil, tools: nil, top_k: nil, top_p: nil)
356
363
  # Some parameter documentations has been truncated, see
357
364
  # {Anthropic::Models::Messages::BatchCreateParams::Request::Params} for more
358
365
  # details.
@@ -368,6 +375,8 @@ module Anthropic
368
375
  #
369
376
  # @param model [Symbol, String, Anthropic::Models::Model] The model that will complete your prompt.\n\nSee [models](https://docs.anthropic
370
377
  #
378
+ # @param cache_control [Anthropic::Models::CacheControlEphemeral, nil] Top-level cache control automatically applies a cache_control marker to the last
379
+ #
371
380
  # @param container [String, nil] Container identifier for reuse across requests.
372
381
  #
373
382
  # @param inference_geo [String, nil] Specifies the geographic region for inference processing. If not specified, the
@@ -32,7 +32,7 @@ module Anthropic
32
32
  # Learn more about the Messages API in our
33
33
  # [user guide](https://docs.claude.com/en/docs/initial-setup)
34
34
  #
35
- # @overload create(max_tokens:, messages:, model:, container: nil, context_management: nil, inference_geo: nil, mcp_servers: nil, metadata: nil, output_config: nil, output_format: nil, service_tier: nil, speed: nil, stop_sequences: nil, system_: nil, temperature: nil, thinking: nil, tool_choice: nil, tools: nil, top_k: nil, top_p: nil, betas: nil, request_options: {})
35
+ # @overload create(max_tokens:, messages:, model:, cache_control: nil, container: nil, context_management: nil, inference_geo: nil, mcp_servers: nil, metadata: nil, output_config: nil, output_format: nil, service_tier: nil, speed: nil, stop_sequences: nil, system_: nil, temperature: nil, thinking: nil, tool_choice: nil, tools: nil, top_k: nil, top_p: nil, betas: nil, request_options: {})
36
36
  #
37
37
  # @param max_tokens [Integer] Body param: The maximum number of tokens to generate before stopping.
38
38
  #
@@ -40,6 +40,8 @@ module Anthropic
40
40
  #
41
41
  # @param model [Symbol, String, Anthropic::Models::Model] Body param: The model that will complete your prompt.\n\nSee [models](https://do
42
42
  #
43
+ # @param cache_control [Anthropic::Models::Beta::BetaCacheControlEphemeral, nil] Body param: Top-level cache control automatically applies a cache_control marker
44
+ #
43
45
  # @param container [Anthropic::Models::Beta::BetaContainerParams, String, nil] Body param: Container identifier for reuse across requests.
44
46
  #
45
47
  # @param context_management [Anthropic::Models::Beta::BetaContextManagementConfig, nil] Body param: Context management configuration.
@@ -136,7 +138,7 @@ module Anthropic
136
138
  # Learn more about the Messages API in our
137
139
  # [user guide](https://docs.claude.com/en/docs/initial-setup)
138
140
  #
139
- # @overload stream_raw(max_tokens:, messages:, model:, container: nil, context_management: nil, inference_geo: nil, mcp_servers: nil, metadata: nil, output_config: nil, output_format: nil, service_tier: nil, speed: nil, stop_sequences: nil, system_: nil, temperature: nil, thinking: nil, tool_choice: nil, tools: nil, top_k: nil, top_p: nil, betas: nil, request_options: {})
141
+ # @overload stream_raw(max_tokens:, messages:, model:, cache_control: nil, container: nil, context_management: nil, inference_geo: nil, mcp_servers: nil, metadata: nil, output_config: nil, output_format: nil, service_tier: nil, speed: nil, stop_sequences: nil, system_: nil, temperature: nil, thinking: nil, tool_choice: nil, tools: nil, top_k: nil, top_p: nil, betas: nil, request_options: {})
140
142
  #
141
143
  # @param max_tokens [Integer] Body param: The maximum number of tokens to generate before stopping.
142
144
  #
@@ -144,6 +146,8 @@ module Anthropic
144
146
  #
145
147
  # @param model [Symbol, String, Anthropic::Models::Model] Body param: The model that will complete your prompt.\n\nSee [models](https://do
146
148
  #
149
+ # @param cache_control [Anthropic::Models::Beta::BetaCacheControlEphemeral, nil] Body param: Top-level cache control automatically applies a cache_control marker
150
+ #
147
151
  # @param container [Anthropic::Models::Beta::BetaContainerParams, String, nil] Body param: Container identifier for reuse across requests.
148
152
  #
149
153
  # @param context_management [Anthropic::Models::Beta::BetaContextManagementConfig, nil] Body param: Context management configuration.
@@ -307,12 +311,14 @@ module Anthropic
307
311
  # Learn more about token counting in our
308
312
  # [user guide](https://docs.claude.com/en/docs/build-with-claude/token-counting)
309
313
  #
310
- # @overload count_tokens(messages:, model:, context_management: nil, mcp_servers: nil, output_config: nil, output_format: nil, speed: nil, system_: nil, thinking: nil, tool_choice: nil, tools: nil, betas: nil, request_options: {})
314
+ # @overload count_tokens(messages:, model:, cache_control: nil, context_management: nil, mcp_servers: nil, output_config: nil, output_format: nil, speed: nil, system_: nil, thinking: nil, tool_choice: nil, tools: nil, betas: nil, request_options: {})
311
315
  #
312
316
  # @param messages [Array<Anthropic::Models::Beta::BetaMessageParam>] Body param: Input messages.
313
317
  #
314
318
  # @param model [Symbol, String, Anthropic::Models::Model] Body param: The model that will complete your prompt.\n\nSee [models](https://do
315
319
  #
320
+ # @param cache_control [Anthropic::Models::Beta::BetaCacheControlEphemeral, nil] Body param: Top-level cache control automatically applies a cache_control marker
321
+ #
316
322
  # @param context_management [Anthropic::Models::Beta::BetaContextManagementConfig, nil] Body param: Context management configuration.
317
323
  #
318
324
  # @param mcp_servers [Array<Anthropic::Models::Beta::BetaRequestMCPServerURLDefinition>] Body param: MCP servers to be utilized in this request
@@ -22,7 +22,7 @@ module Anthropic
22
22
  # Learn more about the Messages API in our
23
23
  # [user guide](https://docs.claude.com/en/docs/initial-setup)
24
24
  #
25
- # @overload create(max_tokens:, messages:, model:, container: nil, inference_geo: nil, metadata: nil, output_config: nil, service_tier: nil, stop_sequences: nil, system_: nil, temperature: nil, thinking: nil, tool_choice: nil, tools: nil, top_k: nil, top_p: nil, request_options: {})
25
+ # @overload create(max_tokens:, messages:, model:, cache_control: nil, container: nil, inference_geo: nil, metadata: nil, output_config: nil, service_tier: nil, stop_sequences: nil, system_: nil, temperature: nil, thinking: nil, tool_choice: nil, tools: nil, top_k: nil, top_p: nil, request_options: {})
26
26
  #
27
27
  # @param max_tokens [Integer] The maximum number of tokens to generate before stopping.
28
28
  #
@@ -30,6 +30,8 @@ module Anthropic
30
30
  #
31
31
  # @param model [Symbol, String, Anthropic::Models::Model] The model that will complete your prompt.\n\nSee [models](https://docs.anthropic
32
32
  #
33
+ # @param cache_control [Anthropic::Models::CacheControlEphemeral, nil] Top-level cache control automatically applies a cache_control marker to the last
34
+ #
33
35
  # @param container [String, nil] Container identifier for reuse across requests.
34
36
  #
35
37
  # @param inference_geo [String, nil] Specifies the geographic region for inference processing. If not specified, the
@@ -184,7 +186,7 @@ module Anthropic
184
186
  # Learn more about the Messages API in our
185
187
  # [user guide](https://docs.claude.com/en/docs/initial-setup)
186
188
  #
187
- # @overload stream_raw(max_tokens:, messages:, model:, container: nil, inference_geo: nil, metadata: nil, output_config: nil, service_tier: nil, stop_sequences: nil, system_: nil, temperature: nil, thinking: nil, tool_choice: nil, tools: nil, top_k: nil, top_p: nil, request_options: {})
189
+ # @overload stream_raw(max_tokens:, messages:, model:, cache_control: nil, container: nil, inference_geo: nil, metadata: nil, output_config: nil, service_tier: nil, stop_sequences: nil, system_: nil, temperature: nil, thinking: nil, tool_choice: nil, tools: nil, top_k: nil, top_p: nil, request_options: {})
188
190
  #
189
191
  # @param max_tokens [Integer] The maximum number of tokens to generate before stopping.
190
192
  #
@@ -192,6 +194,8 @@ module Anthropic
192
194
  #
193
195
  # @param model [Symbol, String, Anthropic::Models::Model] The model that will complete your prompt.\n\nSee [models](https://docs.anthropic
194
196
  #
197
+ # @param cache_control [Anthropic::Models::CacheControlEphemeral, nil] Top-level cache control automatically applies a cache_control marker to the last
198
+ #
195
199
  # @param container [String, nil] Container identifier for reuse across requests.
196
200
  #
197
201
  # @param inference_geo [String, nil] Specifies the geographic region for inference processing. If not specified, the
@@ -254,12 +258,14 @@ module Anthropic
254
258
  # Learn more about token counting in our
255
259
  # [user guide](https://docs.claude.com/en/docs/build-with-claude/token-counting)
256
260
  #
257
- # @overload count_tokens(messages:, model:, output_config: nil, system_: nil, thinking: nil, tool_choice: nil, tools: nil, request_options: {})
261
+ # @overload count_tokens(messages:, model:, cache_control: nil, output_config: nil, system_: nil, thinking: nil, tool_choice: nil, tools: nil, request_options: {})
258
262
  #
259
263
  # @param messages [Array<Anthropic::Models::MessageParam>] Input messages.
260
264
  #
261
265
  # @param model [Symbol, String, Anthropic::Models::Model] The model that will complete your prompt.\n\nSee [models](https://docs.anthropic
262
266
  #
267
+ # @param cache_control [Anthropic::Models::CacheControlEphemeral, nil] Top-level cache control automatically applies a cache_control marker to the last
268
+ #
263
269
  # @param output_config [Anthropic::Models::OutputConfig] Configuration options for the model's output, such as the output format.
264
270
  #
265
271
  # @param system_ [String, Array<Anthropic::Models::TextBlockParam>] System prompt.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Anthropic
4
- VERSION = "1.22.0"
4
+ VERSION = "1.23.0"
5
5
  end
@@ -89,6 +89,19 @@ module Anthropic
89
89
  sig { returns(T.any(Anthropic::Model::OrSymbol, String)) }
90
90
  attr_accessor :model
91
91
 
92
+ # Top-level cache control automatically applies a cache_control marker to the last
93
+ # cacheable block in the request.
94
+ sig { returns(T.nilable(Anthropic::Beta::BetaCacheControlEphemeral)) }
95
+ attr_reader :cache_control
96
+
97
+ sig do
98
+ params(
99
+ cache_control:
100
+ T.nilable(Anthropic::Beta::BetaCacheControlEphemeral::OrHash)
101
+ ).void
102
+ end
103
+ attr_writer :cache_control
104
+
92
105
  # Context management configuration.
93
106
  #
94
107
  # This allows you to control how Claude manages context across multiple requests,
@@ -405,6 +418,8 @@ module Anthropic
405
418
  params(
406
419
  messages: T::Array[Anthropic::Beta::BetaMessageParam::OrHash],
407
420
  model: T.any(Anthropic::Model::OrSymbol, String),
421
+ cache_control:
422
+ T.nilable(Anthropic::Beta::BetaCacheControlEphemeral::OrHash),
408
423
  context_management:
409
424
  T.nilable(Anthropic::Beta::BetaContextManagementConfig::OrHash),
410
425
  mcp_servers:
@@ -534,6 +549,9 @@ module Anthropic
534
549
  # [models](https://docs.anthropic.com/en/docs/models-overview) for additional
535
550
  # details and options.
536
551
  model:,
552
+ # Top-level cache control automatically applies a cache_control marker to the last
553
+ # cacheable block in the request.
554
+ cache_control: nil,
537
555
  # Context management configuration.
538
556
  #
539
557
  # This allows you to control how Claude manages context across multiple requests,
@@ -658,6 +676,8 @@ module Anthropic
658
676
  {
659
677
  messages: T::Array[Anthropic::Beta::BetaMessageParam],
660
678
  model: T.any(Anthropic::Model::OrSymbol, String),
679
+ cache_control:
680
+ T.nilable(Anthropic::Beta::BetaCacheControlEphemeral),
661
681
  context_management:
662
682
  T.nilable(Anthropic::Beta::BetaContextManagementConfig),
663
683
  mcp_servers:
@@ -99,6 +99,19 @@ module Anthropic
99
99
  sig { returns(T.any(Anthropic::Model::OrSymbol, String)) }
100
100
  attr_accessor :model
101
101
 
102
+ # Top-level cache control automatically applies a cache_control marker to the last
103
+ # cacheable block in the request.
104
+ sig { returns(T.nilable(Anthropic::Beta::BetaCacheControlEphemeral)) }
105
+ attr_reader :cache_control
106
+
107
+ sig do
108
+ params(
109
+ cache_control:
110
+ T.nilable(Anthropic::Beta::BetaCacheControlEphemeral::OrHash)
111
+ ).void
112
+ end
113
+ attr_writer :cache_control
114
+
102
115
  # Container identifier for reuse across requests.
103
116
  sig do
104
117
  returns(
@@ -511,6 +524,8 @@ module Anthropic
511
524
  max_tokens: Integer,
512
525
  messages: T::Array[Anthropic::Beta::BetaMessageParam::OrHash],
513
526
  model: T.any(Anthropic::Model::OrSymbol, String),
527
+ cache_control:
528
+ T.nilable(Anthropic::Beta::BetaCacheControlEphemeral::OrHash),
514
529
  container:
515
530
  T.nilable(
516
531
  T.any(Anthropic::Beta::BetaContainerParams::OrHash, String)
@@ -657,6 +672,9 @@ module Anthropic
657
672
  # [models](https://docs.anthropic.com/en/docs/models-overview) for additional
658
673
  # details and options.
659
674
  model:,
675
+ # Top-level cache control automatically applies a cache_control marker to the last
676
+ # cacheable block in the request.
677
+ cache_control: nil,
660
678
  # Container identifier for reuse across requests.
661
679
  container: nil,
662
680
  # Context management configuration.
@@ -832,6 +850,8 @@ module Anthropic
832
850
  max_tokens: Integer,
833
851
  messages: T::Array[Anthropic::Beta::BetaMessageParam],
834
852
  model: T.any(Anthropic::Model::OrSymbol, String),
853
+ cache_control:
854
+ T.nilable(Anthropic::Beta::BetaCacheControlEphemeral),
835
855
  container:
836
856
  T.nilable(T.any(Anthropic::Beta::BetaContainerParams, String)),
837
857
  context_management:
@@ -240,6 +240,23 @@ module Anthropic
240
240
  sig { returns(T.any(Anthropic::Model::OrSymbol, String)) }
241
241
  attr_accessor :model
242
242
 
243
+ # Top-level cache control automatically applies a cache_control marker to the last
244
+ # cacheable block in the request.
245
+ sig do
246
+ returns(T.nilable(Anthropic::Beta::BetaCacheControlEphemeral))
247
+ end
248
+ attr_reader :cache_control
249
+
250
+ sig do
251
+ params(
252
+ cache_control:
253
+ T.nilable(
254
+ Anthropic::Beta::BetaCacheControlEphemeral::OrHash
255
+ )
256
+ ).void
257
+ end
258
+ attr_writer :cache_control
259
+
243
260
  # Container identifier for reuse across requests.
244
261
  sig do
245
262
  returns(
@@ -661,6 +678,10 @@ module Anthropic
661
678
  max_tokens: Integer,
662
679
  messages: T::Array[Anthropic::Beta::BetaMessageParam::OrHash],
663
680
  model: T.any(Anthropic::Model::OrSymbol, String),
681
+ cache_control:
682
+ T.nilable(
683
+ Anthropic::Beta::BetaCacheControlEphemeral::OrHash
684
+ ),
664
685
  container:
665
686
  T.nilable(
666
687
  T.any(
@@ -814,6 +835,9 @@ module Anthropic
814
835
  # [models](https://docs.anthropic.com/en/docs/models-overview) for additional
815
836
  # details and options.
816
837
  model:,
838
+ # Top-level cache control automatically applies a cache_control marker to the last
839
+ # cacheable block in the request.
840
+ cache_control: nil,
817
841
  # Container identifier for reuse across requests.
818
842
  container: nil,
819
843
  # Context management configuration.
@@ -990,6 +1014,8 @@ module Anthropic
990
1014
  max_tokens: Integer,
991
1015
  messages: T::Array[Anthropic::Beta::BetaMessageParam],
992
1016
  model: T.any(Anthropic::Model::OrSymbol, String),
1017
+ cache_control:
1018
+ T.nilable(Anthropic::Beta::BetaCacheControlEphemeral),
993
1019
  container:
994
1020
  T.nilable(
995
1021
  T.any(Anthropic::Beta::BetaContainerParams, String)
@@ -88,6 +88,18 @@ module Anthropic
88
88
  sig { returns(T.any(Anthropic::Model::OrSymbol, String)) }
89
89
  attr_accessor :model
90
90
 
91
+ # Top-level cache control automatically applies a cache_control marker to the last
92
+ # cacheable block in the request.
93
+ sig { returns(T.nilable(Anthropic::CacheControlEphemeral)) }
94
+ attr_reader :cache_control
95
+
96
+ sig do
97
+ params(
98
+ cache_control: T.nilable(Anthropic::CacheControlEphemeral::OrHash)
99
+ ).void
100
+ end
101
+ attr_writer :cache_control
102
+
91
103
  # Configuration options for the model's output, such as the output format.
92
104
  sig { returns(T.nilable(Anthropic::OutputConfig)) }
93
105
  attr_reader :output_config
@@ -309,6 +321,7 @@ module Anthropic
309
321
  params(
310
322
  messages: T::Array[Anthropic::MessageParam::OrHash],
311
323
  model: T.any(Anthropic::Model::OrSymbol, String),
324
+ cache_control: T.nilable(Anthropic::CacheControlEphemeral::OrHash),
312
325
  output_config: Anthropic::OutputConfig::OrHash,
313
326
  system_: Anthropic::MessageCountTokensParams::System::Variants,
314
327
  thinking:
@@ -418,6 +431,9 @@ module Anthropic
418
431
  # [models](https://docs.anthropic.com/en/docs/models-overview) for additional
419
432
  # details and options.
420
433
  model:,
434
+ # Top-level cache control automatically applies a cache_control marker to the last
435
+ # cacheable block in the request.
436
+ cache_control: nil,
421
437
  # Configuration options for the model's output, such as the output format.
422
438
  output_config: nil,
423
439
  # System prompt.
@@ -524,6 +540,7 @@ module Anthropic
524
540
  {
525
541
  messages: T::Array[Anthropic::MessageParam],
526
542
  model: T.any(Anthropic::Model::OrSymbol, String),
543
+ cache_control: T.nilable(Anthropic::CacheControlEphemeral),
527
544
  output_config: Anthropic::OutputConfig,
528
545
  system_: Anthropic::MessageCountTokensParams::System::Variants,
529
546
  thinking:
@@ -95,6 +95,18 @@ module Anthropic
95
95
  sig { returns(T.any(Anthropic::Model::OrSymbol, String)) }
96
96
  attr_accessor :model
97
97
 
98
+ # Top-level cache control automatically applies a cache_control marker to the last
99
+ # cacheable block in the request.
100
+ sig { returns(T.nilable(Anthropic::CacheControlEphemeral)) }
101
+ attr_reader :cache_control
102
+
103
+ sig do
104
+ params(
105
+ cache_control: T.nilable(Anthropic::CacheControlEphemeral::OrHash)
106
+ ).void
107
+ end
108
+ attr_writer :cache_control
109
+
98
110
  # Container identifier for reuse across requests.
99
111
  sig { returns(T.nilable(String)) }
100
112
  attr_accessor :container
@@ -405,6 +417,7 @@ module Anthropic
405
417
  max_tokens: Integer,
406
418
  messages: T::Array[Anthropic::MessageParam::OrHash],
407
419
  model: T.any(Anthropic::Model::OrSymbol, String),
420
+ cache_control: T.nilable(Anthropic::CacheControlEphemeral::OrHash),
408
421
  container: T.nilable(String),
409
422
  inference_geo: T.nilable(String),
410
423
  metadata: Anthropic::Metadata::OrHash,
@@ -530,6 +543,9 @@ module Anthropic
530
543
  # [models](https://docs.anthropic.com/en/docs/models-overview) for additional
531
544
  # details and options.
532
545
  model:,
546
+ # Top-level cache control automatically applies a cache_control marker to the last
547
+ # cacheable block in the request.
548
+ cache_control: nil,
533
549
  # Container identifier for reuse across requests.
534
550
  container: nil,
535
551
  # Specifies the geographic region for inference processing. If not specified, the
@@ -687,6 +703,7 @@ module Anthropic
687
703
  max_tokens: Integer,
688
704
  messages: T::Array[Anthropic::MessageParam],
689
705
  model: T.any(Anthropic::Model::OrSymbol, String),
706
+ cache_control: T.nilable(Anthropic::CacheControlEphemeral),
690
707
  container: T.nilable(String),
691
708
  inference_geo: T.nilable(String),
692
709
  metadata: Anthropic::Metadata,
@@ -207,6 +207,19 @@ module Anthropic
207
207
  sig { returns(T.any(Anthropic::Model::OrSymbol, String)) }
208
208
  attr_accessor :model
209
209
 
210
+ # Top-level cache control automatically applies a cache_control marker to the last
211
+ # cacheable block in the request.
212
+ sig { returns(T.nilable(Anthropic::CacheControlEphemeral)) }
213
+ attr_reader :cache_control
214
+
215
+ sig do
216
+ params(
217
+ cache_control:
218
+ T.nilable(Anthropic::CacheControlEphemeral::OrHash)
219
+ ).void
220
+ end
221
+ attr_writer :cache_control
222
+
210
223
  # Container identifier for reuse across requests.
211
224
  sig { returns(T.nilable(String)) }
212
225
  attr_accessor :container
@@ -540,6 +553,8 @@ module Anthropic
540
553
  max_tokens: Integer,
541
554
  messages: T::Array[Anthropic::MessageParam::OrHash],
542
555
  model: T.any(Anthropic::Model::OrSymbol, String),
556
+ cache_control:
557
+ T.nilable(Anthropic::CacheControlEphemeral::OrHash),
543
558
  container: T.nilable(String),
544
559
  inference_geo: T.nilable(String),
545
560
  metadata: Anthropic::Metadata::OrHash,
@@ -667,6 +682,9 @@ module Anthropic
667
682
  # [models](https://docs.anthropic.com/en/docs/models-overview) for additional
668
683
  # details and options.
669
684
  model:,
685
+ # Top-level cache control automatically applies a cache_control marker to the last
686
+ # cacheable block in the request.
687
+ cache_control: nil,
670
688
  # Container identifier for reuse across requests.
671
689
  container: nil,
672
690
  # Specifies the geographic region for inference processing. If not specified, the
@@ -827,6 +845,7 @@ module Anthropic
827
845
  max_tokens: Integer,
828
846
  messages: T::Array[Anthropic::MessageParam],
829
847
  model: T.any(Anthropic::Model::OrSymbol, String),
848
+ cache_control: T.nilable(Anthropic::CacheControlEphemeral),
830
849
  container: T.nilable(String),
831
850
  inference_geo: T.nilable(String),
832
851
  metadata: Anthropic::Metadata,
@@ -320,6 +320,8 @@ module Anthropic
320
320
  max_tokens: Integer,
321
321
  messages: T::Array[Anthropic::Beta::BetaMessageParam::OrHash],
322
322
  model: T.any(Anthropic::Model::OrSymbol, String),
323
+ cache_control:
324
+ T.nilable(Anthropic::Beta::BetaCacheControlEphemeral::OrHash),
323
325
  container:
324
326
  T.nilable(
325
327
  T.any(Anthropic::Beta::BetaContainerParams::OrHash, String)
@@ -467,6 +469,9 @@ module Anthropic
467
469
  # [models](https://docs.anthropic.com/en/docs/models-overview) for additional
468
470
  # details and options.
469
471
  model:,
472
+ # Body param: Top-level cache control automatically applies a cache_control marker
473
+ # to the last cacheable block in the request.
474
+ cache_control: nil,
470
475
  # Body param: Container identifier for reuse across requests.
471
476
  container: nil,
472
477
  # Body param: Context management configuration.
@@ -655,6 +660,8 @@ module Anthropic
655
660
  max_tokens: Integer,
656
661
  messages: T::Array[Anthropic::Beta::BetaMessageParam::OrHash],
657
662
  model: T.any(Anthropic::Model::OrSymbol, String),
663
+ cache_control:
664
+ T.nilable(Anthropic::Beta::BetaCacheControlEphemeral::OrHash),
658
665
  container:
659
666
  T.nilable(
660
667
  T.any(Anthropic::Beta::BetaContainerParams::OrHash, String)
@@ -806,6 +813,9 @@ module Anthropic
806
813
  # [models](https://docs.anthropic.com/en/docs/models-overview) for additional
807
814
  # details and options.
808
815
  model:,
816
+ # Body param: Top-level cache control automatically applies a cache_control marker
817
+ # to the last cacheable block in the request.
818
+ cache_control: nil,
809
819
  # Body param: Container identifier for reuse across requests.
810
820
  container: nil,
811
821
  # Body param: Context management configuration.
@@ -990,6 +1000,8 @@ module Anthropic
990
1000
  params(
991
1001
  messages: T::Array[Anthropic::Beta::BetaMessageParam::OrHash],
992
1002
  model: T.any(Anthropic::Model::OrSymbol, String),
1003
+ cache_control:
1004
+ T.nilable(Anthropic::Beta::BetaCacheControlEphemeral::OrHash),
993
1005
  context_management:
994
1006
  T.nilable(Anthropic::Beta::BetaContextManagementConfig::OrHash),
995
1007
  mcp_servers:
@@ -1119,6 +1131,9 @@ module Anthropic
1119
1131
  # [models](https://docs.anthropic.com/en/docs/models-overview) for additional
1120
1132
  # details and options.
1121
1133
  model:,
1134
+ # Body param: Top-level cache control automatically applies a cache_control marker
1135
+ # to the last cacheable block in the request.
1136
+ cache_control: nil,
1122
1137
  # Body param: Context management configuration.
1123
1138
  #
1124
1139
  # This allows you to control how Claude manages context across multiple requests,
@@ -21,6 +21,7 @@ module Anthropic
21
21
  max_tokens: Integer,
22
22
  messages: T::Array[Anthropic::MessageParam::OrHash],
23
23
  model: T.any(Anthropic::Model::OrSymbol, String),
24
+ cache_control: T.nilable(Anthropic::CacheControlEphemeral::OrHash),
24
25
  container: T.nilable(String),
25
26
  inference_geo: T.nilable(String),
26
27
  metadata: Anthropic::Metadata::OrHash,
@@ -147,6 +148,9 @@ module Anthropic
147
148
  # [models](https://docs.anthropic.com/en/docs/models-overview) for additional
148
149
  # details and options.
149
150
  model:,
151
+ # Top-level cache control automatically applies a cache_control marker to the last
152
+ # cacheable block in the request.
153
+ cache_control: nil,
150
154
  # Container identifier for reuse across requests.
151
155
  container: nil,
152
156
  # Specifies the geographic region for inference processing. If not specified, the
@@ -607,6 +611,7 @@ module Anthropic
607
611
  max_tokens: Integer,
608
612
  messages: T::Array[Anthropic::MessageParam::OrHash],
609
613
  model: T.any(Anthropic::Model::OrSymbol, String),
614
+ cache_control: T.nilable(Anthropic::CacheControlEphemeral::OrHash),
610
615
  container: T.nilable(String),
611
616
  inference_geo: T.nilable(String),
612
617
  metadata: Anthropic::Metadata::OrHash,
@@ -737,6 +742,9 @@ module Anthropic
737
742
  # [models](https://docs.anthropic.com/en/docs/models-overview) for additional
738
743
  # details and options.
739
744
  model:,
745
+ # Top-level cache control automatically applies a cache_control marker to the last
746
+ # cacheable block in the request.
747
+ cache_control: nil,
740
748
  # Container identifier for reuse across requests.
741
749
  container: nil,
742
750
  # Specifies the geographic region for inference processing. If not specified, the
@@ -902,6 +910,7 @@ module Anthropic
902
910
  params(
903
911
  messages: T::Array[Anthropic::MessageParam::OrHash],
904
912
  model: T.any(Anthropic::Model::OrSymbol, String),
913
+ cache_control: T.nilable(Anthropic::CacheControlEphemeral::OrHash),
905
914
  output_config: Anthropic::OutputConfig::OrHash,
906
915
  system_: Anthropic::MessageCountTokensParams::System::Variants,
907
916
  thinking:
@@ -1011,6 +1020,9 @@ module Anthropic
1011
1020
  # [models](https://docs.anthropic.com/en/docs/models-overview) for additional
1012
1021
  # details and options.
1013
1022
  model:,
1023
+ # Top-level cache control automatically applies a cache_control marker to the last
1024
+ # cacheable block in the request.
1025
+ cache_control: nil,
1014
1026
  # Configuration options for the model's output, such as the output format.
1015
1027
  output_config: nil,
1016
1028
  # System prompt.
@@ -5,6 +5,7 @@ module Anthropic
5
5
  {
6
6
  messages: ::Array[Anthropic::Beta::BetaMessageParam],
7
7
  model: Anthropic::Models::model,
8
+ cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
8
9
  context_management: Anthropic::Beta::BetaContextManagementConfig?,
9
10
  mcp_servers: ::Array[Anthropic::Beta::BetaRequestMCPServerURLDefinition],
10
11
  output_config: Anthropic::Beta::BetaOutputConfig,
@@ -26,6 +27,8 @@ module Anthropic
26
27
 
27
28
  attr_accessor model: Anthropic::Models::model
28
29
 
30
+ attr_accessor cache_control: Anthropic::Beta::BetaCacheControlEphemeral?
31
+
29
32
  attr_accessor context_management: Anthropic::Beta::BetaContextManagementConfig?
30
33
 
31
34
  attr_reader mcp_servers: ::Array[Anthropic::Beta::BetaRequestMCPServerURLDefinition]?
@@ -77,6 +80,7 @@ module Anthropic
77
80
  def initialize: (
78
81
  messages: ::Array[Anthropic::Beta::BetaMessageParam],
79
82
  model: Anthropic::Models::model,
83
+ ?cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
80
84
  ?context_management: Anthropic::Beta::BetaContextManagementConfig?,
81
85
  ?mcp_servers: ::Array[Anthropic::Beta::BetaRequestMCPServerURLDefinition],
82
86
  ?output_config: Anthropic::Beta::BetaOutputConfig,
@@ -93,6 +97,7 @@ module Anthropic
93
97
  def to_hash: -> {
94
98
  messages: ::Array[Anthropic::Beta::BetaMessageParam],
95
99
  model: Anthropic::Models::model,
100
+ cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
96
101
  context_management: Anthropic::Beta::BetaContextManagementConfig?,
97
102
  mcp_servers: ::Array[Anthropic::Beta::BetaRequestMCPServerURLDefinition],
98
103
  output_config: Anthropic::Beta::BetaOutputConfig,
@@ -6,6 +6,7 @@ module Anthropic
6
6
  max_tokens: Integer,
7
7
  messages: ::Array[Anthropic::Beta::BetaMessageParam],
8
8
  model: Anthropic::Models::model,
9
+ cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
9
10
  container: Anthropic::Models::Beta::MessageCreateParams::container?,
10
11
  context_management: Anthropic::Beta::BetaContextManagementConfig?,
11
12
  inference_geo: String?,
@@ -37,6 +38,8 @@ module Anthropic
37
38
 
38
39
  attr_accessor model: Anthropic::Models::model
39
40
 
41
+ attr_accessor cache_control: Anthropic::Beta::BetaCacheControlEphemeral?
42
+
40
43
  attr_accessor container: Anthropic::Models::Beta::MessageCreateParams::container?
41
44
 
42
45
  attr_accessor context_management: Anthropic::Beta::BetaContextManagementConfig?
@@ -121,6 +124,7 @@ module Anthropic
121
124
  max_tokens: Integer,
122
125
  messages: ::Array[Anthropic::Beta::BetaMessageParam],
123
126
  model: Anthropic::Models::model,
127
+ ?cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
124
128
  ?container: Anthropic::Models::Beta::MessageCreateParams::container?,
125
129
  ?context_management: Anthropic::Beta::BetaContextManagementConfig?,
126
130
  ?inference_geo: String?,
@@ -146,6 +150,7 @@ module Anthropic
146
150
  max_tokens: Integer,
147
151
  messages: ::Array[Anthropic::Beta::BetaMessageParam],
148
152
  model: Anthropic::Models::model,
153
+ cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
149
154
  container: Anthropic::Models::Beta::MessageCreateParams::container?,
150
155
  context_management: Anthropic::Beta::BetaContextManagementConfig?,
151
156
  inference_geo: String?,
@@ -59,6 +59,7 @@ module Anthropic
59
59
  max_tokens: Integer,
60
60
  messages: ::Array[Anthropic::Beta::BetaMessageParam],
61
61
  model: Anthropic::Models::model,
62
+ cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
62
63
  container: Anthropic::Models::Beta::Messages::BatchCreateParams::Request::Params::container?,
63
64
  context_management: Anthropic::Beta::BetaContextManagementConfig?,
64
65
  inference_geo: String?,
@@ -86,6 +87,8 @@ module Anthropic
86
87
 
87
88
  attr_accessor model: Anthropic::Models::model
88
89
 
90
+ attr_accessor cache_control: Anthropic::Beta::BetaCacheControlEphemeral?
91
+
89
92
  attr_accessor container: Anthropic::Models::Beta::Messages::BatchCreateParams::Request::Params::container?
90
93
 
91
94
  attr_accessor context_management: Anthropic::Beta::BetaContextManagementConfig?
@@ -168,6 +171,7 @@ module Anthropic
168
171
  max_tokens: Integer,
169
172
  messages: ::Array[Anthropic::Beta::BetaMessageParam],
170
173
  model: Anthropic::Models::model,
174
+ ?cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
171
175
  ?container: Anthropic::Models::Beta::Messages::BatchCreateParams::Request::Params::container?,
172
176
  ?context_management: Anthropic::Beta::BetaContextManagementConfig?,
173
177
  ?inference_geo: String?,
@@ -192,6 +196,7 @@ module Anthropic
192
196
  max_tokens: Integer,
193
197
  messages: ::Array[Anthropic::Beta::BetaMessageParam],
194
198
  model: Anthropic::Models::model,
199
+ cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
195
200
  container: Anthropic::Models::Beta::Messages::BatchCreateParams::Request::Params::container?,
196
201
  context_management: Anthropic::Beta::BetaContextManagementConfig?,
197
202
  inference_geo: String?,
@@ -4,6 +4,7 @@ module Anthropic
4
4
  {
5
5
  messages: ::Array[Anthropic::MessageParam],
6
6
  model: Anthropic::Models::model,
7
+ cache_control: Anthropic::CacheControlEphemeral?,
7
8
  output_config: Anthropic::OutputConfig,
8
9
  system_: Anthropic::Models::MessageCountTokensParams::system_,
9
10
  thinking: Anthropic::Models::thinking_config_param,
@@ -20,6 +21,8 @@ module Anthropic
20
21
 
21
22
  attr_accessor model: Anthropic::Models::model
22
23
 
24
+ attr_accessor cache_control: Anthropic::CacheControlEphemeral?
25
+
23
26
  attr_reader output_config: Anthropic::OutputConfig?
24
27
 
25
28
  def output_config=: (Anthropic::OutputConfig) -> Anthropic::OutputConfig
@@ -51,6 +54,7 @@ module Anthropic
51
54
  def initialize: (
52
55
  messages: ::Array[Anthropic::MessageParam],
53
56
  model: Anthropic::Models::model,
57
+ ?cache_control: Anthropic::CacheControlEphemeral?,
54
58
  ?output_config: Anthropic::OutputConfig,
55
59
  ?system_: Anthropic::Models::MessageCountTokensParams::system_,
56
60
  ?thinking: Anthropic::Models::thinking_config_param,
@@ -62,6 +66,7 @@ module Anthropic
62
66
  def to_hash: -> {
63
67
  messages: ::Array[Anthropic::MessageParam],
64
68
  model: Anthropic::Models::model,
69
+ cache_control: Anthropic::CacheControlEphemeral?,
65
70
  output_config: Anthropic::OutputConfig,
66
71
  system_: Anthropic::Models::MessageCountTokensParams::system_,
67
72
  thinking: Anthropic::Models::thinking_config_param,
@@ -5,6 +5,7 @@ module Anthropic
5
5
  max_tokens: Integer,
6
6
  messages: ::Array[Anthropic::MessageParam],
7
7
  model: Anthropic::Models::model,
8
+ cache_control: Anthropic::CacheControlEphemeral?,
8
9
  container: String?,
9
10
  inference_geo: String?,
10
11
  metadata: Anthropic::Metadata,
@@ -31,6 +32,8 @@ module Anthropic
31
32
 
32
33
  attr_accessor model: Anthropic::Models::model
33
34
 
35
+ attr_accessor cache_control: Anthropic::CacheControlEphemeral?
36
+
34
37
  attr_accessor container: String?
35
38
 
36
39
  attr_accessor inference_geo: String?
@@ -93,6 +96,7 @@ module Anthropic
93
96
  max_tokens: Integer,
94
97
  messages: ::Array[Anthropic::MessageParam],
95
98
  model: Anthropic::Models::model,
99
+ ?cache_control: Anthropic::CacheControlEphemeral?,
96
100
  ?container: String?,
97
101
  ?inference_geo: String?,
98
102
  ?metadata: Anthropic::Metadata,
@@ -113,6 +117,7 @@ module Anthropic
113
117
  max_tokens: Integer,
114
118
  messages: ::Array[Anthropic::MessageParam],
115
119
  model: Anthropic::Models::model,
120
+ cache_control: Anthropic::CacheControlEphemeral?,
116
121
  container: String?,
117
122
  inference_geo: String?,
118
123
  metadata: Anthropic::Metadata,
@@ -47,6 +47,7 @@ module Anthropic
47
47
  max_tokens: Integer,
48
48
  messages: ::Array[Anthropic::MessageParam],
49
49
  model: Anthropic::Models::model,
50
+ cache_control: Anthropic::CacheControlEphemeral?,
50
51
  container: String?,
51
52
  inference_geo: String?,
52
53
  metadata: Anthropic::Metadata,
@@ -70,6 +71,8 @@ module Anthropic
70
71
 
71
72
  attr_accessor model: Anthropic::Models::model
72
73
 
74
+ attr_accessor cache_control: Anthropic::CacheControlEphemeral?
75
+
73
76
  attr_accessor container: String?
74
77
 
75
78
  attr_accessor inference_geo: String?
@@ -138,6 +141,7 @@ module Anthropic
138
141
  max_tokens: Integer,
139
142
  messages: ::Array[Anthropic::MessageParam],
140
143
  model: Anthropic::Models::model,
144
+ ?cache_control: Anthropic::CacheControlEphemeral?,
141
145
  ?container: String?,
142
146
  ?inference_geo: String?,
143
147
  ?metadata: Anthropic::Metadata,
@@ -158,6 +162,7 @@ module Anthropic
158
162
  max_tokens: Integer,
159
163
  messages: ::Array[Anthropic::MessageParam],
160
164
  model: Anthropic::Models::model,
165
+ cache_control: Anthropic::CacheControlEphemeral?,
161
166
  container: String?,
162
167
  inference_geo: String?,
163
168
  metadata: Anthropic::Metadata,
@@ -8,6 +8,7 @@ module Anthropic
8
8
  max_tokens: Integer,
9
9
  messages: ::Array[Anthropic::Beta::BetaMessageParam],
10
10
  model: Anthropic::Models::model,
11
+ ?cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
11
12
  ?container: Anthropic::Models::Beta::MessageCreateParams::container?,
12
13
  ?context_management: Anthropic::Beta::BetaContextManagementConfig?,
13
14
  ?inference_geo: String?,
@@ -33,6 +34,7 @@ module Anthropic
33
34
  max_tokens: Integer,
34
35
  messages: ::Array[Anthropic::Beta::BetaMessageParam],
35
36
  model: Anthropic::Models::model,
37
+ ?cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
36
38
  ?container: Anthropic::Models::Beta::MessageCreateParams::container?,
37
39
  ?context_management: Anthropic::Beta::BetaContextManagementConfig?,
38
40
  ?inference_geo: String?,
@@ -57,6 +59,7 @@ module Anthropic
57
59
  def count_tokens: (
58
60
  messages: ::Array[Anthropic::Beta::BetaMessageParam],
59
61
  model: Anthropic::Models::model,
62
+ ?cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
60
63
  ?context_management: Anthropic::Beta::BetaContextManagementConfig?,
61
64
  ?mcp_servers: ::Array[Anthropic::Beta::BetaRequestMCPServerURLDefinition],
62
65
  ?output_config: Anthropic::Beta::BetaOutputConfig,
@@ -7,6 +7,7 @@ module Anthropic
7
7
  max_tokens: Integer,
8
8
  messages: ::Array[Anthropic::MessageParam],
9
9
  model: Anthropic::Models::model,
10
+ ?cache_control: Anthropic::CacheControlEphemeral?,
10
11
  ?container: String?,
11
12
  ?inference_geo: String?,
12
13
  ?metadata: Anthropic::Metadata,
@@ -27,6 +28,7 @@ module Anthropic
27
28
  max_tokens: Integer,
28
29
  messages: ::Array[Anthropic::MessageParam],
29
30
  model: Anthropic::Models::model,
31
+ ?cache_control: Anthropic::CacheControlEphemeral?,
30
32
  ?container: String?,
31
33
  ?inference_geo: String?,
32
34
  ?metadata: Anthropic::Metadata,
@@ -46,6 +48,7 @@ module Anthropic
46
48
  def count_tokens: (
47
49
  messages: ::Array[Anthropic::MessageParam],
48
50
  model: Anthropic::Models::model,
51
+ ?cache_control: Anthropic::CacheControlEphemeral?,
49
52
  ?output_config: Anthropic::OutputConfig,
50
53
  ?system_: Anthropic::Models::MessageCountTokensParams::system_,
51
54
  ?thinking: Anthropic::Models::thinking_config_param,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anthropic
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.22.0
4
+ version: 1.23.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anthropic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-02-18 00:00:00.000000000 Z
11
+ date: 2026-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cgi