anthropic 1.15.2 → 1.16.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 (153) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +13 -0
  3. data/README.md +10 -10
  4. data/lib/anthropic/helpers/tools/compaction_control.rb +105 -0
  5. data/lib/anthropic/helpers/tools/runner.rb +126 -13
  6. data/lib/anthropic/models/anthropic_beta.rb +3 -0
  7. data/lib/anthropic/models/beta/beta_code_execution_tool_20250522.rb +28 -1
  8. data/lib/anthropic/models/beta/beta_code_execution_tool_20250825.rb +28 -1
  9. data/lib/anthropic/models/beta/beta_content_block.rb +3 -1
  10. data/lib/anthropic/models/beta/beta_content_block_param.rb +3 -1
  11. data/lib/anthropic/models/beta/beta_direct_caller.rb +21 -0
  12. data/lib/anthropic/models/beta/beta_mcp_tool_config.rb +27 -0
  13. data/lib/anthropic/models/beta/beta_mcp_tool_default_config.rb +27 -0
  14. data/lib/anthropic/models/beta/beta_mcp_toolset.rb +58 -0
  15. data/lib/anthropic/models/beta/beta_memory_tool_20250818.rb +36 -1
  16. data/lib/anthropic/models/beta/beta_message.rb +2 -2
  17. data/lib/anthropic/models/beta/beta_message_param.rb +3 -3
  18. data/lib/anthropic/models/beta/beta_output_config.rb +34 -0
  19. data/lib/anthropic/models/beta/beta_raw_content_block_start_event.rb +5 -3
  20. data/lib/anthropic/models/beta/beta_server_tool_caller.rb +27 -0
  21. data/lib/anthropic/models/beta/beta_server_tool_use_block.rb +32 -1
  22. data/lib/anthropic/models/beta/beta_server_tool_use_block_param.rb +33 -1
  23. data/lib/anthropic/models/beta/beta_tool.rb +36 -1
  24. data/lib/anthropic/models/beta/beta_tool_bash_20241022.rb +36 -1
  25. data/lib/anthropic/models/beta/beta_tool_bash_20250124.rb +36 -1
  26. data/lib/anthropic/models/beta/beta_tool_computer_use_20241022.rb +36 -1
  27. data/lib/anthropic/models/beta/beta_tool_computer_use_20250124.rb +36 -1
  28. data/lib/anthropic/models/beta/beta_tool_computer_use_20251124.rb +114 -0
  29. data/lib/anthropic/models/beta/beta_tool_reference_block.rb +25 -0
  30. data/lib/anthropic/models/beta/beta_tool_reference_block_param.rb +36 -0
  31. data/lib/anthropic/models/beta/beta_tool_result_block_param.rb +8 -4
  32. data/lib/anthropic/models/beta/beta_tool_search_tool_bm25_20251119.rb +85 -0
  33. data/lib/anthropic/models/beta/beta_tool_search_tool_regex_20251119.rb +85 -0
  34. data/lib/anthropic/models/beta/beta_tool_search_tool_result_block.rb +43 -0
  35. data/lib/anthropic/models/beta/beta_tool_search_tool_result_block_param.rb +53 -0
  36. data/lib/anthropic/models/beta/beta_tool_search_tool_result_error.rb +44 -0
  37. data/lib/anthropic/models/beta/beta_tool_search_tool_result_error_param.rb +38 -0
  38. data/lib/anthropic/models/beta/beta_tool_search_tool_search_result_block.rb +26 -0
  39. data/lib/anthropic/models/beta/beta_tool_search_tool_search_result_block_param.rb +26 -0
  40. data/lib/anthropic/models/beta/beta_tool_text_editor_20241022.rb +36 -1
  41. data/lib/anthropic/models/beta/beta_tool_text_editor_20250124.rb +36 -1
  42. data/lib/anthropic/models/beta/beta_tool_text_editor_20250429.rb +36 -1
  43. data/lib/anthropic/models/beta/beta_tool_text_editor_20250728.rb +36 -1
  44. data/lib/anthropic/models/beta/beta_tool_union.rb +17 -1
  45. data/lib/anthropic/models/beta/beta_tool_use_block.rb +30 -1
  46. data/lib/anthropic/models/beta/beta_tool_use_block_param.rb +27 -1
  47. data/lib/anthropic/models/beta/beta_web_fetch_tool_20250910.rb +28 -1
  48. data/lib/anthropic/models/beta/beta_web_search_tool_20250305.rb +28 -1
  49. data/lib/anthropic/models/beta/message_count_tokens_params.rb +29 -4
  50. data/lib/anthropic/models/beta/message_create_params.rb +12 -3
  51. data/lib/anthropic/models/beta/messages/batch_create_params.rb +16 -7
  52. data/lib/anthropic/models/messages/batch_create_params.rb +4 -4
  53. data/lib/anthropic/models/model.rb +10 -0
  54. data/lib/anthropic/resources/beta/messages.rb +26 -11
  55. data/lib/anthropic/resources/messages.rb +8 -2
  56. data/lib/anthropic/version.rb +1 -1
  57. data/lib/anthropic.rb +19 -0
  58. data/manifest.yaml +1 -0
  59. data/rbi/anthropic/models/anthropic_beta.rbi +2 -0
  60. data/rbi/anthropic/models/beta/beta_code_execution_tool_20250522.rbi +77 -0
  61. data/rbi/anthropic/models/beta/beta_code_execution_tool_20250825.rbi +77 -0
  62. data/rbi/anthropic/models/beta/beta_content_block.rbi +1 -0
  63. data/rbi/anthropic/models/beta/beta_content_block_param.rbi +1 -0
  64. data/rbi/anthropic/models/beta/beta_direct_caller.rbi +31 -0
  65. data/rbi/anthropic/models/beta/beta_mcp_tool_config.rbi +46 -0
  66. data/rbi/anthropic/models/beta/beta_mcp_tool_default_config.rbi +46 -0
  67. data/rbi/anthropic/models/beta/beta_mcp_toolset.rbi +100 -0
  68. data/rbi/anthropic/models/beta/beta_memory_tool_20250818.rbi +88 -0
  69. data/rbi/anthropic/models/beta/beta_message.rbi +1 -0
  70. data/rbi/anthropic/models/beta/beta_output_config.rbi +82 -0
  71. data/rbi/anthropic/models/beta/beta_raw_content_block_start_event.rbi +2 -0
  72. data/rbi/anthropic/models/beta/beta_server_tool_caller.rbi +34 -0
  73. data/rbi/anthropic/models/beta/beta_server_tool_use_block.rbi +54 -1
  74. data/rbi/anthropic/models/beta/beta_server_tool_use_block_param.rbi +70 -1
  75. data/rbi/anthropic/models/beta/beta_tool.rbi +75 -0
  76. data/rbi/anthropic/models/beta/beta_tool_bash_20241022.rbi +88 -0
  77. data/rbi/anthropic/models/beta/beta_tool_bash_20250124.rbi +88 -0
  78. data/rbi/anthropic/models/beta/beta_tool_computer_use_20241022.rbi +88 -0
  79. data/rbi/anthropic/models/beta/beta_tool_computer_use_20250124.rbi +88 -0
  80. data/rbi/anthropic/models/beta/beta_tool_computer_use_20251124.rbi +204 -0
  81. data/rbi/anthropic/models/beta/beta_tool_reference_block.rbi +35 -0
  82. data/rbi/anthropic/models/beta/beta_tool_reference_block_param.rbi +67 -0
  83. data/rbi/anthropic/models/beta/beta_tool_result_block_param.rbi +3 -1
  84. data/rbi/anthropic/models/beta/beta_tool_search_tool_bm25_20251119.rbi +198 -0
  85. data/rbi/anthropic/models/beta/beta_tool_search_tool_regex_20251119.rbi +198 -0
  86. data/rbi/anthropic/models/beta/beta_tool_search_tool_result_block.rbi +81 -0
  87. data/rbi/anthropic/models/beta/beta_tool_search_tool_result_block_param.rbi +110 -0
  88. data/rbi/anthropic/models/beta/beta_tool_search_tool_result_error.rbi +104 -0
  89. data/rbi/anthropic/models/beta/beta_tool_search_tool_result_error_param.rbi +96 -0
  90. data/rbi/anthropic/models/beta/beta_tool_search_tool_search_result_block.rbi +48 -0
  91. data/rbi/anthropic/models/beta/beta_tool_search_tool_search_result_block_param.rbi +48 -0
  92. data/rbi/anthropic/models/beta/beta_tool_text_editor_20241022.rbi +88 -0
  93. data/rbi/anthropic/models/beta/beta_tool_text_editor_20250124.rbi +88 -0
  94. data/rbi/anthropic/models/beta/beta_tool_text_editor_20250429.rbi +88 -0
  95. data/rbi/anthropic/models/beta/beta_tool_text_editor_20250728.rbi +88 -0
  96. data/rbi/anthropic/models/beta/beta_tool_union.rbi +9 -1
  97. data/rbi/anthropic/models/beta/beta_tool_use_block.rbi +55 -2
  98. data/rbi/anthropic/models/beta/beta_tool_use_block_param.rbi +58 -1
  99. data/rbi/anthropic/models/beta/beta_web_fetch_tool_20250910.rbi +77 -0
  100. data/rbi/anthropic/models/beta/beta_web_search_tool_20250305.rbi +77 -0
  101. data/rbi/anthropic/models/beta/message_count_tokens_params.rbi +44 -5
  102. data/rbi/anthropic/models/beta/message_create_params.rbi +35 -4
  103. data/rbi/anthropic/models/beta/messages/batch_create_params.rbi +43 -10
  104. data/rbi/anthropic/models/messages/batch_create_params.rbi +6 -6
  105. data/rbi/anthropic/models/model.rbi +8 -0
  106. data/rbi/anthropic/resources/beta/messages.rbi +29 -3
  107. data/sig/anthropic/models/anthropic_beta.rbs +2 -0
  108. data/sig/anthropic/models/beta/beta_code_execution_tool_20250522.rbs +27 -0
  109. data/sig/anthropic/models/beta/beta_code_execution_tool_20250825.rbs +27 -0
  110. data/sig/anthropic/models/beta/beta_content_block.rbs +1 -0
  111. data/sig/anthropic/models/beta/beta_content_block_param.rbs +1 -0
  112. data/sig/anthropic/models/beta/beta_direct_caller.rbs +17 -0
  113. data/sig/anthropic/models/beta/beta_mcp_tool_config.rbs +23 -0
  114. data/sig/anthropic/models/beta/beta_mcp_tool_default_config.rbs +23 -0
  115. data/sig/anthropic/models/beta/beta_mcp_toolset.rbs +48 -0
  116. data/sig/anthropic/models/beta/beta_memory_tool_20250818.rbs +36 -0
  117. data/sig/anthropic/models/beta/beta_output_config.rbs +34 -0
  118. data/sig/anthropic/models/beta/beta_raw_content_block_start_event.rbs +1 -0
  119. data/sig/anthropic/models/beta/beta_server_tool_caller.rbs +23 -0
  120. data/sig/anthropic/models/beta/beta_server_tool_use_block.rbs +19 -0
  121. data/sig/anthropic/models/beta/beta_server_tool_use_block_param.rbs +25 -2
  122. data/sig/anthropic/models/beta/beta_tool.rbs +36 -0
  123. data/sig/anthropic/models/beta/beta_tool_bash_20241022.rbs +36 -0
  124. data/sig/anthropic/models/beta/beta_tool_bash_20250124.rbs +36 -0
  125. data/sig/anthropic/models/beta/beta_tool_computer_use_20241022.rbs +36 -0
  126. data/sig/anthropic/models/beta/beta_tool_computer_use_20250124.rbs +36 -0
  127. data/sig/anthropic/models/beta/beta_tool_computer_use_20251124.rbs +99 -0
  128. data/sig/anthropic/models/beta/beta_tool_reference_block.rbs +20 -0
  129. data/sig/anthropic/models/beta/beta_tool_reference_block_param.rbs +34 -0
  130. data/sig/anthropic/models/beta/beta_tool_result_block_param.rbs +1 -0
  131. data/sig/anthropic/models/beta/beta_tool_search_tool_bm25_20251119.rbs +79 -0
  132. data/sig/anthropic/models/beta/beta_tool_search_tool_regex_20251119.rbs +79 -0
  133. data/sig/anthropic/models/beta/beta_tool_search_tool_result_block.rbs +44 -0
  134. data/sig/anthropic/models/beta/beta_tool_search_tool_result_block_param.rbs +49 -0
  135. data/sig/anthropic/models/beta/beta_tool_search_tool_result_error.rbs +51 -0
  136. data/sig/anthropic/models/beta/beta_tool_search_tool_result_error_param.rbs +46 -0
  137. data/sig/anthropic/models/beta/beta_tool_search_tool_search_result_block.rbs +29 -0
  138. data/sig/anthropic/models/beta/beta_tool_search_tool_search_result_block_param.rbs +29 -0
  139. data/sig/anthropic/models/beta/beta_tool_text_editor_20241022.rbs +36 -0
  140. data/sig/anthropic/models/beta/beta_tool_text_editor_20250124.rbs +36 -0
  141. data/sig/anthropic/models/beta/beta_tool_text_editor_20250429.rbs +36 -0
  142. data/sig/anthropic/models/beta/beta_tool_text_editor_20250728.rbs +36 -0
  143. data/sig/anthropic/models/beta/beta_tool_union.rbs +4 -0
  144. data/sig/anthropic/models/beta/beta_tool_use_block.rbs +21 -2
  145. data/sig/anthropic/models/beta/beta_tool_use_block_param.rbs +21 -2
  146. data/sig/anthropic/models/beta/beta_web_fetch_tool_20250910.rbs +27 -0
  147. data/sig/anthropic/models/beta/beta_web_search_tool_20250305.rbs +27 -0
  148. data/sig/anthropic/models/beta/message_count_tokens_params.rbs +13 -0
  149. data/sig/anthropic/models/beta/message_create_params.rbs +9 -0
  150. data/sig/anthropic/models/beta/messages/batch_create_params.rbs +9 -0
  151. data/sig/anthropic/models/model.rbs +9 -1
  152. data/sig/anthropic/resources/beta/messages.rbs +3 -0
  153. metadata +54 -2
