anthropic 1.43.0 → 1.45.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +45 -0
  3. data/README.md +1 -1
  4. data/SECURITY.md +7 -19
  5. data/lib/anthropic/file_part.rb +4 -1
  6. data/lib/anthropic/helpers/streaming/message_stream.rb +18 -0
  7. data/lib/anthropic/internal/util.rb +6 -2
  8. data/lib/anthropic/models/beta/agent_create_params.rb +3 -1
  9. data/lib/anthropic/models/beta/agent_update_params.rb +3 -1
  10. data/lib/anthropic/models/beta/beta_advisor_message_iteration_usage.rb +4 -3
  11. data/lib/anthropic/models/beta/beta_advisor_redacted_result_block.rb +10 -1
  12. data/lib/anthropic/models/beta/beta_advisor_redacted_result_block_param.rb +8 -1
  13. data/lib/anthropic/models/beta/beta_advisor_result_block.rb +15 -1
  14. data/lib/anthropic/models/beta/beta_advisor_result_block_param.rb +7 -1
  15. data/lib/anthropic/models/beta/beta_advisor_tool_20260301.rb +4 -3
  16. data/lib/anthropic/models/beta/beta_content_block_param.rb +7 -1
  17. data/lib/anthropic/models/beta/beta_managed_agents_model.rb +8 -2
  18. data/lib/anthropic/models/beta/beta_managed_agents_model_config.rb +4 -3
  19. data/lib/anthropic/models/beta/beta_managed_agents_model_config_params.rb +4 -3
  20. data/lib/anthropic/models/beta/beta_message.rb +4 -3
  21. data/lib/anthropic/models/beta/beta_message_delta_usage.rb +14 -1
  22. data/lib/anthropic/models/beta/beta_message_param.rb +4 -3
  23. data/lib/anthropic/models/beta/beta_mid_conversation_system_block_param.rb +41 -0
  24. data/lib/anthropic/models/beta/beta_output_tokens_details.rb +30 -0
  25. data/lib/anthropic/models/beta/beta_usage.rb +14 -1
  26. data/lib/anthropic/models/beta/beta_web_fetch_tool_result_error_code.rb +1 -0
  27. data/lib/anthropic/models/beta/message_count_tokens_params.rb +4 -3
  28. data/lib/anthropic/models/beta/message_create_params.rb +4 -3
  29. data/lib/anthropic/models/beta/messages/batch_create_params.rb +4 -3
  30. data/lib/anthropic/models/completion.rb +4 -3
  31. data/lib/anthropic/models/completion_create_params.rb +4 -3
  32. data/lib/anthropic/models/content_block_param.rb +7 -1
  33. data/lib/anthropic/models/message.rb +4 -3
  34. data/lib/anthropic/models/message_count_tokens_params.rb +4 -3
  35. data/lib/anthropic/models/message_create_params.rb +4 -3
  36. data/lib/anthropic/models/message_delta_usage.rb +17 -1
  37. data/lib/anthropic/models/message_param.rb +4 -3
  38. data/lib/anthropic/models/messages/batch_create_params.rb +4 -3
  39. data/lib/anthropic/models/mid_conversation_system_block_param.rb +37 -0
  40. data/lib/anthropic/models/model.rb +14 -2
  41. data/lib/anthropic/models/output_tokens_details.rb +26 -0
  42. data/lib/anthropic/models/usage.rb +17 -1
  43. data/lib/anthropic/models/web_fetch_tool_result_error_code.rb +1 -0
  44. data/lib/anthropic/models.rb +4 -0
  45. data/lib/anthropic/resources/beta/messages.rb +3 -3
  46. data/lib/anthropic/resources/completions.rb +2 -2
  47. data/lib/anthropic/resources/messages.rb +3 -3
  48. data/lib/anthropic/version.rb +1 -1
  49. data/lib/anthropic.rb +4 -0
  50. data/rbi/anthropic/models/beta/beta_advisor_message_iteration_usage.rbi +6 -4
  51. data/rbi/anthropic/models/beta/beta_advisor_redacted_result_block.rbi +22 -4
  52. data/rbi/anthropic/models/beta/beta_advisor_redacted_result_block_param.rbi +18 -4
  53. data/rbi/anthropic/models/beta/beta_advisor_result_block.rbi +26 -3
  54. data/rbi/anthropic/models/beta/beta_advisor_result_block_param.rbi +16 -3
  55. data/rbi/anthropic/models/beta/beta_advisor_tool_20260301.rbi +6 -4
  56. data/rbi/anthropic/models/beta/beta_content_block_param.rbi +2 -1
  57. data/rbi/anthropic/models/beta/beta_managed_agents_model.rbi +10 -2
  58. data/rbi/anthropic/models/beta/beta_managed_agents_model_config.rbi +6 -4
  59. data/rbi/anthropic/models/beta/beta_managed_agents_model_config_params.rbi +6 -4
  60. data/rbi/anthropic/models/beta/beta_message.rbi +6 -4
  61. data/rbi/anthropic/models/beta/beta_message_delta_usage.rbi +28 -0
  62. data/rbi/anthropic/models/beta/beta_message_param.rbi +5 -0
  63. data/rbi/anthropic/models/beta/beta_mid_conversation_system_block_param.rbi +74 -0
  64. data/rbi/anthropic/models/beta/beta_output_tokens_details.rbi +48 -0
  65. data/rbi/anthropic/models/beta/beta_usage.rbi +28 -0
  66. data/rbi/anthropic/models/beta/beta_web_fetch_tool_result_error_code.rbi +5 -0
  67. data/rbi/anthropic/models/beta/message_count_tokens_params.rbi +6 -4
  68. data/rbi/anthropic/models/beta/message_create_params.rbi +6 -4
  69. data/rbi/anthropic/models/beta/messages/batch_create_params.rbi +6 -4
  70. data/rbi/anthropic/models/completion.rbi +6 -4
  71. data/rbi/anthropic/models/completion_create_params.rbi +6 -4
  72. data/rbi/anthropic/models/content_block_param.rbi +2 -1
  73. data/rbi/anthropic/models/message.rbi +6 -4
  74. data/rbi/anthropic/models/message_count_tokens_params.rbi +6 -4
  75. data/rbi/anthropic/models/message_create_params.rbi +6 -4
  76. data/rbi/anthropic/models/message_delta_usage.rbi +27 -0
  77. data/rbi/anthropic/models/message_param.rbi +1 -0
  78. data/rbi/anthropic/models/messages/batch_create_params.rbi +6 -4
  79. data/rbi/anthropic/models/mid_conversation_system_block_param.rbi +66 -0
  80. data/rbi/anthropic/models/model.rbi +7 -2
  81. data/rbi/anthropic/models/output_tokens_details.rbi +41 -0
  82. data/rbi/anthropic/models/usage.rbi +27 -0
  83. data/rbi/anthropic/models/web_fetch_tool_result_error_code.rbi +5 -0
  84. data/rbi/anthropic/models.rbi +5 -0
  85. data/rbi/anthropic/resources/beta/messages.rbi +9 -6
  86. data/rbi/anthropic/resources/completions.rbi +6 -4
  87. data/rbi/anthropic/resources/messages.rbi +9 -6
  88. data/sig/anthropic/models/beta/beta_advisor_redacted_result_block.rbs +9 -1
  89. data/sig/anthropic/models/beta/beta_advisor_redacted_result_block_param.rbs +10 -2
  90. data/sig/anthropic/models/beta/beta_advisor_result_block.rbs +14 -3
  91. data/sig/anthropic/models/beta/beta_advisor_result_block_param.rbs +13 -3
  92. data/sig/anthropic/models/beta/beta_content_block_param.rbs +1 -0
  93. data/sig/anthropic/models/beta/beta_managed_agents_model.rbs +5 -1
  94. data/sig/anthropic/models/beta/beta_message_delta_usage.rbs +5 -0
  95. data/sig/anthropic/models/beta/beta_message_param.rbs +2 -1
  96. data/sig/anthropic/models/beta/beta_mid_conversation_system_block_param.rbs +34 -0
  97. data/sig/anthropic/models/beta/beta_output_tokens_details.rbs +17 -0
  98. data/sig/anthropic/models/beta/beta_usage.rbs +5 -0
  99. data/sig/anthropic/models/beta/beta_web_fetch_tool_result_error_code.rbs +2 -0
  100. data/sig/anthropic/models/content_block_param.rbs +1 -0
  101. data/sig/anthropic/models/message_delta_usage.rbs +5 -0
  102. data/sig/anthropic/models/message_param.rbs +2 -1
  103. data/sig/anthropic/models/mid_conversation_system_block_param.rbs +30 -0
  104. data/sig/anthropic/models/model.rbs +5 -1
  105. data/sig/anthropic/models/output_tokens_details.rbs +13 -0
  106. data/sig/anthropic/models/usage.rbs +5 -0
  107. data/sig/anthropic/models/web_fetch_tool_result_error_code.rbs +2 -0
  108. data/sig/anthropic/models.rbs +4 -0
  109. metadata +14 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4142618ad3822029520091b516413cf32261636cfeff2ea03f1d33e6342cee42
