anthropic 1.3.0 → 1.4.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 (69) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +17 -0
  3. data/README.md +1 -1
  4. data/lib/anthropic/client.rb +5 -2
  5. data/lib/anthropic/internal/transport/base_client.rb +1 -1
  6. data/lib/anthropic/models/beta/beta_citation_char_location.rb +7 -1
  7. data/lib/anthropic/models/beta/beta_citation_content_block_location.rb +7 -1
  8. data/lib/anthropic/models/beta/beta_citation_page_location.rb +7 -1
  9. data/lib/anthropic/models/beta/beta_tool_text_editor_20250728.rb +49 -0
  10. data/lib/anthropic/models/beta/beta_tool_union.rb +3 -1
  11. data/lib/anthropic/models/beta/message_count_tokens_params.rb +5 -3
  12. data/lib/anthropic/models/beta/message_create_params.rb +2 -2
  13. data/lib/anthropic/models/beta/messages/batch_create_params.rb +2 -2
  14. data/lib/anthropic/models/citation_char_location.rb +7 -1
  15. data/lib/anthropic/models/citation_content_block_location.rb +7 -1
  16. data/lib/anthropic/models/citation_page_location.rb +7 -1
  17. data/lib/anthropic/models/message_count_tokens_params.rb +2 -2
  18. data/lib/anthropic/models/message_count_tokens_tool.rb +4 -34
  19. data/lib/anthropic/models/message_create_params.rb +2 -2
  20. data/lib/anthropic/models/messages/batch_create_params.rb +2 -2
  21. data/lib/anthropic/models/model.rb +5 -0
  22. data/lib/anthropic/models/tool_text_editor_20250429.rb +36 -0
  23. data/lib/anthropic/models/tool_text_editor_20250728.rb +45 -0
  24. data/lib/anthropic/models/tool_union.rb +4 -33
  25. data/lib/anthropic/models.rb +4 -0
  26. data/lib/anthropic/resources/beta/messages.rb +3 -3
  27. data/lib/anthropic/resources/messages.rb +3 -3
  28. data/lib/anthropic/version.rb +1 -1
  29. data/lib/anthropic.rb +3 -0
  30. data/rbi/anthropic/internal/transport/base_client.rbi +1 -1
  31. data/rbi/anthropic/models/beta/beta_citation_char_location.rbi +6 -0
  32. data/rbi/anthropic/models/beta/beta_citation_content_block_location.rbi +6 -0
  33. data/rbi/anthropic/models/beta/beta_citation_page_location.rbi +6 -0
  34. data/rbi/anthropic/models/beta/beta_tool_text_editor_20250728.rbi +82 -0
  35. data/rbi/anthropic/models/beta/beta_tool_union.rbi +1 -0
  36. data/rbi/anthropic/models/beta/message_count_tokens_params.rbi +5 -0
  37. data/rbi/anthropic/models/beta/message_create_params.rbi +4 -0
  38. data/rbi/anthropic/models/beta/messages/batch_create_params.rbi +4 -0
  39. data/rbi/anthropic/models/citation_char_location.rbi +6 -0
  40. data/rbi/anthropic/models/citation_content_block_location.rbi +6 -0
  41. data/rbi/anthropic/models/citation_page_location.rbi +6 -0
  42. data/rbi/anthropic/models/message_count_tokens_params.rbi +8 -4
  43. data/rbi/anthropic/models/message_count_tokens_tool.rbi +2 -61
  44. data/rbi/anthropic/models/message_create_params.rbi +8 -4
  45. data/rbi/anthropic/models/messages/batch_create_params.rbi +8 -4
  46. data/rbi/anthropic/models/model.rbi +4 -0
  47. data/rbi/anthropic/models/tool_text_editor_20250429.rbi +62 -0
  48. data/rbi/anthropic/models/tool_text_editor_20250728.rbi +72 -0
  49. data/rbi/anthropic/models/tool_union.rbi +2 -61
  50. data/rbi/anthropic/models.rbi +4 -0
  51. data/rbi/anthropic/resources/beta/messages.rbi +3 -0
  52. data/rbi/anthropic/resources/messages.rbi +6 -3
  53. data/sig/anthropic/internal/transport/base_client.rbs +1 -1
  54. data/sig/anthropic/models/beta/beta_citation_char_location.rbs +5 -0
  55. data/sig/anthropic/models/beta/beta_citation_content_block_location.rbs +5 -0
  56. data/sig/anthropic/models/beta/beta_citation_page_location.rbs +5 -0
  57. data/sig/anthropic/models/beta/beta_tool_text_editor_20250728.rbs +39 -0
  58. data/sig/anthropic/models/beta/beta_tool_union.rbs +1 -0
  59. data/sig/anthropic/models/beta/message_count_tokens_params.rbs +1 -0
  60. data/sig/anthropic/models/citation_char_location.rbs +5 -0
  61. data/sig/anthropic/models/citation_content_block_location.rbs +5 -0
  62. data/sig/anthropic/models/citation_page_location.rbs +5 -0
  63. data/sig/anthropic/models/message_count_tokens_tool.rbs +2 -28
  64. data/sig/anthropic/models/model.rbs +4 -0
  65. data/sig/anthropic/models/tool_text_editor_20250429.rbs +30 -0
  66. data/sig/anthropic/models/tool_text_editor_20250728.rbs +35 -0
  67. data/sig/anthropic/models/tool_union.rbs +2 -28
  68. data/sig/anthropic/models.rbs +4 -0
  69. metadata +11 -2
