anthropic 1.42.0 → 1.44.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 +26 -0
- data/README.md +1 -1
- data/lib/anthropic/file_part.rb +4 -1
- data/lib/anthropic/internal/util.rb +6 -2
- data/lib/anthropic/models/anthropic_beta.rb +3 -0
- data/lib/anthropic/models/beta/agent_create_params.rb +3 -1
- data/lib/anthropic/models/beta/agent_update_params.rb +3 -1
- data/lib/anthropic/models/beta/beta_advisor_message_iteration_usage.rb +4 -3
- data/lib/anthropic/models/beta/beta_advisor_redacted_result_block.rb +10 -1
- data/lib/anthropic/models/beta/beta_advisor_redacted_result_block_param.rb +8 -1
- data/lib/anthropic/models/beta/beta_advisor_result_block.rb +15 -1
- data/lib/anthropic/models/beta/beta_advisor_result_block_param.rb +7 -1
- data/lib/anthropic/models/beta/beta_advisor_tool_20260301.rb +4 -3
- data/lib/anthropic/models/beta/beta_content_block_param.rb +7 -1
- data/lib/anthropic/models/beta/beta_managed_agents_model.rb +8 -2
- data/lib/anthropic/models/beta/beta_managed_agents_model_config.rb +4 -3
- data/lib/anthropic/models/beta/beta_managed_agents_model_config_params.rb +4 -3
- data/lib/anthropic/models/beta/beta_message.rb +4 -3
- data/lib/anthropic/models/beta/beta_message_delta_usage.rb +14 -1
- data/lib/anthropic/models/beta/beta_message_param.rb +4 -3
- data/lib/anthropic/models/beta/beta_mid_conversation_system_block_param.rb +41 -0
- data/lib/anthropic/models/beta/beta_output_tokens_details.rb +30 -0
- data/lib/anthropic/models/beta/beta_thinking_delta.rb +20 -1
- data/lib/anthropic/models/beta/beta_usage.rb +14 -1
- data/lib/anthropic/models/beta/beta_web_fetch_tool_result_error_code.rb +1 -0
- data/lib/anthropic/models/beta/message_count_tokens_params.rb +4 -3
- data/lib/anthropic/models/beta/message_create_params.rb +4 -3
- data/lib/anthropic/models/beta/messages/batch_create_params.rb +4 -3
- data/lib/anthropic/models/completion.rb +4 -3
- data/lib/anthropic/models/completion_create_params.rb +4 -3
- data/lib/anthropic/models/content_block_param.rb +7 -1
- data/lib/anthropic/models/message.rb +4 -3
- data/lib/anthropic/models/message_count_tokens_params.rb +4 -3
- data/lib/anthropic/models/message_create_params.rb +4 -3
- data/lib/anthropic/models/message_delta_usage.rb +17 -1
- data/lib/anthropic/models/message_param.rb +4 -3
- data/lib/anthropic/models/messages/batch_create_params.rb +4 -3
- data/lib/anthropic/models/mid_conversation_system_block_param.rb +37 -0
- data/lib/anthropic/models/model.rb +8 -2
- data/lib/anthropic/models/output_tokens_details.rb +26 -0
- data/lib/anthropic/models/usage.rb +17 -1
- data/lib/anthropic/models/web_fetch_tool_result_error_code.rb +1 -0
- data/lib/anthropic/models.rb +4 -0
- data/lib/anthropic/resources/beta/messages.rb +3 -3
- data/lib/anthropic/resources/completions.rb +2 -2
- data/lib/anthropic/resources/messages.rb +3 -3
- data/lib/anthropic/version.rb +1 -1
- data/lib/anthropic.rb +4 -0
- data/rbi/anthropic/models/anthropic_beta.rbi +5 -0
- data/rbi/anthropic/models/beta/beta_advisor_message_iteration_usage.rbi +6 -4
- data/rbi/anthropic/models/beta/beta_advisor_redacted_result_block.rbi +22 -4
- data/rbi/anthropic/models/beta/beta_advisor_redacted_result_block_param.rbi +18 -4
- data/rbi/anthropic/models/beta/beta_advisor_result_block.rbi +26 -3
- data/rbi/anthropic/models/beta/beta_advisor_result_block_param.rbi +16 -3
- data/rbi/anthropic/models/beta/beta_advisor_tool_20260301.rbi +6 -4
- data/rbi/anthropic/models/beta/beta_content_block_param.rbi +2 -1
- data/rbi/anthropic/models/beta/beta_managed_agents_model.rbi +10 -2
- data/rbi/anthropic/models/beta/beta_managed_agents_model_config.rbi +6 -4
- data/rbi/anthropic/models/beta/beta_managed_agents_model_config_params.rbi +6 -4
- data/rbi/anthropic/models/beta/beta_message.rbi +6 -4
- data/rbi/anthropic/models/beta/beta_message_delta_usage.rbi +28 -0
- data/rbi/anthropic/models/beta/beta_message_param.rbi +5 -0
- data/rbi/anthropic/models/beta/beta_mid_conversation_system_block_param.rbi +74 -0
- data/rbi/anthropic/models/beta/beta_output_tokens_details.rbi +48 -0
- data/rbi/anthropic/models/beta/beta_thinking_delta.rbi +40 -3
- data/rbi/anthropic/models/beta/beta_usage.rbi +28 -0
- data/rbi/anthropic/models/beta/beta_web_fetch_tool_result_error_code.rbi +5 -0
- data/rbi/anthropic/models/beta/message_count_tokens_params.rbi +6 -4
- data/rbi/anthropic/models/beta/message_create_params.rbi +6 -4
- data/rbi/anthropic/models/beta/messages/batch_create_params.rbi +6 -4
- data/rbi/anthropic/models/completion.rbi +6 -4
- data/rbi/anthropic/models/completion_create_params.rbi +6 -4
- data/rbi/anthropic/models/content_block_param.rbi +2 -1
- data/rbi/anthropic/models/message.rbi +6 -4
- data/rbi/anthropic/models/message_count_tokens_params.rbi +6 -4
- data/rbi/anthropic/models/message_create_params.rbi +6 -4
- data/rbi/anthropic/models/message_delta_usage.rbi +27 -0
- data/rbi/anthropic/models/message_param.rbi +1 -0
- data/rbi/anthropic/models/messages/batch_create_params.rbi +6 -4
- data/rbi/anthropic/models/mid_conversation_system_block_param.rbi +66 -0
- data/rbi/anthropic/models/model.rbi +7 -2
- data/rbi/anthropic/models/output_tokens_details.rbi +41 -0
- data/rbi/anthropic/models/usage.rbi +27 -0
- data/rbi/anthropic/models/web_fetch_tool_result_error_code.rbi +5 -0
- data/rbi/anthropic/models.rbi +5 -0
- data/rbi/anthropic/resources/beta/messages.rbi +9 -6
- data/rbi/anthropic/resources/completions.rbi +6 -4
- data/rbi/anthropic/resources/messages.rbi +9 -6
- data/sig/anthropic/models/anthropic_beta.rbs +2 -0
- data/sig/anthropic/models/beta/beta_advisor_redacted_result_block.rbs +9 -1
- data/sig/anthropic/models/beta/beta_advisor_redacted_result_block_param.rbs +10 -2
- data/sig/anthropic/models/beta/beta_advisor_result_block.rbs +14 -3
- data/sig/anthropic/models/beta/beta_advisor_result_block_param.rbs +13 -3
- data/sig/anthropic/models/beta/beta_content_block_param.rbs +1 -0
- data/sig/anthropic/models/beta/beta_managed_agents_model.rbs +5 -1
- data/sig/anthropic/models/beta/beta_message_delta_usage.rbs +5 -0
- data/sig/anthropic/models/beta/beta_message_param.rbs +2 -1
- data/sig/anthropic/models/beta/beta_mid_conversation_system_block_param.rbs +34 -0
- data/sig/anthropic/models/beta/beta_output_tokens_details.rbs +17 -0
- data/sig/anthropic/models/beta/beta_thinking_delta.rbs +14 -3
- data/sig/anthropic/models/beta/beta_usage.rbs +5 -0
- data/sig/anthropic/models/beta/beta_web_fetch_tool_result_error_code.rbs +2 -0
- data/sig/anthropic/models/content_block_param.rbs +1 -0
- data/sig/anthropic/models/message_delta_usage.rbs +5 -0
- data/sig/anthropic/models/message_param.rbs +2 -1
- data/sig/anthropic/models/mid_conversation_system_block_param.rbs +30 -0
- data/sig/anthropic/models/model.rbs +5 -1
- data/sig/anthropic/models/output_tokens_details.rbs +13 -0
- data/sig/anthropic/models/usage.rbs +5 -0
- data/sig/anthropic/models/web_fetch_tool_result_error_code.rbs +2 -0
- data/sig/anthropic/models.rbs +4 -0
- metadata +14 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 876ada84a1da262a8c81ca559e5123da5d477507d02e127415541a6c58e12acd
|
|
4
|
+
data.tar.gz: 45fbc86ad5fa0153da5ff489c356acbd52ec59cee705d1dd3e8f764262c7a232
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 747f49e8366dec6fddbe2190984cf71927f6e55829ce868e8dd116b91ccdd5f89331ad115b84527d73f8963f892f3fea4e317b366283f4df2df1dfb4a3ba3ab1
|
|
7
|
+
data.tar.gz: 6ab572aa679fe5f526ab9043d67f128382e0518f3bfc3d628feefbd751f71eda4be61c05a1767b96faf2b816e58868adab3ed1c4ee3009a7b0efbee220ebdacd
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.44.0 (2026-05-28)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v1.43.0...v1.44.0](https://github.com/anthropics/anthropic-sdk-ruby/compare/v1.43.0...v1.44.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** Add support for claude-opus-4-8, mid-conversation system blocks, and usage.output_tokens_details ([6e361e7](https://github.com/anthropics/anthropic-sdk-ruby/commit/6e361e7ef1fc3bcbcb2b5bfa2a08bccd6a68ba72))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* **internal:** preserve path-qualified multipart filenames (SDK-40) ([#937](https://github.com/anthropics/anthropic-sdk-ruby/issues/937)) ([000e793](https://github.com/anthropics/anthropic-sdk-ruby/commit/000e793062309ee421111866f1bd56d0384277f3))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Documentation
|
|
18
|
+
|
|
19
|
+
* replace literal newlines ([e698364](https://github.com/anthropics/anthropic-sdk-ruby/commit/e698364084ebde9398a3c8e4c969e5922e778658))
|
|
20
|
+
|
|
21
|
+
## 1.43.0 (2026-05-21)
|
|
22
|
+
|
|
23
|
+
Full Changelog: [v1.42.0...v1.43.0](https://github.com/anthropics/anthropic-sdk-ruby/compare/v1.42.0...v1.43.0)
|
|
24
|
+
|
|
25
|
+
### Features
|
|
26
|
+
|
|
27
|
+
* **api:** Add support for thinking-token-count beta for estimated tokens in thinking block deltas when streaming ([9cd8a67](https://github.com/anthropics/anthropic-sdk-ruby/commit/9cd8a67e5a4382a72c2e417de9be587be9237353))
|
|
28
|
+
|
|
3
29
|
## 1.42.0 (2026-05-19)
|
|
4
30
|
|
|
5
31
|
Full Changelog: [v1.41.0...v1.42.0](https://github.com/anthropics/anthropic-sdk-ruby/compare/v1.41.0...v1.42.0)
|
data/README.md
CHANGED
data/lib/anthropic/file_part.rb
CHANGED
|
@@ -45,7 +45,10 @@ module Anthropic
|
|
|
45
45
|
@filename =
|
|
46
46
|
case [filename, (@content = content)]
|
|
47
47
|
in [String | Pathname, _]
|
|
48
|
-
|
|
48
|
+
# Preserve an explicit filename verbatim (e.g. a path-qualified
|
|
49
|
+
# `my-skill/SKILL.md`, which the Skills API requires). Only the
|
|
50
|
+
# auto-derived `nil` branches below are reduced to a basename.
|
|
51
|
+
filename.to_s
|
|
49
52
|
in [nil, Pathname]
|
|
50
53
|
content.basename.to_path
|
|
51
54
|
in [nil, IO]
|
|
@@ -590,10 +590,14 @@ module Anthropic
|
|
|
590
590
|
|
|
591
591
|
case val
|
|
592
592
|
in Anthropic::FilePart unless val.filename.nil?
|
|
593
|
-
filename
|
|
593
|
+
# A multipart `filename=` is an RFC 7578 / 6266 quoted-string, not a
|
|
594
|
+
# URI path segment: escape `"` and `\` and drop CR/LF, but keep `/`
|
|
595
|
+
# and spaces literal so path-qualified names (e.g. `dir/SKILL.md`,
|
|
596
|
+
# required by the Skills API) survive instead of becoming `dir%2F...`.
|
|
597
|
+
filename = val.filename.to_s.gsub(/["\\]/) { "\\#{_1}" }.delete("\r\n")
|
|
594
598
|
y << "; filename=\"#{filename}\""
|
|
595
599
|
in Pathname | IO
|
|
596
|
-
filename =
|
|
600
|
+
filename = ::File.basename(val.to_path).gsub(/["\\]/) { "\\#{_1}" }.delete("\r\n")
|
|
597
601
|
y << "; filename=\"#{filename}\""
|
|
598
602
|
else
|
|
599
603
|
end
|
|
@@ -57,6 +57,8 @@ module Anthropic
|
|
|
57
57
|
|
|
58
58
|
variant const: -> { Anthropic::Models::AnthropicBeta::CACHE_DIAGNOSIS_2026_04_07 }
|
|
59
59
|
|
|
60
|
+
variant const: -> { Anthropic::Models::AnthropicBeta::THINKING_TOKEN_COUNT_2026_05_13 }
|
|
61
|
+
|
|
60
62
|
# @!method self.variants
|
|
61
63
|
# @return [Array(String, Symbol)]
|
|
62
64
|
|
|
@@ -91,6 +93,7 @@ module Anthropic
|
|
|
91
93
|
ADVISOR_TOOL_2026_03_01 = :"advisor-tool-2026-03-01"
|
|
92
94
|
MANAGED_AGENTS_2026_04_01 = :"managed-agents-2026-04-01"
|
|
93
95
|
CACHE_DIAGNOSIS_2026_04_07 = :"cache-diagnosis-2026-04-07"
|
|
96
|
+
THINKING_TOKEN_COUNT_2026_05_13 = :"thinking-token-count-2026-05-13"
|
|
94
97
|
|
|
95
98
|
# @!endgroup
|
|
96
99
|
end
|
|
@@ -111,7 +111,9 @@ module Anthropic
|
|
|
111
111
|
module Model
|
|
112
112
|
extend Anthropic::Internal::Type::Union
|
|
113
113
|
|
|
114
|
-
# The model that will power your agent
|
|
114
|
+
# The model that will power your agent.
|
|
115
|
+
#
|
|
116
|
+
# See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
|
|
115
117
|
variant union: -> { Anthropic::Beta::BetaManagedAgentsModel }
|
|
116
118
|
|
|
117
119
|
# An object that defines additional configuration control over model use
|
|
@@ -140,7 +140,9 @@ module Anthropic
|
|
|
140
140
|
module Model
|
|
141
141
|
extend Anthropic::Internal::Type::Union
|
|
142
142
|
|
|
143
|
-
# The model that will power your agent
|
|
143
|
+
# The model that will power your agent.
|
|
144
|
+
#
|
|
145
|
+
# See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
|
|
144
146
|
variant union: -> { Anthropic::Beta::BetaManagedAgentsModel }
|
|
145
147
|
|
|
146
148
|
# An object that defines additional configuration control over model use
|
|
@@ -29,8 +29,9 @@ module Anthropic
|
|
|
29
29
|
required :input_tokens, Integer
|
|
30
30
|
|
|
31
31
|
# @!attribute model
|
|
32
|
-
# The model that will complete your prompt
|
|
33
|
-
#
|
|
32
|
+
# The model that will complete your prompt.
|
|
33
|
+
#
|
|
34
|
+
# See [models](https://docs.anthropic.com/en/docs/models-overview) for additional
|
|
34
35
|
# details and options.
|
|
35
36
|
#
|
|
36
37
|
# @return [Symbol, String, Anthropic::Models::Model]
|
|
@@ -62,7 +63,7 @@ module Anthropic
|
|
|
62
63
|
#
|
|
63
64
|
# @param input_tokens [Integer] The number of input tokens which were used.
|
|
64
65
|
#
|
|
65
|
-
# @param model [Symbol, String, Anthropic::Models::Model] The model that will complete your prompt
|
|
66
|
+
# @param model [Symbol, String, Anthropic::Models::Model] The model that will complete your prompt.
|
|
66
67
|
#
|
|
67
68
|
# @param output_tokens [Integer] The number of output tokens which were used.
|
|
68
69
|
#
|
|
@@ -11,17 +11,26 @@ module Anthropic
|
|
|
11
11
|
# @return [String]
|
|
12
12
|
required :encrypted_content, String
|
|
13
13
|
|
|
14
|
+
# @!attribute stop_reason
|
|
15
|
+
# The advisor sub-inference's stop reason (same values as the top-level message
|
|
16
|
+
# `stop_reason`).
|
|
17
|
+
#
|
|
18
|
+
# @return [String, nil]
|
|
19
|
+
required :stop_reason, String, nil?: true
|
|
20
|
+
|
|
14
21
|
# @!attribute type
|
|
15
22
|
#
|
|
16
23
|
# @return [Symbol, :advisor_redacted_result]
|
|
17
24
|
required :type, const: :advisor_redacted_result
|
|
18
25
|
|
|
19
|
-
# @!method initialize(encrypted_content:, type: :advisor_redacted_result)
|
|
26
|
+
# @!method initialize(encrypted_content:, stop_reason:, type: :advisor_redacted_result)
|
|
20
27
|
# Some parameter documentations has been truncated, see
|
|
21
28
|
# {Anthropic::Models::Beta::BetaAdvisorRedactedResultBlock} for more details.
|
|
22
29
|
#
|
|
23
30
|
# @param encrypted_content [String] Opaque blob containing the advisor's output. Round-trip verbatim; do not inspect
|
|
24
31
|
#
|
|
32
|
+
# @param stop_reason [String, nil] The advisor sub-inference's stop reason (same values as the top-level message `s
|
|
33
|
+
#
|
|
25
34
|
# @param type [Symbol, :advisor_redacted_result]
|
|
26
35
|
end
|
|
27
36
|
end
|
|
@@ -15,9 +15,16 @@ module Anthropic
|
|
|
15
15
|
# @return [Symbol, :advisor_redacted_result]
|
|
16
16
|
required :type, const: :advisor_redacted_result
|
|
17
17
|
|
|
18
|
-
# @!
|
|
18
|
+
# @!attribute stop_reason
|
|
19
|
+
#
|
|
20
|
+
# @return [String, nil]
|
|
21
|
+
optional :stop_reason, String, nil?: true
|
|
22
|
+
|
|
23
|
+
# @!method initialize(encrypted_content:, stop_reason: nil, type: :advisor_redacted_result)
|
|
19
24
|
# @param encrypted_content [String] Opaque blob produced by a prior response; must be round-tripped verbatim.
|
|
20
25
|
#
|
|
26
|
+
# @param stop_reason [String, nil]
|
|
27
|
+
#
|
|
21
28
|
# @param type [Symbol, :advisor_redacted_result]
|
|
22
29
|
end
|
|
23
30
|
end
|
|
@@ -4,6 +4,14 @@ module Anthropic
|
|
|
4
4
|
module Models
|
|
5
5
|
module Beta
|
|
6
6
|
class BetaAdvisorResultBlock < Anthropic::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute stop_reason
|
|
8
|
+
# The advisor sub-inference's stop reason (same values as the top-level message
|
|
9
|
+
# `stop_reason`). `max_tokens` indicates the advisor's output was truncated at the
|
|
10
|
+
# tool's `max_tokens` value or the advisor model's policy cap.
|
|
11
|
+
#
|
|
12
|
+
# @return [String, nil]
|
|
13
|
+
required :stop_reason, String, nil?: true
|
|
14
|
+
|
|
7
15
|
# @!attribute text
|
|
8
16
|
#
|
|
9
17
|
# @return [String]
|
|
@@ -14,8 +22,14 @@ module Anthropic
|
|
|
14
22
|
# @return [Symbol, :advisor_result]
|
|
15
23
|
required :type, const: :advisor_result
|
|
16
24
|
|
|
17
|
-
# @!method initialize(text:, type: :advisor_result)
|
|
25
|
+
# @!method initialize(stop_reason:, text:, type: :advisor_result)
|
|
26
|
+
# Some parameter documentations has been truncated, see
|
|
27
|
+
# {Anthropic::Models::Beta::BetaAdvisorResultBlock} for more details.
|
|
28
|
+
#
|
|
29
|
+
# @param stop_reason [String, nil] The advisor sub-inference's stop reason (same values as the top-level message `s
|
|
30
|
+
#
|
|
18
31
|
# @param text [String]
|
|
32
|
+
#
|
|
19
33
|
# @param type [Symbol, :advisor_result]
|
|
20
34
|
end
|
|
21
35
|
end
|
|
@@ -14,8 +14,14 @@ module Anthropic
|
|
|
14
14
|
# @return [Symbol, :advisor_result]
|
|
15
15
|
required :type, const: :advisor_result
|
|
16
16
|
|
|
17
|
-
# @!
|
|
17
|
+
# @!attribute stop_reason
|
|
18
|
+
#
|
|
19
|
+
# @return [String, nil]
|
|
20
|
+
optional :stop_reason, String, nil?: true
|
|
21
|
+
|
|
22
|
+
# @!method initialize(text:, stop_reason: nil, type: :advisor_result)
|
|
18
23
|
# @param text [String]
|
|
24
|
+
# @param stop_reason [String, nil]
|
|
19
25
|
# @param type [Symbol, :advisor_result]
|
|
20
26
|
end
|
|
21
27
|
end
|
|
@@ -5,8 +5,9 @@ module Anthropic
|
|
|
5
5
|
module Beta
|
|
6
6
|
class BetaAdvisorTool20260301 < Anthropic::Internal::Type::BaseModel
|
|
7
7
|
# @!attribute model
|
|
8
|
-
# The model that will complete your prompt
|
|
9
|
-
#
|
|
8
|
+
# The model that will complete your prompt.
|
|
9
|
+
#
|
|
10
|
+
# See [models](https://docs.anthropic.com/en/docs/models-overview) for additional
|
|
10
11
|
# details and options.
|
|
11
12
|
#
|
|
12
13
|
# @return [Symbol, String, Anthropic::Models::Model]
|
|
@@ -68,7 +69,7 @@ module Anthropic
|
|
|
68
69
|
# Some parameter documentations has been truncated, see
|
|
69
70
|
# {Anthropic::Models::Beta::BetaAdvisorTool20260301} for more details.
|
|
70
71
|
#
|
|
71
|
-
# @param model [Symbol, String, Anthropic::Models::Model] The model that will complete your prompt
|
|
72
|
+
# @param model [Symbol, String, Anthropic::Models::Model] The model that will complete your prompt.
|
|
72
73
|
#
|
|
73
74
|
# @param allowed_callers [Array<Symbol, Anthropic::Models::Beta::BetaAdvisorTool20260301::AllowedCaller>]
|
|
74
75
|
#
|
|
@@ -68,8 +68,14 @@ module Anthropic
|
|
|
68
68
|
# treats these as no-ops. Empty string content is not allowed.
|
|
69
69
|
variant :compaction, -> { Anthropic::Beta::BetaCompactionBlockParam }
|
|
70
70
|
|
|
71
|
+
# System instructions that appear mid-conversation.
|
|
72
|
+
#
|
|
73
|
+
# Use this block to provide or update system-level instructions at a specific
|
|
74
|
+
# point in the conversation, rather than only via the top-level `system` parameter.
|
|
75
|
+
variant :mid_conv_system, -> { Anthropic::Beta::BetaMidConversationSystemBlockParam }
|
|
76
|
+
|
|
71
77
|
# @!method self.variants
|
|
72
|
-
# @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::BetaAdvisorToolResultBlockParam, 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)]
|
|
78
|
+
# @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::BetaAdvisorToolResultBlockParam, 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, Anthropic::Models::Beta::BetaMidConversationSystemBlockParam)]
|
|
73
79
|
end
|
|
74
80
|
end
|
|
75
81
|
|
|
@@ -3,12 +3,15 @@
|
|
|
3
3
|
module Anthropic
|
|
4
4
|
module Models
|
|
5
5
|
module Beta
|
|
6
|
-
# The model that will power your agent
|
|
7
|
-
#
|
|
6
|
+
# The model that will power your agent.
|
|
7
|
+
#
|
|
8
|
+
# See [models](https://docs.anthropic.com/en/docs/models-overview) for additional
|
|
8
9
|
# details and options.
|
|
9
10
|
module BetaManagedAgentsModel
|
|
10
11
|
extend Anthropic::Internal::Type::Union
|
|
11
12
|
|
|
13
|
+
variant const: -> { Anthropic::Models::Beta::BetaManagedAgentsModel::CLAUDE_OPUS_4_8 }
|
|
14
|
+
|
|
12
15
|
variant const: -> { Anthropic::Models::Beta::BetaManagedAgentsModel::CLAUDE_OPUS_4_7 }
|
|
13
16
|
|
|
14
17
|
variant const: -> { Anthropic::Models::Beta::BetaManagedAgentsModel::CLAUDE_OPUS_4_6 }
|
|
@@ -38,6 +41,9 @@ module Anthropic
|
|
|
38
41
|
|
|
39
42
|
# @!group
|
|
40
43
|
|
|
44
|
+
# Frontier intelligence for long-running agents and coding
|
|
45
|
+
CLAUDE_OPUS_4_8 = :"claude-opus-4-8"
|
|
46
|
+
|
|
41
47
|
# Frontier intelligence for long-running agents and coding
|
|
42
48
|
CLAUDE_OPUS_4_7 = :"claude-opus-4-7"
|
|
43
49
|
|
|
@@ -5,8 +5,9 @@ module Anthropic
|
|
|
5
5
|
module Beta
|
|
6
6
|
class BetaManagedAgentsModelConfig < Anthropic::Internal::Type::BaseModel
|
|
7
7
|
# @!attribute id
|
|
8
|
-
# The model that will power your agent
|
|
9
|
-
#
|
|
8
|
+
# The model that will power your agent.
|
|
9
|
+
#
|
|
10
|
+
# See [models](https://docs.anthropic.com/en/docs/models-overview) for additional
|
|
10
11
|
# details and options.
|
|
11
12
|
#
|
|
12
13
|
# @return [Symbol, String, Anthropic::Models::Beta::BetaManagedAgentsModel]
|
|
@@ -26,7 +27,7 @@ module Anthropic
|
|
|
26
27
|
#
|
|
27
28
|
# Model identifier and configuration.
|
|
28
29
|
#
|
|
29
|
-
# @param id [Symbol, String, Anthropic::Models::Beta::BetaManagedAgentsModel] The model that will power your agent
|
|
30
|
+
# @param id [Symbol, String, Anthropic::Models::Beta::BetaManagedAgentsModel] The model that will power your agent.
|
|
30
31
|
#
|
|
31
32
|
# @param speed [Symbol, Anthropic::Models::Beta::BetaManagedAgentsModelConfig::Speed] Inference speed mode. `fast` provides significantly faster output token generati
|
|
32
33
|
|
|
@@ -5,8 +5,9 @@ module Anthropic
|
|
|
5
5
|
module Beta
|
|
6
6
|
class BetaManagedAgentsModelConfigParams < Anthropic::Internal::Type::BaseModel
|
|
7
7
|
# @!attribute id
|
|
8
|
-
# The model that will power your agent
|
|
9
|
-
#
|
|
8
|
+
# The model that will power your agent.
|
|
9
|
+
#
|
|
10
|
+
# See [models](https://docs.anthropic.com/en/docs/models-overview) for additional
|
|
10
11
|
# details and options.
|
|
11
12
|
#
|
|
12
13
|
# @return [Symbol, String, Anthropic::Models::Beta::BetaManagedAgentsModel]
|
|
@@ -26,7 +27,7 @@ module Anthropic
|
|
|
26
27
|
#
|
|
27
28
|
# An object that defines additional configuration control over model use
|
|
28
29
|
#
|
|
29
|
-
# @param id [Symbol, String, Anthropic::Models::Beta::BetaManagedAgentsModel] The model that will power your agent
|
|
30
|
+
# @param id [Symbol, String, Anthropic::Models::Beta::BetaManagedAgentsModel] The model that will power your agent.
|
|
30
31
|
#
|
|
31
32
|
# @param speed [Symbol, Anthropic::Models::Beta::BetaManagedAgentsModelConfigParams::Speed, nil] Inference speed mode. `fast` provides significantly faster output token generati
|
|
32
33
|
|
|
@@ -87,8 +87,9 @@ module Anthropic
|
|
|
87
87
|
required :diagnostics, -> { Anthropic::Beta::BetaDiagnostics }, nil?: true
|
|
88
88
|
|
|
89
89
|
# @!attribute model
|
|
90
|
-
# The model that will complete your prompt
|
|
91
|
-
#
|
|
90
|
+
# The model that will complete your prompt.
|
|
91
|
+
#
|
|
92
|
+
# See [models](https://docs.anthropic.com/en/docs/models-overview) for additional
|
|
92
93
|
# details and options.
|
|
93
94
|
#
|
|
94
95
|
# @return [Symbol, String, Anthropic::Models::Model]
|
|
@@ -179,7 +180,7 @@ module Anthropic
|
|
|
179
180
|
#
|
|
180
181
|
# @param diagnostics [Anthropic::Models::Beta::BetaDiagnostics, nil] Response envelope for request-level diagnostics. Present (possibly
|
|
181
182
|
#
|
|
182
|
-
# @param model [Symbol, String, Anthropic::Models::Model] The model that will complete your prompt
|
|
183
|
+
# @param model [Symbol, String, Anthropic::Models::Model] The model that will complete your prompt.
|
|
183
184
|
#
|
|
184
185
|
# @param stop_details [Anthropic::Models::Beta::BetaRefusalStopDetails, nil] Structured information about a refusal.
|
|
185
186
|
#
|
|
@@ -43,13 +43,24 @@ module Anthropic
|
|
|
43
43
|
# @return [Integer]
|
|
44
44
|
required :output_tokens, Integer
|
|
45
45
|
|
|
46
|
+
# @!attribute output_tokens_details
|
|
47
|
+
# Breakdown of output tokens by category.
|
|
48
|
+
#
|
|
49
|
+
# `output_tokens` remains the inclusive, authoritative total used for billing.
|
|
50
|
+
# This object provides a read-only decomposition for observability — for example,
|
|
51
|
+
# how many of the billed output tokens were spent on internal reasoning that may
|
|
52
|
+
# have been summarized before being returned to you.
|
|
53
|
+
#
|
|
54
|
+
# @return [Anthropic::Models::Beta::BetaOutputTokensDetails, nil]
|
|
55
|
+
required :output_tokens_details, -> { Anthropic::Beta::BetaOutputTokensDetails }, nil?: true
|
|
56
|
+
|
|
46
57
|
# @!attribute server_tool_use
|
|
47
58
|
# The number of server tool requests.
|
|
48
59
|
#
|
|
49
60
|
# @return [Anthropic::Models::Beta::BetaServerToolUsage, nil]
|
|
50
61
|
required :server_tool_use, -> { Anthropic::Beta::BetaServerToolUsage }, nil?: true
|
|
51
62
|
|
|
52
|
-
# @!method initialize(cache_creation_input_tokens:, cache_read_input_tokens:, input_tokens:, iterations:, output_tokens:, server_tool_use:)
|
|
63
|
+
# @!method initialize(cache_creation_input_tokens:, cache_read_input_tokens:, input_tokens:, iterations:, output_tokens:, output_tokens_details:, server_tool_use:)
|
|
53
64
|
# Some parameter documentations has been truncated, see
|
|
54
65
|
# {Anthropic::Models::Beta::BetaMessageDeltaUsage} for more details.
|
|
55
66
|
#
|
|
@@ -63,6 +74,8 @@ module Anthropic
|
|
|
63
74
|
#
|
|
64
75
|
# @param output_tokens [Integer] The cumulative number of output tokens which were used.
|
|
65
76
|
#
|
|
77
|
+
# @param output_tokens_details [Anthropic::Models::Beta::BetaOutputTokensDetails, nil] Breakdown of output tokens by category.
|
|
78
|
+
#
|
|
66
79
|
# @param server_tool_use [Anthropic::Models::Beta::BetaServerToolUsage, nil] The number of server tool requests.
|
|
67
80
|
end
|
|
68
81
|
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::BetaAdvisorToolResultBlockParam, 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>]
|
|
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::BetaAdvisorToolResultBlockParam, 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, Anthropic::Models::Beta::BetaMidConversationSystemBlockParam>]
|
|
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::BetaAdvisorToolResultBlockParam, 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>]
|
|
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::BetaAdvisorToolResultBlockParam, 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, Anthropic::Models::Beta::BetaMidConversationSystemBlockParam>]
|
|
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::BetaAdvisorToolResultBlockParam, 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>)]
|
|
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::BetaAdvisorToolResultBlockParam, 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, Anthropic::Models::Beta::BetaMidConversationSystemBlockParam>)]
|
|
31
31
|
|
|
32
32
|
# @type [Anthropic::Internal::Type::Converter]
|
|
33
33
|
BetaContentBlockParamArray =
|
|
@@ -40,6 +40,7 @@ module Anthropic
|
|
|
40
40
|
|
|
41
41
|
USER = :user
|
|
42
42
|
ASSISTANT = :assistant
|
|
43
|
+
SYSTEM = :system
|
|
43
44
|
|
|
44
45
|
# @!method self.values
|
|
45
46
|
# @return [Array<Symbol>]
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
module Beta
|
|
6
|
+
class BetaMidConversationSystemBlockParam < Anthropic::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute content
|
|
8
|
+
# System instruction text blocks.
|
|
9
|
+
#
|
|
10
|
+
# @return [Array<Anthropic::Models::Beta::BetaTextBlockParam>]
|
|
11
|
+
required :content, -> { Anthropic::Internal::Type::ArrayOf[Anthropic::Beta::BetaTextBlockParam] }
|
|
12
|
+
|
|
13
|
+
# @!attribute type
|
|
14
|
+
#
|
|
15
|
+
# @return [Symbol, :mid_conv_system]
|
|
16
|
+
required :type, const: :mid_conv_system
|
|
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: :mid_conv_system)
|
|
25
|
+
# System instructions that appear mid-conversation.
|
|
26
|
+
#
|
|
27
|
+
# Use this block to provide or update system-level instructions at a specific
|
|
28
|
+
# point in the conversation, rather than only via the top-level `system`
|
|
29
|
+
# parameter.
|
|
30
|
+
#
|
|
31
|
+
# @param content [Array<Anthropic::Models::Beta::BetaTextBlockParam>] System instruction text blocks.
|
|
32
|
+
#
|
|
33
|
+
# @param cache_control [Anthropic::Models::Beta::BetaCacheControlEphemeral, nil] Create a cache control breakpoint at this content block.
|
|
34
|
+
#
|
|
35
|
+
# @param type [Symbol, :mid_conv_system]
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
BetaMidConversationSystemBlockParam = Beta::BetaMidConversationSystemBlockParam
|
|
40
|
+
end
|
|
41
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
module Beta
|
|
6
|
+
class BetaOutputTokensDetails < Anthropic::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute thinking_tokens
|
|
8
|
+
# Number of output tokens the model generated as internal reasoning, including the
|
|
9
|
+
# thinking-block delimiter tokens.
|
|
10
|
+
#
|
|
11
|
+
# Reflects the raw reasoning the model produced, not the (possibly shorter)
|
|
12
|
+
# summarized thinking text returned in the response body. Computed by
|
|
13
|
+
# re-tokenizing the raw reasoning text, so it may differ from the model's exact
|
|
14
|
+
# generation count by a small number of tokens. Always ≤ `output_tokens`;
|
|
15
|
+
# `output_tokens - thinking_tokens` approximates the non-reasoning output.
|
|
16
|
+
#
|
|
17
|
+
# @return [Integer]
|
|
18
|
+
required :thinking_tokens, Integer
|
|
19
|
+
|
|
20
|
+
# @!method initialize(thinking_tokens:)
|
|
21
|
+
# Some parameter documentations has been truncated, see
|
|
22
|
+
# {Anthropic::Models::Beta::BetaOutputTokensDetails} for more details.
|
|
23
|
+
#
|
|
24
|
+
# @param thinking_tokens [Integer] Number of output tokens the model generated as internal reasoning, including
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
BetaOutputTokensDetails = Beta::BetaOutputTokensDetails
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -4,6 +4,19 @@ module Anthropic
|
|
|
4
4
|
module Models
|
|
5
5
|
module Beta
|
|
6
6
|
class BetaThinkingDelta < Anthropic::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute estimated_tokens
|
|
8
|
+
# Per-frame increment of a coarse, running estimate of the tokens this thinking
|
|
9
|
+
# block has produced so far. Present whenever the
|
|
10
|
+
# `thinking-token-count-2026-05-13` beta is set; `null` unless `thinking.display`
|
|
11
|
+
# resolves to `"omitted"` and a count is due this frame. Sum the increments across
|
|
12
|
+
# `thinking_delta` frames on this block for a progress indicator. Each increment
|
|
13
|
+
# is a non-negative multiple of a fixed quantum and the cadence is rate-limited,
|
|
14
|
+
# so this is a deliberately lossy display hint, not a billable count;
|
|
15
|
+
# `usage.output_tokens` remains authoritative.
|
|
16
|
+
#
|
|
17
|
+
# @return [Integer, nil]
|
|
18
|
+
required :estimated_tokens, Integer, nil?: true
|
|
19
|
+
|
|
7
20
|
# @!attribute thinking
|
|
8
21
|
#
|
|
9
22
|
# @return [String]
|
|
@@ -14,8 +27,14 @@ module Anthropic
|
|
|
14
27
|
# @return [Symbol, :thinking_delta]
|
|
15
28
|
required :type, const: :thinking_delta
|
|
16
29
|
|
|
17
|
-
# @!method initialize(thinking:, type: :thinking_delta)
|
|
30
|
+
# @!method initialize(estimated_tokens:, thinking:, type: :thinking_delta)
|
|
31
|
+
# Some parameter documentations has been truncated, see
|
|
32
|
+
# {Anthropic::Models::Beta::BetaThinkingDelta} for more details.
|
|
33
|
+
#
|
|
34
|
+
# @param estimated_tokens [Integer, nil] Per-frame increment of a coarse, running estimate of the tokens this thinking bl
|
|
35
|
+
#
|
|
18
36
|
# @param thinking [String]
|
|
37
|
+
#
|
|
19
38
|
# @param type [Symbol, :thinking_delta]
|
|
20
39
|
end
|
|
21
40
|
end
|
|
@@ -55,6 +55,17 @@ module Anthropic
|
|
|
55
55
|
# @return [Integer]
|
|
56
56
|
required :output_tokens, Integer
|
|
57
57
|
|
|
58
|
+
# @!attribute output_tokens_details
|
|
59
|
+
# Breakdown of output tokens by category.
|
|
60
|
+
#
|
|
61
|
+
# `output_tokens` remains the inclusive, authoritative total used for billing.
|
|
62
|
+
# This object provides a read-only decomposition for observability — for example,
|
|
63
|
+
# how many of the billed output tokens were spent on internal reasoning that may
|
|
64
|
+
# have been summarized before being returned to you.
|
|
65
|
+
#
|
|
66
|
+
# @return [Anthropic::Models::Beta::BetaOutputTokensDetails, nil]
|
|
67
|
+
required :output_tokens_details, -> { Anthropic::Beta::BetaOutputTokensDetails }, nil?: true
|
|
68
|
+
|
|
58
69
|
# @!attribute server_tool_use
|
|
59
70
|
# The number of server tool requests.
|
|
60
71
|
#
|
|
@@ -73,7 +84,7 @@ module Anthropic
|
|
|
73
84
|
# @return [Symbol, Anthropic::Models::Beta::BetaUsage::Speed, nil]
|
|
74
85
|
required :speed, enum: -> { Anthropic::Beta::BetaUsage::Speed }, nil?: true
|
|
75
86
|
|
|
76
|
-
# @!method initialize(cache_creation:, cache_creation_input_tokens:, cache_read_input_tokens:, inference_geo:, input_tokens:, iterations:, output_tokens:, server_tool_use:, service_tier:, speed:)
|
|
87
|
+
# @!method initialize(cache_creation:, cache_creation_input_tokens:, cache_read_input_tokens:, inference_geo:, input_tokens:, iterations:, output_tokens:, output_tokens_details:, server_tool_use:, service_tier:, speed:)
|
|
77
88
|
# Some parameter documentations has been truncated, see
|
|
78
89
|
# {Anthropic::Models::Beta::BetaUsage} for more details.
|
|
79
90
|
#
|
|
@@ -91,6 +102,8 @@ module Anthropic
|
|
|
91
102
|
#
|
|
92
103
|
# @param output_tokens [Integer] The number of output tokens which were used.
|
|
93
104
|
#
|
|
105
|
+
# @param output_tokens_details [Anthropic::Models::Beta::BetaOutputTokensDetails, nil] Breakdown of output tokens by category.
|
|
106
|
+
#
|
|
94
107
|
# @param server_tool_use [Anthropic::Models::Beta::BetaServerToolUsage, nil] The number of server tool requests.
|
|
95
108
|
#
|
|
96
109
|
# @param service_tier [Symbol, Anthropic::Models::Beta::BetaUsage::ServiceTier, nil] If the request used the priority, standard, or batch tier.
|
|
@@ -9,6 +9,7 @@ module Anthropic
|
|
|
9
9
|
INVALID_TOOL_INPUT = :invalid_tool_input
|
|
10
10
|
URL_TOO_LONG = :url_too_long
|
|
11
11
|
URL_NOT_ALLOWED = :url_not_allowed
|
|
12
|
+
URL_NOT_IN_PRIOR_CONTEXT = :url_not_in_prior_context
|
|
12
13
|
URL_NOT_ACCESSIBLE = :url_not_accessible
|
|
13
14
|
UNSUPPORTED_CONTENT_TYPE = :unsupported_content_type
|
|
14
15
|
TOO_MANY_REQUESTS = :too_many_requests
|
|
@@ -79,8 +79,9 @@ module Anthropic
|
|
|
79
79
|
required :messages, -> { Anthropic::Internal::Type::ArrayOf[Anthropic::Beta::BetaMessageParam] }
|
|
80
80
|
|
|
81
81
|
# @!attribute model
|
|
82
|
-
# The model that will complete your prompt
|
|
83
|
-
#
|
|
82
|
+
# The model that will complete your prompt.
|
|
83
|
+
#
|
|
84
|
+
# See [models](https://docs.anthropic.com/en/docs/models-overview) for additional
|
|
84
85
|
# details and options.
|
|
85
86
|
#
|
|
86
87
|
# @return [Symbol, String, Anthropic::Models::Model]
|
|
@@ -258,7 +259,7 @@ module Anthropic
|
|
|
258
259
|
#
|
|
259
260
|
# @param messages [Array<Anthropic::Models::Beta::BetaMessageParam>] Input messages.
|
|
260
261
|
#
|
|
261
|
-
# @param model [Symbol, String, Anthropic::Models::Model] The model that will complete your prompt
|
|
262
|
+
# @param model [Symbol, String, Anthropic::Models::Model] The model that will complete your prompt.
|
|
262
263
|
#
|
|
263
264
|
# @param cache_control [Anthropic::Models::Beta::BetaCacheControlEphemeral, nil] Top-level cache control automatically applies a cache_control marker to the last
|
|
264
265
|
#
|