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,104 @@
1
+ # typed: strong
2
+
3
+ module Anthropic
4
+ module Models
5
+ BetaToolSearchToolResultError = Beta::BetaToolSearchToolResultError
6
+
7
+ module Beta
8
+ class BetaToolSearchToolResultError < Anthropic::Internal::Type::BaseModel
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(
12
+ Anthropic::Beta::BetaToolSearchToolResultError,
13
+ Anthropic::Internal::AnyHash
14
+ )
15
+ end
16
+
17
+ sig do
18
+ returns(
19
+ Anthropic::Beta::BetaToolSearchToolResultError::ErrorCode::TaggedSymbol
20
+ )
21
+ end
22
+ attr_accessor :error_code
23
+
24
+ sig { returns(T.nilable(String)) }
25
+ attr_accessor :error_message
26
+
27
+ sig { returns(Symbol) }
28
+ attr_accessor :type
29
+
30
+ sig do
31
+ params(
32
+ error_code:
33
+ Anthropic::Beta::BetaToolSearchToolResultError::ErrorCode::OrSymbol,
34
+ error_message: T.nilable(String),
35
+ type: Symbol
36
+ ).returns(T.attached_class)
37
+ end
38
+ def self.new(
39
+ error_code:,
40
+ error_message:,
41
+ type: :tool_search_tool_result_error
42
+ )
43
+ end
44
+
45
+ sig do
46
+ override.returns(
47
+ {
48
+ error_code:
49
+ Anthropic::Beta::BetaToolSearchToolResultError::ErrorCode::TaggedSymbol,
50
+ error_message: T.nilable(String),
51
+ type: Symbol
52
+ }
53
+ )
54
+ end
55
+ def to_hash
56
+ end
57
+
58
+ module ErrorCode
59
+ extend Anthropic::Internal::Type::Enum
60
+
61
+ TaggedSymbol =
62
+ T.type_alias do
63
+ T.all(
64
+ Symbol,
65
+ Anthropic::Beta::BetaToolSearchToolResultError::ErrorCode
66
+ )
67
+ end
68
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
69
+
70
+ INVALID_TOOL_INPUT =
71
+ T.let(
72
+ :invalid_tool_input,
73
+ Anthropic::Beta::BetaToolSearchToolResultError::ErrorCode::TaggedSymbol
74
+ )
75
+ UNAVAILABLE =
76
+ T.let(
77
+ :unavailable,
78
+ Anthropic::Beta::BetaToolSearchToolResultError::ErrorCode::TaggedSymbol
79
+ )
80
+ TOO_MANY_REQUESTS =
81
+ T.let(
82
+ :too_many_requests,
83
+ Anthropic::Beta::BetaToolSearchToolResultError::ErrorCode::TaggedSymbol
84
+ )
85
+ EXECUTION_TIME_EXCEEDED =
86
+ T.let(
87
+ :execution_time_exceeded,
88
+ Anthropic::Beta::BetaToolSearchToolResultError::ErrorCode::TaggedSymbol
89
+ )
90
+
91
+ sig do
92
+ override.returns(
93
+ T::Array[
94
+ Anthropic::Beta::BetaToolSearchToolResultError::ErrorCode::TaggedSymbol
95
+ ]
96
+ )
97
+ end
98
+ def self.values
99
+ end
100
+ end
101
+ end
102
+ end
103
+ end
104
+ end
@@ -0,0 +1,96 @@
1
+ # typed: strong
2
+
3
+ module Anthropic
4
+ module Models
5
+ BetaToolSearchToolResultErrorParam =
6
+ Beta::BetaToolSearchToolResultErrorParam
7
+
8
+ module Beta
9
+ class BetaToolSearchToolResultErrorParam < Anthropic::Internal::Type::BaseModel
10
+ OrHash =
11
+ T.type_alias do
12
+ T.any(
13
+ Anthropic::Beta::BetaToolSearchToolResultErrorParam,
14
+ Anthropic::Internal::AnyHash
15
+ )
16
+ end
17
+
18
+ sig do
19
+ returns(
20
+ Anthropic::Beta::BetaToolSearchToolResultErrorParam::ErrorCode::OrSymbol
21
+ )
22
+ end
23
+ attr_accessor :error_code
24
+
25
+ sig { returns(Symbol) }
26
+ attr_accessor :type
27
+
28
+ sig do
29
+ params(
30
+ error_code:
31
+ Anthropic::Beta::BetaToolSearchToolResultErrorParam::ErrorCode::OrSymbol,
32
+ type: Symbol
33
+ ).returns(T.attached_class)
34
+ end
35
+ def self.new(error_code:, type: :tool_search_tool_result_error)
36
+ end
37
+
38
+ sig do
39
+ override.returns(
40
+ {
41
+ error_code:
42
+ Anthropic::Beta::BetaToolSearchToolResultErrorParam::ErrorCode::OrSymbol,
43
+ type: Symbol
44
+ }
45
+ )
46
+ end
47
+ def to_hash
48
+ end
49
+
50
+ module ErrorCode
51
+ extend Anthropic::Internal::Type::Enum
52
+
53
+ TaggedSymbol =
54
+ T.type_alias do
55
+ T.all(
56
+ Symbol,
57
+ Anthropic::Beta::BetaToolSearchToolResultErrorParam::ErrorCode
58
+ )
59
+ end
60
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
61
+
62
+ INVALID_TOOL_INPUT =
63
+ T.let(
64
+ :invalid_tool_input,
65
+ Anthropic::Beta::BetaToolSearchToolResultErrorParam::ErrorCode::TaggedSymbol
66
+ )
67
+ UNAVAILABLE =
68
+ T.let(
69
+ :unavailable,
70
+ Anthropic::Beta::BetaToolSearchToolResultErrorParam::ErrorCode::TaggedSymbol
71
+ )
72
+ TOO_MANY_REQUESTS =
73
+ T.let(
74
+ :too_many_requests,
75
+ Anthropic::Beta::BetaToolSearchToolResultErrorParam::ErrorCode::TaggedSymbol
76
+ )
77
+ EXECUTION_TIME_EXCEEDED =
78
+ T.let(
79
+ :execution_time_exceeded,
80
+ Anthropic::Beta::BetaToolSearchToolResultErrorParam::ErrorCode::TaggedSymbol
81
+ )
82
+
83
+ sig do
84
+ override.returns(
85
+ T::Array[
86
+ Anthropic::Beta::BetaToolSearchToolResultErrorParam::ErrorCode::TaggedSymbol
87
+ ]
88
+ )
89
+ end
90
+ def self.values
91
+ end
92
+ end
93
+ end
94
+ end
95
+ end
96
+ end
@@ -0,0 +1,48 @@
1
+ # typed: strong
2
+
3
+ module Anthropic
4
+ module Models
5
+ BetaToolSearchToolSearchResultBlock =
6
+ Beta::BetaToolSearchToolSearchResultBlock
7
+
8
+ module Beta
9
+ class BetaToolSearchToolSearchResultBlock < Anthropic::Internal::Type::BaseModel
10
+ OrHash =
11
+ T.type_alias do
12
+ T.any(
13
+ Anthropic::Beta::BetaToolSearchToolSearchResultBlock,
14
+ Anthropic::Internal::AnyHash
15
+ )
16
+ end
17
+
18
+ sig { returns(T::Array[Anthropic::Beta::BetaToolReferenceBlock]) }
19
+ attr_accessor :tool_references
20
+
21
+ sig { returns(Symbol) }
22
+ attr_accessor :type
23
+
24
+ sig do
25
+ params(
26
+ tool_references:
27
+ T::Array[Anthropic::Beta::BetaToolReferenceBlock::OrHash],
28
+ type: Symbol
29
+ ).returns(T.attached_class)
30
+ end
31
+ def self.new(tool_references:, type: :tool_search_tool_search_result)
32
+ end
33
+
34
+ sig do
35
+ override.returns(
36
+ {
37
+ tool_references:
38
+ T::Array[Anthropic::Beta::BetaToolReferenceBlock],
39
+ type: Symbol
40
+ }
41
+ )
42
+ end
43
+ def to_hash
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,48 @@
1
+ # typed: strong
2
+
3
+ module Anthropic
4
+ module Models
5
+ BetaToolSearchToolSearchResultBlockParam =
6
+ Beta::BetaToolSearchToolSearchResultBlockParam
7
+
8
+ module Beta
9
+ class BetaToolSearchToolSearchResultBlockParam < Anthropic::Internal::Type::BaseModel
10
+ OrHash =
11
+ T.type_alias do
12
+ T.any(
13
+ Anthropic::Beta::BetaToolSearchToolSearchResultBlockParam,
14
+ Anthropic::Internal::AnyHash
15
+ )
16
+ end
17
+
18
+ sig { returns(T::Array[Anthropic::Beta::BetaToolReferenceBlockParam]) }
19
+ attr_accessor :tool_references
20
+
21
+ sig { returns(Symbol) }
22
+ attr_accessor :type
23
+
24
+ sig do
25
+ params(
26
+ tool_references:
27
+ T::Array[Anthropic::Beta::BetaToolReferenceBlockParam::OrHash],
28
+ type: Symbol
29
+ ).returns(T.attached_class)
30
+ end
31
+ def self.new(tool_references:, type: :tool_search_tool_search_result)
32
+ end
33
+
34
+ sig do
35
+ override.returns(
36
+ {
37
+ tool_references:
38
+ T::Array[Anthropic::Beta::BetaToolReferenceBlockParam],
39
+ type: Symbol
40
+ }
41
+ )
42
+ end
43
+ def to_hash
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
@@ -23,6 +23,27 @@ module Anthropic
23
23
  sig { returns(Symbol) }