@@ -11,43 +11,14 @@ module Anthropic
11
11
 
12
12
  variant -> { Anthropic::ToolTextEditor20250124 }
13
13
 
14
- variant -> { Anthropic::ToolUnion::TextEditor20250429 }
14
+ variant -> { Anthropic::ToolTextEditor20250429 }
15
15
 
16
- variant -> { Anthropic::WebSearchTool20250305 }
16
+ variant -> { Anthropic::ToolTextEditor20250728 }
17
17
 
18
- class TextEditor20250429 < Anthropic::Internal::Type::BaseModel
19
- # @!attribute name
20
- # Name of the tool.
21
- #
22
- # This is how the tool will be called by the model and in `tool_use` blocks.
23
- #
24
- # @return [Symbol, :str_replace_based_edit_tool]
25
- required :name, const: :str_replace_based_edit_tool
26
-
27
- # @!attribute type
28
- #
29
- # @return [Symbol, :text_editor_20250429]
30
- required :type, const: :text_editor_20250429
31
-
32
- # @!attribute cache_control
33
- # Create a cache control breakpoint at this content block.
34
- #
35
- # @return [Anthropic::Models::CacheControlEphemeral, nil]
36
- optional :cache_control, -> { Anthropic::CacheControlEphemeral }, nil?: true
37
-
38
- # @!method initialize(cache_control: nil, name: :str_replace_based_edit_tool, type: :text_editor_20250429)
39
- # Some parameter documentations has been truncated, see
40
- # {Anthropic::Models::ToolUnion::TextEditor20250429} for more details.
41
- #
42
- # @param cache_control [Anthropic::Models::CacheControlEphemeral, nil] Create a cache control breakpoint at this content block.
43
- #
44
- # @param name [Symbol, :str_replace_based_edit_tool] Name of the tool.
45
- #
46
- # @param type [Symbol, :text_editor_20250429]
47
- end
18
+ variant -> { Anthropic::WebSearchTool20250305 }
48
19
 
49
20
  # @!method self.variants
50
- # @return [Array(Anthropic::Models::Tool, Anthropic::Models::ToolBash20250124, Anthropic::Models::ToolTextEditor20250124, Anthropic::Models::ToolUnion::TextEditor20250429, Anthropic::Models::WebSearchTool20250305)]
21
+ # @return [Array(Anthropic::Models::Tool, Anthropic::Models::ToolBash20250124, Anthropic::Models::ToolTextEditor20250124, Anthropic::Models::ToolTextEditor20250429, Anthropic::Models::ToolTextEditor20250728, Anthropic::Models::WebSearchTool20250305)]
51
22
  end
52
23
  end
53
24
  end
@@ -229,6 +229,10 @@ module Anthropic
229
229
 
230
230
  ToolTextEditor20250124 = Anthropic::Models::ToolTextEditor20250124
231
231
 
232
+ ToolTextEditor20250429 = Anthropic::Models::ToolTextEditor20250429
233
+
234
+ ToolTextEditor20250728 = Anthropic::Models::ToolTextEditor20250728
235
+
232
236
  ToolUnion = Anthropic::Models::ToolUnion
233
237
 
234
238
  ToolUseBlock = Anthropic::Models::ToolUseBlock
@@ -46,7 +46,7 @@ module Anthropic
46
46
  #
47
47
  # @param tool_choice [Anthropic::Models::Beta::BetaToolChoiceAuto, Anthropic::Models::Beta::BetaToolChoiceAny, Anthropic::Models::Beta::BetaToolChoiceTool, Anthropic::Models::Beta::BetaToolChoiceNone] Body param: How the model should use the provided tools. The model can use a spe
48
48
  #
49
- # @param tools [Array<Anthropic::Models::Beta::BetaTool, Anthropic::Models::Beta::BetaToolBash20241022, Anthropic::Models::Beta::BetaToolBash20250124, Anthropic::Models::Beta::BetaCodeExecutionTool20250522, Anthropic::Models::Beta::BetaToolComputerUse20241022, Anthropic::Models::Beta::BetaToolComputerUse20250124, Anthropic::Models::Beta::BetaToolTextEditor20241022, Anthropic::Models::Beta::BetaToolTextEditor20250124, Anthropic::Models::Beta::BetaToolTextEditor20250429, Anthropic::Models::Beta::BetaWebSearchTool20250305>] Body param: Definitions of tools that the model may use.
49
+ # @param tools [Array<Anthropic::Models::Beta::BetaTool, Anthropic::Models::Beta::BetaToolBash20241022, Anthropic::Models::Beta::BetaToolBash20250124, Anthropic::Models::Beta::BetaCodeExecutionTool20250522, Anthropic::Models::Beta::BetaToolComputerUse20241022, Anthropic::Models::Beta::BetaToolComputerUse20250124, Anthropic::Models::Beta::BetaToolTextEditor20241022, Anthropic::Models::Beta::BetaToolTextEditor20250124, Anthropic::Models::Beta::BetaToolTextEditor20250429, Anthropic::Models::Beta::BetaToolTextEditor20250728, Anthropic::Models::Beta::BetaWebSearchTool20250305>] Body param: Definitions of tools that the model may use.
50
50
  #