4
- data.tar.gz: 86a9ff08d3ee65673f329261c436c7163b471aa0eebb33bb8d36a983bd959f82
3
+ metadata.gz: 8e459430d4274990ec5b16c71b6e8ceb9f8fb7ea7b598a0743b1395751f70a04
4
+ data.tar.gz: ca0766ef57242877ab67638e9c83c3511864e1fd99350fa100d3d095db0290d6
5
5
  SHA512:
6
- metadata.gz: eeba6340d54d9d463d49723772cbb43b142b2835356d7719c53c41b56f73cf63d1784d71ee07337b1b43522609492ef5810ed0e48712b5f4649079d939fdd19b
7
- data.tar.gz: 2a3bdb6b07367dbbf419d43b867920b7996544f7b7786eb4366913c5654c044ffb79d1e2a40dcd3a7cd69a37fbaea3bcb78aa2f74f701569b14633cc49470ae0
6
+ metadata.gz: 56c89b576946c7d3dc4544b96230be1602d4cbb58b72249065dd16f6bc2ec19077bbb7c87a6d5483a9f6642b6bae5b672aab9717efbeaebcf05878941c96f413
7
+ data.tar.gz: dab9b9b13abdb2b18049fe2549cad38d426e7616239c5d96245658ed3f05c6c14c15d13c2efac466424e77c744bd7fbece4ea9daf63ebdcdd00f5982591834e1
data/CHANGELOG.md CHANGED
@@ -1,5 +1,50 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.45.0 (2026-06-05)
4
+
5
+ Full Changelog: [v1.44.0...v1.45.0](https://github.com/anthropics/anthropic-sdk-ruby/compare/v1.44.0...v1.45.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** mark Claude Opus 4.1 as deprecated ([ccc292f](https://github.com/anthropics/anthropic-sdk-ruby/commit/ccc292f10ffb2c825f5b34c8372e7d6803ebc83d))
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * **streaming:** carry encrypted_content through beta compaction accumulator ([#938](https://github.com/anthropics/anthropic-sdk-ruby/issues/938)) ([6bd298f](https://github.com/anthropics/anthropic-sdk-ruby/commit/6bd298fa4421192fdc74ee99462d94ec01a514d3))
15
+ * **streaming:** carry stop_details and full usage through message_delta ([#940](https://github.com/anthropics/anthropic-sdk-ruby/issues/940)) ([ef4d2ea](https://github.com/anthropics/anthropic-sdk-ruby/commit/ef4d2ea31c0e566d7ad387419ba7d6144bf06861))
16
+
17
+
18
+ ### Chores
19
+
20
+ * **internal:** codegen related update ([296d6a4](https://github.com/anthropics/anthropic-sdk-ruby/commit/296d6a47ec96c36cf7a924bd74aa752d2d2ff125))
21
+ * **internal:** fix artifact url ([a97bd1e](https://github.com/anthropics/anthropic-sdk-ruby/commit/a97bd1e6fa5094057d2967d1b0573eec6602e026))
22
+ * **internal:** fix branch names ([16564d3](https://github.com/anthropics/anthropic-sdk-ruby/commit/16564d3806d4cb70000fe374c6ccf399e8903ba8))
23
+ * **internal:** update staging repo ([3f6005b](https://github.com/anthropics/anthropic-sdk-ruby/commit/3f6005b00242d66f711c31a4e51973576745aaee))
24
+
25
+
26
+ ### Documentation
27
+
28
+ * point security reports to Anthropic's HackerOne program ([#6](https://github.com/anthropics/anthropic-sdk-ruby/issues/6)) ([2d0f2af](https://github.com/anthropics/anthropic-sdk-ruby/commit/2d0f2af04956b58976aaf783b6ce24a4271c15ab))
29
+
30
+ ## 1.44.0 (2026-05-28)
31
+
32
+ Full Changelog: [v1.43.0...v1.44.0](https://github.com/anthropics/anthropic-sdk-ruby/compare/v1.43.0...v1.44.0)
33
+
34
+ ### Features
35
+
36
+ * **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))
37
+
38
+
39
+ ### Bug Fixes
40
+
41
+ * **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))
42
+
43
+
44
+ ### Documentation
45
+
46
+ * replace literal newlines ([e698364](https://github.com/anthropics/anthropic-sdk-ruby/commit/e698364084ebde9398a3c8e4c969e5922e778658))
47
+
3
48
  ## 1.43.0 (2026-05-21)
4
49
 
5
50
  Full Changelog: [v1.42.0...v1.43.0](https://github.com/anthropics/anthropic-sdk-ruby/compare/v1.42.0...v1.43.0)
data/README.md CHANGED
@@ -15,7 +15,7 @@ Add to your application's Gemfile:
15
15
  <!-- x-release-please-start-version -->
16
16
 
17
17
  ```ruby
18
- gem "anthropic", "~> 1.43.0"
18
+ gem "anthropic", "~> 1.45.0"
19
19
  ```
20
20
 
21
21
  <!-- x-release-please-end -->
data/SECURITY.md CHANGED
@@ -1,27 +1,15 @@
1
1
  # Security Policy
2
2
 
3
- ## Reporting Security Issues
4
-
5
- This SDK is generated by [Stainless Software Inc](http://stainless.com). Stainless takes security seriously, and encourages you to report any security vulnerability promptly so that appropriate action can be taken.
6
-
7
- To report a security issue, please contact the Stainless team at security@stainless.com.
8
-
9
- ## Responsible Disclosure
10
-
11
- We appreciate the efforts of security researchers and individuals who help us maintain the security of
12
- SDKs we generate. If you believe you have found a security vulnerability, please adhere to responsible
13
- disclosure practices by allowing us a reasonable amount of time to investigate and address the issue
14
- before making any information public.
3
+ Thank you for helping us keep the SDKs and systems they interact with secure.
15
4
 
16
- ## Reporting Non-SDK Related Security Issues
5
+ ## Reporting Security Issues
17
6
 
18
- If you encounter security issues that are not directly related to SDKs but pertain to the services
19
- or products provided by Anthropic, please follow the respective company's security reporting guidelines.
7
+ This SDK is maintained by [Anthropic](https://www.anthropic.com/).
20
8
 
21
- ### Anthropic Terms and Policies
9
+ The security of our systems and user data is Anthropic’s top priority. We appreciate the work of security researchers acting in good faith in identifying and reporting potential vulnerabilities.
22
10
 
23
- Please contact support@anthropic.com for any questions or concerns regarding the security of our services.
11
+ Our security program is managed on HackerOne and we ask that any validated vulnerability in this functionality be reported through their [submission form](https://hackerone.com/4f1f16ba-10d3-4d09-9ecc-c721aad90f24/embedded_submissions/new).
24
12
 
25
- ---
13
+ ## Anthropic Bug Bounty
26
14
 
27
- Thank you for helping us keep the SDKs and systems they interact with secure.
15
+ Our Bug Bounty Program Guidelines are defined on our [HackerOne program page](https://hackerone.com/anthropic).
@@ -45,7 +45,10 @@ module Anthropic
45
45
  @filename =
46
46
  case [filename, (@content = content)]
47
47
  in [String | Pathname, _]
48
- ::File.basename(filename)
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]
@@ -134,13 +134,31 @@ module Anthropic
134
134
  content.signature = delta.signature
135
135
  in Anthropic::Models::BetaCompactionContentBlockDelta if content.type == :compaction
136
136
  content.content = delta.content
137
+ content.encrypted_content = delta.encrypted_content
137
138
  else
138
139
  end
139
140
  in Anthropic::Models::RawMessageDeltaEvent | Anthropic::Models::BetaRawMessageDeltaEvent
140
141
  current_snapshot.stop_reason = event.delta.stop_reason
141
142
  current_snapshot.stop_sequence = event.delta.stop_sequence
143
+ current_snapshot.stop_details = event.delta.stop_details unless event.delta.stop_details.nil?
142
144
  current_snapshot.usage.output_tokens = event.usage.output_tokens
143
145
 
146
+ # The message_delta usage is authoritative for the final counts; carry every
147
+ # field the event reports (only when present, so we never clobber the
148
+ # message_start values with nils).
149
+ unless event.usage.input_tokens.nil?
150
+ current_snapshot.usage.input_tokens = event.usage.input_tokens
151
+ end
152
+ unless event.usage.cache_creation_input_tokens.nil?
153
+ current_snapshot.usage.cache_creation_input_tokens = event.usage.cache_creation_input_tokens
154
+ end
155
+ unless event.usage.cache_read_input_tokens.nil?
156
+ current_snapshot.usage.cache_read_input_tokens = event.usage.cache_read_input_tokens
157
+ end
158
+ unless event.usage.server_tool_use.nil?
159
+ current_snapshot.usage.server_tool_use = event.usage.server_tool_use
160
+ end
161
+
144
162
  if event.is_a?(Anthropic::Models::BetaRawMessageDeltaEvent) && !event.usage.iterations.nil?
145
163
  current_snapshot.usage.iterations = event.usage.iterations
146
164
  end
@@ -590,10 +590,14 @@ module Anthropic
590
590
 
591
591
  case val
592
592
  in Anthropic::FilePart unless val.filename.nil?
593
- filename = encode_path(val.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 = encode_path(::File.basename(val.to_path))
600
+ filename = ::File.basename(val.to_path).gsub(/["\\]/) { "\\#{_1}" }.delete("\r\n")
597
601
  y << "; filename=\"#{filename}\""
598
602
  else
599
603
  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.\n\nSee [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
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.\n\nSee [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
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.\n\nSee
33
- # [models](https://docs.anthropic.com/en/docs/models-overview) for additional
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.\n\nSee [models](https://docs.anthropic
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
- # @!method initialize(encrypted_content:, type: :advisor_redacted_result)
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
- # @!method initialize(text:, type: :advisor_result)
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.\n\nSee
9
- # [models](https://docs.anthropic.com/en/docs/models-overview) for additional
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.\n\nSee [models](https://docs.anthropic
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.\n\nSee
7
- # [models](https://docs.anthropic.com/en/docs/models-overview) for additional
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.\n\nSee
9
- # [models](https://docs.anthropic.com/en/docs/models-overview) for additional
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.\n\nSee [models](https://docs.anthropic.com
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.\n\nSee
9
- # [models](https://docs.anthropic.com/en/docs/models-overview) for additional
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.\n\nSee [models](https://docs.anthropic.com
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.\n\nSee
91
- # [models](https://docs.anthropic.com/en/docs/models-overview) for additional
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.\n\nSee [models](https://docs.anthropic
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