anthropic 1.45.0 → 1.47.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 (146) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -0
  3. data/README.md +1 -1
  4. data/lib/anthropic/helpers/streaming/message_stream.rb +4 -0
  5. data/lib/anthropic/models/anthropic_beta.rb +6 -0
  6. data/lib/anthropic/models/beta/agent_create_params.rb +8 -8
  7. data/lib/anthropic/models/beta/agent_update_params.rb +7 -10
  8. data/lib/anthropic/models/beta/beta_advisor_tool_20260301.rb +15 -1
  9. data/lib/anthropic/models/beta/beta_advisor_tool_result_error.rb +1 -0
  10. data/lib/anthropic/models/beta/beta_advisor_tool_result_error_param.rb +1 -0
  11. data/lib/anthropic/models/beta/beta_content_block.rb +14 -1
  12. data/lib/anthropic/models/beta/beta_content_block_param.rb +18 -1
  13. data/lib/anthropic/models/beta/beta_fallback_block.rb +54 -0
  14. data/lib/anthropic/models/beta/beta_fallback_block_param.rb +51 -0
  15. data/lib/anthropic/models/beta/beta_fallback_info.rb +28 -0
  16. data/lib/anthropic/models/beta/beta_fallback_info_param.rb +28 -0
  17. data/lib/anthropic/models/beta/beta_fallback_message_iteration_usage.rb +81 -0
  18. data/lib/anthropic/models/beta/beta_fallback_param.rb +88 -0
  19. data/lib/anthropic/models/beta/beta_iterations_usage.rb +9 -1
  20. data/lib/anthropic/models/beta/beta_managed_agents_custom_tool_input_schema.rb +10 -27
  21. data/lib/anthropic/models/beta/beta_managed_agents_model.rb +5 -0
  22. data/lib/anthropic/models/beta/beta_message.rb +2 -2
  23. data/lib/anthropic/models/beta/beta_message_delta_usage.rb +2 -2
  24. data/lib/anthropic/models/beta/beta_message_iteration_usage.rb +15 -1
  25. data/lib/anthropic/models/beta/beta_message_param.rb +3 -3
  26. data/lib/anthropic/models/beta/beta_model_info.rb +11 -1
  27. data/lib/anthropic/models/beta/beta_raw_content_block_start_event.rb +16 -3
  28. data/lib/anthropic/models/beta/beta_refusal_stop_details.rb +64 -1
  29. data/lib/anthropic/models/beta/beta_tool_search_tool_result_error_param.rb +7 -1
  30. data/lib/anthropic/models/beta/beta_usage.rb +2 -2
  31. data/lib/anthropic/models/beta/beta_webhook_session_archived_event_data.rb +2 -2
  32. data/lib/anthropic/models/beta/beta_webhook_session_created_event_data.rb +2 -2
  33. data/lib/anthropic/models/beta/beta_webhook_session_deleted_event_data.rb +2 -2
  34. data/lib/anthropic/models/beta/beta_webhook_session_idled_event_data.rb +2 -2
  35. data/lib/anthropic/models/beta/beta_webhook_session_outcome_evaluation_ended_event_data.rb +2 -2
  36. data/lib/anthropic/models/beta/beta_webhook_session_pending_event_data.rb +2 -2
  37. data/lib/anthropic/models/beta/beta_webhook_session_requires_action_event_data.rb +2 -2
  38. data/lib/anthropic/models/beta/beta_webhook_session_running_event_data.rb +2 -2
  39. data/lib/anthropic/models/beta/beta_webhook_session_status_idled_event_data.rb +2 -2
  40. data/lib/anthropic/models/beta/beta_webhook_session_status_rescheduled_event_data.rb +2 -2
  41. data/lib/anthropic/models/beta/beta_webhook_session_status_run_started_event_data.rb +2 -2
  42. data/lib/anthropic/models/beta/beta_webhook_session_status_terminated_event_data.rb +2 -2
  43. data/lib/anthropic/models/beta/beta_webhook_session_thread_created_event_data.rb +2 -2
  44. data/lib/anthropic/models/beta/beta_webhook_session_thread_idled_event_data.rb +2 -2
  45. data/lib/anthropic/models/beta/beta_webhook_session_thread_terminated_event_data.rb +2 -2
  46. data/lib/anthropic/models/beta/beta_webhook_vault_archived_event_data.rb +2 -2
  47. data/lib/anthropic/models/beta/beta_webhook_vault_created_event_data.rb +2 -2
  48. data/lib/anthropic/models/beta/beta_webhook_vault_credential_archived_event_data.rb +2 -2
  49. data/lib/anthropic/models/beta/beta_webhook_vault_credential_created_event_data.rb +2 -2
  50. data/lib/anthropic/models/beta/beta_webhook_vault_credential_deleted_event_data.rb +2 -2
  51. data/lib/anthropic/models/beta/beta_webhook_vault_credential_refresh_failed_event_data.rb +2 -2
  52. data/lib/anthropic/models/beta/beta_webhook_vault_deleted_event_data.rb +2 -2
  53. data/lib/anthropic/models/beta/message_create_params.rb +39 -1
  54. data/lib/anthropic/models/beta/messages/batch_create_params.rb +39 -1
  55. data/lib/anthropic/models/beta/session_list_params.rb +2 -2
  56. data/lib/anthropic/models/model.rb +13 -0
  57. data/lib/anthropic/models/refusal_stop_details.rb +1 -0
  58. data/lib/anthropic/models/tool_search_tool_result_error_param.rb +7 -1
  59. data/lib/anthropic/resources/beta/agents.rb +7 -7
  60. data/lib/anthropic/resources/beta/messages.rb +10 -2
  61. data/lib/anthropic/resources/beta/sessions.rb +1 -1
  62. data/lib/anthropic/version.rb +1 -1
  63. data/lib/anthropic.rb +6 -0
  64. data/rbi/anthropic/models/anthropic_beta.rbi +10 -0
  65. data/rbi/anthropic/models/beta/agent_create_params.rbi +8 -8
  66. data/rbi/anthropic/models/beta/agent_update_params.rbi +6 -12
  67. data/rbi/anthropic/models/beta/beta_advisor_tool_20260301.rbi +20 -0
  68. data/rbi/anthropic/models/beta/beta_advisor_tool_result_error.rbi +5 -0
  69. data/rbi/anthropic/models/beta/beta_advisor_tool_result_error_param.rbi +5 -0
  70. data/rbi/anthropic/models/beta/beta_content_block.rbi +2 -1
  71. data/rbi/anthropic/models/beta/beta_content_block_param.rbi +2 -1
  72. data/rbi/anthropic/models/beta/beta_fallback_block.rbi +83 -0
  73. data/rbi/anthropic/models/beta/beta_fallback_block_param.rbi +81 -0
  74. data/rbi/anthropic/models/beta/beta_fallback_info.rbi +45 -0
  75. data/rbi/anthropic/models/beta/beta_fallback_info_param.rbi +47 -0
  76. data/rbi/anthropic/models/beta/beta_fallback_message_iteration_usage.rbi +113 -0
  77. data/rbi/anthropic/models/beta/beta_fallback_param.rbi +167 -0
  78. data/rbi/anthropic/models/beta/beta_iterations_usage.rbi +2 -1
  79. data/rbi/anthropic/models/beta/beta_managed_agents_custom_tool_input_schema.rbi +9 -68
  80. data/rbi/anthropic/models/beta/beta_managed_agents_model.rbi +7 -0
  81. data/rbi/anthropic/models/beta/beta_message.rbi +2 -1
  82. data/rbi/anthropic/models/beta/beta_message_delta_usage.rbi +2 -1
  83. data/rbi/anthropic/models/beta/beta_message_iteration_usage.rbi +14 -0
  84. data/rbi/anthropic/models/beta/beta_model_info.rbi +12 -0
  85. data/rbi/anthropic/models/beta/beta_raw_content_block_start_event.rbi +4 -2
  86. data/rbi/anthropic/models/beta/beta_refusal_stop_details.rbi +105 -0
  87. data/rbi/anthropic/models/beta/beta_tool_search_tool_result_error_param.rbi +11 -2
  88. data/rbi/anthropic/models/beta/beta_usage.rbi +2 -1
  89. data/rbi/anthropic/models/beta/beta_webhook_session_archived_event_data.rbi +2 -2
  90. data/rbi/anthropic/models/beta/beta_webhook_session_created_event_data.rbi +2 -2
  91. data/rbi/anthropic/models/beta/beta_webhook_session_deleted_event_data.rbi +2 -2
  92. data/rbi/anthropic/models/beta/beta_webhook_session_idled_event_data.rbi +2 -2
  93. data/rbi/anthropic/models/beta/beta_webhook_session_outcome_evaluation_ended_event_data.rbi +2 -2
  94. data/rbi/anthropic/models/beta/beta_webhook_session_pending_event_data.rbi +2 -2
  95. data/rbi/anthropic/models/beta/beta_webhook_session_requires_action_event_data.rbi +2 -2
  96. data/rbi/anthropic/models/beta/beta_webhook_session_running_event_data.rbi +2 -2
  97. data/rbi/anthropic/models/beta/beta_webhook_session_status_idled_event_data.rbi +2 -2
  98. data/rbi/anthropic/models/beta/beta_webhook_session_status_rescheduled_event_data.rbi +2 -2
  99. data/rbi/anthropic/models/beta/beta_webhook_session_status_run_started_event_data.rbi +2 -2
  100. data/rbi/anthropic/models/beta/beta_webhook_session_status_terminated_event_data.rbi +2 -2
  101. data/rbi/anthropic/models/beta/beta_webhook_session_thread_created_event_data.rbi +2 -2
  102. data/rbi/anthropic/models/beta/beta_webhook_session_thread_idled_event_data.rbi +2 -2
  103. data/rbi/anthropic/models/beta/beta_webhook_session_thread_terminated_event_data.rbi +2 -2
  104. data/rbi/anthropic/models/beta/beta_webhook_vault_archived_event_data.rbi +2 -2
  105. data/rbi/anthropic/models/beta/beta_webhook_vault_created_event_data.rbi +2 -2
  106. data/rbi/anthropic/models/beta/beta_webhook_vault_credential_archived_event_data.rbi +2 -2
  107. data/rbi/anthropic/models/beta/beta_webhook_vault_credential_created_event_data.rbi +2 -2
  108. data/rbi/anthropic/models/beta/beta_webhook_vault_credential_deleted_event_data.rbi +2 -2
  109. data/rbi/anthropic/models/beta/beta_webhook_vault_credential_refresh_failed_event_data.rbi +2 -2
  110. data/rbi/anthropic/models/beta/beta_webhook_vault_deleted_event_data.rbi +2 -2
  111. data/rbi/anthropic/models/beta/message_create_params.rbi +58 -0
  112. data/rbi/anthropic/models/beta/messages/batch_create_params.rbi +62 -0
  113. data/rbi/anthropic/models/beta/session_list_params.rbi +2 -2
  114. data/rbi/anthropic/models/model.rbi +7 -0
  115. data/rbi/anthropic/models/refusal_stop_details.rbi +5 -0
  116. data/rbi/anthropic/models/tool_search_tool_result_error_param.rbi +11 -2
  117. data/rbi/anthropic/resources/beta/agents.rbi +8 -10
  118. data/rbi/anthropic/resources/beta/messages.rbi +54 -0
  119. data/rbi/anthropic/resources/beta/sessions.rbi +1 -1
  120. data/sig/anthropic/models/anthropic_beta.rbs +4 -0
  121. data/sig/anthropic/models/beta/beta_advisor_tool_20260301.rbs +5 -0
  122. data/sig/anthropic/models/beta/beta_advisor_tool_result_error.rbs +2 -0
  123. data/sig/anthropic/models/beta/beta_advisor_tool_result_error_param.rbs +2 -0
  124. data/sig/anthropic/models/beta/beta_content_block.rbs +1 -0
  125. data/sig/anthropic/models/beta/beta_content_block_param.rbs +1 -0
  126. data/sig/anthropic/models/beta/beta_fallback_block.rbs +34 -0
  127. data/sig/anthropic/models/beta/beta_fallback_block_param.rbs +34 -0
  128. data/sig/anthropic/models/beta/beta_fallback_info.rbs +17 -0
  129. data/sig/anthropic/models/beta/beta_fallback_info_param.rbs +17 -0
  130. data/sig/anthropic/models/beta/beta_fallback_message_iteration_usage.rbs +54 -0
  131. data/sig/anthropic/models/beta/beta_fallback_param.rbs +66 -0
  132. data/sig/anthropic/models/beta/beta_iterations_usage.rbs +1 -0
  133. data/sig/anthropic/models/beta/beta_managed_agents_custom_tool_input_schema.rbs +9 -25
  134. data/sig/anthropic/models/beta/beta_managed_agents_model.rbs +5 -1
  135. data/sig/anthropic/models/beta/beta_message_iteration_usage.rbs +5 -0
  136. data/sig/anthropic/models/beta/beta_model_info.rbs +5 -0
  137. data/sig/anthropic/models/beta/beta_raw_content_block_start_event.rbs +1 -0
  138. data/sig/anthropic/models/beta/beta_refusal_stop_details.rbs +17 -1
  139. data/sig/anthropic/models/beta/beta_tool_search_tool_result_error_param.rbs +7 -2
  140. data/sig/anthropic/models/beta/message_create_params.rbs +10 -0
  141. data/sig/anthropic/models/beta/messages/batch_create_params.rbs +10 -0
  142. data/sig/anthropic/models/model.rbs +9 -1
  143. data/sig/anthropic/models/refusal_stop_details.rbs +2 -1
  144. data/sig/anthropic/models/tool_search_tool_result_error_param.rbs +7 -2
  145. data/sig/anthropic/resources/beta/messages.rbs +4 -0
  146. metadata +20 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8e459430d4274990ec5b16c71b6e8ceb9f8fb7ea7b598a0743b1395751f70a04