51
51
  # @param top_k [Integer] Body param: Only sample from the top K options for each subsequent token.
52
52
  #
@@ -128,7 +128,7 @@ module Anthropic
128
128
  #
129
129
  # @param tool_choice [Anthropic::Models::Beta::BetaToolChoiceAuto, Anthropic::Models::Beta::BetaToolChoiceAny, Anthropic::Models::Beta::BetaToolChoiceTool, Anthropic::Models::Beta::BetaToolChoiceNone] Body param: How the model should use the provided tools. The model can use a spe
130
130
  #
131
- # @param tools [Array<Anthropic::Models::Beta::BetaTool, Anthropic::Models::Beta::BetaToolBash20241022, Anthropic::Models::Beta::BetaToolBash20250124, Anthropic::Models::Beta::BetaCodeExecutionTool20250522, Anthropic::Models::Beta::BetaToolComputerUse20241022, Anthropic::Models::Beta::BetaToolComputerUse20250124, Anthropic::Models::Beta::BetaToolTextEditor20241022, Anthropic::Models::Beta::BetaToolTextEditor20250124, Anthropic::Models::Beta::BetaToolTextEditor20250429, Anthropic::Models::Beta::BetaWebSearchTool20250305>] Body param: Definitions of tools that the model may use.
131
+ # @param tools [Array<Anthropic::Models::Beta::BetaTool, Anthropic::Models::Beta::BetaToolBash20241022, Anthropic::Models::Beta::BetaToolBash20250124, Anthropic::Models::Beta::BetaCodeExecutionTool20250522, Anthropic::Models::Beta::BetaToolComputerUse20241022, Anthropic::Models::Beta::BetaToolComputerUse20250124, Anthropic::Models::Beta::BetaToolTextEditor20241022, Anthropic::Models::Beta::BetaToolTextEditor20250124, Anthropic::Models::Beta::BetaToolTextEditor20250429, Anthropic::Models::Beta::BetaToolTextEditor20250728, Anthropic::Models::Beta::BetaWebSearchTool20250305>] Body param: Definitions of tools that the model may use.
132
132
  #
133
133
  # @param top_k [Integer] Body param: Only sample from the top K options for each subsequent token.
134
134
  #
@@ -259,7 +259,7 @@ module Anthropic
259
259
  #
260
260
  # @param tool_choice [Anthropic::Models::Beta::BetaToolChoiceAuto, Anthropic::Models::Beta::BetaToolChoiceAny, Anthropic::Models::Beta::BetaToolChoiceTool, Anthropic::Models::Beta::BetaToolChoiceNone] Body param: How the model should use the provided tools. The model can use a spe
261
261
  #
262
- # @param tools [Array<Anthropic::Models::Beta::BetaTool, Anthropic::Models::Beta::BetaToolBash20241022, Anthropic::Models::Beta::BetaToolBash20250124, Anthropic::Models::Beta::BetaCodeExecutionTool20250522, Anthropic::Models::Beta::BetaToolComputerUse20241022, Anthropic::Models::Beta::BetaToolComputerUse20250124, Anthropic::Models::Beta::BetaToolTextEditor20241022, Anthropic::Models::Beta::BetaToolTextEditor20250124, Anthropic::Models::Beta::BetaToolTextEditor20250429, Anthropic::Models::Beta::BetaWebSearchTool20250305>] Body param: Definitions of tools that the model may use.
262
+ # @param tools [Array<Anthropic::Models::Beta::BetaTool, Anthropic::Models::Beta::BetaToolBash20241022, Anthropic::Models::Beta::BetaToolBash20250124, Anthropic::Models::Beta::BetaCodeExecutionTool20250522, Anthropic::Models::Beta::BetaToolComputerUse20241022, Anthropic::Models::Beta::BetaToolComputerUse20250124, Anthropic::Models::Beta::BetaToolTextEditor20241022, Anthropic::Models::Beta::BetaToolTextEditor20250124, Anthropic::Models::Beta::BetaToolTextEditor20250429, Anthropic::Models::Beta::BetaToolTextEditor20250728, Anthropic::Models::Beta::BetaWebSearchTool20250305>] Body param: Definitions of tools that the model may use.
263
263
  #
264
264
  # @param betas [Array<String, Symbol, Anthropic::Models::AnthropicBeta>] Header param: Optional header to specify the beta version(s) you want to use.
265
265
  #
@@ -41,7 +41,7 @@ module Anthropic
41
41
  #
42
42
  # @param tool_choice [Anthropic::Models::ToolChoiceAuto, Anthropic::Models::ToolChoiceAny, Anthropic::Models::ToolChoiceTool, Anthropic::Models::ToolChoiceNone] How the model should use the provided tools. The model can use a specific tool,
43
43
  #
44
- # @param tools [Array<Anthropic::Models::Tool, Anthropic::Models::ToolBash20250124, Anthropic::Models::ToolTextEditor20250124, Anthropic::Models::ToolUnion::TextEditor20250429, Anthropic::Models::WebSearchTool20250305>] Definitions of tools that the model may use.
44
+ # @param tools [Array<Anthropic::Models::Tool, Anthropic::Models::ToolBash20250124, Anthropic::Models::ToolTextEditor20250124, Anthropic::Models::ToolTextEditor20250429, Anthropic::Models::ToolTextEditor20250728, Anthropic::Models::WebSearchTool20250305>] Definitions of tools that the model may use.
45
45
  #