24
24
  attr_accessor :type
25
25
 
26
+ sig do
27
+ returns(
28
+ T.nilable(
29
+ T::Array[
30
+ Anthropic::Beta::BetaToolTextEditor20241022::AllowedCaller::OrSymbol
31
+ ]
32
+ )
33
+ )
34
+ end
35
+ attr_reader :allowed_callers
36
+
37
+ sig do
38
+ params(
39
+ allowed_callers:
40
+ T::Array[
41
+ Anthropic::Beta::BetaToolTextEditor20241022::AllowedCaller::OrSymbol
42
+ ]
43
+ ).void
44
+ end
45
+ attr_writer :allowed_callers
46
+
26
47
  # Create a cache control breakpoint at this content block.
27
48
  sig { returns(T.nilable(Anthropic::Beta::BetaCacheControlEphemeral)) }
28
49
  attr_reader :cache_control
@@ -35,6 +56,22 @@ module Anthropic
35
56
  end
36
57
  attr_writer :cache_control
37
58
 
59
+ # If true, tool will not be included in initial system prompt. Only loaded when
60
+ # returned via tool_reference from tool search.
61
+ sig { returns(T.nilable(T::Boolean)) }
62
+ attr_reader :defer_loading
63
+
64
+ sig { params(defer_loading: T::Boolean).void }
65
+ attr_writer :defer_loading
66
+
67
+ sig { returns(T.nilable(T::Array[T::Hash[Symbol, T.anything]])) }
68
+ attr_reader :input_examples
69
+
70
+ sig do
71
+ params(input_examples: T::Array[T::Hash[Symbol, T.anything]]).void
72
+ end
73
+ attr_writer :input_examples
74
+
38
75
  sig { returns(T.nilable(T::Boolean)) }
