anthropic 1.2.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 (75) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +41 -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 -22
  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 +70 -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/helpers/bedrock/client.rbi +17 -6
  31. data/rbi/anthropic/helpers/streaming/events.rbi +12 -2
  32. data/rbi/anthropic/helpers/streaming/message_stream.rbi +48 -34
  33. data/rbi/anthropic/helpers/vertex/client.rbi +17 -6
  34. data/rbi/anthropic/internal/transport/base_client.rbi +1 -1
  35. data/rbi/anthropic/models/beta/beta_citation_char_location.rbi +6 -0
  36. data/rbi/anthropic/models/beta/beta_citation_content_block_location.rbi +6 -0
  37. data/rbi/anthropic/models/beta/beta_citation_page_location.rbi +6 -0
  38. data/rbi/anthropic/models/beta/beta_tool_text_editor_20250728.rbi +82 -0
  39. data/rbi/anthropic/models/beta/beta_tool_union.rbi +1 -0
  40. data/rbi/anthropic/models/beta/message_count_tokens_params.rbi +5 -0
  41. data/rbi/anthropic/models/beta/message_create_params.rbi +4 -0
  42. data/rbi/anthropic/models/beta/messages/batch_create_params.rbi +4 -0
  43. data/rbi/anthropic/models/citation_char_location.rbi +6 -0
  44. data/rbi/anthropic/models/citation_content_block_location.rbi +6 -0
  45. data/rbi/anthropic/models/citation_page_location.rbi +6 -0
  46. data/rbi/anthropic/models/message_count_tokens_params.rbi +8 -4
  47. data/rbi/anthropic/models/message_count_tokens_tool.rbi +2 -61
  48. data/rbi/anthropic/models/message_create_params.rbi +8 -4
  49. data/rbi/anthropic/models/messages/batch_create_params.rbi +8 -4
  50. data/rbi/anthropic/models/model.rbi +4 -8
  51. data/rbi/anthropic/models/tool_text_editor_20250429.rbi +62 -0
  52. data/rbi/anthropic/models/tool_text_editor_20250728.rbi +72 -0
  53. data/rbi/anthropic/models/tool_union.rbi +2 -61
  54. data/rbi/anthropic/models.rbi +4 -0
  55. data/rbi/anthropic/resources/beta/messages.rbi +3 -0
  56. data/rbi/anthropic/resources/messages.rbi +53 -28
  57. data/sig/anthropic/helpers/streaming/events.rbs +30 -32
  58. data/sig/anthropic/helpers/streaming/message_stream.rbs +4 -2
  59. data/sig/anthropic/internal/transport/base_client.rbs +1 -1
  60. data/sig/anthropic/models/beta/beta_citation_char_location.rbs +5 -0
  61. data/sig/anthropic/models/beta/beta_citation_content_block_location.rbs +5 -0
  62. data/sig/anthropic/models/beta/beta_citation_page_location.rbs +5 -0
  63. data/sig/anthropic/models/beta/beta_tool_text_editor_20250728.rbs +39 -0
  64. data/sig/anthropic/models/beta/beta_tool_union.rbs +1 -0
  65. data/sig/anthropic/models/beta/message_count_tokens_params.rbs +1 -0
  66. data/sig/anthropic/models/citation_char_location.rbs +5 -0
  67. data/sig/anthropic/models/citation_content_block_location.rbs +5 -0
  68. data/sig/anthropic/models/citation_page_location.rbs +5 -0
  69. data/sig/anthropic/models/message_count_tokens_tool.rbs +2 -28
  70. data/sig/anthropic/models/model.rbs +4 -10
  71. data/sig/anthropic/models/tool_text_editor_20250429.rbs +30 -0
  72. data/sig/anthropic/models/tool_text_editor_20250728.rbs +35 -0
  73. data/sig/anthropic/models/tool_union.rbs +2 -28
  74. data/sig/anthropic/models.rbs +4 -0
  75. metadata +11 -2
@@ -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
@@ -332,7 +332,8 @@ module Anthropic
332
332
  Anthropic::Tool,
333
333
  Anthropic::ToolBash20250124,
334
334
  Anthropic::ToolTextEditor20250124,
335
- Anthropic::ToolUnion::TextEditor20250429,
335
+ Anthropic::ToolTextEditor20250429,
336
+ Anthropic::ToolTextEditor20250728,
336
337
  Anthropic::WebSearchTool20250305
337
338
  )
338
339
  ]
@@ -349,7 +350,8 @@ module Anthropic
349
350
  Anthropic::Tool::OrHash,
350
351
  Anthropic::ToolBash20250124::OrHash,
351
352
  Anthropic::ToolTextEditor20250124::OrHash,
