anthropic 1.48.2 → 1.49.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 (212) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +14 -0
  3. data/README.md +1 -1
  4. data/lib/anthropic/client.rb +8 -2
  5. data/lib/anthropic/errors.rb +14 -0
  6. data/lib/anthropic/helpers/aws/client.rb +3 -3
  7. data/lib/anthropic/helpers/aws_auth.rb +39 -29
  8. data/lib/anthropic/helpers/bedrock/client.rb +99 -67
  9. data/lib/anthropic/helpers/bedrock/event_stream.rb +92 -0
  10. data/lib/anthropic/helpers/bedrock/mantle_client.rb +3 -3
  11. data/lib/anthropic/helpers/vertex/client.rb +99 -55
  12. data/lib/anthropic/internal/transport/base_client.rb +196 -33
  13. data/lib/anthropic/internal/util.rb +37 -1
  14. data/lib/anthropic/middleware.rb +435 -0
  15. data/lib/anthropic/models/beta/beta_advisor_tool_20260301.rb +3 -1
  16. data/lib/anthropic/models/beta/beta_code_execution_tool_20250522.rb +3 -1
  17. data/lib/anthropic/models/beta/beta_code_execution_tool_20250825.rb +3 -1
  18. data/lib/anthropic/models/beta/beta_code_execution_tool_20260120.rb +3 -1
  19. data/lib/anthropic/models/beta/beta_code_execution_tool_20260521.rb +86 -0
  20. data/lib/anthropic/models/beta/beta_content_block.rb +3 -3
  21. data/lib/anthropic/models/beta/beta_content_block_param.rb +10 -12
  22. data/lib/anthropic/models/beta/beta_fallback_block.rb +13 -5
  23. data/lib/anthropic/models/beta/beta_fallback_block_param.rb +22 -13
  24. data/lib/anthropic/models/beta/beta_fallback_refusal_trigger.rb +44 -0
  25. data/lib/anthropic/models/beta/beta_memory_tool_20250818.rb +3 -1
  26. data/lib/anthropic/models/beta/beta_raw_content_block_start_event.rb +3 -3
  27. data/lib/anthropic/models/beta/beta_refusal_stop_details.rb +3 -7
  28. data/lib/anthropic/models/beta/beta_tool.rb +3 -1
  29. data/lib/anthropic/models/beta/beta_tool_bash_20241022.rb +3 -1
  30. data/lib/anthropic/models/beta/beta_tool_bash_20250124.rb +3 -1
  31. data/lib/anthropic/models/beta/beta_tool_computer_use_20241022.rb +3 -1
  32. data/lib/anthropic/models/beta/beta_tool_computer_use_20250124.rb +3 -1
  33. data/lib/anthropic/models/beta/beta_tool_computer_use_20251124.rb +3 -1
  34. data/lib/anthropic/models/beta/beta_tool_search_tool_bm25_20251119.rb +3 -1
  35. data/lib/anthropic/models/beta/beta_tool_search_tool_regex_20251119.rb +3 -1
  36. data/lib/anthropic/models/beta/beta_tool_text_editor_20241022.rb +3 -1
  37. data/lib/anthropic/models/beta/beta_tool_text_editor_20250124.rb +3 -1
  38. data/lib/anthropic/models/beta/beta_tool_text_editor_20250429.rb +3 -1
  39. data/lib/anthropic/models/beta/beta_tool_text_editor_20250728.rb +3 -1
  40. data/lib/anthropic/models/beta/beta_tool_union.rb +4 -1
  41. data/lib/anthropic/models/beta/beta_web_fetch_tool_20250910.rb +3 -1
  42. data/lib/anthropic/models/beta/beta_web_fetch_tool_20260209.rb +3 -1
  43. data/lib/anthropic/models/beta/beta_web_fetch_tool_20260309.rb +3 -1
  44. data/lib/anthropic/models/beta/beta_web_search_tool_20250305.rb +3 -1
  45. data/lib/anthropic/models/beta/beta_web_search_tool_20260209.rb +3 -1
  46. data/lib/anthropic/models/beta/beta_webhook_event.rb +2 -2
  47. data/lib/anthropic/models/beta/beta_webhook_event_data.rb +3 -1
  48. data/lib/anthropic/models/beta/beta_webhook_session_updated_event_data.rb +41 -0
  49. data/lib/anthropic/models/beta/message_count_tokens_params.rb +6 -3
  50. data/lib/anthropic/models/beta/message_create_params.rb +2 -2
  51. data/lib/anthropic/models/beta/messages/batch_create_params.rb +2 -2
  52. data/lib/anthropic/models/beta/unwrap_webhook_event.rb +2 -2
  53. data/lib/anthropic/models/code_execution_tool_20250522.rb +3 -1
  54. data/lib/anthropic/models/code_execution_tool_20250825.rb +3 -1
  55. data/lib/anthropic/models/code_execution_tool_20260120.rb +3 -1
  56. data/lib/anthropic/models/code_execution_tool_20260521.rb +82 -0
  57. data/lib/anthropic/models/memory_tool_20250818.rb +3 -1
  58. data/lib/anthropic/models/message_count_tokens_params.rb +2 -2
  59. data/lib/anthropic/models/message_count_tokens_tool.rb +4 -1
  60. data/lib/anthropic/models/message_create_params.rb +2 -2
  61. data/lib/anthropic/models/messages/batch_create_params.rb +2 -2
  62. data/lib/anthropic/models/refusal_stop_details.rb +3 -7
  63. data/lib/anthropic/models/tool.rb +3 -1
  64. data/lib/anthropic/models/tool_bash_20250124.rb +3 -1
  65. data/lib/anthropic/models/tool_search_tool_bm25_20251119.rb +3 -1
  66. data/lib/anthropic/models/tool_search_tool_regex_20251119.rb +3 -1
  67. data/lib/anthropic/models/tool_text_editor_20250124.rb +3 -1
  68. data/lib/anthropic/models/tool_text_editor_20250429.rb +3 -1
  69. data/lib/anthropic/models/tool_text_editor_20250728.rb +3 -1
  70. data/lib/anthropic/models/tool_union.rb +4 -1
  71. data/lib/anthropic/models/web_fetch_tool_20250910.rb +3 -1
  72. data/lib/anthropic/models/web_fetch_tool_20260209.rb +3 -1
  73. data/lib/anthropic/models/web_fetch_tool_20260309.rb +3 -1
  74. data/lib/anthropic/models/web_search_tool_20250305.rb +3 -1
  75. data/lib/anthropic/models/web_search_tool_20260209.rb +3 -1
  76. data/lib/anthropic/models.rb +2 -0
  77. data/lib/anthropic/request_options.rb +9 -0
  78. data/lib/anthropic/resources/beta/messages.rb +3 -3
  79. data/lib/anthropic/resources/messages.rb +3 -3
  80. data/lib/anthropic/version.rb +1 -1
  81. data/lib/anthropic.rb +6 -0
  82. data/rbi/anthropic/client.rbi +7 -2
  83. data/rbi/anthropic/errors.rbi +5 -0
  84. data/rbi/anthropic/helpers/aws/client.rbi +3 -6
  85. data/rbi/anthropic/helpers/bedrock/client.rbi +24 -13
  86. data/rbi/anthropic/helpers/bedrock/event_stream.rbi +25 -0
  87. data/rbi/anthropic/helpers/bedrock/mantle_client.rbi +3 -6
  88. data/rbi/anthropic/helpers/vertex/client.rbi +28 -8
  89. data/rbi/anthropic/internal/transport/base_client.rbi +39 -4
  90. data/rbi/anthropic/internal/util.rbi +5 -0
  91. data/rbi/anthropic/middleware.rbi +338 -0
  92. data/rbi/anthropic/models/beta/beta_advisor_tool_20260301.rbi +7 -1
  93. data/rbi/anthropic/models/beta/beta_code_execution_tool_20250522.rbi +7 -1
  94. data/rbi/anthropic/models/beta/beta_code_execution_tool_20250825.rbi +7 -1
  95. data/rbi/anthropic/models/beta/beta_code_execution_tool_20260120.rbi +7 -1
  96. data/rbi/anthropic/models/beta/beta_code_execution_tool_20260521.rbi +178 -0
  97. data/rbi/anthropic/models/beta/beta_fallback_block.rbi +19 -4
  98. data/rbi/anthropic/models/beta/beta_fallback_block_param.rbi +23 -13
  99. data/rbi/anthropic/models/beta/beta_fallback_refusal_trigger.rbi +108 -0
  100. data/rbi/anthropic/models/beta/beta_memory_tool_20250818.rbi +7 -1
  101. data/rbi/anthropic/models/beta/beta_refusal_stop_details.rbi +3 -9
  102. data/rbi/anthropic/models/beta/beta_tool.rbi +7 -1
  103. data/rbi/anthropic/models/beta/beta_tool_bash_20241022.rbi +7 -1
  104. data/rbi/anthropic/models/beta/beta_tool_bash_20250124.rbi +7 -1
  105. data/rbi/anthropic/models/beta/beta_tool_computer_use_20241022.rbi +7 -1
  106. data/rbi/anthropic/models/beta/beta_tool_computer_use_20250124.rbi +7 -1
  107. data/rbi/anthropic/models/beta/beta_tool_computer_use_20251124.rbi +7 -1
  108. data/rbi/anthropic/models/beta/beta_tool_search_tool_bm25_20251119.rbi +7 -1
  109. data/rbi/anthropic/models/beta/beta_tool_search_tool_regex_20251119.rbi +7 -1
  110. data/rbi/anthropic/models/beta/beta_tool_text_editor_20241022.rbi +7 -1
  111. data/rbi/anthropic/models/beta/beta_tool_text_editor_20250124.rbi +7 -1
  112. data/rbi/anthropic/models/beta/beta_tool_text_editor_20250429.rbi +7 -1
  113. data/rbi/anthropic/models/beta/beta_tool_text_editor_20250728.rbi +7 -1
  114. data/rbi/anthropic/models/beta/beta_tool_union.rbi +1 -0
  115. data/rbi/anthropic/models/beta/beta_web_fetch_tool_20250910.rbi +7 -1
  116. data/rbi/anthropic/models/beta/beta_web_fetch_tool_20260209.rbi +7 -1
  117. data/rbi/anthropic/models/beta/beta_web_fetch_tool_20260309.rbi +7 -1
  118. data/rbi/anthropic/models/beta/beta_web_search_tool_20250305.rbi +7 -1
  119. data/rbi/anthropic/models/beta/beta_web_search_tool_20260209.rbi +7 -1
  120. data/rbi/anthropic/models/beta/beta_webhook_event.rbi +6 -3
  121. data/rbi/anthropic/models/beta/beta_webhook_event_data.rbi +2 -1
  122. data/rbi/anthropic/models/beta/beta_webhook_session_updated_event_data.rbi +63 -0
  123. data/rbi/anthropic/models/beta/message_count_tokens_params.rbi +5 -0
  124. data/rbi/anthropic/models/beta/message_create_params.rbi +4 -0
  125. data/rbi/anthropic/models/beta/messages/batch_create_params.rbi +4 -0
  126. data/rbi/anthropic/models/beta/unwrap_webhook_event.rbi +2 -1
  127. data/rbi/anthropic/models/code_execution_tool_20250522.rbi +7 -1
  128. data/rbi/anthropic/models/code_execution_tool_20250825.rbi +7 -1
  129. data/rbi/anthropic/models/code_execution_tool_20260120.rbi +7 -1
  130. data/rbi/anthropic/models/code_execution_tool_20260521.rbi +168 -0
  131. data/rbi/anthropic/models/memory_tool_20250818.rbi +7 -1
  132. data/rbi/anthropic/models/message_count_tokens_params.rbi +4 -0
  133. data/rbi/anthropic/models/message_count_tokens_tool.rbi +1 -0
  134. data/rbi/anthropic/models/message_create_params.rbi +4 -0
  135. data/rbi/anthropic/models/messages/batch_create_params.rbi +4 -0
  136. data/rbi/anthropic/models/refusal_stop_details.rbi +3 -9
  137. data/rbi/anthropic/models/tool.rbi +7 -1
  138. data/rbi/anthropic/models/tool_bash_20250124.rbi +7 -1
  139. data/rbi/anthropic/models/tool_search_tool_bm25_20251119.rbi +7 -1
  140. data/rbi/anthropic/models/tool_search_tool_regex_20251119.rbi +7 -1
  141. data/rbi/anthropic/models/tool_text_editor_20250124.rbi +7 -1
  142. data/rbi/anthropic/models/tool_text_editor_20250429.rbi +7 -1
  143. data/rbi/anthropic/models/tool_text_editor_20250728.rbi +7 -1
  144. data/rbi/anthropic/models/tool_union.rbi +1 -0
  145. data/rbi/anthropic/models/web_fetch_tool_20250910.rbi +7 -1
  146. data/rbi/anthropic/models/web_fetch_tool_20260209.rbi +7 -1
  147. data/rbi/anthropic/models/web_fetch_tool_20260309.rbi +7 -1
  148. data/rbi/anthropic/models/web_search_tool_20250305.rbi +7 -1
  149. data/rbi/anthropic/models/web_search_tool_20260209.rbi +7 -1
  150. data/rbi/anthropic/models.rbi +2 -0
  151. data/rbi/anthropic/request_options.rbi +5 -0
  152. data/rbi/anthropic/resources/beta/messages.rbi +3 -0
  153. data/rbi/anthropic/resources/messages.rbi +3 -0
  154. data/sig/anthropic/client.rbs +2 -1
  155. data/sig/anthropic/errors.rbs +3 -0
  156. data/sig/anthropic/helpers/bedrock/client.rbs +12 -4
  157. data/sig/anthropic/helpers/vertex/client.rbs +17 -4
  158. data/sig/anthropic/internal/transport/base_client.rbs +18 -3
  159. data/sig/anthropic/internal/util.rbs +2 -0
  160. data/sig/anthropic/middleware.rbs +117 -0
  161. data/sig/anthropic/models/beta/beta_advisor_tool_20260301.rbs +5 -1
  162. data/sig/anthropic/models/beta/beta_code_execution_tool_20250522.rbs +5 -1
  163. data/sig/anthropic/models/beta/beta_code_execution_tool_20250825.rbs +5 -1
  164. data/sig/anthropic/models/beta/beta_code_execution_tool_20260120.rbs +5 -1
  165. data/sig/anthropic/models/beta/beta_code_execution_tool_20260521.rbs +74 -0
  166. data/sig/anthropic/models/beta/beta_fallback_block.rbs +5 -0
  167. data/sig/anthropic/models/beta/beta_fallback_block_param.rbs +9 -2
  168. data/sig/anthropic/models/beta/beta_fallback_refusal_trigger.rbs +42 -0
  169. data/sig/anthropic/models/beta/beta_memory_tool_20250818.rbs +5 -1
  170. data/sig/anthropic/models/beta/beta_tool.rbs +5 -1
  171. data/sig/anthropic/models/beta/beta_tool_bash_20241022.rbs +5 -1
  172. data/sig/anthropic/models/beta/beta_tool_bash_20250124.rbs +5 -1
  173. data/sig/anthropic/models/beta/beta_tool_computer_use_20241022.rbs +5 -1
  174. data/sig/anthropic/models/beta/beta_tool_computer_use_20250124.rbs +5 -1
  175. data/sig/anthropic/models/beta/beta_tool_computer_use_20251124.rbs +5 -1
  176. data/sig/anthropic/models/beta/beta_tool_search_tool_bm25_20251119.rbs +5 -1
  177. data/sig/anthropic/models/beta/beta_tool_search_tool_regex_20251119.rbs +5 -1
  178. data/sig/anthropic/models/beta/beta_tool_text_editor_20241022.rbs +5 -1
  179. data/sig/anthropic/models/beta/beta_tool_text_editor_20250124.rbs +5 -1
  180. data/sig/anthropic/models/beta/beta_tool_text_editor_20250429.rbs +5 -1
  181. data/sig/anthropic/models/beta/beta_tool_text_editor_20250728.rbs +5 -1
  182. data/sig/anthropic/models/beta/beta_tool_union.rbs +1 -0
  183. data/sig/anthropic/models/beta/beta_web_fetch_tool_20250910.rbs +5 -1
  184. data/sig/anthropic/models/beta/beta_web_fetch_tool_20260209.rbs +5 -1
  185. data/sig/anthropic/models/beta/beta_web_fetch_tool_20260309.rbs +5 -1
  186. data/sig/anthropic/models/beta/beta_web_search_tool_20250305.rbs +5 -1
  187. data/sig/anthropic/models/beta/beta_web_search_tool_20260209.rbs +5 -1
  188. data/sig/anthropic/models/beta/beta_webhook_event_data.rbs +1 -0
  189. data/sig/anthropic/models/beta/beta_webhook_session_updated_event_data.rbs +39 -0
  190. data/sig/anthropic/models/beta/message_count_tokens_params.rbs +1 -0
  191. data/sig/anthropic/models/code_execution_tool_20250522.rbs +5 -1
  192. data/sig/anthropic/models/code_execution_tool_20250825.rbs +5 -1
  193. data/sig/anthropic/models/code_execution_tool_20260120.rbs +5 -1
  194. data/sig/anthropic/models/code_execution_tool_20260521.rbs +70 -0
  195. data/sig/anthropic/models/memory_tool_20250818.rbs +5 -1
  196. data/sig/anthropic/models/message_count_tokens_tool.rbs +1 -0
  197. data/sig/anthropic/models/tool.rbs +5 -1
  198. data/sig/anthropic/models/tool_bash_20250124.rbs +5 -1
  199. data/sig/anthropic/models/tool_search_tool_bm25_20251119.rbs +5 -1
  200. data/sig/anthropic/models/tool_search_tool_regex_20251119.rbs +5 -1
  201. data/sig/anthropic/models/tool_text_editor_20250124.rbs +5 -1
  202. data/sig/anthropic/models/tool_text_editor_20250429.rbs +5 -1
  203. data/sig/anthropic/models/tool_text_editor_20250728.rbs +5 -1
  204. data/sig/anthropic/models/tool_union.rbs +1 -0
  205. data/sig/anthropic/models/web_fetch_tool_20250910.rbs +5 -1
  206. data/sig/anthropic/models/web_fetch_tool_20260209.rbs +5 -1
  207. data/sig/anthropic/models/web_fetch_tool_20260309.rbs +5 -1
  208. data/sig/anthropic/models/web_search_tool_20250305.rbs +5 -1
  209. data/sig/anthropic/models/web_search_tool_20260209.rbs +5 -1
  210. data/sig/anthropic/models.rbs +2 -0
  211. data/sig/anthropic/request_options.rbs +4 -1
  212. metadata +19 -2