@@ -0,0 +1,29 @@
1
+ module Anthropic
2
+ module Models
3
+ class BetaToolSearchToolSearchResultBlock = Beta::BetaToolSearchToolSearchResultBlock
4
+
5
+ module Beta
6
+ type beta_tool_search_tool_search_result_block =
7
+ {
8
+ tool_references: ::Array[Anthropic::Beta::BetaToolReferenceBlock],
9
+ type: :tool_search_tool_search_result
10
+ }
11
+
12
+ class BetaToolSearchToolSearchResultBlock < Anthropic::Internal::Type::BaseModel
13
+ attr_accessor tool_references: ::Array[Anthropic::Beta::BetaToolReferenceBlock]
14
+
15
+ attr_accessor type: :tool_search_tool_search_result
16
+
17
+ def initialize: (
18
+ tool_references: ::Array[Anthropic::Beta::BetaToolReferenceBlock],
19
+ ?type: :tool_search_tool_search_result
20
+ ) -> void
21
+
22
+ def to_hash: -> {
23
+ tool_references: ::Array[Anthropic::Beta::BetaToolReferenceBlock],
24
+ type: :tool_search_tool_search_result
25
+ }
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,29 @@
1
+ module Anthropic
2
+ module Models
3
+ class BetaToolSearchToolSearchResultBlockParam = Beta::BetaToolSearchToolSearchResultBlockParam
4
+
5
+ module Beta
6
+ type beta_tool_search_tool_search_result_block_param =
7
+ {
8
+ tool_references: ::Array[Anthropic::Beta::BetaToolReferenceBlockParam],
9
+ type: :tool_search_tool_search_result
10
+ }
11
+
12
+ class BetaToolSearchToolSearchResultBlockParam < Anthropic::Internal::Type::BaseModel
13
+ attr_accessor tool_references: ::Array[Anthropic::Beta::BetaToolReferenceBlockParam]
14
+
15
+ attr_accessor type: :tool_search_tool_search_result
16
+
17
+ def initialize: (
18
+ tool_references: ::Array[Anthropic::Beta::BetaToolReferenceBlockParam],
19
+ ?type: :tool_search_tool_search_result
20
+ ) -> void
21
+
22
+ def to_hash: -> {
23
+ tool_references: ::Array[Anthropic::Beta::BetaToolReferenceBlockParam],
24
+ type: :tool_search_tool_search_result
25
+ }
26
+ end
27
+ end
28
+ end
29
+ end
@@ -7,7 +7,10 @@ module Anthropic
7
7
  {
8
8
  name: :str_replace_editor,
9
9
  type: :text_editor_20241022,
10
+ allowed_callers: ::Array[Anthropic::Models::Beta::BetaToolTextEditor20241022::allowed_caller],
10
11
  cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
12
+ defer_loading: bool,
13
+ input_examples: ::Array[::Hash[Symbol, top]],
11
14
  strict: bool
12
15
  }
