anthropic 1.11.0 → 1.13.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 (177) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +29 -0
  3. data/README.md +1 -1
  4. data/lib/anthropic/helpers/streaming/message_stream.rb +3 -0
  5. data/lib/anthropic/internal/page_cursor.rb +92 -0
  6. data/lib/anthropic/internal/token_page.rb +92 -0
  7. data/lib/anthropic/internal/transport/pooled_net_requester.rb +30 -24
  8. data/lib/anthropic/models/anthropic_beta.rb +3 -0
  9. data/lib/anthropic/models/beta/beta_all_thinking_turns.rb +19 -0
  10. data/lib/anthropic/models/beta/beta_clear_thinking_20251015_edit.rb +48 -0
  11. data/lib/anthropic/models/beta/beta_clear_thinking_20251015_edit_response.rb +36 -0
  12. data/lib/anthropic/models/beta/beta_clear_tool_uses_20250919_edit_response.rb +0 -2
  13. data/lib/anthropic/models/beta/beta_container.rb +9 -1
  14. data/lib/anthropic/models/beta/beta_container_params.rb +34 -0
  15. data/lib/anthropic/models/beta/beta_context_management_config.rb +17 -5
  16. data/lib/anthropic/models/beta/beta_context_management_response.rb +16 -5
  17. data/lib/anthropic/models/beta/beta_mcp_tool_use_block_param.rb +3 -3
  18. data/lib/anthropic/models/beta/beta_message.rb +4 -2
  19. data/lib/anthropic/models/beta/beta_raw_message_delta_event.rb +2 -2
  20. data/lib/anthropic/models/beta/beta_server_tool_use_block_param.rb +3 -3
  21. data/lib/anthropic/models/beta/beta_skill.rb +51 -0
  22. data/lib/anthropic/models/beta/beta_skill_params.rb +51 -0
  23. data/lib/anthropic/models/beta/beta_thinking_config_enabled.rb +1 -1
  24. data/lib/anthropic/models/beta/beta_thinking_config_param.rb +1 -1
  25. data/lib/anthropic/models/beta/beta_thinking_turns.rb +25 -0
  26. data/lib/anthropic/models/beta/beta_tool.rb +5 -3
  27. data/lib/anthropic/models/beta/beta_tool_use_block_param.rb +3 -3
  28. data/lib/anthropic/models/beta/message_count_tokens_params.rb +15 -12
  29. data/lib/anthropic/models/beta/message_create_params.rb +34 -18
  30. data/lib/anthropic/models/beta/messages/batch_create_params.rb +39 -20
  31. data/lib/anthropic/models/beta/skill_create_params.rb +49 -0
  32. data/lib/anthropic/models/beta/skill_create_response.rb +84 -0
  33. data/lib/anthropic/models/beta/skill_delete_params.rb +24 -0
  34. data/lib/anthropic/models/beta/skill_delete_response.rb +34 -0
  35. data/lib/anthropic/models/beta/skill_list_params.rb +61 -0
  36. data/lib/anthropic/models/beta/skill_list_response.rb +84 -0
  37. data/lib/anthropic/models/beta/skill_retrieve_params.rb +24 -0
  38. data/lib/anthropic/models/beta/skill_retrieve_response.rb +84 -0
  39. data/lib/anthropic/models/beta/skills/version_create_params.rb +42 -0
  40. data/lib/anthropic/models/beta/skills/version_create_response.rb +92 -0
  41. data/lib/anthropic/models/beta/skills/version_delete_params.rb +39 -0
  42. data/lib/anthropic/models/beta/skills/version_delete_response.rb +36 -0
  43. data/lib/anthropic/models/beta/skills/version_list_params.rb +47 -0
  44. data/lib/anthropic/models/beta/skills/version_list_response.rb +92 -0
  45. data/lib/anthropic/models/beta/skills/version_retrieve_params.rb +39 -0
  46. data/lib/anthropic/models/beta/skills/version_retrieve_response.rb +92 -0
  47. data/lib/anthropic/models/completion_create_params.rb +3 -4
  48. data/lib/anthropic/models/message_count_tokens_params.rb +10 -10
  49. data/lib/anthropic/models/message_create_params.rb +13 -13
  50. data/lib/anthropic/models/messages/batch_create_params.rb +14 -15
  51. data/lib/anthropic/models/model.rb +6 -20
  52. data/lib/anthropic/models/server_tool_use_block_param.rb +3 -3
  53. data/lib/anthropic/models/stop_reason.rb +0 -1
  54. data/lib/anthropic/models/thinking_config_enabled.rb +1 -1
  55. data/lib/anthropic/models/thinking_config_param.rb +1 -1
  56. data/lib/anthropic/models/tool.rb +5 -3
  57. data/lib/anthropic/models/tool_use_block_param.rb +3 -3
  58. data/lib/anthropic/resources/beta/messages.rb +5 -5
  59. data/lib/anthropic/resources/beta/skills/versions.rb +154 -0
  60. data/lib/anthropic/resources/beta/skills.rb +144 -0
  61. data/lib/anthropic/resources/beta.rb +4 -0
  62. data/lib/anthropic/resources/completions.rb +4 -4
  63. data/lib/anthropic/version.rb +1 -1
  64. data/lib/anthropic.rb +27 -0
  65. data/rbi/anthropic/internal/page_cursor.rbi +25 -0
  66. data/rbi/anthropic/internal/token_page.rbi +25 -0
  67. data/rbi/anthropic/models/anthropic_beta.rbi +2 -0
  68. data/rbi/anthropic/models/beta/beta_all_thinking_turns.rbi +30 -0
  69. data/rbi/anthropic/models/beta/beta_clear_thinking_20251015_edit.rbi +109 -0
  70. data/rbi/anthropic/models/beta/beta_clear_thinking_20251015_edit_response.rbi +61 -0
  71. data/rbi/anthropic/models/beta/beta_clear_tool_uses_20250919_edit_response.rbi +0 -1
  72. data/rbi/anthropic/models/beta/beta_container.rbi +23 -3
  73. data/rbi/anthropic/models/beta/beta_container_params.rbi +54 -0
  74. data/rbi/anthropic/models/beta/beta_context_management_config.rbi +51 -5
  75. data/rbi/anthropic/models/beta/beta_context_management_response.rbi +32 -4
  76. data/rbi/anthropic/models/beta/beta_mcp_tool_use_block.rbi +3 -3
  77. data/rbi/anthropic/models/beta/beta_mcp_tool_use_block_param.rbi +3 -3
  78. data/rbi/anthropic/models/beta/beta_message.rbi +6 -2
  79. data/rbi/anthropic/models/beta/beta_raw_message_delta_event.rbi +2 -2
  80. data/rbi/anthropic/models/beta/beta_server_tool_use_block.rbi +3 -3
  81. data/rbi/anthropic/models/beta/beta_server_tool_use_block_param.rbi +3 -3
  82. data/rbi/anthropic/models/beta/beta_skill.rbi +80 -0
  83. data/rbi/anthropic/models/beta/beta_skill_params.rbi +91 -0
  84. data/rbi/anthropic/models/beta/beta_thinking_config_enabled.rbi +2 -2
  85. data/rbi/anthropic/models/beta/beta_thinking_config_param.rbi +1 -1
  86. data/rbi/anthropic/models/beta/beta_thinking_turns.rbi +33 -0
  87. data/rbi/anthropic/models/beta/beta_tool.rbi +3 -3
  88. data/rbi/anthropic/models/beta/beta_tool_use_block.rbi +8 -3
  89. data/rbi/anthropic/models/beta/beta_tool_use_block_param.rbi +3 -3
  90. data/rbi/anthropic/models/beta/message_count_tokens_params.rbi +27 -21
  91. data/rbi/anthropic/models/beta/message_create_params.rbi +61 -29
  92. data/rbi/anthropic/models/beta/messages/batch_create_params.rbi +70 -33
  93. data/rbi/anthropic/models/beta/skill_create_params.rbi +90 -0
  94. data/rbi/anthropic/models/beta/skill_create_response.rbi +118 -0
  95. data/rbi/anthropic/models/beta/skill_delete_params.rbi +62 -0
  96. data/rbi/anthropic/models/beta/skill_delete_response.rbi +46 -0
  97. data/rbi/anthropic/models/beta/skill_list_params.rbi +109 -0
  98. data/rbi/anthropic/models/beta/skill_list_response.rbi +118 -0
  99. data/rbi/anthropic/models/beta/skill_retrieve_params.rbi +62 -0
  100. data/rbi/anthropic/models/beta/skill_retrieve_response.rbi +118 -0
  101. data/rbi/anthropic/models/beta/skills/version_create_params.rbi +79 -0
  102. data/rbi/anthropic/models/beta/skills/version_create_response.rbi +124 -0
  103. data/rbi/anthropic/models/beta/skills/version_delete_params.rbi +77 -0
  104. data/rbi/anthropic/models/beta/skills/version_delete_response.rbi +48 -0
  105. data/rbi/anthropic/models/beta/skills/version_list_params.rbi +85 -0
  106. data/rbi/anthropic/models/beta/skills/version_list_response.rbi +124 -0
  107. data/rbi/anthropic/models/beta/skills/version_retrieve_params.rbi +77 -0
  108. data/rbi/anthropic/models/beta/skills/version_retrieve_response.rbi +124 -0
  109. data/rbi/anthropic/models/completion_create_params.rbi +6 -8
  110. data/rbi/anthropic/models/message_count_tokens_params.rbi +19 -19
  111. data/rbi/anthropic/models/message_create_params.rbi +24 -24
  112. data/rbi/anthropic/models/messages/batch_create_params.rbi +26 -28
  113. data/rbi/anthropic/models/model.rbi +0 -11
  114. data/rbi/anthropic/models/server_tool_use_block.rbi +8 -3
  115. data/rbi/anthropic/models/server_tool_use_block_param.rbi +3 -3
  116. data/rbi/anthropic/models/stop_reason.rbi +0 -5
  117. data/rbi/anthropic/models/thinking_config_enabled.rbi +2 -2
  118. data/rbi/anthropic/models/thinking_config_param.rbi +1 -1
  119. data/rbi/anthropic/models/tool.rbi +3 -3
  120. data/rbi/anthropic/models/tool_use_block.rbi +8 -3
  121. data/rbi/anthropic/models/tool_use_block_param.rbi +3 -3
  122. data/rbi/anthropic/resources/beta/messages.rbi +51 -36
  123. data/rbi/anthropic/resources/beta/skills/versions.rbi +124 -0
  124. data/rbi/anthropic/resources/beta/skills.rbi +118 -0
  125. data/rbi/anthropic/resources/beta.rbi +3 -0
  126. data/rbi/anthropic/resources/completions.rbi +10 -12
  127. data/rbi/anthropic/resources/messages.rbi +31 -31
  128. data/sig/anthropic/internal/page_cursor.rbs +15 -0
  129. data/sig/anthropic/internal/token_page.rbs +15 -0
  130. data/sig/anthropic/models/anthropic_beta.rbs +2 -0
  131. data/sig/anthropic/models/beta/beta_all_thinking_turns.rbs +17 -0
  132. data/sig/anthropic/models/beta/beta_clear_thinking_20251015_edit.rbs +44 -0
  133. data/sig/anthropic/models/beta/beta_clear_thinking_20251015_edit_response.rbs +34 -0
  134. data/sig/anthropic/models/beta/beta_container.rbs +18 -3
  135. data/sig/anthropic/models/beta/beta_container_params.rbs +26 -0
  136. data/sig/anthropic/models/beta/beta_context_management_config.rbs +18 -6
  137. data/sig/anthropic/models/beta/beta_context_management_response.rbs +14 -4
  138. data/sig/anthropic/models/beta/beta_mcp_tool_use_block.rbs +4 -4
  139. data/sig/anthropic/models/beta/beta_mcp_tool_use_block_param.rbs +4 -4
  140. data/sig/anthropic/models/beta/beta_server_tool_use_block.rbs +4 -4
  141. data/sig/anthropic/models/beta/beta_server_tool_use_block_param.rbs +4 -4
  142. data/sig/anthropic/models/beta/beta_skill.rbs +45 -0
  143. data/sig/anthropic/models/beta/beta_skill_params.rbs +47 -0
  144. data/sig/anthropic/models/beta/beta_thinking_turns.rbs +19 -0
  145. data/sig/anthropic/models/beta/beta_tool.rbs +8 -4
  146. data/sig/anthropic/models/beta/beta_tool_use_block.rbs +9 -4
  147. data/sig/anthropic/models/beta/beta_tool_use_block_param.rbs +4 -4
  148. data/sig/anthropic/models/beta/message_create_params.rbs +12 -4
  149. data/sig/anthropic/models/beta/messages/batch_create_params.rbs +12 -4
  150. data/sig/anthropic/models/beta/skill_create_params.rbs +42 -0
  151. data/sig/anthropic/models/beta/skill_create_response.rbs +52 -0
  152. data/sig/anthropic/models/beta/skill_delete_params.rbs +30 -0
  153. data/sig/anthropic/models/beta/skill_delete_response.rbs +17 -0
  154. data/sig/anthropic/models/beta/skill_list_params.rbs +49 -0
  155. data/sig/anthropic/models/beta/skill_list_response.rbs +52 -0
  156. data/sig/anthropic/models/beta/skill_retrieve_params.rbs +30 -0
  157. data/sig/anthropic/models/beta/skill_retrieve_response.rbs +52 -0
  158. data/sig/anthropic/models/beta/skills/version_create_params.rbs +39 -0
  159. data/sig/anthropic/models/beta/skills/version_create_response.rbs +59 -0
  160. data/sig/anthropic/models/beta/skills/version_delete_params.rbs +39 -0
  161. data/sig/anthropic/models/beta/skills/version_delete_response.rbs +19 -0
  162. data/sig/anthropic/models/beta/skills/version_list_params.rbs +44 -0
  163. data/sig/anthropic/models/beta/skills/version_list_response.rbs +59 -0
  164. data/sig/anthropic/models/beta/skills/version_retrieve_params.rbs +39 -0
  165. data/sig/anthropic/models/beta/skills/version_retrieve_response.rbs +59 -0
  166. data/sig/anthropic/models/model.rbs +0 -11
  167. data/sig/anthropic/models/server_tool_use_block.rbs +9 -4
  168. data/sig/anthropic/models/server_tool_use_block_param.rbs +4 -4
  169. data/sig/anthropic/models/stop_reason.rbs +0 -2
  170. data/sig/anthropic/models/tool.rbs +8 -4
  171. data/sig/anthropic/models/tool_use_block.rbs +9 -4
  172. data/sig/anthropic/models/tool_use_block_param.rbs +4 -4
  173. data/sig/anthropic/resources/beta/messages.rbs +2 -2
  174. data/sig/anthropic/resources/beta/skills/versions.rbs +40 -0
  175. data/sig/anthropic/resources/beta/skills.rbs +38 -0
  176. data/sig/anthropic/resources/beta.rbs +2 -0
  177. metadata +83 -2