46
46
  # @param top_k [Integer] Only sample from the top K options for each subsequent token.
47
47
  #
@@ -180,7 +180,7 @@ module Anthropic
180
180
  #
181
181
  # @param tool_choice [Anthropic::Models::ToolChoiceAuto, Anthropic::Models::ToolChoiceAny, Anthropic::Models::ToolChoiceTool, Anthropic::Models::ToolChoiceNone] How the model should use the provided tools. The model can use a specific tool,
182
182
  #
183
- # @param tools [Array<Anthropic::Models::Tool, Anthropic::Models::ToolBash20250124, Anthropic::Models::ToolTextEditor20250124, Anthropic::Models::ToolUnion::TextEditor20250429, Anthropic::Models::WebSearchTool20250305>] Definitions of tools that the model may use.
183
+ # @param tools [Array<Anthropic::Models::Tool, Anthropic::Models::ToolBash20250124, Anthropic::Models::ToolTextEditor20250124, Anthropic::Models::ToolTextEditor20250429, Anthropic::Models::ToolTextEditor20250728, Anthropic::Models::WebSearchTool20250305>] Definitions of tools that the model may use.
184
184
  #
185
185
  # @param top_k [Integer] Only sample from the top K options for each subsequent token.
186
186
  #
@@ -232,7 +232,7 @@ module Anthropic
232
232
  #
233
233
  # @param tool_choice [Anthropic::Models::ToolChoiceAuto, Anthropic::Models::ToolChoiceAny, Anthropic::Models::ToolChoiceTool, Anthropic::Models::ToolChoiceNone] How the model should use the provided tools. The model can use a specific tool,
234
234
  #
235
- # @param tools [Array<Anthropic::Models::Tool, Anthropic::Models::ToolBash20250124, Anthropic::Models::ToolTextEditor20250124, Anthropic::Models::MessageCountTokensTool::TextEditor20250429, Anthropic::Models::WebSearchTool20250305>] Definitions of tools that the model may use.
235
+ # @param tools [Array<Anthropic::Models::Tool, Anthropic::Models::ToolBash20250124, Anthropic::Models::ToolTextEditor20250124, Anthropic::Models::ToolTextEditor20250429, Anthropic::Models::ToolTextEditor20250728, Anthropic::Models::WebSearchTool20250305>] Definitions of tools that the model may use.
236
236
  #
237
237
  # @param request_options [Anthropic::RequestOptions, Hash{Symbol=>Object}, nil]
238
238
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Anthropic
4
- VERSION = "1.3.0"
4
+ VERSION = "1.4.0"
5
5
  end
data/lib/anthropic.rb CHANGED
@@ -158,6 +158,7 @@ require_relative "anthropic/models/beta/beta_tool_result_block_param"
158
158
  require_relative "anthropic/models/beta/beta_tool_text_editor_20241022"
159
159
  require_relative "anthropic/models/beta/beta_tool_text_editor_20250124"
160
160
  require_relative "anthropic/models/beta/beta_tool_text_editor_20250429"
161
+ require_relative "anthropic/models/beta/beta_tool_text_editor_20250728"
161
162
  require_relative "anthropic/models/beta/beta_tool_union"
162
163
  require_relative "anthropic/models/beta/beta_tool_use_block"
163
164
  require_relative "anthropic/models/beta/beta_tool_use_block_param"
@@ -303,6 +304,8 @@ require_relative "anthropic/models/tool_choice_none"
303
304
  require_relative "anthropic/models/tool_choice_tool"
304
305
  require_relative "anthropic/models/tool_result_block_param"
305
306
  require_relative "anthropic/models/tool_text_editor_20250124"
307
+ require_relative "anthropic/models/tool_text_editor_20250429"
308
+ require_relative "anthropic/models/tool_text_editor_20250728"
306
309
  require_relative "anthropic/models/tool_union"
307
310
  require_relative "anthropic/models/tool_use_block"
308
311
  require_relative "anthropic/models/tool_use_block_param"
@@ -222,7 +222,7 @@ module Anthropic
222
222
  send_retry_header: T::Boolean
223
223
  ).returns([Integer, Net::HTTPResponse, T::Enumerable[String]])
224
224
  end
225
- private def send_request(
225
+ def send_request(
226
226
  request,
227
227
  redirect_count:,
228
228
  retry_count:,
@@ -26,6 +26,9 @@ module Anthropic
26
26
  sig { returns(Integer) }
27
27
  attr_accessor :end_char_index
28
28
 
29
+ sig { returns(T.nilable(String)) }
30
+ attr_accessor :file_id
31
+
29
32
  sig { returns(Integer) }
30
33
  attr_accessor :start_char_index
31
34
 
@@ -38,6 +41,7 @@ module Anthropic
38
41
  document_index: Integer,
39
42
  document_title: T.nilable(String),
40
43
  end_char_index: Integer,
44
+ file_id: T.nilable(String),
41
45
  start_char_index: Integer,
42
46
  type: Symbol
43
47
  ).returns(T.attached_class)
@@ -47,6 +51,7 @@ module Anthropic
47
51
  document_index:,
48
52
  document_title:,
49
53
  end_char_index:,
54
+ file_id:,
50
55
  start_char_index:,
51
56
  type: :char_location
52
57
  )