352
- Anthropic::ToolUnion::TextEditor20250429::OrHash,
353
+ Anthropic::ToolTextEditor20250429::OrHash,
354
+ Anthropic::ToolTextEditor20250728::OrHash,
353
355
  Anthropic::WebSearchTool20250305::OrHash
354
356
  )
355
357
  ]
@@ -413,7 +415,8 @@ module Anthropic
413
415
  Anthropic::Tool::OrHash,
414
416
  Anthropic::ToolBash20250124::OrHash,
415
417
  Anthropic::ToolTextEditor20250124::OrHash,
416
- Anthropic::ToolUnion::TextEditor20250429::OrHash,
418
+ Anthropic::ToolTextEditor20250429::OrHash,
419
+ Anthropic::ToolTextEditor20250728::OrHash,
417
420
  Anthropic::WebSearchTool20250305::OrHash
418
421
  )
419
422
  ],
@@ -697,7 +700,8 @@ module Anthropic
697
700
  Anthropic::Tool,
698
701
  Anthropic::ToolBash20250124,
699
702
  Anthropic::ToolTextEditor20250124,
700
- Anthropic::ToolUnion::TextEditor20250429,
703
+ Anthropic::ToolTextEditor20250429,
704
+ Anthropic::ToolTextEditor20250728,
701
705
  Anthropic::WebSearchTool20250305
702
706
  )
703
707
  ],
@@ -464,7 +464,8 @@ module Anthropic
464
464
  Anthropic::Tool,
465
465
  Anthropic::ToolBash20250124,
466
466
  Anthropic::ToolTextEditor20250124,
467
- Anthropic::ToolUnion::TextEditor20250429,
467
+ Anthropic::ToolTextEditor20250429,
468
+ Anthropic::ToolTextEditor20250728,
468
469
  Anthropic::WebSearchTool20250305
469
470
  )
470
471
  ]
@@ -481,7 +482,8 @@ module Anthropic
481
482
  Anthropic::Tool::OrHash,
482
483
  Anthropic::ToolBash20250124::OrHash,
483
484
  Anthropic::ToolTextEditor20250124::OrHash,
484
- Anthropic::ToolUnion::TextEditor20250429::OrHash,
485
+ Anthropic::ToolTextEditor20250429::OrHash,
486
+ Anthropic::ToolTextEditor20250728::OrHash,
485
487
  Anthropic::WebSearchTool20250305::OrHash
486
488
  )
487
489
  ]
@@ -552,7 +554,8 @@ module Anthropic
552
554
  Anthropic::Tool::OrHash,
553
555
  Anthropic::ToolBash20250124::OrHash,
554
556
  Anthropic::ToolTextEditor20250124::OrHash,
555
- Anthropic::ToolUnion::TextEditor20250429::OrHash,
557
+ Anthropic::ToolTextEditor20250429::OrHash,
558
+ Anthropic::ToolTextEditor20250728::OrHash,
556
559
  Anthropic::WebSearchTool20250305::OrHash
557
560
  )
558
561
  ],
@@ -842,7 +845,8 @@ module Anthropic
842
845
  Anthropic::Tool,
843
846
  Anthropic::ToolBash20250124,
844
847
  Anthropic::ToolTextEditor20250124,
845
- Anthropic::ToolUnion::TextEditor20250429,
848
+ Anthropic::ToolTextEditor20250429,
849
+ Anthropic::ToolTextEditor20250728,
846
850
  Anthropic::WebSearchTool20250305
847
851
  )
848
852
  ],
@@ -68,6 +68,10 @@ module Anthropic
68
68
  CLAUDE_4_OPUS_20250514 =
69
69
  T.let(:"claude-4-opus-20250514", Anthropic::Model::TaggedSymbol)
70
70
 
71
+ # Our most capable model
72
+ CLAUDE_OPUS_4_1_20250805 =
73
+ T.let(:"claude-opus-4-1-20250805", Anthropic::Model::TaggedSymbol)
74
+
71
75
  # Excels at writing and complex tasks
72
76
  CLAUDE_3_OPUS_LATEST =
73
77
  T.let(:"claude-3-opus-latest", Anthropic::Model::TaggedSymbol)
@@ -76,17 +80,9 @@ module Anthropic
76
80
  CLAUDE_3_OPUS_20240229 =
77
81
  T.let(:"claude-3-opus-20240229", Anthropic::Model::TaggedSymbol)
78
82
 
79
- # Balance of speed and intelligence
80
- CLAUDE_3_SONNET_20240229 =
81
- T.let(:"claude-3-sonnet-20240229", Anthropic::Model::TaggedSymbol)
82
-
83
83
  # Our previous most fast and cost-effective
84
84
  CLAUDE_3_HAIKU_20240307 =