@@ -17,7 +17,7 @@ module Anthropic
17
17
  # only specifies the absolute maximum number of tokens to generate.
18
18
  #
19
19
  # Different models have different maximum values for this parameter. See
20
- # [models](https://docs.anthropic.com/en/docs/models-overview) for details.
20
+ # [models](https://docs.claude.com/en/docs/models-overview) for details.
21
21
  sig { returns(Integer) }
22
22
  attr_accessor :max_tokens
23
23
 
@@ -78,12 +78,12 @@ module Anthropic
78
78
  # { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
79
79
  # ```
80
80
  #
81
- # See [input examples](https://docs.anthropic.com/en/api/messages-examples).
81
+ # See [input examples](https://docs.claude.com/en/api/messages-examples).
82
82
  #
83
83
  # Note that if you want to include a
84
- # [system prompt](https://docs.anthropic.com/en/docs/system-prompts), you can use
85
- # the top-level `system` parameter — there is no `"system"` role for input
86
- # messages in the Messages API.
84
+ # [system prompt](https://docs.claude.com/en/docs/system-prompts), you can use the
85
+ # top-level `system` parameter — there is no `"system"` role for input messages in
86
+ # the Messages API.
87
87
  #
88
88
  # There is a limit of 100,000 messages in a single request.
89
89
  sig { returns(T::Array[Anthropic::MessageParam]) }