@@ -59,6 +64,7 @@ module Anthropic
59
64
  document_index: Integer,
60
65
  document_title: T.nilable(String),
61
66
  end_char_index: Integer,
67
+ file_id: T.nilable(String),
62
68
  start_char_index: Integer,
63
69
  type: Symbol
64
70
  }
@@ -26,6 +26,9 @@ module Anthropic
26
26
  sig { returns(Integer) }
27
27
  attr_accessor :end_block_index
28
28
 
29
+ sig { returns(T.nilable(String)) }
30
+ attr_accessor :file_id
31
+
29
32
  sig { returns(Integer) }
30
33
  attr_accessor :start_block_index
31
34
 
@@ -38,6 +41,7 @@ module Anthropic
38
41
  document_index: Integer,
39
42
  document_title: T.nilable(String),
40
43
  end_block_index: Integer,
44
+ file_id: T.nilable(String),
41
45
  start_block_index: Integer,
42
46
  type: Symbol
43
47
  ).returns(T.attached_class)
@@ -47,6 +51,7 @@ module Anthropic
47
51
  document_index:,
48
52
  document_title:,
49
53
  end_block_index:,
54
+ file_id:,
50
55
  start_block_index:,
51
56
  type: :content_block_location
52
57
  )
@@ -59,6 +64,7 @@ module Anthropic
59
64
  document_index: Integer,
60
65
  document_title: T.nilable(String),
61
66
  end_block_index: Integer,
67
+ file_id: T.nilable(String),
62
68
  start_block_index: Integer,
63
69
  type: Symbol
64
70
  }
@@ -26,6 +26,9 @@ module Anthropic
26
26
  sig { returns(Integer) }
27
27
  attr_accessor :end_page_number
28
28
 
29
+ sig { returns(T.nilable(String)) }
30
+ attr_accessor :file_id
31
+
29
32
  sig { returns(Integer) }
30
33
  attr_accessor :start_page_number
31
34
 
@@ -38,6 +41,7 @@ module Anthropic
38
41
  document_index: Integer,
39
42
  document_title: T.nilable(String),
40
43
  end_page_number: Integer,
44
+ file_id: T.nilable(String),
41
45
  start_page_number: Integer,
42
46
  type: Symbol
43
47
  ).returns(T.attached_class)
@@ -47,6 +51,7 @@ module Anthropic
47
51
  document_index:,
48
52
  document_title:,
49
53
  end_page_number:,
54
+ file_id:,
50
55
  start_page_number:,
51
56
  type: :page_location
52
57
  )
@@ -59,6 +64,7 @@ module Anthropic
59
64
  document_index: Integer,
60
65
  document_title: T.nilable(String),
61
66
  end_page_number: Integer,
67
+ file_id: T.nilable(String),
62
68
  start_page_number: Integer,
63
69
  type: Symbol
64
70
  }
@@ -0,0 +1,82 @@
1
+ # typed: strong
2
+
3
+ module Anthropic
4
+ module Models
5
+ BetaToolTextEditor20250728 = Beta::BetaToolTextEditor20250728
6
+
7
+ module Beta
8
+ class BetaToolTextEditor20250728 < Anthropic::Internal::Type::BaseModel
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(
12
+ Anthropic::Beta::BetaToolTextEditor20250728,
13
+ Anthropic::Internal::AnyHash
14
+ )
15
+ end
16
+
17
+ # Name of the tool.
18
+ #
19
+ # This is how the tool will be called by the model and in `tool_use` blocks.
20
+ sig { returns(Symbol) }
21
+ attr_accessor :name
22
+
23
+ sig { returns(Symbol) }
24
+ attr_accessor :type
25
+
26
+ # Create a cache control breakpoint at this content block.
27
+ sig { returns(T.nilable(Anthropic::Beta::BetaCacheControlEphemeral)) }
28
+ attr_reader :cache_control
29
+
30
+ sig do
31
+ params(
32
+ cache_control:
33
+ T.nilable(Anthropic::Beta::BetaCacheControlEphemeral::OrHash)
34
+ ).void
35
+ end
36
+ attr_writer :cache_control
37
+
38
+ # Maximum number of characters to display when viewing a file. If not specified,
39
+ # defaults to displaying the full file.
40
+ sig { returns(T.nilable(Integer)) }
41
+ attr_accessor :max_characters
42
+
43
+ sig do
44
+ params(
45
+ cache_control:
46
+ T.nilable(Anthropic::Beta::BetaCacheControlEphemeral::OrHash),
47
+ max_characters: T.nilable(Integer),
48
+ name: Symbol,
49
+ type: Symbol
50
+ ).returns(T.attached_class)
51
+ end
52
+ def self.new(
53
+ # Create a cache control breakpoint at this content block.
54
+ cache_control: nil,
55
+ # Maximum number of characters to display when viewing a file. If not specified,
56
+ # defaults to displaying the full file.
57
+ max_characters: nil,
58
+ # Name of the tool.
59
+ #
60
+ # This is how the tool will be called by the model and in `tool_use` blocks.
61
+ name: :str_replace_based_edit_tool,
62
+ type: :text_editor_20250728
63
+ )
64
+ end
65
+
66
+ sig do
67
+ override.returns(
68
+ {
69
+ name: Symbol,
70
+ type: Symbol,
71
+ cache_control:
72
+ T.nilable(Anthropic::Beta::BetaCacheControlEphemeral),
73
+ max_characters: T.nilable(Integer)
74
+ }
75
+ )
76
+ end
77
+ def to_hash
78
+ end
79
+ end
80
+ end
81
+ end
82
+ end
@@ -20,6 +20,7 @@ module Anthropic
20
20
  Anthropic::Beta::BetaToolTextEditor20241022,