39
76
  attr_reader :strict
40
77
 
@@ -43,16 +80,27 @@ module Anthropic
43
80
 
44
81
  sig do
45
82
  params(
83
+ allowed_callers:
84
+ T::Array[
85
+ Anthropic::Beta::BetaToolTextEditor20241022::AllowedCaller::OrSymbol
86
+ ],
46
87
  cache_control:
47
88
  T.nilable(Anthropic::Beta::BetaCacheControlEphemeral::OrHash),
89
+ defer_loading: T::Boolean,
90
+ input_examples: T::Array[T::Hash[Symbol, T.anything]],
48
91
  strict: T::Boolean,
49
92
  name: Symbol,
50
93
  type: Symbol
51
94
  ).returns(T.attached_class)
52
95
  end
53
96
  def self.new(
97
+ allowed_callers: nil,
54
98
  # Create a cache control breakpoint at this content block.
55
99
  cache_control: nil,
100
+ # If true, tool will not be included in initial system prompt. Only loaded when
101
+ # returned via tool_reference from tool search.
102
+ defer_loading: nil,
103
+ input_examples: nil,
56
104
  strict: nil,
57
105
  # Name of the tool.
58
106
  #
@@ -67,14 +115,54 @@ module Anthropic
67
115
  {
68
116
  name: Symbol,
69
117
  type: Symbol,
118
+ allowed_callers:
119
+ T::Array[
120
+ Anthropic::Beta::BetaToolTextEditor20241022::AllowedCaller::OrSymbol
121
+ ],
70
122
  cache_control:
71
123
  T.nilable(Anthropic::Beta::BetaCacheControlEphemeral),
124
+ defer_loading: T::Boolean,
125
+ input_examples: T::Array[T::Hash[Symbol, T.anything]],
72
126
  strict: T::Boolean
73
127
  }
74
128
  )