85
85
  T.let(:"claude-3-haiku-20240307", Anthropic::Model::TaggedSymbol)
86
-
87
- CLAUDE_2_1 = T.let(:"claude-2.1", Anthropic::Model::TaggedSymbol)
88
-
89
- CLAUDE_2_0 = T.let(:"claude-2.0", Anthropic::Model::TaggedSymbol)
90
86
  end
91
87
  end
92
88
  end
@@ -0,0 +1,62 @@
1
+ # typed: strong
2
+
3
+ module Anthropic
4
+ module Models
5
+ class ToolTextEditor20250429 < Anthropic::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Anthropic::ToolTextEditor20250429, Anthropic::Internal::AnyHash)
9
+ end
10
+
11
+ # Name of the tool.
12
+ #
13
+ # This is how the tool will be called by the model and in `tool_use` blocks.
14
+ sig { returns(Symbol) }
15
+ attr_accessor :name
16
+
17
+ sig { returns(Symbol) }
18
+ attr_accessor :type
19
+
20
+ # Create a cache control breakpoint at this content block.
21
+ sig { returns(T.nilable(Anthropic::CacheControlEphemeral)) }
22
+ attr_reader :cache_control
23
+
24
+ sig do
25
+ params(
26
+ cache_control: T.nilable(Anthropic::CacheControlEphemeral::OrHash)
27
+ ).void
28
+ end
29
+ attr_writer :cache_control
30
+
31
+ sig do
32
+ params(
33
+ cache_control: T.nilable(Anthropic::CacheControlEphemeral::OrHash),
34
+ name: Symbol,
35
+ type: Symbol
36
+ ).returns(T.attached_class)
37
+ end
38
+ def self.new(
39
+ # Create a cache control breakpoint at this content block.
40
+ cache_control: nil,
41
+ # Name of the tool.
42
+ #
43
+ # This is how the tool will be called by the model and in `tool_use` blocks.
44
+ name: :str_replace_based_edit_tool,
45
+ type: :text_editor_20250429
46
+ )
47
+ end
48
+
49
+ sig do
50
+ override.returns(
51
+ {
52
+ name: Symbol,
53
+ type: Symbol,
54
+ cache_control: T.nilable(Anthropic::CacheControlEphemeral)
55
+ }
56
+ )
57
+ end
58
+ def to_hash
59
+ end
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,72 @@
1
+ # typed: strong
2
+
3
+ module Anthropic
4
+ module Models
5
+ class ToolTextEditor20250728 < Anthropic::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Anthropic::ToolTextEditor20250728, Anthropic::Internal::AnyHash)
9
+ end
10
+
11
+ # Name of the tool.
12
+ #
13
+ # This is how the tool will be called by the model and in `tool_use` blocks.
14
+ sig { returns(Symbol) }
15
+ attr_accessor :name
16
+
17
+ sig { returns(Symbol) }
18
+ attr_accessor :type
19
+
20
+ # Create a cache control breakpoint at this content block.
21
+ sig { returns(T.nilable(Anthropic::CacheControlEphemeral)) }
22
+ attr_reader :cache_control
23
+
24
+ sig do
25
+ params(
26
+ cache_control: T.nilable(Anthropic::CacheControlEphemeral::OrHash)
27
+ ).void
28
+ end
29
+ attr_writer :cache_control
30
+
31
+ # Maximum number of characters to display when viewing a file. If not specified,
32
+ # defaults to displaying the full file.
33
+ sig { returns(T.nilable(Integer)) }
34
+ attr_accessor :max_characters
35
+
36
+ sig do
37
+ params(
38
+ cache_control: T.nilable(Anthropic::CacheControlEphemeral::OrHash),
39
+ max_characters: T.nilable(Integer),
40
+ name: Symbol,
41
+ type: Symbol
42
+ ).returns(T.attached_class)
43
+ end
44
+ def self.new(
45
+ # Create a cache control breakpoint at this content block.
46
+ cache_control: nil,
47
+ # Maximum number of characters to display when viewing a file. If not specified,
48
+ # defaults to displaying the full file.
49
+ max_characters: nil,
50
+ # Name of the tool.
51
+ #
52
+ # This is how the tool will be called by the model and in `tool_use` blocks.
53
+ name: :str_replace_based_edit_tool,
54
+ type: :text_editor_20250728
55
+ )
56
+ end
57
+
58
+ sig do
59
+ override.returns(
60
+ {
61
+ name: Symbol,
62
+ type: Symbol,
63
+ cache_control: T.nilable(Anthropic::CacheControlEphemeral),
64
+ max_characters: T.nilable(Integer)
65
+ }
66
+ )
67
+ end
68
+ def to_hash
69
+ end
70
+ end
71
+ end
72
+ end