@@ -33,25 +33,31 @@ module Anthropic
33
33
  sig { returns(Symbol) }
34
34
  attr_accessor :type
35
35
 
36
+ # The response block's `trigger`, echoed verbatim. Accepted and ignored by the
37
+ # server; any object or `null` is allowed.
38
+ sig { returns(T.nilable(T.anything)) }
39
+ attr_reader :trigger
40
+
41
+ sig { params(trigger: T.anything).void }
42
+ attr_writer :trigger
43
+
36
44
  # A `fallback` block echoed back from a prior response.
37
45
  #
38
- # Accepted in `messages[].content` and never rendered into the prompt, not
39
- # validated against the request's `fallbacks` chain or top-level `model`, and
40
- # stripped before the sticky-routing cache key is computed.
46
+ # Accepted in `messages[].content` and not rendered into the prompt; not validated
47
+ # against the request's `fallbacks` chain or top-level `model`.
41
48
  #
42
- # Callers should echo the assistant turn verbatim block included. The block's
43
- # position is load-bearing for thinking verification: the thinking runs on either
44
- # side of a fallback hop carry independently-rooted verification hash chains, and
45
- # this block is the only record of where one chain ends and the next begins. When
46
- # thinking runs flank the boundary, omitting the block merges the runs into one
47
- # contiguous span whose hashes cannot verify (the request is rejected), and moving
48
- # it into the middle of a single run splits that run's chain and is likewise
49
- # rejected; between non-thinking blocks the block's placement has no verification
50
- # effect.
49
+ # Echo the assistant turn back verbatim, including this block in its original
50
+ # position. The block marks the boundary between content produced before and after
51
+ # a fallback hop, and the server relies on that boundary to validate the turn:
52
+ # when thinking runs flank the boundary, omitting the block merges them into one
53
+ # span the server cannot validate (the request is rejected), and moving it into
54
+ # the middle of a single run is likewise rejected; between non-thinking blocks the
55
+ # block's placement has no validation effect.
51
56
  sig do