75
129
  end
76
130
  def to_hash
77
131
  end
132
+
133
+ module AllowedCaller
134
+ extend Anthropic::Internal::Type::Enum
135
+
136
+ TaggedSymbol =
137
+ T.type_alias do
138
+ T.all(
139
+ Symbol,
140
+ Anthropic::Beta::BetaToolTextEditor20241022::AllowedCaller
141
+ )
142
+ end
143
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
144
+
145
+ DIRECT =
146
+ T.let(
147
+ :direct,
148
+ Anthropic::Beta::BetaToolTextEditor20241022::AllowedCaller::TaggedSymbol
149
+ )
150
+ CODE_EXECUTION_20250825 =
151
+ T.let(
152
+ :code_execution_20250825,
153
+ Anthropic::Beta::BetaToolTextEditor20241022::AllowedCaller::TaggedSymbol
154
+ )
155
+
156
+ sig do
157
+ override.returns(
158
+ T::Array[
159
+ Anthropic::Beta::BetaToolTextEditor20241022::AllowedCaller::TaggedSymbol
160
+ ]
161
+ )
162
+ end
163
+ def self.values
164
+ end
165
+ end
78
166
  end
79
167
  end
80
168
  end
@@ -23,6 +23,27 @@ module Anthropic
23
23
  sig { returns(Symbol) }
24
24
  attr_accessor :type
25
25
 
26
+ sig do
27
+ returns(
28
+ T.nilable(
29
+ T::Array[
30
+ Anthropic::Beta::BetaToolTextEditor20250124::AllowedCaller::OrSymbol
31
+ ]
32
+ )
33
+ )
34
+ end
35
+ attr_reader :allowed_callers
36
+
37
+ sig do
38
+ params(
39
+ allowed_callers:
40
+ T::Array[
41
+ Anthropic::Beta::BetaToolTextEditor20250124::AllowedCaller::OrSymbol
42
+ ]
43
+ ).void
44
+ end
45
+ attr_writer :allowed_callers
46
+
26
47
  # Create a cache control breakpoint at this content block.
27
48
  sig { returns(T.nilable(Anthropic::Beta::BetaCacheControlEphemeral)) }
28
49
  attr_reader :cache_control
@@ -35,6 +56,22 @@ module Anthropic
35
56
  end
36
57
  attr_writer :cache_control
37
58
 
59
+ # If true, tool will not be included in initial system prompt. Only loaded when
60
+ # returned via tool_reference from tool search.
61
+ sig { returns(T.nilable(T::Boolean)) }
62
+ attr_reader :defer_loading
63
+
64
+ sig { params(defer_loading: T::Boolean).void }
65
+ attr_writer :defer_loading
66
+
67
+ sig { returns(T.nilable(T::Array[T::Hash[Symbol, T.anything]])) }
68
+ attr_reader :input_examples
69
+
70
+ sig do
71
+ params(input_examples: T::Array[T::Hash[Symbol, T.anything]]).void
72
+ end
73
+ attr_writer :input_examples
74
+
38
75
  sig { returns(T.nilable(T::Boolean)) }