4
- data.tar.gz: ca0766ef57242877ab67638e9c83c3511864e1fd99350fa100d3d095db0290d6
3
+ metadata.gz: c4bc5b547e144ce8912f64688a18447637a87c762639cb57e34605698cf26e9b
4
+ data.tar.gz: bfa5bfdf7451e6906b0f51e821495375c0b97226a3b8661994a4de82b533984b
5
5
  SHA512:
6
- metadata.gz: 56c89b576946c7d3dc4544b96230be1602d4cbb58b72249065dd16f6bc2ec19077bbb7c87a6d5483a9f6642b6bae5b672aab9717efbeaebcf05878941c96f413
7
- data.tar.gz: dab9b9b13abdb2b18049fe2549cad38d426e7616239c5d96245658ed3f05c6c14c15d13c2efac466424e77c744bd7fbece4ea9daf63ebdcdd00f5982591834e1
6
+ metadata.gz: 80450518d0be5fb60fe3b1d1f909ed2d0b6b740d6ecd38e6335a2235728dd0171a026c4654ba484a971e20de4626444b6f5ce6e8591cd83854b92266159bae11
7
+ data.tar.gz: 22072523e6e0df8c4530a54738498b6098d71b274bdd2b97de552a275105b6cb92f53f4102512ff7791834ad3e487f8790b411856342b3cf79cb67815004bb30
data/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.47.0 (2026-06-09)
4
+
5
+ Full Changelog: [v1.46.0...v1.47.0](https://github.com/anthropics/anthropic-sdk-ruby/compare/v1.46.0...v1.47.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** add support for claude-mythos-5 and claude-fable-5, with support for server-side fallbacks on refusal ([41e21c3](https://github.com/anthropics/anthropic-sdk-ruby/commit/41e21c3a17ba4d5b930e50701ffc395844fb1dd9))
10
+
11
+ ## 1.46.0 (2026-06-06)
12
+
13
+ Full Changelog: [v1.45.0...v1.46.0](https://github.com/anthropics/anthropic-sdk-ruby/compare/v1.45.0...v1.46.0)
14
+
15
+ ### Features
16
+
17
+ * **api:** small updates to Managed Agents types ([7edca7a](https://github.com/anthropics/anthropic-sdk-ruby/commit/7edca7a42f521b53085fef8360dcda9bad974748))
18
+
3
19
  ## 1.45.0 (2026-06-05)
4
20
 
5
21
  Full Changelog: [v1.44.0...v1.45.0](https://github.com/anthropics/anthropic-sdk-ruby/compare/v1.44.0...v1.45.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.45.0"
18
+ gem "anthropic", "~> 1.47.0"
19
19
  ```
20
20
 
21
21
  <!-- x-release-please-end -->
@@ -113,6 +113,10 @@ module Anthropic
113
113
  return Anthropic::Internal::Type::Converter.coerce(Anthropic::Models::BetaMessage, event.message)
114
114
  in Anthropic::Models::RawContentBlockStartEvent | Anthropic::Models::BetaRawContentBlockStartEvent
115
115
  current_snapshot.content = (current_snapshot.content || []) + [event.content_block]
116
+
117
+ # The final hop's fallback block names the model that served the response —
118
+ # keeps the snapshot consistent with the relabeled non-streaming message.
119
+ current_snapshot.model = event.content_block.to.model if event.content_block.type == :fallback
116
120
  in Anthropic::Models::RawContentBlockDeltaEvent | Anthropic::Models::BetaRawContentBlockDeltaEvent
117
121
  content = current_snapshot.content[event.index]
118
122
 
@@ -59,6 +59,10 @@ module Anthropic
59
59
 
60
60
  variant const: -> { Anthropic::Models::AnthropicBeta::THINKING_TOKEN_COUNT_2026_05_13 }
61
61
 
62
+ variant const: -> { Anthropic::Models::AnthropicBeta::SERVER_SIDE_FALLBACK_2026_06_01 }
63
+
64
+ variant const: -> { Anthropic::Models::AnthropicBeta::FALLBACK_CREDIT_2026_06_01 }
65
+
62
66
  # @!method self.variants
63
67
  # @return [Array(String, Symbol)]
64
68
 
@@ -94,6 +98,8 @@ module Anthropic
94
98
  MANAGED_AGENTS_2026_04_01 = :"managed-agents-2026-04-01"
95
99
  CACHE_DIAGNOSIS_2026_04_07 = :"cache-diagnosis-2026-04-07"
96
100
  THINKING_TOKEN_COUNT_2026_05_13 = :"thinking-token-count-2026-05-13"
101
+ SERVER_SIDE_FALLBACK_2026_06_01 = :"server-side-fallback-2026-06-01"
102
+ FALLBACK_CREDIT_2026_06_01 = :"fallback-credit-2026-06-01"
97
103
 
98
104
  # @!endgroup
99
105
  end
@@ -18,13 +18,13 @@ module Anthropic
18
18
  required :model, union: -> { Anthropic::Beta::AgentCreateParams::Model }
19
19
 
20
20
  # @!attribute name
21
- # Human-readable name for the agent. 1-256 characters.
21
+ # Human-readable name for the agent.
22
22
  #
23
23
  # @return [String]
24
24
  required :name, String
25
25
 
26
26
  # @!attribute description
27
- # Description of what the agent does. Up to 2048 characters.
27
+ # Description of what the agent does.
28
28
  #
29
29
  # @return [String, nil]
30
30
  optional :description, String, nil?: true
@@ -52,14 +52,14 @@ module Anthropic
52
52
  optional :multiagent, -> { Anthropic::Beta::BetaManagedAgentsMultiagentParams }, nil?: true
53
53
 
54
54
  # @!attribute skills
55
- # Skills available to the agent. Maximum 20.
55
+ # Skills available to the agent.
56
56
  #
57
57
  # @return [Array<Anthropic::Models::Beta::BetaManagedAgentsAnthropicSkillParams, Anthropic::Models::Beta::BetaManagedAgentsCustomSkillParams>, nil]
58
58
  optional :skills,
59
59
  -> { Anthropic::Internal::Type::ArrayOf[union: Anthropic::Beta::BetaManagedAgentsSkillParams] }
60
60
 
61
61
  # @!attribute system_
62
- # System prompt for the agent. Up to 100,000 characters.
62
+ # System prompt for the agent.
63
63
  #
64
64
  # @return [String, nil]
65
65
  optional :system_, String, api_name: :system, nil?: true
@@ -84,9 +84,9 @@ module Anthropic
84
84
  #
85
85
  # @param model [Symbol, String, Anthropic::Models::Beta::BetaManagedAgentsModel, Anthropic::Models::Beta::BetaManagedAgentsModelConfigParams] Model identifier. Accepts the [model string](https://platform.claude.com/docs/en
86
86
  #
87
- # @param name [String] Human-readable name for the agent. 1-256 characters.
87
+ # @param name [String] Human-readable name for the agent.
88
88
  #
89
- # @param description [String, nil] Description of what the agent does. Up to 2048 characters.
89
+ # @param description [String, nil] Description of what the agent does.
90
90
  #
91
91
  # @param mcp_servers [Array<Anthropic::Models::Beta::BetaManagedAgentsURLMCPServerParams>] MCP servers this agent connects to. Maximum 20. Names must be unique within the
92
92
  #
@@ -94,9 +94,9 @@ module Anthropic
94
94
  #
95
95
  # @param multiagent [Anthropic::Models::Beta::BetaManagedAgentsMultiagentParams, nil] A coordinator topology: the session's primary thread orchestrates work by spawni
96
96
  #
97
- # @param skills [Array<Anthropic::Models::Beta::BetaManagedAgentsAnthropicSkillParams, Anthropic::Models::Beta::BetaManagedAgentsCustomSkillParams>] Skills available to the agent. Maximum 20.
97
+ # @param skills [Array<Anthropic::Models::Beta::BetaManagedAgentsAnthropicSkillParams, Anthropic::Models::Beta::BetaManagedAgentsCustomSkillParams>] Skills available to the agent.
98
98
  #
99
- # @param system_ [String, nil] System prompt for the agent. Up to 100,000 characters.
99
+ # @param system_ [String, nil] System prompt for the agent.
100
100
  #
101
101
  # @param tools [Array<Anthropic::Models::Beta::BetaManagedAgentsAgentToolset20260401Params, Anthropic::Models::Beta::BetaManagedAgentsMCPToolsetParams, Anthropic::Models::Beta::BetaManagedAgentsCustomToolParams>] Tool configurations available to the agent. Maximum of 128 tools across all tool
102
102
  #
@@ -22,8 +22,7 @@ module Anthropic
22
22
  required :version, Integer
23
23
 
24
24
  # @!attribute description
25
- # Description. Up to 2048 characters. Omit to preserve; send empty string or null
26
- # to clear.
25
+ # Description. Omit to preserve; send empty string or null to clear.
27
26
  #
28
27
  # @return [String, nil]
29
28
  optional :description, String, nil?: true
@@ -64,14 +63,13 @@ module Anthropic
64
63
  optional :multiagent, -> { Anthropic::Beta::BetaManagedAgentsMultiagentParams }, nil?: true
65
64
 
66
65
  # @!attribute name
67
- # Human-readable name. 1-256 characters. Omit to preserve. Cannot be cleared.
66
+ # Human-readable name. Must be non-empty. Omit to preserve. Cannot be cleared.
68
67
  #
69
68
  # @return [String, nil]
70
69
  optional :name, String
71
70
 
72
71
  # @!attribute skills
73
72
  # Skills. Full replacement. Omit to preserve; send empty array or null to clear.
74
- # Maximum 20.
75
73
  #
76
74
  # @return [Array<Anthropic::Models::Beta::BetaManagedAgentsAnthropicSkillParams, Anthropic::Models::Beta::BetaManagedAgentsCustomSkillParams>, nil]
77
75
  optional :skills,
@@ -81,8 +79,7 @@ module Anthropic
81
79
  nil?: true
82
80
 
83
81
  # @!attribute system_
84
- # System prompt. Up to 100,000 characters. Omit to preserve; send empty string or
85
- # null to clear.
82
+ # System prompt. Omit to preserve; send empty string or null to clear.
86
83
  #
87
84
  # @return [String, nil]
88
85
  optional :system_, String, api_name: :system, nil?: true
@@ -111,7 +108,7 @@ module Anthropic
111
108
  #
112
109
  # @param version [Integer] The agent's current version, used to prevent concurrent overwrites. Obtain this
113
110
  #
114
- # @param description [String, nil] Description. Up to 2048 characters. Omit to preserve; send empty string or null
111
+ # @param description [String, nil] Description. Omit to preserve; send empty string or null to clear.
115
112
  #
116
113
  # @param mcp_servers [Array<Anthropic::Models::Beta::BetaManagedAgentsURLMCPServerParams>, nil] MCP servers. Full replacement. Omit to preserve; send empty array or null to cle
117
114
  #
@@ -121,11 +118,11 @@ module Anthropic
121
118
  #
122
119
  # @param multiagent [Anthropic::Models::Beta::BetaManagedAgentsMultiagentParams, nil] A coordinator topology: the session's primary thread orchestrates work by spawni
123
120
  #
124
- # @param name [String] Human-readable name. 1-256 characters. Omit to preserve. Cannot be cleared.
121
+ # @param name [String] Human-readable name. Must be non-empty. Omit to preserve. Cannot be cleared.
125
122
  #
126
- # @param skills [Array<Anthropic::Models::Beta::BetaManagedAgentsAnthropicSkillParams, Anthropic::Models::Beta::BetaManagedAgentsCustomSkillParams>, nil] Skills. Full replacement. Omit to preserve; send empty array or null to clear. M
123
+ # @param skills [Array<Anthropic::Models::Beta::BetaManagedAgentsAnthropicSkillParams, Anthropic::Models::Beta::BetaManagedAgentsCustomSkillParams>, nil] Skills. Full replacement. Omit to preserve; send empty array or null to clear.
127
124
  #
128
- # @param system_ [String, nil] System prompt. Up to 100,000 characters. Omit to preserve; send empty string or
125
+ # @param system_ [String, nil] System prompt. Omit to preserve; send empty string or null to clear.
129
126
  #
130
127
  # @param tools [Array<Anthropic::Models::Beta::BetaManagedAgentsAgentToolset20260401Params, Anthropic::Models::Beta::BetaManagedAgentsMCPToolsetParams, Anthropic::Models::Beta::BetaManagedAgentsCustomToolParams>, nil] Tool configurations available to the agent. Full replacement. Omit to preserve;
131
128
  #
@@ -53,6 +53,18 @@ module Anthropic
53
53
  # @return [Boolean, nil]
54
54
  optional :defer_loading, Anthropic::Internal::Type::Boolean
55
55
 
56
+ # @!attribute max_tokens
57
+ # Bounds the advisor's total output (thinking + text) per call. When the advisor
58
+ # hits this cap, the returned advisor_result or advisor_redacted_result block
59
+ # carries stop_reason='max_tokens', and a truncation note is appended to the
60
+ # advice text the worker model sees (inside the encrypted blob in redacted mode).
61
+ # When set, the server also emits a remaining-tokens budget block in the advisor's
62
+ # prompt so the advisor self-shapes toward the cap. When omitted, the advisor
63
+ # model's default output cap applies and no budget block is emitted.
64
+ #
65
+ # @return [Integer, nil]
66
+ optional :max_tokens, Integer, nil?: true
67
+
56
68
  # @!attribute max_uses
57
69
  # Maximum number of times the tool can be used in the API request.
58
70
  #
@@ -65,7 +77,7 @@ module Anthropic
65
77
  # @return [Boolean, nil]
66
78
  optional :strict, Anthropic::Internal::Type::Boolean
67
79
 
68
- # @!method initialize(model:, allowed_callers: nil, cache_control: nil, caching: nil, defer_loading: nil, max_uses: nil, strict: nil, name: :advisor, type: :advisor_20260301)
80
+ # @!method initialize(model:, allowed_callers: nil, cache_control: nil, caching: nil, defer_loading: nil, max_tokens: nil, max_uses: nil, strict: nil, name: :advisor, type: :advisor_20260301)
69
81
  # Some parameter documentations has been truncated, see
70
82
  # {Anthropic::Models::Beta::BetaAdvisorTool20260301} for more details.
71
83
  #
@@ -79,6 +91,8 @@ module Anthropic
79
91
  #
80
92
  # @param defer_loading [Boolean] If true, tool will not be included in initial system prompt. Only loaded when re
81
93
  #
94
+ # @param max_tokens [Integer, nil] Bounds the advisor's total output (thinking + text) per call. When the advisor h
95
+ #
82
96
  # @param max_uses [Integer, nil] Maximum number of times the tool can be used in the API request.
83
97
  #
84
98
  # @param strict [Boolean] When true, guarantees schema validation on tool names and inputs
@@ -28,6 +28,7 @@ module Anthropic
28
28
  OVERLOADED = :overloaded
29
29
  UNAVAILABLE = :unavailable
30
30
  EXECUTION_TIME_EXCEEDED = :execution_time_exceeded
31
+ MODEL_NOT_FOUND = :model_not_found
31
32
 
32
33
  # @!method self.values
33
34
  # @return [Array<Symbol>]
@@ -28,6 +28,7 @@ module Anthropic
28
28
  OVERLOADED = :overloaded
29
29
  UNAVAILABLE = :unavailable
30
30
  EXECUTION_TIME_EXCEEDED = :execution_time_exceeded
31
+ MODEL_NOT_FOUND = :model_not_found
31
32
 
32
33
  # @!method self.values
33
34
  # @return [Array<Symbol>]
@@ -48,8 +48,21 @@ module Anthropic
48
48
  # compaction blocks with null content; the server treats them as no-ops.
49
49
  variant :compaction, -> { Anthropic::Beta::BetaCompactionBlock }
50
50
 
51
+ # Marks the point in `content` where one model's output gives way to the next.
52
+ #
53
+ # One block appears per hop where a preceding model actually ran this turn and
54
+ # declined. A turn routed directly by the sticky decision has no such boundary
55
+ # and carries no block — the signal for whether a fallback model served the
56
+ # response is the presence of a `fallback_message` entry in
57
+ # `usage.iterations`, not this block.
58
+ #
59
+ # The block is treated like a server-tool content block for streaming: it
60
+ # arrives via the standard `content_block_start` / `content_block_stop`
61
+ # pair and carries no deltas.
62
+ variant :fallback, -> { Anthropic::Beta::BetaFallbackBlock }
63
+
51
64
  # @!method self.variants
52
- # @return [Array(Anthropic::Models::Beta::BetaTextBlock, Anthropic::Models::Beta::BetaThinkingBlock, Anthropic::Models::Beta::BetaRedactedThinkingBlock, Anthropic::Models::Beta::BetaToolUseBlock, Anthropic::Models::Beta::BetaServerToolUseBlock, Anthropic::Models::Beta::BetaWebSearchToolResultBlock, Anthropic::Models::Beta::BetaWebFetchToolResultBlock, Anthropic::Models::Beta::BetaAdvisorToolResultBlock, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaToolSearchToolResultBlock, Anthropic::Models::Beta::BetaMCPToolUseBlock, Anthropic::Models::Beta::BetaMCPToolResultBlock, Anthropic::Models::Beta::BetaContainerUploadBlock, Anthropic::Models::Beta::BetaCompactionBlock)]
65
+ # @return [Array(Anthropic::Models::Beta::BetaTextBlock, Anthropic::Models::Beta::BetaThinkingBlock, Anthropic::Models::Beta::BetaRedactedThinkingBlock, Anthropic::Models::Beta::BetaToolUseBlock, Anthropic::Models::Beta::BetaServerToolUseBlock, Anthropic::Models::Beta::BetaWebSearchToolResultBlock, Anthropic::Models::Beta::BetaWebFetchToolResultBlock, Anthropic::Models::Beta::BetaAdvisorToolResultBlock, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaToolSearchToolResultBlock, Anthropic::Models::Beta::BetaMCPToolUseBlock, Anthropic::Models::Beta::BetaMCPToolResultBlock, Anthropic::Models::Beta::BetaContainerUploadBlock, Anthropic::Models::Beta::BetaCompactionBlock, Anthropic::Models::Beta::BetaFallbackBlock)]
53
66
  end
54
67
  end
55
68
 
@@ -74,8 +74,25 @@ module Anthropic
74
74
  # point in the conversation, rather than only via the top-level `system` parameter.
75
75
  variant :mid_conv_system, -> { Anthropic::Beta::BetaMidConversationSystemBlockParam }
76
76
 
77
+ # A `fallback` block echoed back from a prior response.
78
+ #
79
+ # Accepted in `messages[].content` and never rendered into the prompt,
80
+ # not validated against the request's `fallbacks` chain or top-level
81
+ # `model`, and stripped before the sticky-routing cache key is computed.
82
+ #
83
+ # Callers should echo the assistant turn verbatim — block included. The
84
+ # block's position is load-bearing for thinking verification: the thinking
85
+ # runs on either side of a fallback hop carry independently-rooted
86
+ # verification hash chains, and this block is the only record of where one
87
+ # chain ends and the next begins. When thinking runs flank the boundary,
88
+ # omitting the block merges the runs into one contiguous span whose hashes
89
+ # cannot verify (the request is rejected), and moving it into the middle of
90
+ # a single run splits that run's chain and is likewise rejected; between
91
+ # non-thinking blocks the block's placement has no verification effect.
92
+ variant :fallback, -> { Anthropic::Beta::BetaFallbackBlockParam }
93
+
77
94
  # @!method self.variants
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)]
95
+ # @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, Anthropic::Models::Beta::BetaFallbackBlockParam)]
79
96
  end
80
97
  end
81
98
 
@@ -0,0 +1,54 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Beta
6
+ class BetaFallbackBlock < Anthropic::Internal::Type::BaseModel
7
+ # @!attribute from
8
+ # The model whose output ends at this point — the model that declined at this hop.
9
+ # When the declining hop is the requested model, its `model` echoes the top-level
10
+ # `model` string the caller sent (alias or canonical); when the declining hop is a
11
+ # fallback model, its `model` is that model's canonical id.
12
+ #
13
+ # @return [Anthropic::Models::Beta::BetaFallbackInfo]
14
+ required :from, -> { Anthropic::Beta::BetaFallbackInfo }
15
+
16
+ # @!attribute to
17
+ # The fallback model producing the content that follows this block. Its `model` is
18
+ # always the canonical id.
19
+ #
20
+ # @return [Anthropic::Models::Beta::BetaFallbackInfo]
21
+ required :to, -> { Anthropic::Beta::BetaFallbackInfo }
22
+
23
+ # @!attribute type
24
+ #
25
+ # @return [Symbol, :fallback]
26
+ required :type, const: :fallback
27
+
28
+ # @!method initialize(from:, to:, type: :fallback)
29
+ # Some parameter documentations has been truncated, see
30
+ # {Anthropic::Models::Beta::BetaFallbackBlock} for more details.
31
+ #
32
+ # Marks the point in `content` where one model's output gives way to the next.
33
+ #
34
+ # One block appears per hop where a preceding model actually ran this turn and
35
+ # declined. A turn routed directly by the sticky decision has no such boundary and
36
+ # carries no block — the signal for whether a fallback model served the response
37
+ # is the presence of a `fallback_message` entry in `usage.iterations`, not this
38
+ # block.
39
+ #
40
+ # The block is treated like a server-tool content block for streaming: it arrives
41
+ # via the standard `content_block_start` / `content_block_stop` pair and carries
42
+ # no deltas.
43
+ #
44
+ # @param from [Anthropic::Models::Beta::BetaFallbackInfo] The model whose output ends at this point — the model that declined at this hop.
45
+ #
46
+ # @param to [Anthropic::Models::Beta::BetaFallbackInfo] The fallback model producing the content that follows this block. Its `model` is
47
+ #
48
+ # @param type [Symbol, :fallback]
49
+ end
50
+ end
51
+
52
+ BetaFallbackBlock = Beta::BetaFallbackBlock
53
+ end
54
+ end
@@ -0,0 +1,51 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Beta
6
+ class BetaFallbackBlockParam < Anthropic::Internal::Type::BaseModel
7
+ # @!attribute from
8
+ # Identifies one hop of a fallback transition.
9
+ #
10
+ # @return [Anthropic::Models::Beta::BetaFallbackInfoParam]
11
+ required :from, -> { Anthropic::Beta::BetaFallbackInfoParam }
12
+
13
+ # @!attribute to
14
+ # Identifies one hop of a fallback transition.
15
+ #
16
+ # @return [Anthropic::Models::Beta::BetaFallbackInfoParam]
17
+ required :to, -> { Anthropic::Beta::BetaFallbackInfoParam }
18
+
19
+ # @!attribute type
20
+ #
21
+ # @return [Symbol, :fallback]
22
+ required :type, const: :fallback
23
+
24
+ # @!method initialize(from:, to:, type: :fallback)
25
+ # A `fallback` block echoed back from a prior response.
26
+ #
27
+ # Accepted in `messages[].content` and never rendered into the prompt, not
28
+ # validated against the request's `fallbacks` chain or top-level `model`, and
29
+ # stripped before the sticky-routing cache key is computed.
30
+ #
31
+ # Callers should echo the assistant turn verbatim — block included. The block's
32
+ # position is load-bearing for thinking verification: the thinking runs on either
33
+ # side of a fallback hop carry independently-rooted verification hash chains, and
34
+ # this block is the only record of where one chain ends and the next begins. When
35
+ # thinking runs flank the boundary, omitting the block merges the runs into one
36
+ # contiguous span whose hashes cannot verify (the request is rejected), and moving
37
+ # it into the middle of a single run splits that run's chain and is likewise
38
+ # rejected; between non-thinking blocks the block's placement has no verification
39
+ # effect.
40
+ #
41
+ # @param from [Anthropic::Models::Beta::BetaFallbackInfoParam] Identifies one hop of a fallback transition.
42
+ #
43
+ # @param to [Anthropic::Models::Beta::BetaFallbackInfoParam] Identifies one hop of a fallback transition.
44
+ #
45
+ # @param type [Symbol, :fallback]
46
+ end
47
+ end
48
+
49
+ BetaFallbackBlockParam = Beta::BetaFallbackBlockParam
50
+ end
51
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Beta
6
+ class BetaFallbackInfo < Anthropic::Internal::Type::BaseModel
7
+ # @!attribute model
8
+ # The model that will complete your prompt.
9
+ #
10
+ # See [models](https://docs.anthropic.com/en/docs/models-overview) for additional
11
+ # details and options.
12
+ #
13
+ # @return [Symbol, String, Anthropic::Models::Model]
14
+ required :model, union: -> { Anthropic::Model }
15
+
16
+ # @!method initialize(model:)
17
+ # Some parameter documentations has been truncated, see
18
+ # {Anthropic::Models::Beta::BetaFallbackInfo} for more details.
19
+ #
20
+ # Identifies one hop of a fallback transition.
21
+ #
22
+ # @param model [Symbol, String, Anthropic::Models::Model] The model that will complete your prompt.
23
+ end
24
+ end
25
+
26
+ BetaFallbackInfo = Beta::BetaFallbackInfo
27
+ end
28
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Beta
6
+ class BetaFallbackInfoParam < Anthropic::Internal::Type::BaseModel
7
+ # @!attribute model
8
+ # The model that will complete your prompt.
9
+ #
10
+ # See [models](https://docs.anthropic.com/en/docs/models-overview) for additional
11
+ # details and options.
12
+ #
13
+ # @return [Symbol, String, Anthropic::Models::Model]
14
+ required :model, union: -> { Anthropic::Model }
15
+
16
+ # @!method initialize(model:)
17
+ # Some parameter documentations has been truncated, see
18
+ # {Anthropic::Models::Beta::BetaFallbackInfoParam} for more details.
19
+ #
20
+ # Identifies one hop of a fallback transition.
21
+ #
22
+ # @param model [Symbol, String, Anthropic::Models::Model] The model that will complete your prompt.
23
+ end
24
+ end
25
+
26
+ BetaFallbackInfoParam = Beta::BetaFallbackInfoParam
27
+ end
28
+ end
@@ -0,0 +1,81 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Beta
6
+ class BetaFallbackMessageIterationUsage < Anthropic::Internal::Type::BaseModel
7
+ # @!attribute cache_creation
8
+ # Breakdown of cached tokens by TTL
9
+ #
10
+ # @return [Anthropic::Models::Beta::BetaCacheCreation, nil]
11
+ required :cache_creation, -> { Anthropic::Beta::BetaCacheCreation }, nil?: true
12
+
13
+ # @!attribute cache_creation_input_tokens
14
+ # The number of input tokens used to create the cache entry.
15
+ #
16
+ # @return [Integer]
17
+ required :cache_creation_input_tokens, Integer
18
+
19
+ # @!attribute cache_read_input_tokens
20
+ # The number of input tokens read from the cache.
21
+ #
22
+ # @return [Integer]
23
+ required :cache_read_input_tokens, Integer
24
+
25
+ # @!attribute input_tokens
26
+ # The number of input tokens which were used.
27
+ #
28
+ # @return [Integer]
29
+ required :input_tokens, Integer
30
+
31
+ # @!attribute model
32
+ # The model that will complete your prompt.
33
+ #
34
+ # See [models](https://docs.anthropic.com/en/docs/models-overview) for additional
35
+ # details and options.
36
+ #
37
+ # @return [Symbol, String, Anthropic::Models::Model]
38
+ required :model, union: -> { Anthropic::Model }
39
+
40
+ # @!attribute output_tokens
41
+ # The number of output tokens which were used.
42
+ #
43
+ # @return [Integer]
44
+ required :output_tokens, Integer
45
+
46
+ # @!attribute type
47
+ # Usage for the fallback-model attempt that served the response
48
+ #
49
+ # @return [Symbol, :fallback_message]
50
+ required :type, const: :fallback_message
51
+
52
+ # @!method initialize(cache_creation:, cache_creation_input_tokens:, cache_read_input_tokens:, input_tokens:, model:, output_tokens:, type: :fallback_message)
53
+ # Some parameter documentations has been truncated, see
54
+ # {Anthropic::Models::Beta::BetaFallbackMessageIterationUsage} for more details.
55
+ #
56
+ # Token usage for the fallback-model attempt of a server-side fallback request.
57
+ #
58
+ # Produced in place of a `message` entry for whichever hop served the response. A
59
+ # declined hop produces the existing `message` entry. Whether a fallback model
60
+ # served the response is signalled by the presence of this entry in
61
+ # `usage.iterations`.
62
+ #
63
+ # @param cache_creation [Anthropic::Models::Beta::BetaCacheCreation, nil] Breakdown of cached tokens by TTL
64
+ #
65
+ # @param cache_creation_input_tokens [Integer] The number of input tokens used to create the cache entry.
66
+ #
67
+ # @param cache_read_input_tokens [Integer] The number of input tokens read from the cache.
68
+ #
69
+ # @param input_tokens [Integer] The number of input tokens which were used.
70
+ #
71
+ # @param model [Symbol, String, Anthropic::Models::Model] The model that will complete your prompt.
72
+ #
73
+ # @param output_tokens [Integer] The number of output tokens which were used.
74
+ #
75
+ # @param type [Symbol, :fallback_message] Usage for the fallback-model attempt that served the response
76
+ end
77
+ end
78
+
79
+ BetaFallbackMessageIterationUsage = Beta::BetaFallbackMessageIterationUsage
80
+ end
81
+ end
@@ -0,0 +1,88 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Beta
6
+ class BetaFallbackParam < Anthropic::Internal::Type::BaseModel
7
+ # @!attribute model
8
+ # The model that will complete your prompt.
9
+ #
10
+ # See [models](https://docs.anthropic.com/en/docs/models-overview) for additional
11
+ # details and options.
12
+ #
13
+ # @return [Symbol, String, Anthropic::Models::Model]
14
+ required :model, union: -> { Anthropic::Model }
15
+
16
+ # @!attribute max_tokens
17
+ #
18
+ # @return [Integer, nil]
19
+ optional :max_tokens, Integer, nil?: true
20
+
21
+ # @!attribute output_config
22
+ #
23
+ # @return [Anthropic::Models::Beta::BetaOutputConfig, nil]
24
+ optional :output_config, -> { Anthropic::Beta::BetaOutputConfig }, nil?: true
25
+
26
+ # @!attribute speed
27
+ #
28
+ # @return [Symbol, Anthropic::Models::Beta::BetaFallbackParam::Speed, nil]
29
+ optional :speed, enum: -> { Anthropic::Beta::BetaFallbackParam::Speed }, nil?: true
30
+
31
+ # @!attribute thinking
32
+ #
33
+ # @return [Anthropic::Models::Beta::BetaThinkingConfigEnabled, Anthropic::Models::Beta::BetaThinkingConfigDisabled, Anthropic::Models::Beta::BetaThinkingConfigAdaptive, nil]
34
+ optional :thinking, union: -> { Anthropic::Beta::BetaFallbackParam::Thinking }, nil?: true
35
+
36
+ # @!method initialize(model:, max_tokens: nil, output_config: nil, speed: nil, thinking: nil)
37
+ # Some parameter documentations has been truncated, see
38
+ # {Anthropic::Models::Beta::BetaFallbackParam} for more details.
39
+ #
40
+ # One entry in the `fallbacks` chain on a `/v1/messages` request.
41
+ #
42
+ # `model` is required. The four override fields (`max_tokens`, `thinking`,
43
+ # `output_config`, and `speed`) replace the corresponding top-level field for this
44
+ # attempt only and are validated as if the request were made to `model`. Any other
45
+ # key is rejected at parse time.
46
+ #
47
+ # @param model [Symbol, String, Anthropic::Models::Model] The model that will complete your prompt.
48
+ #
49
+ # @param max_tokens [Integer, nil]
50
+ #
51
+ # @param output_config [Anthropic::Models::Beta::BetaOutputConfig, nil]
52
+ #
53
+ # @param speed [Symbol, Anthropic::Models::Beta::BetaFallbackParam::Speed, nil]
54
+ #
55
+ # @param thinking [Anthropic::Models::Beta::BetaThinkingConfigEnabled, Anthropic::Models::Beta::BetaThinkingConfigDisabled, Anthropic::Models::Beta::BetaThinkingConfigAdaptive, nil]
56
+
57
+ # @see Anthropic::Models::Beta::BetaFallbackParam#speed
58
+ module Speed
59
+ extend Anthropic::Internal::Type::Enum
60
+
61
+ STANDARD = :standard
62
+ FAST = :fast
63
+
64
+ # @!method self.values
65
+ # @return [Array<Symbol>]
66
+ end
67
+
68
+ # @see Anthropic::Models::Beta::BetaFallbackParam#thinking
69
+ module Thinking
70
+ extend Anthropic::Internal::Type::Union
71
+
72
+ discriminator :type
73
+
74
+ variant :enabled, -> { Anthropic::Beta::BetaThinkingConfigEnabled }
75
+
76
+ variant :disabled, -> { Anthropic::Beta::BetaThinkingConfigDisabled }
77
+
78
+ variant :adaptive, -> { Anthropic::Beta::BetaThinkingConfigAdaptive }
79
+
80
+ # @!method self.variants
81
+ # @return [Array(Anthropic::Models::Beta::BetaThinkingConfigEnabled, Anthropic::Models::Beta::BetaThinkingConfigDisabled, Anthropic::Models::Beta::BetaThinkingConfigAdaptive)]
82
+ end
83
+ end
84
+ end
85
+
86
+ BetaFallbackParam = Beta::BetaFallbackParam
87
+ end
88
+ end