21
21
  Anthropic::Beta::BetaToolTextEditor20250124,
22
22
  Anthropic::Beta::BetaToolTextEditor20250429,
23
+ Anthropic::Beta::BetaToolTextEditor20250728,
23
24
  Anthropic::Beta::BetaWebSearchTool20250305
24
25
  )
25
26
  end
@@ -303,6 +303,7 @@ module Anthropic
303
303
  Anthropic::Beta::BetaToolTextEditor20241022,
304
304
  Anthropic::Beta::BetaToolTextEditor20250124,
305
305
  Anthropic::Beta::BetaToolTextEditor20250429,
306
+ Anthropic::Beta::BetaToolTextEditor20250728,
306
307
  Anthropic::Beta::BetaWebSearchTool20250305
307
308
  )
308
309
  ]
@@ -325,6 +326,7 @@ module Anthropic
325
326
  Anthropic::Beta::BetaToolTextEditor20241022::OrHash,
326
327
  Anthropic::Beta::BetaToolTextEditor20250124::OrHash,
327
328
  Anthropic::Beta::BetaToolTextEditor20250429::OrHash,
329
+ Anthropic::Beta::BetaToolTextEditor20250728::OrHash,
328
330
  Anthropic::Beta::BetaWebSearchTool20250305::OrHash
329
331
  )
330
332
  ]
@@ -383,6 +385,7 @@ module Anthropic
383
385
  Anthropic::Beta::BetaToolTextEditor20241022::OrHash,
384
386
  Anthropic::Beta::BetaToolTextEditor20250124::OrHash,
385
387
  Anthropic::Beta::BetaToolTextEditor20250429::OrHash,
388
+ Anthropic::Beta::BetaToolTextEditor20250728::OrHash,
386
389
  Anthropic::Beta::BetaWebSearchTool20250305::OrHash
387
390
  )
388
391
  ],
@@ -620,6 +623,7 @@ module Anthropic
620
623
  Anthropic::Beta::BetaToolTextEditor20241022,
621
624
  Anthropic::Beta::BetaToolTextEditor20250124,
622
625
  Anthropic::Beta::BetaToolTextEditor20250429,
626
+ Anthropic::Beta::BetaToolTextEditor20250728,
623
627
  Anthropic::Beta::BetaWebSearchTool20250305
624
628
  )
625
629
  ],
@@ -679,6 +683,7 @@ module Anthropic
679
683
  Anthropic::Beta::BetaToolTextEditor20241022,
680
684
  Anthropic::Beta::BetaToolTextEditor20250124,
681
685
  Anthropic::Beta::BetaToolTextEditor20250429,
686
+ Anthropic::Beta::BetaToolTextEditor20250728,
682
687
  Anthropic::Beta::BetaWebSearchTool20250305
683
688
  )
684
689
  end
@@ -373,6 +373,7 @@ module Anthropic
373
373
  Anthropic::Beta::BetaToolTextEditor20241022,
374
374
  Anthropic::Beta::BetaToolTextEditor20250124,
375
375
  Anthropic::Beta::BetaToolTextEditor20250429,
376
+ Anthropic::Beta::BetaToolTextEditor20250728,
376
377
  Anthropic::Beta::BetaWebSearchTool20250305
377
378
  )
378
379
  ]
@@ -395,6 +396,7 @@ module Anthropic
395
396
  Anthropic::Beta::BetaToolTextEditor20241022::OrHash,
396
397
  Anthropic::Beta::BetaToolTextEditor20250124::OrHash,
397
398
  Anthropic::Beta::BetaToolTextEditor20250429::OrHash,
399
+ Anthropic::Beta::BetaToolTextEditor20250728::OrHash,
398
400
  Anthropic::Beta::BetaWebSearchTool20250305::OrHash
399
401
  )
400
402
  ]
@@ -487,6 +489,7 @@ module Anthropic
487
489
  Anthropic::Beta::BetaToolTextEditor20241022::OrHash,
488
490
  Anthropic::Beta::BetaToolTextEditor20250124::OrHash,
489
491
  Anthropic::Beta::BetaToolTextEditor20250429::OrHash,
492
+ Anthropic::Beta::BetaToolTextEditor20250728::OrHash,
490
493
  Anthropic::Beta::BetaWebSearchTool20250305::OrHash
491
494
  )
492
495
  ],
@@ -787,6 +790,7 @@ module Anthropic
787
790
  Anthropic::Beta::BetaToolTextEditor20241022,
788
791
  Anthropic::Beta::BetaToolTextEditor20250124,
789
792
  Anthropic::Beta::BetaToolTextEditor20250429,