52
57
  params(
53
58
  from: Anthropic::Beta::BetaFallbackInfoParam::OrHash,
54
59
  to: Anthropic::Beta::BetaFallbackInfoParam::OrHash,
60
+ trigger: T.anything,
55
61
  type: Symbol
56
62
  ).returns(T.attached_class)
57
63
  end
@@ -60,6 +66,9 @@ module Anthropic
60
66
  from:,
61
67
  # Identifies one hop of a fallback transition.
62
68
  to:,
69
+ # The response block's `trigger`, echoed verbatim. Accepted and ignored by the
70
+ # server; any object or `null` is allowed.
71
+ trigger: nil,
63
72
  type: :fallback
64
73
  )
65
74
  end
@@ -69,7 +78,8 @@ module Anthropic
69
78
  {
70
79
  from: Anthropic::Beta::BetaFallbackInfoParam,
71
80
  to: Anthropic::Beta::BetaFallbackInfoParam,
72
- type: Symbol
81
+ type: Symbol,
82
+ trigger: T.anything
73
83
  }
74
84
  )
75
85
  end
@@ -0,0 +1,108 @@
1
+ # typed: strong
2
+
3
+ module Anthropic
4
+ module Models
5
+ BetaFallbackRefusalTrigger = Beta::BetaFallbackRefusalTrigger
6
+
7
+ module Beta
8
+ class BetaFallbackRefusalTrigger < Anthropic::Internal::Type::BaseModel
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(
12
+ Anthropic::Beta::BetaFallbackRefusalTrigger,
13
+ Anthropic::Internal::AnyHash
14
+ )
15
+ end
16
+
17
+ # The policy category that triggered a refusal.
18
+ sig do
19
+ returns(
20
+ T.nilable(
21
+ Anthropic::Beta::BetaFallbackRefusalTrigger::Category::TaggedSymbol
22
+ )
23
+ )
24
+ end
25
+ attr_accessor :category
26
+
27
+ sig { returns(Symbol) }
28
+ attr_accessor :type
29
+
30
+ # The `from` model declined for policy reasons.
31
+ sig do
32
+ params(
33
+ category:
34
+ T.nilable(
35
+ Anthropic::Beta::BetaFallbackRefusalTrigger::Category::OrSymbol
36
+ ),
37
+ type: Symbol
38
+ ).returns(T.attached_class)
39
+ end
40
+ def self.new(
41
+ # The policy category that triggered a refusal.
42
+ category:,
43
+ type: :refusal
44
+ )
45
+ end
46
+
47
+ sig do
48
+ override.returns(
49
+ {
50
+ category:
51
+ T.nilable(
52
+ Anthropic::Beta::BetaFallbackRefusalTrigger::Category::TaggedSymbol
53
+ ),
54
+ type: Symbol
55
+ }
56
+ )
57
+ end
58
+ def to_hash
59
+ end
60
+
61
+ # The policy category that triggered a refusal.
62
+ module Category
63
+ extend Anthropic::Internal::Type::Enum
64
+
65
+ TaggedSymbol =
66
+ T.type_alias do
67
+ T.all(
68
+ Symbol,
69
+ Anthropic::Beta::BetaFallbackRefusalTrigger::Category
70
+ )
71
+ end
72
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
73
+
74
+ CYBER =
75
+ T.let(
76
+ :cyber,
77
+ Anthropic::Beta::BetaFallbackRefusalTrigger::Category::TaggedSymbol
78
+ )
79
+ BIO =
80
+ T.let(
81
+ :bio,
82
+ Anthropic::Beta::BetaFallbackRefusalTrigger::Category::TaggedSymbol
83
+ )
84
+ FRONTIER_LLM =
85
+ T.let(
86
+ :frontier_llm,
87
+ Anthropic::Beta::BetaFallbackRefusalTrigger::Category::TaggedSymbol
88
+ )
89
+ REASONING_EXTRACTION =
90
+ T.let(
91
+ :reasoning_extraction,
92
+ Anthropic::Beta::BetaFallbackRefusalTrigger::Category::TaggedSymbol
93
+ )
94
+
95
+ sig do
96
+ override.returns(
97
+ T::Array[
98
+ Anthropic::Beta::BetaFallbackRefusalTrigger::Category::TaggedSymbol
99
+ ]
100
+ )
101
+ end
102
+ def self.values
103
+ end
104
+ end
105
+ end
106
+ end
107
+ end
108
+ end
@@ -137,7 +137,8 @@ module Anthropic
137
137
  # Values: direct: The model can call this tool directly. code_execution_20250825:
138
138
  # The tool can be called from the code execution environment (v1).
139
139
  # code_execution_20260120: The tool can be called from the code execution
140
- # environment (v2 with persistence).
140
+ # environment (v2 with persistence). code_execution_20260521: The tool can be
141
+ # called from the code execution environment (v2 with persistence).
141
142
  module AllowedCaller
142
143
  extend Anthropic::Internal::Type::Enum
143
144
 
@@ -165,6 +166,11 @@ module Anthropic
165
166
  :code_execution_20260120,
166
167
  Anthropic::Beta::BetaMemoryTool20250818::AllowedCaller::TaggedSymbol
167
168
  )
169
+ CODE_EXECUTION_20260521 =
170
+ T.let(
171
+ :code_execution_20260521,
172
+ Anthropic::Beta::BetaMemoryTool20250818::AllowedCaller::TaggedSymbol
173
+ )
168
174
 
169
175
  sig do
170
176
  override.returns(
@@ -14,9 +14,7 @@ module Anthropic
14
14
  )
15
15
  end
16
16
 
17
- # The policy category that triggered the refusal.
18
- #
19
- # `null` when the refusal doesn't map to a named category.
17
+ # The policy category that triggered a refusal.
20
18
  sig do
21
19
  returns(
22
20
  T.nilable(
@@ -101,9 +99,7 @@ module Anthropic
101
99
  ).returns(T.attached_class)
102
100
  end
103
101
  def self.new(
104
- # The policy category that triggered the refusal.
105
- #
106
- # `null` when the refusal doesn't map to a named category.
102
+ # The policy category that triggered a refusal.
107
103
  category:,
108
104
  # Human-readable explanation of the refusal.
109
105
  #
@@ -176,9 +172,7 @@ module Anthropic
176
172
  def to_hash
177
173
  end
178
174
 
179
- # The policy category that triggered the refusal.
180
- #
181
- # `null` when the refusal doesn't map to a named category.
175
+ # The policy category that triggered a refusal.
182
176
  module Category
183
177
  extend Anthropic::Internal::Type::Enum
184
178
 
@@ -229,7 +229,8 @@ module Anthropic
229
229
  # Values: direct: The model can call this tool directly. code_execution_20250825:
230
230
  # The tool can be called from the code execution environment (v1).
231
231
  # code_execution_20260120: The tool can be called from the code execution
232
- # environment (v2 with persistence).
232
+ # environment (v2 with persistence). code_execution_20260521: The tool can be
233
+ # called from the code execution environment (v2 with persistence).
233
234
  module AllowedCaller
234
235
  extend Anthropic::Internal::Type::Enum
235
236
 
@@ -254,6 +255,11 @@ module Anthropic
254
255
  :code_execution_20260120,
255
256
  Anthropic::Beta::BetaTool::AllowedCaller::TaggedSymbol
256
257
  )
258
+ CODE_EXECUTION_20260521 =
259
+ T.let(
260
+ :code_execution_20260521,
261
+ Anthropic::Beta::BetaTool::AllowedCaller::TaggedSymbol
262
+ )
257
263
 
258
264
  sig do
259
265
  override.returns(
@@ -137,7 +137,8 @@ module Anthropic
137
137
  # Values: direct: The model can call this tool directly. code_execution_20250825:
138
138
  # The tool can be called from the code execution environment (v1).
139
139
  # code_execution_20260120: The tool can be called from the code execution
140
- # environment (v2 with persistence).
140
+ # environment (v2 with persistence). code_execution_20260521: The tool can be
141
+ # called from the code execution environment (v2 with persistence).
141
142
  module AllowedCaller
142
143
  extend Anthropic::Internal::Type::Enum
143
144
 
@@ -165,6 +166,11 @@ module Anthropic
165
166
  :code_execution_20260120,
166
167
  Anthropic::Beta::BetaToolBash20241022::AllowedCaller::TaggedSymbol
167
168
  )
169
+ CODE_EXECUTION_20260521 =
170
+ T.let(
171
+ :code_execution_20260521,
172
+ Anthropic::Beta::BetaToolBash20241022::AllowedCaller::TaggedSymbol
173
+ )
168
174
 
169
175
  sig do
170
176
  override.returns(
@@ -137,7 +137,8 @@ module Anthropic
137
137
  # Values: direct: The model can call this tool directly. code_execution_20250825:
138
138
  # The tool can be called from the code execution environment (v1).
139
139
  # code_execution_20260120: The tool can be called from the code execution
140
- # environment (v2 with persistence).
140
+ # environment (v2 with persistence). code_execution_20260521: The tool can be
141
+ # called from the code execution environment (v2 with persistence).
141
142
  module AllowedCaller
142
143
  extend Anthropic::Internal::Type::Enum
143
144
 
@@ -165,6 +166,11 @@ module Anthropic
165
166
  :code_execution_20260120,
166
167
  Anthropic::Beta::BetaToolBash20250124::AllowedCaller::TaggedSymbol
167
168
  )
169
+ CODE_EXECUTION_20260521 =
170
+ T.let(
171
+ :code_execution_20260521,
172
+ Anthropic::Beta::BetaToolBash20250124::AllowedCaller::TaggedSymbol
173
+ )
168
174
 
169
175
  sig do
170
176
  override.returns(
@@ -161,7 +161,8 @@ module Anthropic
161
161
  # Values: direct: The model can call this tool directly. code_execution_20250825:
162
162
  # The tool can be called from the code execution environment (v1).
163
163
  # code_execution_20260120: The tool can be called from the code execution
164
- # environment (v2 with persistence).
164
+ # environment (v2 with persistence). code_execution_20260521: The tool can be
165
+ # called from the code execution environment (v2 with persistence).
165
166
  module AllowedCaller
166
167
  extend Anthropic::Internal::Type::Enum
167
168
 
@@ -189,6 +190,11 @@ module Anthropic
189
190
  :code_execution_20260120,
190
191
  Anthropic::Beta::BetaToolComputerUse20241022::AllowedCaller::TaggedSymbol
191
192
  )
193
+ CODE_EXECUTION_20260521 =
194
+ T.let(
195
+ :code_execution_20260521,
196
+ Anthropic::Beta::BetaToolComputerUse20241022::AllowedCaller::TaggedSymbol
197
+ )
192
198
 
193
199
  sig do
194
200
  override.returns(
@@ -161,7 +161,8 @@ module Anthropic
161
161
  # Values: direct: The model can call this tool directly. code_execution_20250825:
162
162
  # The tool can be called from the code execution environment (v1).
163
163
  # code_execution_20260120: The tool can be called from the code execution
164
- # environment (v2 with persistence).
164
+ # environment (v2 with persistence). code_execution_20260521: The tool can be
165
+ # called from the code execution environment (v2 with persistence).
165
166
  module AllowedCaller
166
167
  extend Anthropic::Internal::Type::Enum
167
168
 
@@ -189,6 +190,11 @@ module Anthropic
189
190
  :code_execution_20260120,
190
191
  Anthropic::Beta::BetaToolComputerUse20250124::AllowedCaller::TaggedSymbol
191
192
  )
193
+ CODE_EXECUTION_20260521 =
194
+ T.let(
195
+ :code_execution_20260521,
196
+ Anthropic::Beta::BetaToolComputerUse20250124::AllowedCaller::TaggedSymbol
197
+ )
192
198
 
193
199
  sig do
194
200
  override.returns(
@@ -172,7 +172,8 @@ module Anthropic
172
172
  # Values: direct: The model can call this tool directly. code_execution_20250825:
173
173
  # The tool can be called from the code execution environment (v1).
174
174
  # code_execution_20260120: The tool can be called from the code execution
175
- # environment (v2 with persistence).
175
+ # environment (v2 with persistence). code_execution_20260521: The tool can be
176
+ # called from the code execution environment (v2 with persistence).
176
177
  module AllowedCaller
177
178
  extend Anthropic::Internal::Type::Enum
178
179
 
@@ -200,6 +201,11 @@ module Anthropic
200
201
  :code_execution_20260120,
201
202
  Anthropic::Beta::BetaToolComputerUse20251124::AllowedCaller::TaggedSymbol
202
203
  )
204
+ CODE_EXECUTION_20260521 =
205
+ T.let(
206
+ :code_execution_20260521,
207
+ Anthropic::Beta::BetaToolComputerUse20251124::AllowedCaller::TaggedSymbol
208
+ )
203
209
 
204
210
  sig do
205
211
  override.returns(
@@ -166,7 +166,8 @@ module Anthropic
166
166
  # Values: direct: The model can call this tool directly. code_execution_20250825:
167
167
  # The tool can be called from the code execution environment (v1).
168
168
  # code_execution_20260120: The tool can be called from the code execution
169
- # environment (v2 with persistence).
169
+ # environment (v2 with persistence). code_execution_20260521: The tool can be
170
+ # called from the code execution environment (v2 with persistence).
170
171
  module AllowedCaller
171
172
  extend Anthropic::Internal::Type::Enum
172
173
 
@@ -194,6 +195,11 @@ module Anthropic
194
195
  :code_execution_20260120,
195
196
  Anthropic::Beta::BetaToolSearchToolBm25_20251119::AllowedCaller::TaggedSymbol
196
197
  )
198
+ CODE_EXECUTION_20260521 =
199
+ T.let(
200
+ :code_execution_20260521,
201
+ Anthropic::Beta::BetaToolSearchToolBm25_20251119::AllowedCaller::TaggedSymbol
202
+ )
197
203
 
198
204
  sig do
199
205
  override.returns(
@@ -166,7 +166,8 @@ module Anthropic
166
166
  # Values: direct: The model can call this tool directly. code_execution_20250825:
167
167
  # The tool can be called from the code execution environment (v1).
168
168
  # code_execution_20260120: The tool can be called from the code execution
169
- # environment (v2 with persistence).
169
+ # environment (v2 with persistence). code_execution_20260521: The tool can be
170
+ # called from the code execution environment (v2 with persistence).
170
171
  module AllowedCaller
171
172
  extend Anthropic::Internal::Type::Enum
172
173
 
@@ -194,6 +195,11 @@ module Anthropic
194
195
  :code_execution_20260120,
195
196
  Anthropic::Beta::BetaToolSearchToolRegex20251119::AllowedCaller::TaggedSymbol
196
197
  )
198
+ CODE_EXECUTION_20260521 =
199
+ T.let(
200
+ :code_execution_20260521,
201
+ Anthropic::Beta::BetaToolSearchToolRegex20251119::AllowedCaller::TaggedSymbol
202
+ )
197
203
 
198
204
  sig do
199
205
  override.returns(
@@ -137,7 +137,8 @@ module Anthropic
137
137
  # Values: direct: The model can call this tool directly. code_execution_20250825:
138
138
  # The tool can be called from the code execution environment (v1).
139
139
  # code_execution_20260120: The tool can be called from the code execution
140
- # environment (v2 with persistence).
140
+ # environment (v2 with persistence). code_execution_20260521: The tool can be
141
+ # called from the code execution environment (v2 with persistence).
141
142
  module AllowedCaller
142
143
  extend Anthropic::Internal::Type::Enum
143
144
 
@@ -165,6 +166,11 @@ module Anthropic
165
166
  :code_execution_20260120,
166
167
  Anthropic::Beta::BetaToolTextEditor20241022::AllowedCaller::TaggedSymbol
167
168
  )
169
+ CODE_EXECUTION_20260521 =
170
+ T.let(
171
+ :code_execution_20260521,
172
+ Anthropic::Beta::BetaToolTextEditor20241022::AllowedCaller::TaggedSymbol
173
+ )
168
174
 
169
175
  sig do
170
176
  override.returns(
@@ -137,7 +137,8 @@ module Anthropic
137
137
  # Values: direct: The model can call this tool directly. code_execution_20250825:
138
138
  # The tool can be called from the code execution environment (v1).
139
139
  # code_execution_20260120: The tool can be called from the code execution
140
- # environment (v2 with persistence).
140
+ # environment (v2 with persistence). code_execution_20260521: The tool can be
141
+ # called from the code execution environment (v2 with persistence).
141
142
  module AllowedCaller
142
143
  extend Anthropic::Internal::Type::Enum
143
144
 
@@ -165,6 +166,11 @@ module Anthropic
165
166
  :code_execution_20260120,
166
167
  Anthropic::Beta::BetaToolTextEditor20250124::AllowedCaller::TaggedSymbol
167
168
  )
169
+ CODE_EXECUTION_20260521 =
170
+ T.let(
171
+ :code_execution_20260521,
172
+ Anthropic::Beta::BetaToolTextEditor20250124::AllowedCaller::TaggedSymbol
173
+ )
168
174
 
169
175
  sig do
170
176
  override.returns(
@@ -137,7 +137,8 @@ module Anthropic
137
137
  # Values: direct: The model can call this tool directly. code_execution_20250825:
138
138
  # The tool can be called from the code execution environment (v1).
139
139
  # code_execution_20260120: The tool can be called from the code execution
140
- # environment (v2 with persistence).
140
+ # environment (v2 with persistence). code_execution_20260521: The tool can be
141
+ # called from the code execution environment (v2 with persistence).
141
142
  module AllowedCaller
142
143
  extend Anthropic::Internal::Type::Enum
143
144
 
@@ -165,6 +166,11 @@ module Anthropic
165
166
  :code_execution_20260120,
166
167
  Anthropic::Beta::BetaToolTextEditor20250429::AllowedCaller::TaggedSymbol
167
168
  )
169
+ CODE_EXECUTION_20260521 =
170
+ T.let(
171
+ :code_execution_20260521,
172
+ Anthropic::Beta::BetaToolTextEditor20250429::AllowedCaller::TaggedSymbol
173
+ )
168
174
 
169
175
  sig do
170
176
  override.returns(
@@ -147,7 +147,8 @@ module Anthropic
147
147
  # Values: direct: The model can call this tool directly. code_execution_20250825:
148
148
  # The tool can be called from the code execution environment (v1).
149
149
  # code_execution_20260120: The tool can be called from the code execution
150
- # environment (v2 with persistence).
150
+ # environment (v2 with persistence). code_execution_20260521: The tool can be
151
+ # called from the code execution environment (v2 with persistence).
151
152
  module AllowedCaller
152
153
  extend Anthropic::Internal::Type::Enum
153
154
 
@@ -175,6 +176,11 @@ module Anthropic
175
176
  :code_execution_20260120,
176
177
  Anthropic::Beta::BetaToolTextEditor20250728::AllowedCaller::TaggedSymbol
177
178
  )
179
+ CODE_EXECUTION_20260521 =
180
+ T.let(
181
+ :code_execution_20260521,
182
+ Anthropic::Beta::BetaToolTextEditor20250728::AllowedCaller::TaggedSymbol
183
+ )
178
184
 
179
185
  sig do
180
186
  override.returns(
@@ -19,6 +19,7 @@ module Anthropic
19
19
  Anthropic::Beta::BetaCodeExecutionTool20250522,
20
20
  Anthropic::Beta::BetaCodeExecutionTool20250825,
21
21
  Anthropic::Beta::BetaCodeExecutionTool20260120,
22
+ Anthropic::Beta::BetaCodeExecutionTool20260521,
22
23
  Anthropic::Beta::BetaToolComputerUse20241022,
23
24
  Anthropic::Beta::BetaMemoryTool20250818,
24
25
  Anthropic::Beta::BetaToolComputerUse20250124,
@@ -179,7 +179,8 @@ module Anthropic
179
179
  # Values: direct: The model can call this tool directly. code_execution_20250825:
180
180
  # The tool can be called from the code execution environment (v1).
181
181
  # code_execution_20260120: The tool can be called from the code execution
182
- # environment (v2 with persistence).
182
+ # environment (v2 with persistence). code_execution_20260521: The tool can be
183
+ # called from the code execution environment (v2 with persistence).
183
184
  module AllowedCaller
184
185
  extend Anthropic::Internal::Type::Enum
185
186
 
@@ -207,6 +208,11 @@ module Anthropic
207
208
  :code_execution_20260120,
208
209
  Anthropic::Beta::BetaWebFetchTool20250910::AllowedCaller::TaggedSymbol
209
210
  )
211
+ CODE_EXECUTION_20260521 =
212
+ T.let(
213
+ :code_execution_20260521,
214
+ Anthropic::Beta::BetaWebFetchTool20250910::AllowedCaller::TaggedSymbol
215
+ )
210
216
 
211
217
  sig do
212
218
  override.returns(
@@ -179,7 +179,8 @@ module Anthropic
179
179
  # Values: direct: The model can call this tool directly. code_execution_20250825:
180
180
  # The tool can be called from the code execution environment (v1).
181
181
  # code_execution_20260120: The tool can be called from the code execution
182
- # environment (v2 with persistence).
182
+ # environment (v2 with persistence). code_execution_20260521: The tool can be
183
+ # called from the code execution environment (v2 with persistence).
183
184
  module AllowedCaller
184
185
  extend Anthropic::Internal::Type::Enum
185
186
 
@@ -207,6 +208,11 @@ module Anthropic
207
208
  :code_execution_20260120,
208
209
  Anthropic::Beta::BetaWebFetchTool20260209::AllowedCaller::TaggedSymbol
209
210
  )
211
+ CODE_EXECUTION_20260521 =
212
+ T.let(
213
+ :code_execution_20260521,
214
+ Anthropic::Beta::BetaWebFetchTool20260209::AllowedCaller::TaggedSymbol
215
+ )
210
216
 
211
217
  sig do
212
218
  override.returns(
@@ -195,7 +195,8 @@ module Anthropic
195
195
  # Values: direct: The model can call this tool directly. code_execution_20250825:
196
196
  # The tool can be called from the code execution environment (v1).
197
197
  # code_execution_20260120: The tool can be called from the code execution
198
- # environment (v2 with persistence).
198
+ # environment (v2 with persistence). code_execution_20260521: The tool can be
199
+ # called from the code execution environment (v2 with persistence).
199
200
  module AllowedCaller
200
201
  extend Anthropic::Internal::Type::Enum
201
202
 
@@ -223,6 +224,11 @@ module Anthropic
223
224
  :code_execution_20260120,
224
225
  Anthropic::Beta::BetaWebFetchTool20260309::AllowedCaller::TaggedSymbol
225
226
  )
227
+ CODE_EXECUTION_20260521 =
228
+ T.let(
229
+ :code_execution_20260521,
230
+ Anthropic::Beta::BetaWebFetchTool20260309::AllowedCaller::TaggedSymbol
231
+ )
226
232
 
227
233
  sig do
228
234
  override.returns(
@@ -171,7 +171,8 @@ module Anthropic
171
171
  # Values: direct: The model can call this tool directly. code_execution_20250825:
172
172
  # The tool can be called from the code execution environment (v1).
173
173
  # code_execution_20260120: The tool can be called from the code execution
174
- # environment (v2 with persistence).
174
+ # environment (v2 with persistence). code_execution_20260521: The tool can be
175
+ # called from the code execution environment (v2 with persistence).
175
176
  module AllowedCaller
176
177
  extend Anthropic::Internal::Type::Enum
177
178
 
@@ -199,6 +200,11 @@ module Anthropic
199
200
  :code_execution_20260120,
200
201
  Anthropic::Beta::BetaWebSearchTool20250305::AllowedCaller::TaggedSymbol
201
202
  )
203
+ CODE_EXECUTION_20260521 =
204
+ T.let(
205
+ :code_execution_20260521,
206
+ Anthropic::Beta::BetaWebSearchTool20250305::AllowedCaller::TaggedSymbol
207
+ )
202
208
 
203
209
  sig do
204
210
  override.returns(
@@ -171,7 +171,8 @@ module Anthropic
171
171
  # Values: direct: The model can call this tool directly. code_execution_20250825:
172
172
  # The tool can be called from the code execution environment (v1).
173
173
  # code_execution_20260120: The tool can be called from the code execution
174
- # environment (v2 with persistence).
174
+ # environment (v2 with persistence). code_execution_20260521: The tool can be
175
+ # called from the code execution environment (v2 with persistence).
175
176
  module AllowedCaller
176
177
  extend Anthropic::Internal::Type::Enum
177
178
 
@@ -199,6 +200,11 @@ module Anthropic
199
200
  :code_execution_20260120,
200
201
  Anthropic::Beta::BetaWebSearchTool20260209::AllowedCaller::TaggedSymbol
201
202
  )
203
+ CODE_EXECUTION_20260521 =
204
+ T.let(
205
+ :code_execution_20260521,
206
+ Anthropic::Beta::BetaWebSearchTool20260209::AllowedCaller::TaggedSymbol
207
+ )
202
208
 
203
209
  sig do
204
210
  override.returns(
@@ -46,7 +46,8 @@ module Anthropic
46
46
  Anthropic::Beta::BetaWebhookVaultCredentialCreatedEventData,
47
47
  Anthropic::Beta::BetaWebhookVaultCredentialArchivedEventData,
48
48
  Anthropic::Beta::BetaWebhookVaultCredentialDeletedEventData,
49
- Anthropic::Beta::BetaWebhookVaultCredentialRefreshFailedEventData
49
+ Anthropic::Beta::BetaWebhookVaultCredentialRefreshFailedEventData,
50
+ Anthropic::Beta::BetaWebhookSessionUpdatedEventData
50
51
  )
51
52
  )