39
76
  attr_reader :strict
40
77
 
@@ -43,16 +80,27 @@ module Anthropic
43
80
 
44
81
  sig do
45
82
  params(
83
+ allowed_callers:
84
+ T::Array[
85
+ Anthropic::Beta::BetaToolTextEditor20250124::AllowedCaller::OrSymbol
86
+ ],
46
87
  cache_control:
47
88
  T.nilable(Anthropic::Beta::BetaCacheControlEphemeral::OrHash),
89
+ defer_loading: T::Boolean,
90
+ input_examples: T::Array[T::Hash[Symbol, T.anything]],
48
91
  strict: T::Boolean,
49
92
  name: Symbol,
50
93
  type: Symbol
51
94
  ).returns(T.attached_class)
52
95
  end
53
96
  def self.new(
97
+ allowed_callers: nil,
54
98
  # Create a cache control breakpoint at this content block.
55
99
  cache_control: nil,
100
+ # If true, tool will not be included in initial system prompt. Only loaded when
101
+ # returned via tool_reference from tool search.
102
+ defer_loading: nil,
103
+ input_examples: nil,
56
104
  strict: nil,
57
105
  # Name of the tool.
58
106
  #
@@ -67,14 +115,54 @@ module Anthropic
67
115
  {
68
116
  name: Symbol,
69
117
  type: Symbol,
118
+ allowed_callers:
119
+ T::Array[
120
+ Anthropic::Beta::BetaToolTextEditor20250124::AllowedCaller::OrSymbol
121
+ ],
70
122
  cache_control:
71
123
  T.nilable(Anthropic::Beta::BetaCacheControlEphemeral),
124
+ defer_loading: T::Boolean,
125
+ input_examples: T::Array[T::Hash[Symbol, T.anything]],
72
126
  strict: T::Boolean
73
127
  }
74
128
  )
75
129
  end
76
130
  def to_hash
77
131
  end
132
+
133
+ module AllowedCaller
134
+ extend Anthropic::Internal::Type::Enum
135
+
136
+ TaggedSymbol =
137
+ T.type_alias do
138
+ T.all(
139
+ Symbol,
140
+ Anthropic::Beta::BetaToolTextEditor20250124::AllowedCaller
141
+ )
142
+ end
143
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
144
+
145
+ DIRECT =
146
+ T.let(
147
+ :direct,
148
+ Anthropic::Beta::BetaToolTextEditor20250124::AllowedCaller::TaggedSymbol
149
+ )
150
+ CODE_EXECUTION_20250825 =
151
+ T.let(
152
+ :code_execution_20250825,
153
+ Anthropic::Beta::BetaToolTextEditor20250124::AllowedCaller::TaggedSymbol
154
+ )
155
+
156
+ sig do
157
+ override.returns(
158
+ T::Array[
159
+ Anthropic::Beta::BetaToolTextEditor20250124::AllowedCaller::TaggedSymbol
160
+ ]
161
+ )
162
+ end
163
+ def self.values
164
+ end
165
+ end
78
166
  end
79
167
  end
80
168
  end
@@ -23,6 +23,27 @@ module Anthropic
23
23
  sig { returns(Symbol) }
24
24
  attr_accessor :type
25
25
 
26
+ sig do
27
+ returns(
28
+ T.nilable(
29
+ T::Array[
30
+ Anthropic::Beta::BetaToolTextEditor20250429::AllowedCaller::OrSymbol
31
+ ]
32
+ )
33
+ )
34
+ end
35
+ attr_reader :allowed_callers
36
+
37
+ sig do
38
+ params(
39
+ allowed_callers:
40
+ T::Array[
41
+ Anthropic::Beta::BetaToolTextEditor20250429::AllowedCaller::OrSymbol
42
+ ]
43
+ ).void
44
+ end
45
+ attr_writer :allowed_callers
46
+
26
47
  # Create a cache control breakpoint at this content block.