793
+ Anthropic::Beta::BetaToolTextEditor20250728,
790
794
  Anthropic::Beta::BetaWebSearchTool20250305
791
795
  )
792
796
  ],
@@ -529,6 +529,7 @@ module Anthropic
529
529
  Anthropic::Beta::BetaToolTextEditor20241022,
530
530
  Anthropic::Beta::BetaToolTextEditor20250124,
531
531
  Anthropic::Beta::BetaToolTextEditor20250429,
532
+ Anthropic::Beta::BetaToolTextEditor20250728,
532
533
  Anthropic::Beta::BetaWebSearchTool20250305
533
534
  )
534
535
  ]
@@ -551,6 +552,7 @@ module Anthropic
551
552
  Anthropic::Beta::BetaToolTextEditor20241022::OrHash,
552
553
  Anthropic::Beta::BetaToolTextEditor20250124::OrHash,
553
554
  Anthropic::Beta::BetaToolTextEditor20250429::OrHash,
555
+ Anthropic::Beta::BetaToolTextEditor20250728::OrHash,
554
556
  Anthropic::Beta::BetaWebSearchTool20250305::OrHash
555
557
  )
556
558
  ]
@@ -632,6 +634,7 @@ module Anthropic
632
634
  Anthropic::Beta::BetaToolTextEditor20241022::OrHash,
633
635
  Anthropic::Beta::BetaToolTextEditor20250124::OrHash,
634
636
  Anthropic::Beta::BetaToolTextEditor20250429::OrHash,
637
+ Anthropic::Beta::BetaToolTextEditor20250728::OrHash,
635
638
  Anthropic::Beta::BetaWebSearchTool20250305::OrHash
636
639
  )
637
640
  ],
@@ -936,6 +939,7 @@ module Anthropic
936
939
  Anthropic::Beta::BetaToolTextEditor20241022,
937
940
  Anthropic::Beta::BetaToolTextEditor20250124,
938
941
  Anthropic::Beta::BetaToolTextEditor20250429,
942
+ Anthropic::Beta::BetaToolTextEditor20250728,
939
943
  Anthropic::Beta::BetaWebSearchTool20250305
940
944
  )
941
945
  ],
@@ -20,6 +20,9 @@ module Anthropic
20
20
  sig { returns(Integer) }
21
21
  attr_accessor :end_char_index
22
22
 
23
+ sig { returns(T.nilable(String)) }
24
+ attr_accessor :file_id
25
+
23
26
  sig { returns(Integer) }
24
27
  attr_accessor :start_char_index
25
28
 
@@ -32,6 +35,7 @@ module Anthropic
32
35
  document_index: Integer,
33
36
  document_title: T.nilable(String),
34
37
  end_char_index: Integer,
38
+ file_id: T.nilable(String),
35
39
  start_char_index: Integer,
36
40
  type: Symbol
37
41
  ).returns(T.attached_class)
@@ -41,6 +45,7 @@ module Anthropic
41
45
  document_index:,
42
46
  document_title:,
43
47
  end_char_index:,
48
+ file_id:,
44
49
  start_char_index:,
45
50
  type: :char_location
46
51
  )
@@ -53,6 +58,7 @@ module Anthropic
53
58
  document_index: Integer,
54
59
  document_title: T.nilable(String),
55
60
  end_char_index: Integer,
61
+ file_id: T.nilable(String),
56
62
  start_char_index: Integer,
57
63
  type: Symbol
58
64
  }
@@ -23,6 +23,9 @@ module Anthropic
23
23
  sig { returns(Integer) }
24
24
  attr_accessor :end_block_index
25
25
 
26
+ sig { returns(T.nilable(String)) }
27
+ attr_accessor :file_id
28
+
26
29
  sig { returns(Integer) }
27
30
  attr_accessor :start_block_index
28
31
 
@@ -35,6 +38,7 @@ module Anthropic
35
38
  document_index: Integer,
36
39
  document_title: T.nilable(String),
37
40
  end_block_index: Integer,
41
+ file_id: T.nilable(String),
38
42
  start_block_index: Integer,
39
43
  type: Symbol
40
44
  ).returns(T.attached_class)
@@ -44,6 +48,7 @@ module Anthropic
44
48
  document_index:,
45
49
  document_title:,
46
50
  end_block_index:,
51
+ file_id:,
47
52
  start_block_index:,
48
53
  type: :content_block_location
49
54
  )
@@ -56,6 +61,7 @@ module Anthropic
56
61
  document_index: Integer,
57
62
  document_title: T.nilable(String),
58
63
  end_block_index: Integer,
64
+ file_id: T.nilable(String),
59
65
  start_block_index: Integer,
60
66
  type: Symbol
61
67
  }
@@ -20,6 +20,9 @@ module Anthropic
20
20
  sig { returns(Integer) }
21
21
  attr_accessor :end_page_number
22
22
 
23
+ sig { returns(T.nilable(String)) }
24
+ attr_accessor :file_id
25
+
23
26
  sig { returns(Integer) }
24
27
  attr_accessor :start_page_number
25
28
 
@@ -32,6 +35,7 @@ module Anthropic
32
35
  document_index: Integer,
33
36
  document_title: T.nilable(String),
34
37
  end_page_number: Integer,
38
+ file_id: T.nilable(String),
35
39
  start_page_number: Integer,