52
53
  end
@@ -83,7 +84,8 @@ module Anthropic
83
84
  Anthropic::Beta::BetaWebhookVaultCredentialCreatedEventData::OrHash,
84
85
  Anthropic::Beta::BetaWebhookVaultCredentialArchivedEventData::OrHash,
85
86
  Anthropic::Beta::BetaWebhookVaultCredentialDeletedEventData::OrHash,
86
- Anthropic::Beta::BetaWebhookVaultCredentialRefreshFailedEventData::OrHash
87
+ Anthropic::Beta::BetaWebhookVaultCredentialRefreshFailedEventData::OrHash,
88
+ Anthropic::Beta::BetaWebhookSessionUpdatedEventData::OrHash
87
89
  ),
88
90
  type: Symbol
89
91
  ).returns(T.attached_class)
@@ -127,7 +129,8 @@ module Anthropic
127
129
  Anthropic::Beta::BetaWebhookVaultCredentialCreatedEventData,
128
130
  Anthropic::Beta::BetaWebhookVaultCredentialArchivedEventData,
129
131
  Anthropic::Beta::BetaWebhookVaultCredentialDeletedEventData,
130
- Anthropic::Beta::BetaWebhookVaultCredentialRefreshFailedEventData
132
+ Anthropic::Beta::BetaWebhookVaultCredentialRefreshFailedEventData,
133
+ Anthropic::Beta::BetaWebhookSessionUpdatedEventData
131
134
  ),
132
135
  type: Symbol
133
136
  }
@@ -32,7 +32,8 @@ module Anthropic
32
32
  Anthropic::Beta::BetaWebhookVaultCredentialCreatedEventData,
33
33
  Anthropic::Beta::BetaWebhookVaultCredentialArchivedEventData,
34
34
  Anthropic::Beta::BetaWebhookVaultCredentialDeletedEventData,
35
- Anthropic::Beta::BetaWebhookVaultCredentialRefreshFailedEventData
35
+ Anthropic::Beta::BetaWebhookVaultCredentialRefreshFailedEventData,
36
+ Anthropic::Beta::BetaWebhookSessionUpdatedEventData
36
37
  )
37
38
  end
38
39