27
48
  sig { returns(T.nilable(Anthropic::Beta::BetaCacheControlEphemeral)) }
28
49
  attr_reader :cache_control
@@ -35,6 +56,22 @@ module Anthropic
35
56
  end
36
57
  attr_writer :cache_control
37
58
 
59
+ # If true, tool will not be included in initial system prompt. Only loaded when
60
+ # returned via tool_reference from tool search.
61
+ sig { returns(T.nilable(T::Boolean)) }
62
+ attr_reader :defer_loading
63
+
64
+ sig { params(defer_loading: T::Boolean).void }
65
+ attr_writer :defer_loading
66
+
67
+ sig { returns(T.nilable(T::Array[T::Hash[Symbol, T.anything]])) }
68
+ attr_reader :input_examples
69
+
70
+ sig do
71
+ params(input_examples: T::Array[T::Hash[Symbol, T.anything]]).void
72
+ end
73
+ attr_writer :input_examples
74
+
38
75
  sig { returns(T.nilable(T::Boolean)) }
39
76
  attr_reader :strict
40
77
 
@@ -43,16 +80,27 @@ module Anthropic
43
80
 
44
81
  sig do
45
82
  params(
83
+ allowed_callers:
84
+ T::Array[
85
+ Anthropic::Beta::BetaToolTextEditor20250429::AllowedCaller::OrSymbol
86
+ ],
46
87
  cache_control:
47
88
  T.nilable(Anthropic::Beta::BetaCacheControlEphemeral::OrHash),
89
+ defer_loading: T::Boolean,
90
+ input_examples: T::Array[T::Hash[Symbol, T.anything]],
48
91
  strict: T::Boolean,
49
92
  name: Symbol,
50
93
  type: Symbol
51
94
  ).returns(T.attached_class)
52
95
  end
53
96
  def self.new(
97
+ allowed_callers: nil,
54
98
  # Create a cache control breakpoint at this content block.
55
99
  cache_control: nil,
100
+ # If true, tool will not be included in initial system prompt. Only loaded when
101
+ # returned via tool_reference from tool search.
102
+ defer_loading: nil,
103
+ input_examples: nil,
56
104
  strict: nil,
57
105
  # Name of the tool.
58
106
  #
@@ -67,14 +115,54 @@ module Anthropic
67
115
  {
68
116
  name: Symbol,
69
117
  type: Symbol,
118
+ allowed_callers:
119
+ T::Array[
120
+ Anthropic::Beta::BetaToolTextEditor20250429::AllowedCaller::OrSymbol
121
+ ],
70
122
  cache_control:
71
123
  T.nilable(Anthropic::Beta::BetaCacheControlEphemeral),
124
+ defer_loading: T::Boolean,
125
+ input_examples: T::Array[T::Hash[Symbol, T.anything]],
72
126
  strict: T::Boolean
73
127
  }
74
128
  )
75
129
  end
76
130
  def to_hash
77
131
  end
132
+
133
+ module AllowedCaller
134
+ extend Anthropic::Internal::Type::Enum
135
+
136
+ TaggedSymbol =
137
+ T.type_alias do
138
+ T.all(
139
+ Symbol,
140
+ Anthropic::Beta::BetaToolTextEditor20250429::AllowedCaller
141
+ )
142
+ end
143
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
144
+
145
+ DIRECT =
146
+ T.let(
147
+ :direct,
148
+ Anthropic::Beta::BetaToolTextEditor20250429::AllowedCaller::TaggedSymbol
149
+ )
150
+ CODE_EXECUTION_20250825 =
151
+ T.let(
152
+ :code_execution_20250825,
153
+ Anthropic::Beta::BetaToolTextEditor20250429::AllowedCaller::TaggedSymbol
154
+ )
155
+
156
+ sig do
157
+ override.returns(
158
+ T::Array[
159
+ Anthropic::Beta::BetaToolTextEditor20250429::AllowedCaller::TaggedSymbol
160
+ ]
161
+ )
162
+ end
163
+ def self.values
164
+ end
165
+ end
78
166
  end
79
167
  end
80
168
  end