36
40
  type: Symbol
37
41
  ).returns(T.attached_class)
@@ -41,6 +45,7 @@ module Anthropic
41
45
  document_index:,
42
46
  document_title:,
43
47
  end_page_number:,
48
+ file_id:,
44
49
  start_page_number:,
45
50
  type: :page_location
46
51
  )
@@ -53,6 +58,7 @@ module Anthropic
53
58
  document_index: Integer,
54
59
  document_title: T.nilable(String),
55
60
  end_page_number: Integer,
61
+ file_id: T.nilable(String),
56
62
  start_page_number: Integer,
57
63
  type: Symbol
58
64
  }
@@ -274,7 +274,8 @@ module Anthropic
274
274
  Anthropic::Tool,
275
275
  Anthropic::ToolBash20250124,
276
276
  Anthropic::ToolTextEditor20250124,
277
- Anthropic::MessageCountTokensTool::TextEditor20250429,
277
+ Anthropic::ToolTextEditor20250429,
278
+ Anthropic::ToolTextEditor20250728,
278
279
  Anthropic::WebSearchTool20250305
279
280
  )
280
281
  ]
@@ -291,7 +292,8 @@ module Anthropic
291
292
  Anthropic::Tool::OrHash,
292
293
  Anthropic::ToolBash20250124::OrHash,
293
294
  Anthropic::ToolTextEditor20250124::OrHash,
294
- Anthropic::MessageCountTokensTool::TextEditor20250429::OrHash,
295
+ Anthropic::ToolTextEditor20250429::OrHash,
296
+ Anthropic::ToolTextEditor20250728::OrHash,
295
297
  Anthropic::WebSearchTool20250305::OrHash
296
298
  )
297
299
  ]
@@ -322,7 +324,8 @@ module Anthropic
322
324
  Anthropic::Tool::OrHash,
323
325
  Anthropic::ToolBash20250124::OrHash,
324
326
  Anthropic::ToolTextEditor20250124::OrHash,
325
- Anthropic::MessageCountTokensTool::TextEditor20250429::OrHash,
327
+ Anthropic::ToolTextEditor20250429::OrHash,
328
+ Anthropic::ToolTextEditor20250728::OrHash,
326
329
  Anthropic::WebSearchTool20250305::OrHash
327
330
  )
328
331
  ],
@@ -546,7 +549,8 @@ module Anthropic
546
549
  Anthropic::Tool,
547
550
  Anthropic::ToolBash20250124,
548
551
  Anthropic::ToolTextEditor20250124,
549
- Anthropic::MessageCountTokensTool::TextEditor20250429,
552
+ Anthropic::ToolTextEditor20250429,
553
+ Anthropic::ToolTextEditor20250728,
550
554
  Anthropic::WebSearchTool20250305
551
555
  )
552
556
  ],
@@ -11,71 +11,12 @@ module Anthropic
11
11
  Anthropic::Tool,
12
12
  Anthropic::ToolBash20250124,
13
13
  Anthropic::ToolTextEditor20250124,
14
- Anthropic::MessageCountTokensTool::TextEditor20250429,
14
+ Anthropic::ToolTextEditor20250429,
15
+ Anthropic::ToolTextEditor20250728,
15
16
  Anthropic::WebSearchTool20250305
16
17
  )
17
18
  end
18
19
 
19
- class TextEditor20250429 < Anthropic::Internal::Type::BaseModel
20
- OrHash =
21
- T.type_alias do
22
- T.any(
23
- Anthropic::MessageCountTokensTool::TextEditor20250429,
24
- Anthropic::Internal::AnyHash
25
- )
26
- end
27
-
28
- # Name of the tool.
29
- #
30
- # This is how the tool will be called by the model and in `tool_use` blocks.
31
- sig { returns(Symbol) }
32
- attr_accessor :name
33
-
34
- sig { returns(Symbol) }
35
- attr_accessor :type
36
-
37
- # Create a cache control breakpoint at this content block.
38
- sig { returns(T.nilable(Anthropic::CacheControlEphemeral)) }
39
- attr_reader :cache_control
40
-
41
- sig do
42
- params(
43
- cache_control: T.nilable(Anthropic::CacheControlEphemeral::OrHash)
44
- ).void
45
- end
46
- attr_writer :cache_control
47
-
48
- sig do
49
- params(
50
- cache_control: T.nilable(Anthropic::CacheControlEphemeral::OrHash),
51
- name: Symbol,
52
- type: Symbol
53
- ).returns(T.attached_class)
54
- end
55
- def self.new(
56
- # Create a cache control breakpoint at this content block.
57
- cache_control: nil,
58
- # Name of the tool.
59
- #
60
- # This is how the tool will be called by the model and in `tool_use` blocks.
61
- name: :str_replace_based_edit_tool,
62
- type: :text_editor_20250429
63
- )
64
- end
65
-
66
- sig do
67
- override.returns(
68
- {
69
- name: Symbol,
70
- type: Symbol,
71
- cache_control: T.nilable(Anthropic::CacheControlEphemeral)
72
- }
73
- )
74
- end
75
- def to_hash
76
- end
77
- end
78
-
79
20
  sig do
80
21
  override.returns(T::Array[Anthropic::MessageCountTokensTool::Variants])
81
22
  end