@@ -106,7 +106,7 @@ module Anthropic
106
106
  # for this request.
107
107
  #
108
108
  # Anthropic offers different levels of service for your API requests. See
109
- # [service-tiers](https://docs.anthropic.com/en/api/service-tiers) for details.
109
+ # [service-tiers](https://docs.claude.com/en/api/service-tiers) for details.
110
110
  sig do
111
111
  returns(
112
112
  T.nilable(Anthropic::MessageCreateParams::ServiceTier::OrSymbol)
@@ -140,7 +140,7 @@ module Anthropic
140
140
  #
141
141
  # A system prompt is a way of providing context and instructions to Claude, such
142
142
  # as specifying a particular goal or role. See our
143
- # [guide to system prompts](https://docs.anthropic.com/en/docs/system-prompts).
143
+ # [guide to system prompts](https://docs.claude.com/en/docs/system-prompts).
144
144
  sig do
145
145
  returns(T.nilable(Anthropic::MessageCreateParams::System::Variants))
146
146
  end
@@ -172,7 +172,7 @@ module Anthropic
172
172
  # tokens and counts towards your `max_tokens` limit.
173
173
  #
174
174
  # See
175
- # [extended thinking](https://docs.anthropic.com/en/docs/build-with-claude/extended-thinking)
175
+ # [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking)
176
176
  # for details.
177
177
  sig do
178
178
  returns(
@@ -235,9 +235,9 @@ module Anthropic
235
235
  #
236
236
  # There are two types of tools: **client tools** and **server tools**. The
237
237
  # behavior described below applies to client tools. For
238
- # [server tools](https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/overview#server-tools),
238
+ # [server tools](https://docs.claude.com/en/docs/agents-and-tools/tool-use/overview#server-tools),
239
239
  # see their individual documentation as each has its own behavior (e.g., the
240
- # [web search tool](https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/web-search-tool)).
240
+ # [web search tool](https://docs.claude.com/en/docs/agents-and-tools/tool-use/web-search-tool)).
241
241
  #
242
242
  # Each tool definition includes:
243
243
  #
@@ -300,7 +300,7 @@ module Anthropic
300
300
  # functions, or more generally whenever you want the model to produce a particular
301
301
  # JSON structure of output.
302
302
  #
303
- # See our [guide](https://docs.anthropic.com/en/docs/tool-use) for more details.
303
+ # See our [guide](https://docs.claude.com/en/docs/tool-use) for more details.
304
304
  sig do
305
305
  returns(
306
306
  T.nilable(
@@ -409,7 +409,7 @@ module Anthropic
409
409
  # only specifies the absolute maximum number of tokens to generate.
410
410
  #
411
411
  # Different models have different maximum values for this parameter. See
412
- # [models](https://docs.anthropic.com/en/docs/models-overview) for details.
412
+ # [models](https://docs.claude.com/en/docs/models-overview) for details.
413
413
  max_tokens:,
414
414
  # Input messages.
415
415
  #
@@ -468,12 +468,12 @@ module Anthropic
468
468
  # { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
469
469
  # ```
470
470
  #
471
- # See [input examples](https://docs.anthropic.com/en/api/messages-examples).
471
+ # See [input examples](https://docs.claude.com/en/api/messages-examples).
472
472
  #
473
473
  # Note that if you want to include a
474
- # [system prompt](https://docs.anthropic.com/en/docs/system-prompts), you can use
475
- # the top-level `system` parameter — there is no `"system"` role for input
476
- # messages in the Messages API.
474
+ # [system prompt](https://docs.claude.com/en/docs/system-prompts), you can use the
475
+ # top-level `system` parameter — there is no `"system"` role for input messages in
476
+ # the Messages API.
477
477
  #
478
478
  # There is a limit of 100,000 messages in a single request.
479
479
  messages:,
@@ -487,7 +487,7 @@ module Anthropic
487
487
  # for this request.
488
488
  #
489
489
  # Anthropic offers different levels of service for your API requests. See
490
- # [service-tiers](https://docs.anthropic.com/en/api/service-tiers) for details.
490
+ # [service-tiers](https://docs.claude.com/en/api/service-tiers) for details.
491
491
  service_tier: nil,
492
492
  # Custom text sequences that will cause the model to stop generating.
493
493
  #
@@ -503,7 +503,7 @@ module Anthropic
503
503
  #
504
504
  # A system prompt is a way of providing context and instructions to Claude, such
505
505
  # as specifying a particular goal or role. See our
506
- # [guide to system prompts](https://docs.anthropic.com/en/docs/system-prompts).
506
+ # [guide to system prompts](https://docs.claude.com/en/docs/system-prompts).
507
507
  system_: nil,
508
508
  # Amount of randomness injected into the response.
509
509
  #
@@ -521,7 +521,7 @@ module Anthropic
521
521
  # tokens and counts towards your `max_tokens` limit.
522
522
  #
523
523
  # See
524
- # [extended thinking](https://docs.anthropic.com/en/docs/build-with-claude/extended-thinking)
524
+ # [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking)
525
525
  # for details.
526
526
  thinking: nil,
527
527
  # How the model should use the provided tools. The model can use a specific tool,
@@ -536,9 +536,9 @@ module Anthropic
536
536
  #
537
537
  # There are two types of tools: **client tools** and **server tools**. The
538
538
  # behavior described below applies to client tools. For
539
- # [server tools](https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/overview#server-tools),
539
+ # [server tools](https://docs.claude.com/en/docs/agents-and-tools/tool-use/overview#server-tools),
540
540
  # see their individual documentation as each has its own behavior (e.g., the
541
- # [web search tool](https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/web-search-tool)).
541
+ # [web search tool](https://docs.claude.com/en/docs/agents-and-tools/tool-use/web-search-tool)).
542
542
  #
543
543
  # Each tool definition includes:
544
544
  #
@@ -601,7 +601,7 @@ module Anthropic
601
601
  # functions, or more generally whenever you want the model to produce a particular
602
602
  # JSON structure of output.
603
603
  #
604
- # See our [guide](https://docs.anthropic.com/en/docs/tool-use) for more details.
604
+ # See our [guide](https://docs.claude.com/en/docs/tool-use) for more details.
605
605
  tools: nil,
606
606
  # Only sample from the top K options for each subsequent token.
607
607
  #
@@ -672,7 +672,7 @@ module Anthropic
672
672
  # for this request.
673
673
  #
674
674
  # Anthropic offers different levels of service for your API requests. See
675
- # [service-tiers](https://docs.anthropic.com/en/api/service-tiers) for details.
675
+ # [service-tiers](https://docs.claude.com/en/api/service-tiers) for details.
676
676
  module ServiceTier
677
677
  extend Anthropic::Internal::Type::Enum
678
678
 
@@ -706,7 +706,7 @@ module Anthropic
706
706
  #
707
707
  # A system prompt is a way of providing context and instructions to Claude, such
708
708
  # as specifying a particular goal or role. See our
709
- # [guide to system prompts](https://docs.anthropic.com/en/docs/system-prompts).
709
+ # [guide to system prompts](https://docs.claude.com/en/docs/system-prompts).
710
710
  module System
711
711
  extend Anthropic::Internal::Type::Union
712
712
 
@@ -129,7 +129,7 @@ module Anthropic
129
129
  # only specifies the absolute maximum number of tokens to generate.
130
130
  #
131
131
  # Different models have different maximum values for this parameter. See
132
- # [models](https://docs.anthropic.com/en/docs/models-overview) for details.
132
+ # [models](https://docs.claude.com/en/docs/models-overview) for details.
133
133
  sig { returns(Integer) }
134
134
  attr_accessor :max_tokens
135
135
 
@@ -190,12 +190,12 @@ module Anthropic
190
190
  # { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
191
191
  # ```
192
192
  #
193
- # See [input examples](https://docs.anthropic.com/en/api/messages-examples).
193
+ # See [input examples](https://docs.claude.com/en/api/messages-examples).
194
194
  #
195
195
  # Note that if you want to include a
196
- # [system prompt](https://docs.anthropic.com/en/docs/system-prompts), you can use
197
- # the top-level `system` parameter — there is no `"system"` role for input
198
- # messages in the Messages API.
196
+ # [system prompt](https://docs.claude.com/en/docs/system-prompts), you can use the
197
+ # top-level `system` parameter — there is no `"system"` role for input messages in
198
+ # the Messages API.
199
199
  #
200
200
  # There is a limit of 100,000 messages in a single request.
201
201
  sig { returns(T::Array[Anthropic::MessageParam]) }
@@ -218,7 +218,7 @@ module Anthropic
218
218
  # for this request.
219
219
  #
220
220
  # Anthropic offers different levels of service for your API requests. See
221
- # [service-tiers](https://docs.anthropic.com/en/api/service-tiers) for details.
221
+ # [service-tiers](https://docs.claude.com/en/api/service-tiers) for details.
222
222
  sig do
223
223
  returns(
224
224
  T.nilable(
@@ -253,8 +253,7 @@ module Anthropic
253
253
 
254
254
  # Whether to incrementally stream the response using server-sent events.
255
255
  #
256
- # See [streaming](https://docs.anthropic.com/en/api/messages-streaming) for
257
- # details.
256
+ # See [streaming](https://docs.claude.com/en/api/messages-streaming) for details.
258
257
  sig { returns(T.nilable(T::Boolean)) }
259
258
  attr_reader :stream
260
259
 
@@ -265,7 +264,7 @@ module Anthropic
265
264
  #
266
265
  # A system prompt is a way of providing context and instructions to Claude, such
267
266
  # as specifying a particular goal or role. See our
268
- # [guide to system prompts](https://docs.anthropic.com/en/docs/system-prompts).
267
+ # [guide to system prompts](https://docs.claude.com/en/docs/system-prompts).
269
268
  sig do
270
269
  returns(
271
270
  T.nilable(
@@ -304,7 +303,7 @@ module Anthropic
304
303
  # tokens and counts towards your `max_tokens` limit.
305
304
  #
306
305
  # See
307
- # [extended thinking](https://docs.anthropic.com/en/docs/build-with-claude/extended-thinking)
306
+ # [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking)
308
307
  # for details.
309
308
  sig do
310
309
  returns(
@@ -367,9 +366,9 @@ module Anthropic
367
366
  #
368
367
  # There are two types of tools: **client tools** and **server tools**. The
369
368
  # behavior described below applies to client tools. For
370
- # [server tools](https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/overview#server-tools),
369
+ # [server tools](https://docs.claude.com/en/docs/agents-and-tools/tool-use/overview#server-tools),
371
370
  # see their individual documentation as each has its own behavior (e.g., the
372
- # [web search tool](https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/web-search-tool)).
371
+ # [web search tool](https://docs.claude.com/en/docs/agents-and-tools/tool-use/web-search-tool)).
373
372
  #
374
373
  # Each tool definition includes:
375
374
  #
@@ -432,7 +431,7 @@ module Anthropic
432
431
  # functions, or more generally whenever you want the model to produce a particular
433
432
  # JSON structure of output.
434
433
  #
435
- # See our [guide](https://docs.anthropic.com/en/docs/tool-use) for more details.
434
+ # See our [guide](https://docs.claude.com/en/docs/tool-use) for more details.
436
435
  sig do
437
436
  returns(
438
437
  T.nilable(
@@ -547,7 +546,7 @@ module Anthropic
547
546
  # only specifies the absolute maximum number of tokens to generate.
548
547
  #
549
548
  # Different models have different maximum values for this parameter. See
550
- # [models](https://docs.anthropic.com/en/docs/models-overview) for details.
549
+ # [models](https://docs.claude.com/en/docs/models-overview) for details.
551
550
  max_tokens:,
552
551
  # Input messages.
553
552
  #
@@ -606,12 +605,12 @@ module Anthropic
606
605
  # { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
607
606
  # ```
608
607
  #
609
- # See [input examples](https://docs.anthropic.com/en/api/messages-examples).
608
+ # See [input examples](https://docs.claude.com/en/api/messages-examples).
610
609
  #
611
610
  # Note that if you want to include a
612
- # [system prompt](https://docs.anthropic.com/en/docs/system-prompts), you can use
613
- # the top-level `system` parameter — there is no `"system"` role for input
614
- # messages in the Messages API.
611
+ # [system prompt](https://docs.claude.com/en/docs/system-prompts), you can use the
612
+ # top-level `system` parameter — there is no `"system"` role for input messages in
613
+ # the Messages API.
615
614
  #
616
615
  # There is a limit of 100,000 messages in a single request.
617
616
  messages:,
@@ -625,7 +624,7 @@ module Anthropic
625
624
  # for this request.
626
625
  #
627
626
  # Anthropic offers different levels of service for your API requests. See
628
- # [service-tiers](https://docs.anthropic.com/en/api/service-tiers) for details.
627
+ # [service-tiers](https://docs.claude.com/en/api/service-tiers) for details.
629
628
  service_tier: nil,
630
629
  # Custom text sequences that will cause the model to stop generating.
631
630
  #
@@ -639,14 +638,13 @@ module Anthropic
639
638
  stop_sequences: nil,
640
639
  # Whether to incrementally stream the response using server-sent events.
641
640
  #
642
- # See [streaming](https://docs.anthropic.com/en/api/messages-streaming) for
643
- # details.
641
+ # See [streaming](https://docs.claude.com/en/api/messages-streaming) for details.
644
642
  stream: nil,
645
643
  # System prompt.
646
644
  #
647
645
  # A system prompt is a way of providing context and instructions to Claude, such
648
646
  # as specifying a particular goal or role. See our
649
- # [guide to system prompts](https://docs.anthropic.com/en/docs/system-prompts).
647
+ # [guide to system prompts](https://docs.claude.com/en/docs/system-prompts).
650
648
  system_: nil,
651
649
  # Amount of randomness injected into the response.
652
650
  #
@@ -664,7 +662,7 @@ module Anthropic
664
662
  # tokens and counts towards your `max_tokens` limit.
665
663
  #
666
664
  # See
667
- # [extended thinking](https://docs.anthropic.com/en/docs/build-with-claude/extended-thinking)
665
+ # [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking)
668
666
  # for details.
669
667
  thinking: nil,
670
668
  # How the model should use the provided tools. The model can use a specific tool,
@@ -679,9 +677,9 @@ module Anthropic
679
677
  #
680
678
  # There are two types of tools: **client tools** and **server tools**. The
681
679
  # behavior described below applies to client tools. For
682
- # [server tools](https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/overview#server-tools),
680
+ # [server tools](https://docs.claude.com/en/docs/agents-and-tools/tool-use/overview#server-tools),
683
681
  # see their individual documentation as each has its own behavior (e.g., the
684
- # [web search tool](https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/web-search-tool)).
682
+ # [web search tool](https://docs.claude.com/en/docs/agents-and-tools/tool-use/web-search-tool)).
685
683
  #
686
684
  # Each tool definition includes:
687
685
  #
@@ -744,7 +742,7 @@ module Anthropic
744
742
  # functions, or more generally whenever you want the model to produce a particular
745
743
  # JSON structure of output.
746
744
  #
747
- # See our [guide](https://docs.anthropic.com/en/docs/tool-use) for more details.
745
+ # See our [guide](https://docs.claude.com/en/docs/tool-use) for more details.
748
746
  tools: nil,
749
747
  # Only sample from the top K options for each subsequent token.
750
748
  #
@@ -816,7 +814,7 @@ module Anthropic
816
814
  # for this request.
817
815
  #
818
816
  # Anthropic offers different levels of service for your API requests. See
819
- # [service-tiers](https://docs.anthropic.com/en/api/service-tiers) for details.
817
+ # [service-tiers](https://docs.claude.com/en/api/service-tiers) for details.
820
818
  module ServiceTier
821
819
  extend Anthropic::Internal::Type::Enum
822
820
 
@@ -855,7 +853,7 @@ module Anthropic
855
853
  #
856
854
  # A system prompt is a way of providing context and instructions to Claude, such
857
855
  # as specifying a particular goal or role. See our
858
- # [guide to system prompts](https://docs.anthropic.com/en/docs/system-prompts).
856
+ # [guide to system prompts](https://docs.claude.com/en/docs/system-prompts).
859
857
  module System
860
858
  extend Anthropic::Internal::Type::Union
861
859
 
@@ -61,17 +61,6 @@ module Anthropic
61
61
  CLAUDE_SONNET_4_5_20250929 =
62
62
  T.let(:"claude-sonnet-4-5-20250929", Anthropic::Model::TaggedSymbol)
63
63
 
64
- # Our previous most intelligent model
65
- CLAUDE_3_5_SONNET_LATEST =
66
- T.let(:"claude-3-5-sonnet-latest", Anthropic::Model::TaggedSymbol)
67
-
68
- # Our previous most intelligent model
69
- CLAUDE_3_5_SONNET_20241022 =
70
- T.let(:"claude-3-5-sonnet-20241022", Anthropic::Model::TaggedSymbol)
71
-
72
- CLAUDE_3_5_SONNET_20240620 =
73
- T.let(:"claude-3-5-sonnet-20240620", Anthropic::Model::TaggedSymbol)
74
-
75
64
  # Our most capable model
76
65
  CLAUDE_OPUS_4_0 =
77
66
  T.let(:"claude-opus-4-0", Anthropic::Model::TaggedSymbol)
@@ -11,7 +11,7 @@ module Anthropic
11
11
  sig { returns(String) }
12
12
  attr_accessor :id
13
13
 
14
- sig { returns(T.anything) }
14
+ sig { returns(T::Hash[Symbol, T.anything]) }
15
15
  attr_accessor :input
16
16
 
17
17
  sig { returns(Symbol) }
@@ -23,7 +23,7 @@ module Anthropic
23
23
  sig do
24
24
  params(
25
25
  id: String,
26
- input: T.anything,
26
+ input: T::Hash[Symbol, T.anything],
27
27
  name: Symbol,
28
28
  type: Symbol
29
29
  ).returns(T.attached_class)
@@ -33,7 +33,12 @@ module Anthropic
33
33
 
34
34
  sig do
35
35
  override.returns(
36
- { id: String, input: T.anything, name: Symbol, type: Symbol }
36
+ {
37
+ id: String,
38
+ input: T::Hash[Symbol, T.anything],
39
+ name: Symbol,
40
+ type: Symbol
41
+ }
37
42
  )
38
43
  end
39
44
  def to_hash
@@ -14,7 +14,7 @@ module Anthropic
14
14
  sig { returns(String) }
15
15
  attr_accessor :id
16
16
 
17
- sig { returns(T.anything) }
17
+ sig { returns(T::Hash[Symbol, T.anything]) }
18
18
  attr_accessor :input
19
19
 
20
20
  sig { returns(Symbol) }
@@ -37,7 +37,7 @@ module Anthropic
37
37
  sig do
38
38
  params(
39
39
  id: String,
40
- input: T.anything,
40
+ input: T::Hash[Symbol, T.anything],
41
41
  cache_control: T.nilable(Anthropic::CacheControlEphemeral::OrHash),
42
42
  name: Symbol,
43
43
  type: Symbol
@@ -57,7 +57,7 @@ module Anthropic
57
57
  override.returns(
58
58
  {
59
59
  id: String,
60
- input: T.anything,
60
+ input: T::Hash[Symbol, T.anything],
61
61
  name: Symbol,
62
62
  type: Symbol,
63
63
  cache_control: T.nilable(Anthropic::CacheControlEphemeral)
@@ -14,11 +14,6 @@ module Anthropic
14
14
  TOOL_USE = T.let(:tool_use, Anthropic::StopReason::TaggedSymbol)
15
15
  PAUSE_TURN = T.let(:pause_turn, Anthropic::StopReason::TaggedSymbol)
16
16
  REFUSAL = T.let(:refusal, Anthropic::StopReason::TaggedSymbol)
17
- MODEL_CONTEXT_WINDOW_EXCEEDED =
18
- T.let(
19
- :model_context_window_exceeded,
20
- Anthropic::StopReason::TaggedSymbol
21
- )
22
17
 
23
18
  sig { override.returns(T::Array[Anthropic::StopReason::TaggedSymbol]) }
24
19
  def self.values
@@ -15,7 +15,7 @@ module Anthropic
15
15
  # Must be ≥1024 and less than `max_tokens`.
16
16
  #
17
17
  # See
18
- # [extended thinking](https://docs.anthropic.com/en/docs/build-with-claude/extended-thinking)
18
+ # [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking)
19
19
  # for details.
20
20
  sig { returns(Integer) }
21
21
  attr_accessor :budget_tokens
@@ -34,7 +34,7 @@ module Anthropic
34
34
  # Must be ≥1024 and less than `max_tokens`.
35
35
  #
36
36
  # See
37
- # [extended thinking](https://docs.anthropic.com/en/docs/build-with-claude/extended-thinking)
37
+ # [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking)
38
38
  # for details.
39
39
  budget_tokens:,
40
40
  type: :enabled
@@ -9,7 +9,7 @@ module Anthropic
9
9
  # tokens and counts towards your `max_tokens` limit.
10
10
  #
11
11
  # See
12
- # [extended thinking](https://docs.anthropic.com/en/docs/build-with-claude/extended-thinking)
12
+ # [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking)
13
13
  # for details.
14
14
  module ThinkingConfigParam
15
15
  extend Anthropic::Internal::Type::Union
@@ -103,7 +103,7 @@ module Anthropic
103
103
  sig { returns(Symbol) }
104
104
  attr_accessor :type
105
105
 
106
- sig { returns(T.nilable(T.anything)) }
106
+ sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
107
107
  attr_accessor :properties
108
108
 
109
109
  sig { returns(T.nilable(T::Array[String])) }
@@ -115,7 +115,7 @@ module Anthropic
115
115
  # will produce.
116
116
  sig do
117
117
  params(
118
- properties: T.nilable(T.anything),
118
+ properties: T.nilable(T::Hash[Symbol, T.anything]),
119
119
  required: T.nilable(T::Array[String]),
120
120
  type: Symbol
121
121
  ).returns(T.attached_class)
@@ -127,7 +127,7 @@ module Anthropic
127
127
  override.returns(
128
128
  {
129
129
  type: Symbol,
130
- properties: T.nilable(T.anything),
130
+ properties: T.nilable(T::Hash[Symbol, T.anything]),
131
131
  required: T.nilable(T::Array[String])
132
132
  }
133
133
  )
@@ -11,7 +11,7 @@ module Anthropic
11
11
  sig { returns(String) }
12
12
  attr_accessor :id
13
13
 
14
- sig { returns(T.anything) }
14
+ sig { returns(T::Hash[Symbol, T.anything]) }
15
15
  attr_accessor :input
16
16
 
17
17
  sig { returns(String) }
@@ -23,7 +23,7 @@ module Anthropic
23
23
  sig do
24
24
  params(
25
25
  id: String,
26
- input: T.anything,
26
+ input: T::Hash[Symbol, T.anything],
27
27
  name: String,
28
28
  type: Symbol
29
29
  ).returns(T.attached_class)
@@ -33,7 +33,12 @@ module Anthropic
33
33
 
34
34
  sig do
35
35
  override.returns(
36
- { id: String, input: T.anything, name: String, type: Symbol }
36
+ {
37
+ id: String,
38
+ input: T::Hash[Symbol, T.anything],
39
+ name: String,
40
+ type: Symbol
41
+ }
37
42
  )
38
43
  end
39
44
  def to_hash
@@ -11,7 +11,7 @@ module Anthropic
11
11
  sig { returns(String) }
12
12
  attr_accessor :id
13
13
 
14
- sig { returns(T.anything) }
14
+ sig { returns(T::Hash[Symbol, T.anything]) }
15
15
  attr_accessor :input
16
16
 
17
17
  sig { returns(String) }
@@ -34,7 +34,7 @@ module Anthropic
34
34
  sig do
35
35
  params(
36
36
  id: String,
37
- input: T.anything,
37
+ input: T::Hash[Symbol, T.anything],
38
38
  name: String,
39
39
  cache_control: T.nilable(Anthropic::CacheControlEphemeral::OrHash),
40
40
  type: Symbol
@@ -54,7 +54,7 @@ module Anthropic
54
54
  override.returns(
55
55
  {
56
56
  id: String,
57
- input: T.anything,
57
+ input: T::Hash[Symbol, T.anything],
58
58
  name: String,
59
59
  type: Symbol,
60
60
  cache_control: T.nilable(Anthropic::CacheControlEphemeral)