13
16
 
@@ -16,14 +19,33 @@ module Anthropic
16
19
 
17
20
  attr_accessor type: :text_editor_20241022
18
21
 
22
+ attr_reader allowed_callers: ::Array[Anthropic::Models::Beta::BetaToolTextEditor20241022::allowed_caller]?
23
+
24
+ def allowed_callers=: (
25
+ ::Array[Anthropic::Models::Beta::BetaToolTextEditor20241022::allowed_caller]
26
+ ) -> ::Array[Anthropic::Models::Beta::BetaToolTextEditor20241022::allowed_caller]
27
+
19
28
  attr_accessor cache_control: Anthropic::Beta::BetaCacheControlEphemeral?
20
29
 
30
+ attr_reader defer_loading: bool?
31
+
32
+ def defer_loading=: (bool) -> bool
33
+
34
+ attr_reader input_examples: ::Array[::Hash[Symbol, top]]?
35
+
36
+ def input_examples=: (
37
+ ::Array[::Hash[Symbol, top]]
38
+ ) -> ::Array[::Hash[Symbol, top]]
39
+
21
40
  attr_reader strict: bool?
22
41
 
23
42
  def strict=: (bool) -> bool
24
43
 
25
44
  def initialize: (
45
+ ?allowed_callers: ::Array[Anthropic::Models::Beta::BetaToolTextEditor20241022::allowed_caller],
26
46
  ?cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
47
+ ?defer_loading: bool,
48
+ ?input_examples: ::Array[::Hash[Symbol, top]],
27
49
  ?strict: bool,
28
50
  ?name: :str_replace_editor,
29
51
  ?type: :text_editor_20241022
@@ -32,9 +54,23 @@ module Anthropic
32
54
  def to_hash: -> {
33
55
  name: :str_replace_editor,
34
56
  type: :text_editor_20241022,
57
+ allowed_callers: ::Array[Anthropic::Models::Beta::BetaToolTextEditor20241022::allowed_caller],
35
58
  cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
59
+ defer_loading: bool,
60
+ input_examples: ::Array[::Hash[Symbol, top]],
36
61
  strict: bool
37
62
  }
63
+
64
+ type allowed_caller = :direct | :code_execution_20250825
65
+
66
+ module AllowedCaller
67
+ extend Anthropic::Internal::Type::Enum
68
+
69
+ DIRECT: :direct
70
+ CODE_EXECUTION_20250825: :code_execution_20250825
71
+
72
+ def self?.values: -> ::Array[Anthropic::Models::Beta::BetaToolTextEditor20241022::allowed_caller]
73
+ end
38
74
  end
39
75
  end
40
76
  end
@@ -7,7 +7,10 @@ module Anthropic
7
7
  {
8
8
  name: :str_replace_editor,
9
9
  type: :text_editor_20250124,
10
+ allowed_callers: ::Array[Anthropic::Models::Beta::BetaToolTextEditor20250124::allowed_caller],
10
11
  cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
12
+ defer_loading: bool,
13
+ input_examples: ::Array[::Hash[Symbol, top]],
11
14
  strict: bool
12
15
  }
13
16
 
@@ -16,14 +19,33 @@ module Anthropic
16
19
 
17
20
  attr_accessor type: :text_editor_20250124
18
21
 
22
+ attr_reader allowed_callers: ::Array[Anthropic::Models::Beta::BetaToolTextEditor20250124::allowed_caller]?
23
+
24
+ def allowed_callers=: (
25
+ ::Array[Anthropic::Models::Beta::BetaToolTextEditor20250124::allowed_caller]
26
+ ) -> ::Array[Anthropic::Models::Beta::BetaToolTextEditor20250124::allowed_caller]
27
+
19
28
  attr_accessor cache_control: Anthropic::Beta::BetaCacheControlEphemeral?
20
29
 
30
+ attr_reader defer_loading: bool?
31
+
32
+ def defer_loading=: (bool) -> bool
33
+
34
+ attr_reader input_examples: ::Array[::Hash[Symbol, top]]?
35
+
36
+ def input_examples=: (
37
+ ::Array[::Hash[Symbol, top]]
38
+ ) -> ::Array[::Hash[Symbol, top]]
39
+
21
40
  attr_reader strict: bool?
22
41
 
23
42
  def strict=: (bool) -> bool
24
43
 
25
44
  def initialize: (
45
+ ?allowed_callers: ::Array[Anthropic::Models::Beta::BetaToolTextEditor20250124::allowed_caller],
26
46
  ?cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
47
+ ?defer_loading: bool,
48
+ ?input_examples: ::Array[::Hash[Symbol, top]],
27
49
  ?strict: bool,
28
50
  ?name: :str_replace_editor,
29
51
  ?type: :text_editor_20250124
@@ -32,9 +54,23 @@ module Anthropic
32
54
  def to_hash: -> {
33
55
  name: :str_replace_editor,
34
56
  type: :text_editor_20250124,
57
+ allowed_callers: ::Array[Anthropic::Models::Beta::BetaToolTextEditor20250124::allowed_caller],
35
58
  cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
59
+ defer_loading: bool,
60
+ input_examples: ::Array[::Hash[Symbol, top]],
36
61
  strict: bool
37
62
  }
63
+
64
+ type allowed_caller = :direct | :code_execution_20250825
65
+
66
+ module AllowedCaller
67
+ extend Anthropic::Internal::Type::Enum
68
+
69
+ DIRECT: :direct
70
+ CODE_EXECUTION_20250825: :code_execution_20250825
71
+
72
+ def self?.values: -> ::Array[Anthropic::Models::Beta::BetaToolTextEditor20250124::allowed_caller]
73
+ end
38
74
  end
39
75
  end
40
76
  end
@@ -7,7 +7,10 @@ module Anthropic
7
7
  {
8
8
  name: :str_replace_based_edit_tool,
9
9
  type: :text_editor_20250429,
10
+ allowed_callers: ::Array[Anthropic::Models::Beta::BetaToolTextEditor20250429::allowed_caller],
10
11
  cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
12
+ defer_loading: bool,
13
+ input_examples: ::Array[::Hash[Symbol, top]],
11
14
  strict: bool
12
15
  }
13
16
 
@@ -16,14 +19,33 @@ module Anthropic
16
19
 
17
20
  attr_accessor type: :text_editor_20250429
18
21
 
22
+ attr_reader allowed_callers: ::Array[Anthropic::Models::Beta::BetaToolTextEditor20250429::allowed_caller]?
23
+
24
+ def allowed_callers=: (
25
+ ::Array[Anthropic::Models::Beta::BetaToolTextEditor20250429::allowed_caller]
26
+ ) -> ::Array[Anthropic::Models::Beta::BetaToolTextEditor20250429::allowed_caller]
27
+
19
28
  attr_accessor cache_control: Anthropic::Beta::BetaCacheControlEphemeral?
20
29
 
30
+ attr_reader defer_loading: bool?
31
+
32
+ def defer_loading=: (bool) -> bool
33
+
34
+ attr_reader input_examples: ::Array[::Hash[Symbol, top]]?
35
+
36
+ def input_examples=: (
37
+ ::Array[::Hash[Symbol, top]]
38
+ ) -> ::Array[::Hash[Symbol, top]]
39
+
21
40
  attr_reader strict: bool?
22
41
 
23
42
  def strict=: (bool) -> bool
24
43
 
25
44
  def initialize: (
45
+ ?allowed_callers: ::Array[Anthropic::Models::Beta::BetaToolTextEditor20250429::allowed_caller],
26
46
  ?cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
47
+ ?defer_loading: bool,
48
+ ?input_examples: ::Array[::Hash[Symbol, top]],
27
49
  ?strict: bool,
28
50
  ?name: :str_replace_based_edit_tool,
29
51
  ?type: :text_editor_20250429
@@ -32,9 +54,23 @@ module Anthropic
32
54
  def to_hash: -> {
33
55
  name: :str_replace_based_edit_tool,
34
56
  type: :text_editor_20250429,
57
+ allowed_callers: ::Array[Anthropic::Models::Beta::BetaToolTextEditor20250429::allowed_caller],
35
58
  cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
59
+ defer_loading: bool,
60
+ input_examples: ::Array[::Hash[Symbol, top]],
36
61
  strict: bool
37
62
  }
63
+
64
+ type allowed_caller = :direct | :code_execution_20250825
65
+
66
+ module AllowedCaller
67
+ extend Anthropic::Internal::Type::Enum
68
+
69
+ DIRECT: :direct
70
+ CODE_EXECUTION_20250825: :code_execution_20250825
71
+
72
+ def self?.values: -> ::Array[Anthropic::Models::Beta::BetaToolTextEditor20250429::allowed_caller]
73
+ end
38
74
  end
39
75
  end
40
76
  end
@@ -7,7 +7,10 @@ module Anthropic
7
7
  {
8
8
  name: :str_replace_based_edit_tool,
9
9
  type: :text_editor_20250728,
10
+ allowed_callers: ::Array[Anthropic::Models::Beta::BetaToolTextEditor20250728::allowed_caller],
10
11
  cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
12
+ defer_loading: bool,
13
+ input_examples: ::Array[::Hash[Symbol, top]],
11
14
  max_characters: Integer?,
12
15
  strict: bool
13
16
  }
@@ -17,8 +20,24 @@ module Anthropic
17
20
 
18
21
  attr_accessor type: :text_editor_20250728
19
22
 
23
+ attr_reader allowed_callers: ::Array[Anthropic::Models::Beta::BetaToolTextEditor20250728::allowed_caller]?
24
+
25
+ def allowed_callers=: (
26
+ ::Array[Anthropic::Models::Beta::BetaToolTextEditor20250728::allowed_caller]
27
+ ) -> ::Array[Anthropic::Models::Beta::BetaToolTextEditor20250728::allowed_caller]
28
+
20
29
  attr_accessor cache_control: Anthropic::Beta::BetaCacheControlEphemeral?
21
30
 
31
+ attr_reader defer_loading: bool?
32
+
33
+ def defer_loading=: (bool) -> bool
34
+
35
+ attr_reader input_examples: ::Array[::Hash[Symbol, top]]?
36
+
37
+ def input_examples=: (
38
+ ::Array[::Hash[Symbol, top]]
39
+ ) -> ::Array[::Hash[Symbol, top]]
40
+
22
41
  attr_accessor max_characters: Integer?
23
42
 
24
43
  attr_reader strict: bool?
@@ -26,7 +45,10 @@ module Anthropic
26
45
  def strict=: (bool) -> bool
27
46
 
28
47
  def initialize: (
48
+ ?allowed_callers: ::Array[Anthropic::Models::Beta::BetaToolTextEditor20250728::allowed_caller],
29
49
  ?cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
50
+ ?defer_loading: bool,
51
+ ?input_examples: ::Array[::Hash[Symbol, top]],
30
52
  ?max_characters: Integer?,
31
53
  ?strict: bool,
32
54
  ?name: :str_replace_based_edit_tool,
@@ -36,10 +58,24 @@ module Anthropic
36
58
  def to_hash: -> {
37
59
  name: :str_replace_based_edit_tool,
38
60
  type: :text_editor_20250728,
61
+ allowed_callers: ::Array[Anthropic::Models::Beta::BetaToolTextEditor20250728::allowed_caller],
39
62
  cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
63
+ defer_loading: bool,
64
+ input_examples: ::Array[::Hash[Symbol, top]],
40
65
  max_characters: Integer?,
41
66
  strict: bool
42
67
  }
68
+
69
+ type allowed_caller = :direct | :code_execution_20250825
70
+
71
+ module AllowedCaller
72
+ extend Anthropic::Internal::Type::Enum
73
+
74
+ DIRECT: :direct
75
+ CODE_EXECUTION_20250825: :code_execution_20250825
76
+
77
+ def self?.values: -> ::Array[Anthropic::Models::Beta::BetaToolTextEditor20250728::allowed_caller]
78
+ end
43
79
  end
44
80
  end
45
81
  end
@@ -13,11 +13,15 @@ module Anthropic
13
13
  | Anthropic::Beta::BetaMemoryTool20250818
14
14
  | Anthropic::Beta::BetaToolComputerUse20250124
15
15
  | Anthropic::Beta::BetaToolTextEditor20241022
16
+ | Anthropic::Beta::BetaToolComputerUse20251124
16
17
  | Anthropic::Beta::BetaToolTextEditor20250124
17
18
  | Anthropic::Beta::BetaToolTextEditor20250429
18
19
  | Anthropic::Beta::BetaToolTextEditor20250728
19
20
  | Anthropic::Beta::BetaWebSearchTool20250305
20
21
  | Anthropic::Beta::BetaWebFetchTool20250910
22
+ | Anthropic::Beta::BetaToolSearchToolBm25_20251119
23
+ | Anthropic::Beta::BetaToolSearchToolRegex20251119
24
+ | Anthropic::Beta::BetaMCPToolset
21
25
 
22
26
  module BetaToolUnion
23
27
  extend Anthropic::Internal::Type::Union
@@ -8,7 +8,8 @@ module Anthropic
8
8
  id: String,
9
9
  input: ::Hash[Symbol, top],
10
10
  name: String,
11
- type: :tool_use
11
+ type: :tool_use,
12
+ caller_: Anthropic::Models::Beta::BetaToolUseBlock::caller_
12
13
  }
13
14
 
14
15
  class BetaToolUseBlock < Anthropic::Internal::Type::BaseModel
@@ -20,10 +21,17 @@ module Anthropic
20
21
 
21
22
  attr_accessor type: :tool_use
22
23
 
24
+ attr_reader caller_: Anthropic::Models::Beta::BetaToolUseBlock::caller_?
25
+
26
+ def caller_=: (
27
+ Anthropic::Models::Beta::BetaToolUseBlock::caller_
28
+ ) -> Anthropic::Models::Beta::BetaToolUseBlock::caller_
29
+
23
30
  def initialize: (
24
31
  id: String,
25
32
  input: ::Hash[Symbol, top],
26
33
  name: String,
34
+ ?caller_: Anthropic::Models::Beta::BetaToolUseBlock::caller_,
27
35
  ?type: :tool_use
28
36
  ) -> void
29
37
 
@@ -31,8 +39,19 @@ module Anthropic
31
39
  id: String,
32
40
  input: ::Hash[Symbol, top],
33
41
  name: String,
34
- type: :tool_use
42
+ type: :tool_use,
43
+ caller_: Anthropic::Models::Beta::BetaToolUseBlock::caller_
35
44
  }
45
+
46
+ type caller_ =
47
+ Anthropic::Beta::BetaDirectCaller
48
+ | Anthropic::Beta::BetaServerToolCaller
49
+
50
+ module Caller
51
+ extend Anthropic::Internal::Type::Union
52
+
53
+ def self?.variants: -> ::Array[Anthropic::Models::Beta::BetaToolUseBlock::caller_]
54
+ end
36
55
  end
37
56
  end
38
57
  end
@@ -9,7 +9,8 @@ module Anthropic
9
9
  input: ::Hash[Symbol, top],
10
10
  name: String,
11
11
  type: :tool_use,
12
- cache_control: Anthropic::Beta::BetaCacheControlEphemeral?
12
+ cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
13
+ caller_: Anthropic::Models::Beta::BetaToolUseBlockParam::caller_
13
14
  }
14
15
 
15
16
  class BetaToolUseBlockParam < Anthropic::Internal::Type::BaseModel
@@ -23,11 +24,18 @@ module Anthropic
23
24
 
24
25
  attr_accessor cache_control: Anthropic::Beta::BetaCacheControlEphemeral?
25
26
 
27
+ attr_reader caller_: Anthropic::Models::Beta::BetaToolUseBlockParam::caller_?
28
+
29
+ def caller_=: (
30
+ Anthropic::Models::Beta::BetaToolUseBlockParam::caller_
31
+ ) -> Anthropic::Models::Beta::BetaToolUseBlockParam::caller_
32
+
26
33
  def initialize: (
27
34
  id: String,
28
35
  input: ::Hash[Symbol, top],
29
36
  name: String,
30
37
  ?cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
38
+ ?caller_: Anthropic::Models::Beta::BetaToolUseBlockParam::caller_,
31
39
  ?type: :tool_use
32
40
  ) -> void
33
41
 
@@ -36,8 +44,19 @@ module Anthropic
36
44
  input: ::Hash[Symbol, top],
37
45
  name: String,
38
46
  type: :tool_use,
39
- cache_control: Anthropic::Beta::BetaCacheControlEphemeral?
47
+ cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
48
+ caller_: Anthropic::Models::Beta::BetaToolUseBlockParam::caller_
40
49
  }
