anthropic 1.17.0 → 1.18.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 +19 -0
- data/README.md +1 -1
- data/lib/anthropic/helpers/streaming/events.rb +13 -0
- data/lib/anthropic/helpers/streaming/message_stream.rb +11 -0
- data/lib/anthropic/internal/transport/pooled_net_requester.rb +1 -1
- data/lib/anthropic/models/beta/beta_compact_20260112_edit.rb +46 -0
- data/lib/anthropic/models/beta/beta_compaction_block.rb +33 -0
- data/lib/anthropic/models/beta/beta_compaction_block_param.rb +43 -0
- data/lib/anthropic/models/beta/beta_compaction_content_block_delta.rb +25 -0
- data/lib/anthropic/models/beta/beta_compaction_iteration_usage.rb +62 -0
- data/lib/anthropic/models/beta/beta_content_block.rb +8 -1
- data/lib/anthropic/models/beta/beta_content_block_param.rb +10 -1
- data/lib/anthropic/models/beta/beta_context_management_config.rb +8 -3
- data/lib/anthropic/models/beta/beta_iterations_usage.rb +28 -0
- data/lib/anthropic/models/beta/beta_message.rb +2 -2
- data/lib/anthropic/models/beta/beta_message_delta_usage.rb +21 -1
- data/lib/anthropic/models/beta/beta_message_iteration_usage.rb +62 -0
- data/lib/anthropic/models/beta/beta_message_param.rb +3 -3
- data/lib/anthropic/models/beta/beta_output_config.rb +4 -9
- data/lib/anthropic/models/beta/beta_raw_content_block_delta.rb +3 -1
- data/lib/anthropic/models/beta/beta_raw_content_block_delta_event.rb +2 -2
- data/lib/anthropic/models/beta/beta_raw_content_block_start_event.rb +10 -3
- data/lib/anthropic/models/beta/beta_stop_reason.rb +1 -0
- data/lib/anthropic/models/beta/beta_thinking_config_adaptive.rb +19 -0
- data/lib/anthropic/models/beta/beta_thinking_config_param.rb +3 -1
- data/lib/anthropic/models/beta/beta_tool.rb +13 -1
- data/lib/anthropic/models/beta/beta_usage.rb +29 -1
- data/lib/anthropic/models/beta/message_count_tokens_params.rb +2 -2
- data/lib/anthropic/models/beta/message_create_params.rb +12 -3
- data/lib/anthropic/models/beta/messages/batch_create_params.rb +12 -3
- data/lib/anthropic/models/message_count_tokens_params.rb +2 -2
- data/lib/anthropic/models/message_create_params.rb +12 -3
- data/lib/anthropic/models/messages/batch_create_params.rb +12 -3
- data/lib/anthropic/models/model.rb +5 -0
- data/lib/anthropic/models/output_config.rb +24 -1
- data/lib/anthropic/models/thinking_config_adaptive.rb +15 -0
- data/lib/anthropic/models/thinking_config_param.rb +3 -1
- data/lib/anthropic/models/tool.rb +13 -1
- data/lib/anthropic/models/usage.rb +9 -1
- data/lib/anthropic/models.rb +2 -0
- data/lib/anthropic/resources/beta/messages.rb +30 -5
- data/lib/anthropic/resources/messages.rb +27 -5
- data/lib/anthropic/version.rb +1 -1
- data/lib/anthropic.rb +9 -0
- data/rbi/anthropic/models/beta/beta_compact_20260112_edit.rbi +78 -0
- data/rbi/anthropic/models/beta/beta_compaction_block.rbi +47 -0
- data/rbi/anthropic/models/beta/beta_compaction_block_param.rbi +75 -0
- data/rbi/anthropic/models/beta/beta_compaction_content_block_delta.rbi +37 -0
- data/rbi/anthropic/models/beta/beta_compaction_iteration_usage.rbi +94 -0
- data/rbi/anthropic/models/beta/beta_content_block.rbi +2 -1
- data/rbi/anthropic/models/beta/beta_content_block_param.rbi +2 -1
- data/rbi/anthropic/models/beta/beta_context_management_config.rbi +12 -5
- data/rbi/anthropic/models/beta/beta_iterations_usage.rbi +39 -0
- data/rbi/anthropic/models/beta/beta_message.rbi +2 -1
- data/rbi/anthropic/models/beta/beta_message_delta_usage.rbi +39 -0
- data/rbi/anthropic/models/beta/beta_message_iteration_usage.rbi +94 -0
- data/rbi/anthropic/models/beta/beta_output_config.rbi +5 -12
- data/rbi/anthropic/models/beta/beta_raw_content_block_delta.rbi +2 -1
- data/rbi/anthropic/models/beta/beta_raw_content_block_delta_event.rbi +2 -1
- data/rbi/anthropic/models/beta/beta_raw_content_block_start_event.rbi +4 -2
- data/rbi/anthropic/models/beta/beta_stop_reason.rbi +2 -0
- data/rbi/anthropic/models/beta/beta_thinking_config_adaptive.rbi +30 -0
- data/rbi/anthropic/models/beta/beta_thinking_config_param.rbi +2 -1
- data/rbi/anthropic/models/beta/beta_tool.rbi +16 -0
- data/rbi/anthropic/models/beta/beta_usage.rbi +47 -0
- data/rbi/anthropic/models/beta/message_count_tokens_params.rbi +8 -4
- data/rbi/anthropic/models/beta/message_create_params.rbi +18 -4
- data/rbi/anthropic/models/beta/messages/batch_create_params.rbi +18 -4
- data/rbi/anthropic/models/message_count_tokens_params.rbi +8 -4
- data/rbi/anthropic/models/message_create_params.rbi +18 -4
- data/rbi/anthropic/models/messages/batch_create_params.rbi +18 -4
- data/rbi/anthropic/models/model.rbi +4 -0
- data/rbi/anthropic/models/output_config.rbi +38 -4
- data/rbi/anthropic/models/thinking_config_adaptive.rbi +23 -0
- data/rbi/anthropic/models/thinking_config_param.rbi +2 -1
- data/rbi/anthropic/models/tool.rbi +16 -0
- data/rbi/anthropic/models/usage.rbi +8 -0
- data/rbi/anthropic/models.rbi +2 -0
- data/rbi/anthropic/resources/beta/messages.rbi +14 -3
- data/rbi/anthropic/resources/messages.rbi +14 -3
- data/sig/anthropic/models/beta/beta_compact_20260112_edit.rbs +41 -0
- data/sig/anthropic/models/beta/beta_compaction_block.rbs +19 -0
- data/sig/anthropic/models/beta/beta_compaction_block_param.rbs +34 -0
- data/sig/anthropic/models/beta/beta_compaction_content_block_delta.rbs +20 -0
- data/sig/anthropic/models/beta/beta_compaction_iteration_usage.rbs +49 -0
- data/sig/anthropic/models/beta/beta_content_block.rbs +1 -0
- data/sig/anthropic/models/beta/beta_content_block_param.rbs +1 -0
- data/sig/anthropic/models/beta/beta_context_management_config.rbs +1 -0
- data/sig/anthropic/models/beta/beta_iterations_usage.rbs +22 -0
- data/sig/anthropic/models/beta/beta_message_delta_usage.rbs +5 -0
- data/sig/anthropic/models/beta/beta_message_iteration_usage.rbs +49 -0
- data/sig/anthropic/models/beta/beta_output_config.rbs +2 -1
- data/sig/anthropic/models/beta/beta_raw_content_block_delta.rbs +1 -0
- data/sig/anthropic/models/beta/beta_raw_content_block_start_event.rbs +1 -0
- data/sig/anthropic/models/beta/beta_stop_reason.rbs +2 -0
- data/sig/anthropic/models/beta/beta_thinking_config_adaptive.rbs +17 -0
- data/sig/anthropic/models/beta/beta_thinking_config_param.rbs +1 -0
- data/sig/anthropic/models/beta/beta_tool.rbs +5 -0
- data/sig/anthropic/models/beta/beta_usage.rbs +10 -0
- data/sig/anthropic/models/beta/message_create_params.rbs +5 -0
- data/sig/anthropic/models/beta/messages/batch_create_params.rbs +5 -0
- data/sig/anthropic/models/message_create_params.rbs +5 -0
- data/sig/anthropic/models/messages/batch_create_params.rbs +5 -0
- data/sig/anthropic/models/model.rbs +5 -1
- data/sig/anthropic/models/output_config.rbs +28 -3
- data/sig/anthropic/models/thinking_config_adaptive.rbs +13 -0
- data/sig/anthropic/models/thinking_config_param.rbs +3 -1
- data/sig/anthropic/models/tool.rbs +5 -0
- data/sig/anthropic/models/usage.rbs +5 -0
- data/sig/anthropic/models.rbs +2 -0
- data/sig/anthropic/resources/beta/messages.rbs +2 -0
- data/sig/anthropic/resources/messages.rbs +2 -0
- metadata +29 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: aa12265ad752f381a43cc10fd241f157049b40a092f8792f58c942d1d2523aeb
|
|
4
|
+
data.tar.gz: c3f5c151995f28bfca102ac4dca98e33c3f1144c6c2d9a20a864d092a1fb2304
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b155c6a753280b3219a33514bec5698ea303fd35e9d37166ca8de2af27d0708468f2c944100684e3fe56b6415e24d9ad279e5f2c8a1abadcb5c3fc793fc5b94d
|
|
7
|
+
data.tar.gz: 3be747abe016c87882b22921c29704e3b2808e18a6aaec060388414cd209f8b5a610c81024807c419a2942e5a56bfe31026d6da2b4f34dec2043a9349e95166d
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.18.0 (2026-02-05)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v1.17.0...v1.18.0](https://github.com/anthropics/anthropic-sdk-ruby/compare/v1.17.0...v1.18.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** manual updates ([53027e2](https://github.com/anthropics/anthropic-sdk-ruby/commit/53027e2d56db596ca8a42558d848ebd22075a854))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* **client:** always add content-length to post body, even when empty ([359dcee](https://github.com/anthropics/anthropic-sdk-ruby/commit/359dcee68a26733fe1ee884a393aed88fd28b05b))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Chores
|
|
18
|
+
|
|
19
|
+
* **ci:** remove claude-code-review workflow ([4d513ef](https://github.com/anthropics/anthropic-sdk-ruby/commit/4d513efcb8d074bd70efc4513bdcc5a0872e7171))
|
|
20
|
+
* **docs:** remove www prefix ([306cdf9](https://github.com/anthropics/anthropic-sdk-ruby/commit/306cdf9962dba36b35a83eaaa7e5be166fc5a35f))
|
|
21
|
+
|
|
3
22
|
## 1.17.0 (2026-01-29)
|
|
4
23
|
|
|
5
24
|
Full Changelog: [v1.16.3...v1.17.0](https://github.com/anthropics/anthropic-sdk-ruby/compare/v1.16.3...v1.17.0)
|
data/README.md
CHANGED
|
@@ -76,6 +76,19 @@ module Anthropic
|
|
|
76
76
|
required :signature, String
|
|
77
77
|
end
|
|
78
78
|
|
|
79
|
+
class CompactionEvent < Anthropic::Internal::Type::BaseModel
|
|
80
|
+
# @!attribute type
|
|
81
|
+
#
|
|
82
|
+
# @return [Symbol, :compaction]
|
|
83
|
+
required :type, const: :compaction
|
|
84
|
+
|
|
85
|
+
# @!attribute content
|
|
86
|
+
# The compacted content summary.
|
|
87
|
+
#
|
|
88
|
+
# @return [String, nil]
|
|
89
|
+
required :content, String, nil?: true
|
|
90
|
+
end
|
|
91
|
+
|
|
79
92
|
class InputJsonEvent < Anthropic::Internal::Type::BaseModel
|
|
80
93
|
# @!attribute type
|
|
81
94
|
#
|
|
@@ -132,12 +132,18 @@ module Anthropic
|
|
|
132
132
|
content.thinking += delta.thinking
|
|
133
133
|
in Anthropic::Models::SignatureDelta | Anthropic::Models::BetaSignatureDelta if content.type == :thinking
|
|
134
134
|
content.signature = delta.signature
|
|
135
|
+
in Anthropic::Models::BetaCompactionContentBlockDelta if content.type == :compaction
|
|
136
|
+
content.content = delta.content
|
|
135
137
|
else
|
|
136
138
|
end
|
|
137
139
|
in Anthropic::Models::RawMessageDeltaEvent | Anthropic::Models::BetaRawMessageDeltaEvent
|
|
138
140
|
current_snapshot.stop_reason = event.delta.stop_reason
|
|
139
141
|
current_snapshot.stop_sequence = event.delta.stop_sequence
|
|
140
142
|
current_snapshot.usage.output_tokens = event.usage.output_tokens
|
|
143
|
+
|
|
144
|
+
if event.is_a?(Anthropic::Models::BetaRawMessageDeltaEvent) && !event.usage.iterations.nil?
|
|
145
|
+
current_snapshot.usage.iterations = event.usage.iterations
|
|
146
|
+
end
|
|
141
147
|
else
|
|
142
148
|
end
|
|
143
149
|
|
|
@@ -198,6 +204,11 @@ module Anthropic
|
|
|
198
204
|
type: :signature,
|
|
199
205
|
signature: content_block.signature
|
|
200
206
|
)
|
|
207
|
+
in Anthropic::Models::BetaCompactionContentBlockDelta if content_block.type == :compaction
|
|
208
|
+
events_to_yield << Anthropic::Streaming::CompactionEvent.new(
|
|
209
|
+
type: :compaction,
|
|
210
|
+
content: content_block.content
|
|
211
|
+
)
|
|
201
212
|
else
|
|
202
213
|
end
|
|
203
214
|
in Anthropic::Models::RawContentBlockStopEvent | Anthropic::Models::BetaRawContentBlockStopEvent
|
|
@@ -75,7 +75,7 @@ module Anthropic
|
|
|
75
75
|
|
|
76
76
|
case body
|
|
77
77
|
in nil
|
|
78
|
-
|
|
78
|
+
req["content-length"] ||= 0 unless req["transfer-encoding"]
|
|
79
79
|
in String
|
|
80
80
|
req["content-length"] ||= body.bytesize.to_s unless req["transfer-encoding"]
|
|
81
81
|
req.body_stream = Anthropic::Internal::Util::ReadIOAdapter.new(body, &blk)
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
module Beta
|
|
6
|
+
class BetaCompact20260112Edit < Anthropic::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute type
|
|
8
|
+
#
|
|
9
|
+
# @return [Symbol, :compact_20260112]
|
|
10
|
+
required :type, const: :compact_20260112
|
|
11
|
+
|
|
12
|
+
# @!attribute instructions
|
|
13
|
+
# Additional instructions for summarization.
|
|
14
|
+
#
|
|
15
|
+
# @return [String, nil]
|
|
16
|
+
optional :instructions, String, nil?: true
|
|
17
|
+
|
|
18
|
+
# @!attribute pause_after_compaction
|
|
19
|
+
# Whether to pause after compaction and return the compaction block to the user.
|
|
20
|
+
#
|
|
21
|
+
# @return [Boolean, nil]
|
|
22
|
+
optional :pause_after_compaction, Anthropic::Internal::Type::Boolean
|
|
23
|
+
|
|
24
|
+
# @!attribute trigger
|
|
25
|
+
# When to trigger compaction. Defaults to 150000 input tokens.
|
|
26
|
+
#
|
|
27
|
+
# @return [Anthropic::Models::Beta::BetaInputTokensTrigger, nil]
|
|
28
|
+
optional :trigger, -> { Anthropic::Beta::BetaInputTokensTrigger }, nil?: true
|
|
29
|
+
|
|
30
|
+
# @!method initialize(instructions: nil, pause_after_compaction: nil, trigger: nil, type: :compact_20260112)
|
|
31
|
+
# Automatically compact older context when reaching the configured trigger
|
|
32
|
+
# threshold.
|
|
33
|
+
#
|
|
34
|
+
# @param instructions [String, nil] Additional instructions for summarization.
|
|
35
|
+
#
|
|
36
|
+
# @param pause_after_compaction [Boolean] Whether to pause after compaction and return the compaction block to the user.
|
|
37
|
+
#
|
|
38
|
+
# @param trigger [Anthropic::Models::Beta::BetaInputTokensTrigger, nil] When to trigger compaction. Defaults to 150000 input tokens.
|
|
39
|
+
#
|
|
40
|
+
# @param type [Symbol, :compact_20260112]
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
BetaCompact20260112Edit = Beta::BetaCompact20260112Edit
|
|
45
|
+
end
|
|
46
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
module Beta
|
|
6
|
+
class BetaCompactionBlock < Anthropic::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute content
|
|
8
|
+
# Summary of compacted content, or null if compaction failed
|
|
9
|
+
#
|
|
10
|
+
# @return [String, nil]
|
|
11
|
+
required :content, String, nil?: true
|
|
12
|
+
|
|
13
|
+
# @!attribute type
|
|
14
|
+
#
|
|
15
|
+
# @return [Symbol, :compaction]
|
|
16
|
+
required :type, const: :compaction
|
|
17
|
+
|
|
18
|
+
# @!method initialize(content:, type: :compaction)
|
|
19
|
+
# A compaction block returned when autocompact is triggered.
|
|
20
|
+
#
|
|
21
|
+
# When content is None, it indicates the compaction failed to produce a valid
|
|
22
|
+
# summary (e.g., malformed output from the model). Clients may round-trip
|
|
23
|
+
# compaction blocks with null content; the server treats them as no-ops.
|
|
24
|
+
#
|
|
25
|
+
# @param content [String, nil] Summary of compacted content, or null if compaction failed
|
|
26
|
+
#
|
|
27
|
+
# @param type [Symbol, :compaction]
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
BetaCompactionBlock = Beta::BetaCompactionBlock
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
module Beta
|
|
6
|
+
class BetaCompactionBlockParam < Anthropic::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute content
|
|
8
|
+
# Summary of previously compacted content, or null if compaction failed
|
|
9
|
+
#
|
|
10
|
+
# @return [String, nil]
|
|
11
|
+
required :content, String, nil?: true
|
|
12
|
+
|
|
13
|
+
# @!attribute type
|
|
14
|
+
#
|
|
15
|
+
# @return [Symbol, :compaction]
|
|
16
|
+
required :type, const: :compaction
|
|
17
|
+
|
|
18
|
+
# @!attribute cache_control
|
|
19
|
+
# Create a cache control breakpoint at this content block.
|
|
20
|
+
#
|
|
21
|
+
# @return [Anthropic::Models::Beta::BetaCacheControlEphemeral, nil]
|
|
22
|
+
optional :cache_control, -> { Anthropic::Beta::BetaCacheControlEphemeral }, nil?: true
|
|
23
|
+
|
|
24
|
+
# @!method initialize(content:, cache_control: nil, type: :compaction)
|
|
25
|
+
# A compaction block containing summary of previous context.
|
|
26
|
+
#
|
|
27
|
+
# Users should round-trip these blocks from responses to subsequent requests to
|
|
28
|
+
# maintain context across compaction boundaries.
|
|
29
|
+
#
|
|
30
|
+
# When content is None, the block represents a failed compaction. The server
|
|
31
|
+
# treats these as no-ops. Empty string content is not allowed.
|
|
32
|
+
#
|
|
33
|
+
# @param content [String, nil] Summary of previously compacted content, or null if compaction failed
|
|
34
|
+
#
|
|
35
|
+
# @param cache_control [Anthropic::Models::Beta::BetaCacheControlEphemeral, nil] Create a cache control breakpoint at this content block.
|
|
36
|
+
#
|
|
37
|
+
# @param type [Symbol, :compaction]
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
BetaCompactionBlockParam = Beta::BetaCompactionBlockParam
|
|
42
|
+
end
|
|
43
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
module Beta
|
|
6
|
+
class BetaCompactionContentBlockDelta < Anthropic::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute content
|
|
8
|
+
#
|
|
9
|
+
# @return [String, nil]
|
|
10
|
+
required :content, String, nil?: true
|
|
11
|
+
|
|
12
|
+
# @!attribute type
|
|
13
|
+
#
|
|
14
|
+
# @return [Symbol, :compaction_delta]
|
|
15
|
+
required :type, const: :compaction_delta
|
|
16
|
+
|
|
17
|
+
# @!method initialize(content:, type: :compaction_delta)
|
|
18
|
+
# @param content [String, nil]
|
|
19
|
+
# @param type [Symbol, :compaction_delta]
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
BetaCompactionContentBlockDelta = Beta::BetaCompactionContentBlockDelta
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
module Beta
|
|
6
|
+
class BetaCompactionIterationUsage < Anthropic::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute cache_creation
|
|
8
|
+
# Breakdown of cached tokens by TTL
|
|
9
|
+
#
|
|
10
|
+
# @return [Anthropic::Models::Beta::BetaCacheCreation, nil]
|
|
11
|
+
required :cache_creation, -> { Anthropic::Beta::BetaCacheCreation }, nil?: true
|
|
12
|
+
|
|
13
|
+
# @!attribute cache_creation_input_tokens
|
|
14
|
+
# The number of input tokens used to create the cache entry.
|
|
15
|
+
#
|
|
16
|
+
# @return [Integer]
|
|
17
|
+
required :cache_creation_input_tokens, Integer
|
|
18
|
+
|
|
19
|
+
# @!attribute cache_read_input_tokens
|
|
20
|
+
# The number of input tokens read from the cache.
|
|
21
|
+
#
|
|
22
|
+
# @return [Integer]
|
|
23
|
+
required :cache_read_input_tokens, Integer
|
|
24
|
+
|
|
25
|
+
# @!attribute input_tokens
|
|
26
|
+
# The number of input tokens which were used.
|
|
27
|
+
#
|
|
28
|
+
# @return [Integer]
|
|
29
|
+
required :input_tokens, Integer
|
|
30
|
+
|
|
31
|
+
# @!attribute output_tokens
|
|
32
|
+
# The number of output tokens which were used.
|
|
33
|
+
#
|
|
34
|
+
# @return [Integer]
|
|
35
|
+
required :output_tokens, Integer
|
|
36
|
+
|
|
37
|
+
# @!attribute type
|
|
38
|
+
# Usage for a compaction iteration
|
|
39
|
+
#
|
|
40
|
+
# @return [Symbol, :compaction]
|
|
41
|
+
required :type, const: :compaction
|
|
42
|
+
|
|
43
|
+
# @!method initialize(cache_creation:, cache_creation_input_tokens:, cache_read_input_tokens:, input_tokens:, output_tokens:, type: :compaction)
|
|
44
|
+
# Token usage for a compaction iteration.
|
|
45
|
+
#
|
|
46
|
+
# @param cache_creation [Anthropic::Models::Beta::BetaCacheCreation, nil] Breakdown of cached tokens by TTL
|
|
47
|
+
#
|
|
48
|
+
# @param cache_creation_input_tokens [Integer] The number of input tokens used to create the cache entry.
|
|
49
|
+
#
|
|
50
|
+
# @param cache_read_input_tokens [Integer] The number of input tokens read from the cache.
|
|
51
|
+
#
|
|
52
|
+
# @param input_tokens [Integer] The number of input tokens which were used.
|
|
53
|
+
#
|
|
54
|
+
# @param output_tokens [Integer] The number of output tokens which were used.
|
|
55
|
+
#
|
|
56
|
+
# @param type [Symbol, :compaction] Usage for a compaction iteration
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
BetaCompactionIterationUsage = Beta::BetaCompactionIterationUsage
|
|
61
|
+
end
|
|
62
|
+
end
|
|
@@ -39,8 +39,15 @@ module Anthropic
|
|
|
39
39
|
# Response model for a file uploaded to the container.
|
|
40
40
|
variant :container_upload, -> { Anthropic::Beta::BetaContainerUploadBlock }
|
|
41
41
|
|
|
42
|
+
# A compaction block returned when autocompact is triggered.
|
|
43
|
+
#
|
|
44
|
+
# When content is None, it indicates the compaction failed to produce a valid
|
|
45
|
+
# summary (e.g., malformed output from the model). Clients may round-trip
|
|
46
|
+
# compaction blocks with null content; the server treats them as no-ops.
|
|
47
|
+
variant :compaction, -> { Anthropic::Beta::BetaCompactionBlock }
|
|
48
|
+
|
|
42
49
|
# @!method self.variants
|
|
43
|
-
# @return [Array(Anthropic::Models::Beta::BetaTextBlock, Anthropic::Models::Beta::BetaThinkingBlock, Anthropic::Models::Beta::BetaRedactedThinkingBlock, Anthropic::Models::Beta::BetaToolUseBlock, Anthropic::Models::Beta::BetaServerToolUseBlock, Anthropic::Models::Beta::BetaWebSearchToolResultBlock, Anthropic::Models::Beta::BetaWebFetchToolResultBlock, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaToolSearchToolResultBlock, Anthropic::Models::Beta::BetaMCPToolUseBlock, Anthropic::Models::Beta::BetaMCPToolResultBlock, Anthropic::Models::Beta::BetaContainerUploadBlock)]
|
|
50
|
+
# @return [Array(Anthropic::Models::Beta::BetaTextBlock, Anthropic::Models::Beta::BetaThinkingBlock, Anthropic::Models::Beta::BetaRedactedThinkingBlock, Anthropic::Models::Beta::BetaToolUseBlock, Anthropic::Models::Beta::BetaServerToolUseBlock, Anthropic::Models::Beta::BetaWebSearchToolResultBlock, Anthropic::Models::Beta::BetaWebFetchToolResultBlock, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaToolSearchToolResultBlock, Anthropic::Models::Beta::BetaMCPToolUseBlock, Anthropic::Models::Beta::BetaMCPToolResultBlock, Anthropic::Models::Beta::BetaContainerUploadBlock, Anthropic::Models::Beta::BetaCompactionBlock)]
|
|
44
51
|
end
|
|
45
52
|
end
|
|
46
53
|
|
|
@@ -57,8 +57,17 @@ module Anthropic
|
|
|
57
57
|
# Files uploaded via this block will be available in the container's input directory.
|
|
58
58
|
variant :container_upload, -> { Anthropic::Beta::BetaContainerUploadBlockParam }
|
|
59
59
|
|
|
60
|
+
# A compaction block containing summary of previous context.
|
|
61
|
+
#
|
|
62
|
+
# Users should round-trip these blocks from responses to subsequent requests
|
|
63
|
+
# to maintain context across compaction boundaries.
|
|
64
|
+
#
|
|
65
|
+
# When content is None, the block represents a failed compaction. The server
|
|
66
|
+
# treats these as no-ops. Empty string content is not allowed.
|
|
67
|
+
variant :compaction, -> { Anthropic::Beta::BetaCompactionBlockParam }
|
|
68
|
+
|
|
60
69
|
# @!method self.variants
|
|
61
|
-
# @return [Array(Anthropic::Models::Beta::BetaTextBlockParam, Anthropic::Models::Beta::BetaImageBlockParam, Anthropic::Models::Beta::BetaRequestDocumentBlock, Anthropic::Models::Beta::BetaSearchResultBlockParam, Anthropic::Models::Beta::BetaThinkingBlockParam, Anthropic::Models::Beta::BetaRedactedThinkingBlockParam, Anthropic::Models::Beta::BetaToolUseBlockParam, Anthropic::Models::Beta::BetaToolResultBlockParam, Anthropic::Models::Beta::BetaServerToolUseBlockParam, Anthropic::Models::Beta::BetaWebSearchToolResultBlockParam, Anthropic::Models::Beta::BetaWebFetchToolResultBlockParam, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaToolSearchToolResultBlockParam, Anthropic::Models::Beta::BetaMCPToolUseBlockParam, Anthropic::Models::Beta::BetaRequestMCPToolResultBlockParam, Anthropic::Models::Beta::BetaContainerUploadBlockParam)]
|
|
70
|
+
# @return [Array(Anthropic::Models::Beta::BetaTextBlockParam, Anthropic::Models::Beta::BetaImageBlockParam, Anthropic::Models::Beta::BetaRequestDocumentBlock, Anthropic::Models::Beta::BetaSearchResultBlockParam, Anthropic::Models::Beta::BetaThinkingBlockParam, Anthropic::Models::Beta::BetaRedactedThinkingBlockParam, Anthropic::Models::Beta::BetaToolUseBlockParam, Anthropic::Models::Beta::BetaToolResultBlockParam, Anthropic::Models::Beta::BetaServerToolUseBlockParam, Anthropic::Models::Beta::BetaWebSearchToolResultBlockParam, Anthropic::Models::Beta::BetaWebFetchToolResultBlockParam, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaToolSearchToolResultBlockParam, Anthropic::Models::Beta::BetaMCPToolUseBlockParam, Anthropic::Models::Beta::BetaRequestMCPToolResultBlockParam, Anthropic::Models::Beta::BetaContainerUploadBlockParam, Anthropic::Models::Beta::BetaCompactionBlockParam)]
|
|
62
71
|
end
|
|
63
72
|
end
|
|
64
73
|
|
|
@@ -7,13 +7,15 @@ module Anthropic
|
|
|
7
7
|
# @!attribute edits
|
|
8
8
|
# List of context management edits to apply
|
|
9
9
|
#
|
|
10
|
-
# @return [Array<Anthropic::Models::Beta::BetaClearToolUses20250919Edit, Anthropic::Models::Beta::BetaClearThinking20251015Edit>, nil]
|
|
10
|
+
# @return [Array<Anthropic::Models::Beta::BetaClearToolUses20250919Edit, Anthropic::Models::Beta::BetaClearThinking20251015Edit, Anthropic::Models::Beta::BetaCompact20260112Edit>, nil]
|
|
11
11
|
optional :edits,
|
|
12
12
|
-> { Anthropic::Internal::Type::ArrayOf[union: Anthropic::Beta::BetaContextManagementConfig::Edit] }
|
|
13
13
|
|
|
14
14
|
# @!method initialize(edits: nil)
|
|
15
|
-
# @param edits [Array<Anthropic::Models::Beta::BetaClearToolUses20250919Edit, Anthropic::Models::Beta::BetaClearThinking20251015Edit>] List of context management edits to apply
|
|
15
|
+
# @param edits [Array<Anthropic::Models::Beta::BetaClearToolUses20250919Edit, Anthropic::Models::Beta::BetaClearThinking20251015Edit, Anthropic::Models::Beta::BetaCompact20260112Edit>] List of context management edits to apply
|
|
16
16
|
|
|
17
|
+
# Automatically compact older context when reaching the configured trigger
|
|
18
|
+
# threshold.
|
|
17
19
|
module Edit
|
|
18
20
|
extend Anthropic::Internal::Type::Union
|
|
19
21
|
|
|
@@ -23,8 +25,11 @@ module Anthropic
|
|
|
23
25
|
|
|
24
26
|
variant :clear_thinking_20251015, -> { Anthropic::Beta::BetaClearThinking20251015Edit }
|
|
25
27
|
|
|
28
|
+
# Automatically compact older context when reaching the configured trigger threshold.
|
|
29
|
+
variant :compact_20260112, -> { Anthropic::Beta::BetaCompact20260112Edit }
|
|
30
|
+
|
|
26
31
|
# @!method self.variants
|
|
27
|
-
# @return [Array(Anthropic::Models::Beta::BetaClearToolUses20250919Edit, Anthropic::Models::Beta::BetaClearThinking20251015Edit)]
|
|
32
|
+
# @return [Array(Anthropic::Models::Beta::BetaClearToolUses20250919Edit, Anthropic::Models::Beta::BetaClearThinking20251015Edit, Anthropic::Models::Beta::BetaCompact20260112Edit)]
|
|
28
33
|
end
|
|
29
34
|
end
|
|
30
35
|
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
module Beta
|
|
6
|
+
# Token usage for a sampling iteration.
|
|
7
|
+
module BetaIterationsUsageItem
|
|
8
|
+
extend Anthropic::Internal::Type::Union
|
|
9
|
+
|
|
10
|
+
# Token usage for a sampling iteration.
|
|
11
|
+
variant -> { Anthropic::Beta::BetaMessageIterationUsage }
|
|
12
|
+
|
|
13
|
+
# Token usage for a compaction iteration.
|
|
14
|
+
variant -> { Anthropic::Beta::BetaCompactionIterationUsage }
|
|
15
|
+
|
|
16
|
+
# @!method self.variants
|
|
17
|
+
# @return [Array(Anthropic::Models::Beta::BetaMessageIterationUsage, Anthropic::Models::Beta::BetaCompactionIterationUsage)]
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
# @type [Anthropic::Internal::Type::Converter]
|
|
21
|
+
BetaIterationsUsage =
|
|
22
|
+
Anthropic::Internal::Type::ArrayOf[union: -> { Anthropic::Beta::BetaIterationsUsageItem }]
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# @type [Anthropic::Internal::Type::Converter]
|
|
26
|
+
BetaIterationsUsage = Beta::BetaIterationsUsage
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -56,7 +56,7 @@ module Anthropic
|
|
|
56
56
|
# [{ "type": "text", "text": "B)" }]
|
|
57
57
|
# ```
|
|
58
58
|
#
|
|
59
|
-
# @return [Array<Anthropic::Models::Beta::BetaTextBlock, Anthropic::Models::Beta::BetaThinkingBlock, Anthropic::Models::Beta::BetaRedactedThinkingBlock, Anthropic::Models::Beta::BetaToolUseBlock, Anthropic::Models::Beta::BetaServerToolUseBlock, Anthropic::Models::Beta::BetaWebSearchToolResultBlock, Anthropic::Models::Beta::BetaWebFetchToolResultBlock, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaToolSearchToolResultBlock, Anthropic::Models::Beta::BetaMCPToolUseBlock, Anthropic::Models::Beta::BetaMCPToolResultBlock, Anthropic::Models::Beta::BetaContainerUploadBlock>]
|
|
59
|
+
# @return [Array<Anthropic::Models::Beta::BetaTextBlock, Anthropic::Models::Beta::BetaThinkingBlock, Anthropic::Models::Beta::BetaRedactedThinkingBlock, Anthropic::Models::Beta::BetaToolUseBlock, Anthropic::Models::Beta::BetaServerToolUseBlock, Anthropic::Models::Beta::BetaWebSearchToolResultBlock, Anthropic::Models::Beta::BetaWebFetchToolResultBlock, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaToolSearchToolResultBlock, Anthropic::Models::Beta::BetaMCPToolUseBlock, Anthropic::Models::Beta::BetaMCPToolResultBlock, Anthropic::Models::Beta::BetaContainerUploadBlock, Anthropic::Models::Beta::BetaCompactionBlock>]
|
|
60
60
|
required :content, -> { Anthropic::Internal::Type::ArrayOf[union: Anthropic::Beta::BetaContentBlock] }
|
|
61
61
|
|
|
62
62
|
# parsed value of response when a JSON output schema object has been specified via :output_format
|
|
@@ -160,7 +160,7 @@ module Anthropic
|
|
|
160
160
|
#
|
|
161
161
|
# @param container [Anthropic::Models::Beta::BetaContainer, nil] Information about the container used in the request (for the code execution tool
|
|
162
162
|
#
|
|
163
|
-
# @param content [Array<Anthropic::Models::Beta::BetaTextBlock, Anthropic::Models::Beta::BetaThinkingBlock, Anthropic::Models::Beta::BetaRedactedThinkingBlock, Anthropic::Models::Beta::BetaToolUseBlock, Anthropic::Models::Beta::BetaServerToolUseBlock, Anthropic::Models::Beta::BetaWebSearchToolResultBlock, Anthropic::Models::Beta::BetaWebFetchToolResultBlock, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaToolSearchToolResultBlock, Anthropic::Models::Beta::BetaMCPToolUseBlock, Anthropic::Models::Beta::BetaMCPToolResultBlock, Anthropic::Models::Beta::BetaContainerUploadBlock>] Content generated by the model.
|
|
163
|
+
# @param content [Array<Anthropic::Models::Beta::BetaTextBlock, Anthropic::Models::Beta::BetaThinkingBlock, Anthropic::Models::Beta::BetaRedactedThinkingBlock, Anthropic::Models::Beta::BetaToolUseBlock, Anthropic::Models::Beta::BetaServerToolUseBlock, Anthropic::Models::Beta::BetaWebSearchToolResultBlock, Anthropic::Models::Beta::BetaWebFetchToolResultBlock, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaToolSearchToolResultBlock, Anthropic::Models::Beta::BetaMCPToolUseBlock, Anthropic::Models::Beta::BetaMCPToolResultBlock, Anthropic::Models::Beta::BetaContainerUploadBlock, Anthropic::Models::Beta::BetaCompactionBlock>] Content generated by the model.
|
|
164
164
|
#
|
|
165
165
|
# @param context_management [Anthropic::Models::Beta::BetaContextManagementResponse, nil] Context management response.
|
|
166
166
|
#
|
|
@@ -22,6 +22,21 @@ module Anthropic
|
|
|
22
22
|
# @return [Integer, nil]
|
|
23
23
|
required :input_tokens, Integer, nil?: true
|
|
24
24
|
|
|
25
|
+
# @!attribute iterations
|
|
26
|
+
# Per-iteration token usage breakdown.
|
|
27
|
+
#
|
|
28
|
+
# Each entry represents one sampling iteration, with its own input/output token
|
|
29
|
+
# counts and cache statistics. This allows you to:
|
|
30
|
+
#
|
|
31
|
+
# - Determine which iterations exceeded long context thresholds (>=200k tokens)
|
|
32
|
+
# - Calculate the true context window size from the last iteration
|
|
33
|
+
# - Understand token accumulation across server-side tool use loops
|
|
34
|
+
#
|
|
35
|
+
# @return [Array<Anthropic::Models::Beta::BetaMessageIterationUsage, Anthropic::Models::Beta::BetaCompactionIterationUsage>, nil]
|
|
36
|
+
required :iterations,
|
|
37
|
+
-> { Anthropic::Internal::Type::ArrayOf[union: Anthropic::Beta::BetaIterationsUsageItem] },
|
|
38
|
+
nil?: true
|
|
39
|
+
|
|
25
40
|
# @!attribute output_tokens
|
|
26
41
|
# The cumulative number of output tokens which were used.
|
|
27
42
|
#
|
|
@@ -34,13 +49,18 @@ module Anthropic
|
|
|
34
49
|
# @return [Anthropic::Models::Beta::BetaServerToolUsage, nil]
|
|
35
50
|
required :server_tool_use, -> { Anthropic::Beta::BetaServerToolUsage }, nil?: true
|
|
36
51
|
|
|
37
|
-
# @!method initialize(cache_creation_input_tokens:, cache_read_input_tokens:, input_tokens:, output_tokens:, server_tool_use:)
|
|
52
|
+
# @!method initialize(cache_creation_input_tokens:, cache_read_input_tokens:, input_tokens:, iterations:, output_tokens:, server_tool_use:)
|
|
53
|
+
# Some parameter documentations has been truncated, see
|
|
54
|
+
# {Anthropic::Models::Beta::BetaMessageDeltaUsage} for more details.
|
|
55
|
+
#
|
|
38
56
|
# @param cache_creation_input_tokens [Integer, nil] The cumulative number of input tokens used to create the cache entry.
|
|
39
57
|
#
|
|
40
58
|
# @param cache_read_input_tokens [Integer, nil] The cumulative number of input tokens read from the cache.
|
|
41
59
|
#
|
|
42
60
|
# @param input_tokens [Integer, nil] The cumulative number of input tokens which were used.
|
|
43
61
|
#
|
|
62
|
+
# @param iterations [Array<Anthropic::Models::Beta::BetaMessageIterationUsage, Anthropic::Models::Beta::BetaCompactionIterationUsage>, nil] Per-iteration token usage breakdown.
|
|
63
|
+
#
|
|
44
64
|
# @param output_tokens [Integer] The cumulative number of output tokens which were used.
|
|
45
65
|
#
|
|
46
66
|
# @param server_tool_use [Anthropic::Models::Beta::BetaServerToolUsage, nil] The number of server tool requests.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
module Beta
|
|
6
|
+
class BetaMessageIterationUsage < Anthropic::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute cache_creation
|
|
8
|
+
# Breakdown of cached tokens by TTL
|
|
9
|
+
#
|
|
10
|
+
# @return [Anthropic::Models::Beta::BetaCacheCreation, nil]
|
|
11
|
+
required :cache_creation, -> { Anthropic::Beta::BetaCacheCreation }, nil?: true
|
|
12
|
+
|
|
13
|
+
# @!attribute cache_creation_input_tokens
|
|
14
|
+
# The number of input tokens used to create the cache entry.
|
|
15
|
+
#
|
|
16
|
+
# @return [Integer]
|
|
17
|
+
required :cache_creation_input_tokens, Integer
|
|
18
|
+
|
|
19
|
+
# @!attribute cache_read_input_tokens
|
|
20
|
+
# The number of input tokens read from the cache.
|
|
21
|
+
#
|
|
22
|
+
# @return [Integer]
|
|
23
|
+
required :cache_read_input_tokens, Integer
|
|
24
|
+
|
|
25
|
+
# @!attribute input_tokens
|
|
26
|
+
# The number of input tokens which were used.
|
|
27
|
+
#
|
|
28
|
+
# @return [Integer]
|
|
29
|
+
required :input_tokens, Integer
|
|
30
|
+
|
|
31
|
+
# @!attribute output_tokens
|
|
32
|
+
# The number of output tokens which were used.
|
|
33
|
+
#
|
|
34
|
+
# @return [Integer]
|
|
35
|
+
required :output_tokens, Integer
|
|
36
|
+
|
|
37
|
+
# @!attribute type
|
|
38
|
+
# Usage for a sampling iteration
|
|
39
|
+
#
|
|
40
|
+
# @return [Symbol, :message]
|
|
41
|
+
required :type, const: :message
|
|
42
|
+
|
|
43
|
+
# @!method initialize(cache_creation:, cache_creation_input_tokens:, cache_read_input_tokens:, input_tokens:, output_tokens:, type: :message)
|
|
44
|
+
# Token usage for a sampling iteration.
|
|
45
|
+
#
|
|
46
|
+
# @param cache_creation [Anthropic::Models::Beta::BetaCacheCreation, nil] Breakdown of cached tokens by TTL
|
|
47
|
+
#
|
|
48
|
+
# @param cache_creation_input_tokens [Integer] The number of input tokens used to create the cache entry.
|
|
49
|
+
#
|
|
50
|
+
# @param cache_read_input_tokens [Integer] The number of input tokens read from the cache.
|
|
51
|
+
#
|
|
52
|
+
# @param input_tokens [Integer] The number of input tokens which were used.
|
|
53
|
+
#
|
|
54
|
+
# @param output_tokens [Integer] The number of output tokens which were used.
|
|
55
|
+
#
|
|
56
|
+
# @param type [Symbol, :message] Usage for a sampling iteration
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
BetaMessageIterationUsage = Beta::BetaMessageIterationUsage
|
|
61
|
+
end
|
|
62
|
+
end
|
|
@@ -6,7 +6,7 @@ module Anthropic
|
|
|
6
6
|
class BetaMessageParam < Anthropic::Internal::Type::BaseModel
|
|
7
7
|
# @!attribute content
|
|
8
8
|
#
|
|
9
|
-
# @return [String, Array<Anthropic::Models::Beta::BetaTextBlockParam, Anthropic::Models::Beta::BetaImageBlockParam, Anthropic::Models::Beta::BetaRequestDocumentBlock, Anthropic::Models::Beta::BetaSearchResultBlockParam, Anthropic::Models::Beta::BetaThinkingBlockParam, Anthropic::Models::Beta::BetaRedactedThinkingBlockParam, Anthropic::Models::Beta::BetaToolUseBlockParam, Anthropic::Models::Beta::BetaToolResultBlockParam, Anthropic::Models::Beta::BetaServerToolUseBlockParam, Anthropic::Models::Beta::BetaWebSearchToolResultBlockParam, Anthropic::Models::Beta::BetaWebFetchToolResultBlockParam, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaToolSearchToolResultBlockParam, Anthropic::Models::Beta::BetaMCPToolUseBlockParam, Anthropic::Models::Beta::BetaRequestMCPToolResultBlockParam, Anthropic::Models::Beta::BetaContainerUploadBlockParam>]
|
|
9
|
+
# @return [String, Array<Anthropic::Models::Beta::BetaTextBlockParam, Anthropic::Models::Beta::BetaImageBlockParam, Anthropic::Models::Beta::BetaRequestDocumentBlock, Anthropic::Models::Beta::BetaSearchResultBlockParam, Anthropic::Models::Beta::BetaThinkingBlockParam, Anthropic::Models::Beta::BetaRedactedThinkingBlockParam, Anthropic::Models::Beta::BetaToolUseBlockParam, Anthropic::Models::Beta::BetaToolResultBlockParam, Anthropic::Models::Beta::BetaServerToolUseBlockParam, Anthropic::Models::Beta::BetaWebSearchToolResultBlockParam, Anthropic::Models::Beta::BetaWebFetchToolResultBlockParam, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaToolSearchToolResultBlockParam, Anthropic::Models::Beta::BetaMCPToolUseBlockParam, Anthropic::Models::Beta::BetaRequestMCPToolResultBlockParam, Anthropic::Models::Beta::BetaContainerUploadBlockParam, Anthropic::Models::Beta::BetaCompactionBlockParam>]
|
|
10
10
|
required :content, union: -> { Anthropic::Beta::BetaMessageParam::Content }
|
|
11
11
|
|
|
12
12
|
# @!attribute role
|
|
@@ -15,7 +15,7 @@ module Anthropic
|
|
|
15
15
|
required :role, enum: -> { Anthropic::Beta::BetaMessageParam::Role }
|
|
16
16
|
|
|
17
17
|
# @!method initialize(content:, role:)
|
|
18
|
-
# @param content [String, Array<Anthropic::Models::Beta::BetaTextBlockParam, Anthropic::Models::Beta::BetaImageBlockParam, Anthropic::Models::Beta::BetaRequestDocumentBlock, Anthropic::Models::Beta::BetaSearchResultBlockParam, Anthropic::Models::Beta::BetaThinkingBlockParam, Anthropic::Models::Beta::BetaRedactedThinkingBlockParam, Anthropic::Models::Beta::BetaToolUseBlockParam, Anthropic::Models::Beta::BetaToolResultBlockParam, Anthropic::Models::Beta::BetaServerToolUseBlockParam, Anthropic::Models::Beta::BetaWebSearchToolResultBlockParam, Anthropic::Models::Beta::BetaWebFetchToolResultBlockParam, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaToolSearchToolResultBlockParam, Anthropic::Models::Beta::BetaMCPToolUseBlockParam, Anthropic::Models::Beta::BetaRequestMCPToolResultBlockParam, Anthropic::Models::Beta::BetaContainerUploadBlockParam>]
|
|
18
|
+
# @param content [String, Array<Anthropic::Models::Beta::BetaTextBlockParam, Anthropic::Models::Beta::BetaImageBlockParam, Anthropic::Models::Beta::BetaRequestDocumentBlock, Anthropic::Models::Beta::BetaSearchResultBlockParam, Anthropic::Models::Beta::BetaThinkingBlockParam, Anthropic::Models::Beta::BetaRedactedThinkingBlockParam, Anthropic::Models::Beta::BetaToolUseBlockParam, Anthropic::Models::Beta::BetaToolResultBlockParam, Anthropic::Models::Beta::BetaServerToolUseBlockParam, Anthropic::Models::Beta::BetaWebSearchToolResultBlockParam, Anthropic::Models::Beta::BetaWebFetchToolResultBlockParam, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaToolSearchToolResultBlockParam, Anthropic::Models::Beta::BetaMCPToolUseBlockParam, Anthropic::Models::Beta::BetaRequestMCPToolResultBlockParam, Anthropic::Models::Beta::BetaContainerUploadBlockParam, Anthropic::Models::Beta::BetaCompactionBlockParam>]
|
|
19
19
|
# @param role [Symbol, Anthropic::Models::Beta::BetaMessageParam::Role]
|
|
20
20
|
|
|
21
21
|
# @see Anthropic::Models::Beta::BetaMessageParam#content
|
|
@@ -27,7 +27,7 @@ module Anthropic
|
|
|
27
27
|
variant -> { Anthropic::Models::Beta::BetaMessageParam::Content::BetaContentBlockParamArray }
|
|
28
28
|
|
|
29
29
|
# @!method self.variants
|
|
30
|
-
# @return [Array(String, Array<Anthropic::Models::Beta::BetaTextBlockParam, Anthropic::Models::Beta::BetaImageBlockParam, Anthropic::Models::Beta::BetaRequestDocumentBlock, Anthropic::Models::Beta::BetaSearchResultBlockParam, Anthropic::Models::Beta::BetaThinkingBlockParam, Anthropic::Models::Beta::BetaRedactedThinkingBlockParam, Anthropic::Models::Beta::BetaToolUseBlockParam, Anthropic::Models::Beta::BetaToolResultBlockParam, Anthropic::Models::Beta::BetaServerToolUseBlockParam, Anthropic::Models::Beta::BetaWebSearchToolResultBlockParam, Anthropic::Models::Beta::BetaWebFetchToolResultBlockParam, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaToolSearchToolResultBlockParam, Anthropic::Models::Beta::BetaMCPToolUseBlockParam, Anthropic::Models::Beta::BetaRequestMCPToolResultBlockParam, Anthropic::Models::Beta::BetaContainerUploadBlockParam>)]
|
|
30
|
+
# @return [Array(String, Array<Anthropic::Models::Beta::BetaTextBlockParam, Anthropic::Models::Beta::BetaImageBlockParam, Anthropic::Models::Beta::BetaRequestDocumentBlock, Anthropic::Models::Beta::BetaSearchResultBlockParam, Anthropic::Models::Beta::BetaThinkingBlockParam, Anthropic::Models::Beta::BetaRedactedThinkingBlockParam, Anthropic::Models::Beta::BetaToolUseBlockParam, Anthropic::Models::Beta::BetaToolResultBlockParam, Anthropic::Models::Beta::BetaServerToolUseBlockParam, Anthropic::Models::Beta::BetaWebSearchToolResultBlockParam, Anthropic::Models::Beta::BetaWebFetchToolResultBlockParam, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaToolSearchToolResultBlockParam, Anthropic::Models::Beta::BetaMCPToolUseBlockParam, Anthropic::Models::Beta::BetaRequestMCPToolResultBlockParam, Anthropic::Models::Beta::BetaContainerUploadBlockParam, Anthropic::Models::Beta::BetaCompactionBlockParam>)]
|
|
31
31
|
|
|
32
32
|
# @type [Anthropic::Internal::Type::Converter]
|
|
33
33
|
BetaContentBlockParamArray =
|
|
@@ -5,10 +5,7 @@ module Anthropic
|
|
|
5
5
|
module Beta
|
|
6
6
|
class BetaOutputConfig < Anthropic::Internal::Type::BaseModel
|
|
7
7
|
# @!attribute effort
|
|
8
|
-
#
|
|
9
|
-
# result in more thorough analysis but take longer.
|
|
10
|
-
#
|
|
11
|
-
# Valid values are `low`, `medium`, or `high`.
|
|
8
|
+
# All possible effort levels.
|
|
12
9
|
#
|
|
13
10
|
# @return [Symbol, Anthropic::Models::Beta::BetaOutputConfig::Effort, nil]
|
|
14
11
|
optional :effort, enum: -> { Anthropic::Beta::BetaOutputConfig::Effort }, nil?: true
|
|
@@ -24,14 +21,11 @@ module Anthropic
|
|
|
24
21
|
# Some parameter documentations has been truncated, see
|
|
25
22
|
# {Anthropic::Models::Beta::BetaOutputConfig} for more details.
|
|
26
23
|
#
|
|
27
|
-
# @param effort [Symbol, Anthropic::Models::Beta::BetaOutputConfig::Effort, nil]
|
|
24
|
+
# @param effort [Symbol, Anthropic::Models::Beta::BetaOutputConfig::Effort, nil] All possible effort levels.
|
|
28
25
|
#
|
|
29
26
|
# @param format_ [Anthropic::Models::Beta::BetaJSONOutputFormat, nil] A schema to specify Claude's output format in responses. See [structured outputs
|
|
30
27
|
|
|
31
|
-
#
|
|
32
|
-
# result in more thorough analysis but take longer.
|
|
33
|
-
#
|
|
34
|
-
# Valid values are `low`, `medium`, or `high`.
|
|
28
|
+
# All possible effort levels.
|
|
35
29
|
#
|
|
36
30
|
# @see Anthropic::Models::Beta::BetaOutputConfig#effort
|
|
37
31
|
module Effort
|
|
@@ -40,6 +34,7 @@ module Anthropic
|
|
|
40
34
|
LOW = :low
|
|
41
35
|
MEDIUM = :medium
|
|
42
36
|
HIGH = :high
|
|
37
|
+
MAX = :max
|
|
43
38
|
|
|
44
39
|
# @!method self.values
|
|
45
40
|
# @return [Array<Symbol>]
|
|
@@ -18,8 +18,10 @@ module Anthropic
|
|
|
18
18
|
|
|
19
19
|
variant :signature_delta, -> { Anthropic::Beta::BetaSignatureDelta }
|
|
20
20
|
|
|
21
|
+
variant :compaction_delta, -> { Anthropic::Beta::BetaCompactionContentBlockDelta }
|
|
22
|
+
|
|
21
23
|
# @!method self.variants
|
|
22
|
-
# @return [Array(Anthropic::Models::Beta::BetaTextDelta, Anthropic::Models::Beta::BetaInputJSONDelta, Anthropic::Models::Beta::BetaCitationsDelta, Anthropic::Models::Beta::BetaThinkingDelta, Anthropic::Models::Beta::BetaSignatureDelta)]
|
|
24
|
+
# @return [Array(Anthropic::Models::Beta::BetaTextDelta, Anthropic::Models::Beta::BetaInputJSONDelta, Anthropic::Models::Beta::BetaCitationsDelta, Anthropic::Models::Beta::BetaThinkingDelta, Anthropic::Models::Beta::BetaSignatureDelta, Anthropic::Models::Beta::BetaCompactionContentBlockDelta)]
|
|
23
25
|
end
|
|
24
26
|
end
|
|
25
27
|
|