50
+
51
+ type caller_ =
52
+ Anthropic::Beta::BetaDirectCaller
53
+ | Anthropic::Beta::BetaServerToolCaller
54
+
55
+ module Caller
56
+ extend Anthropic::Internal::Type::Union
57
+
58
+ def self?.variants: -> ::Array[Anthropic::Models::Beta::BetaToolUseBlockParam::caller_]
59
+ end
41
60
  end
42
61
  end
43
62
  end
@@ -7,10 +7,12 @@ module Anthropic
7
7
  {
8
8
  name: :web_fetch,
9
9
  type: :web_fetch_20250910,
10
+ allowed_callers: ::Array[Anthropic::Models::Beta::BetaWebFetchTool20250910::allowed_caller],
10
11
  allowed_domains: ::Array[String]?,
11
12
  blocked_domains: ::Array[String]?,
12
13
  cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
13
14
  citations: Anthropic::Beta::BetaCitationsConfigParam?,
15
+ defer_loading: bool,
14
16
  max_content_tokens: Integer?,
15
17
  max_uses: Integer?,
16
18
  strict: bool
@@ -21,6 +23,12 @@ module Anthropic
21
23
 
22
24
  attr_accessor type: :web_fetch_20250910
23
25
 
26
+ attr_reader allowed_callers: ::Array[Anthropic::Models::Beta::BetaWebFetchTool20250910::allowed_caller]?
27
+
28
+ def allowed_callers=: (
29
+ ::Array[Anthropic::Models::Beta::BetaWebFetchTool20250910::allowed_caller]
30
+ ) -> ::Array[Anthropic::Models::Beta::BetaWebFetchTool20250910::allowed_caller]
31
+
24
32
  attr_accessor allowed_domains: ::Array[String]?
25
33
 
26
34
  attr_accessor blocked_domains: ::Array[String]?
@@ -29,6 +37,10 @@ module Anthropic
29
37
 
30
38
  attr_accessor citations: Anthropic::Beta::BetaCitationsConfigParam?
31
39
 
40
+ attr_reader defer_loading: bool?
41
+
42
+ def defer_loading=: (bool) -> bool
43
+
32
44
  attr_accessor max_content_tokens: Integer?
33
45
 
34
46
  attr_accessor max_uses: Integer?
@@ -38,10 +50,12 @@ module Anthropic
38
50
  def strict=: (bool) -> bool
39
51
 
40
52
  def initialize: (
53
+ ?allowed_callers: ::Array[Anthropic::Models::Beta::BetaWebFetchTool20250910::allowed_caller],
41
54
  ?allowed_domains: ::Array[String]?,
42
55
  ?blocked_domains: ::Array[String]?,
43
56
  ?cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
44
57
  ?citations: Anthropic::Beta::BetaCitationsConfigParam?,
58
+ ?defer_loading: bool,
45
59
  ?max_content_tokens: Integer?,
46
60
  ?max_uses: Integer?,
47
61
  ?strict: bool,
@@ -52,14 +66,27 @@ module Anthropic
52
66
  def to_hash: -> {
53
67
  name: :web_fetch,
54
68
  type: :web_fetch_20250910,
69
+ allowed_callers: ::Array[Anthropic::Models::Beta::BetaWebFetchTool20250910::allowed_caller],
55
70
  allowed_domains: ::Array[String]?,
56
71
  blocked_domains: ::Array[String]?,
57
72
  cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
58
73
  citations: Anthropic::Beta::BetaCitationsConfigParam?,
74
+ defer_loading: bool,
59
75
  max_content_tokens: Integer?,
60
76
  max_uses: Integer?,
61
77
  strict: bool
62
78
  }
79
+
80
+ type allowed_caller = :direct | :code_execution_20250825
81
+
82
+ module AllowedCaller
83
+ extend Anthropic::Internal::Type::Enum
84
+
85
+ DIRECT: :direct
86
+ CODE_EXECUTION_20250825: :code_execution_20250825
87
+
88
+ def self?.values: -> ::Array[Anthropic::Models::Beta::BetaWebFetchTool20250910::allowed_caller]
89
+ end
63
90
  end
64
91
  end
65
92
  end
@@ -7,9 +7,11 @@ module Anthropic
7
7
  {
8
8
  name: :web_search,
9
9
  type: :web_search_20250305,
10
+ allowed_callers: ::Array[Anthropic::Models::Beta::BetaWebSearchTool20250305::allowed_caller],
10
11
  allowed_domains: ::Array[String]?,
11
12
  blocked_domains: ::Array[String]?,
12
13
  cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
14
+ defer_loading: bool,
13
15
  max_uses: Integer?,
14
16
  strict: bool,
15
17
  user_location: Anthropic::Beta::BetaWebSearchTool20250305::UserLocation?
@@ -20,12 +22,22 @@ module Anthropic
20
22
 
21
23
  attr_accessor type: :web_search_20250305
22
24
 
25
+ attr_reader allowed_callers: ::Array[Anthropic::Models::Beta::BetaWebSearchTool20250305::allowed_caller]?
26
+
27
+ def allowed_callers=: (
28
+ ::Array[Anthropic::Models::Beta::BetaWebSearchTool20250305::allowed_caller]
29
+ ) -> ::Array[Anthropic::Models::Beta::BetaWebSearchTool20250305::allowed_caller]
30
+
23
31
  attr_accessor allowed_domains: ::Array[String]?
24
32
 
25
33
  attr_accessor blocked_domains: ::Array[String]?
26
34
 
27
35
  attr_accessor cache_control: Anthropic::Beta::BetaCacheControlEphemeral?
28
36
 
37
+ attr_reader defer_loading: bool?
38
+
39
+ def defer_loading=: (bool) -> bool
40
+
29
41
  attr_accessor max_uses: Integer?
30
42
 
31
43
  attr_reader strict: bool?
@@ -35,9 +47,11 @@ module Anthropic
35
47
  attr_accessor user_location: Anthropic::Beta::BetaWebSearchTool20250305::UserLocation?
36
48
 
37
49
  def initialize: (
50
+ ?allowed_callers: ::Array[Anthropic::Models::Beta::BetaWebSearchTool20250305::allowed_caller],
38
51
  ?allowed_domains: ::Array[String]?,
39
52
  ?blocked_domains: ::Array[String]?,
40
53
  ?cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
54
+ ?defer_loading: bool,
41
55
  ?max_uses: Integer?,
42
56
  ?strict: bool,
43
57
  ?user_location: Anthropic::Beta::BetaWebSearchTool20250305::UserLocation?,
@@ -48,14 +62,27 @@ module Anthropic
48
62
  def to_hash: -> {
49
63
  name: :web_search,
50
64
  type: :web_search_20250305,
65
+ allowed_callers: ::Array[Anthropic::Models::Beta::BetaWebSearchTool20250305::allowed_caller],
51
66
  allowed_domains: ::Array[String]?,
52
67
  blocked_domains: ::Array[String]?,
53
68
  cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
69
+ defer_loading: bool,
54
70
  max_uses: Integer?,
55
71
  strict: bool,
56
72
  user_location: Anthropic::Beta::BetaWebSearchTool20250305::UserLocation?
57
73
  }
58
74
 
75
+ type allowed_caller = :direct | :code_execution_20250825
76
+
77
+ module AllowedCaller
78
+ extend Anthropic::Internal::Type::Enum
79
+
80
+ DIRECT: :direct
81
+ CODE_EXECUTION_20250825: :code_execution_20250825
82
+
83
+ def self?.values: -> ::Array[Anthropic::Models::Beta::BetaWebSearchTool20250305::allowed_caller]
84
+ end
85
+
59
86
  type user_location =
60
87
  {
61
88
  type: :approximate,
@@ -7,6 +7,7 @@ module Anthropic
7
7
  model: Anthropic::Models::model,
8
8
  context_management: Anthropic::Beta::BetaContextManagementConfig?,
9
9
  mcp_servers: ::Array[Anthropic::Beta::BetaRequestMCPServerURLDefinition],
10
+ output_config: Anthropic::Beta::BetaOutputConfig,
10
11
  output_format: Anthropic::Beta::BetaJSONOutputFormat?,
11
12
  system_: Anthropic::Models::Beta::MessageCountTokensParams::system_,
12
13
  thinking: Anthropic::Models::Beta::beta_thinking_config_param,
@@ -32,6 +33,12 @@ module Anthropic
32
33
  ::Array[Anthropic::Beta::BetaRequestMCPServerURLDefinition]
33
34
  ) -> ::Array[Anthropic::Beta::BetaRequestMCPServerURLDefinition]
34
35
 
36
+ attr_reader output_config: Anthropic::Beta::BetaOutputConfig?
37
+
38
+ def output_config=: (
39
+ Anthropic::Beta::BetaOutputConfig
40
+ ) -> Anthropic::Beta::BetaOutputConfig
41
+
35
42
  attr_accessor output_format: Anthropic::Beta::BetaJSONOutputFormat?
36
43
 
37
44
  attr_reader system_: Anthropic::Models::Beta::MessageCountTokensParams::system_?
@@ -69,6 +76,7 @@ module Anthropic
69
76
  model: Anthropic::Models::model,
70
77
  ?context_management: Anthropic::Beta::BetaContextManagementConfig?,
71
78
  ?mcp_servers: ::Array[Anthropic::Beta::BetaRequestMCPServerURLDefinition],
79
+ ?output_config: Anthropic::Beta::BetaOutputConfig,
72
80
  ?output_format: Anthropic::Beta::BetaJSONOutputFormat?,
73
81
  ?system_: Anthropic::Models::Beta::MessageCountTokensParams::system_,
74
82
  ?thinking: Anthropic::Models::Beta::beta_thinking_config_param,
@@ -83,6 +91,7 @@ module Anthropic
83
91
  model: Anthropic::Models::model,
84
92
  context_management: Anthropic::Beta::BetaContextManagementConfig?,
85
93
  mcp_servers: ::Array[Anthropic::Beta::BetaRequestMCPServerURLDefinition],
94
+ output_config: Anthropic::Beta::BetaOutputConfig,
86
95
  output_format: Anthropic::Beta::BetaJSONOutputFormat?,
87
96
  system_: Anthropic::Models::Beta::MessageCountTokensParams::system_,
88
97
  thinking: Anthropic::Models::Beta::beta_thinking_config_param,
@@ -112,11 +121,15 @@ module Anthropic
112
121
  | Anthropic::Beta::BetaMemoryTool20250818
113
122
  | Anthropic::Beta::BetaToolComputerUse20250124
114
123
  | Anthropic::Beta::BetaToolTextEditor20241022
124
+ | Anthropic::Beta::BetaToolComputerUse20251124
115
125
  | Anthropic::Beta::BetaToolTextEditor20250124
116
126
  | Anthropic::Beta::BetaToolTextEditor20250429
117
127
  | Anthropic::Beta::BetaToolTextEditor20250728
118
128
  | Anthropic::Beta::BetaWebSearchTool20250305
119
129
  | Anthropic::Beta::BetaWebFetchTool20250910
130
+ | Anthropic::Beta::BetaToolSearchToolBm25_20251119
131
+ | Anthropic::Beta::BetaToolSearchToolRegex20251119
132
+ | Anthropic::Beta::BetaMCPToolset
120
133
 
121
134
  module Tool
122
135
  extend Anthropic::Internal::Type::Union