anthropic 1.3.0 → 1.4.1

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 (70) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +25 -0
  3. data/README.md +1 -1
  4. data/lib/anthropic/client.rb +5 -2
  5. data/lib/anthropic/helpers/bedrock/client.rb +23 -46
  6. data/lib/anthropic/internal/transport/base_client.rb +19 -1
  7. data/lib/anthropic/models/beta/beta_citation_char_location.rb +7 -1
  8. data/lib/anthropic/models/beta/beta_citation_content_block_location.rb +7 -1
  9. data/lib/anthropic/models/beta/beta_citation_page_location.rb +7 -1
  10. data/lib/anthropic/models/beta/beta_tool_text_editor_20250728.rb +49 -0
  11. data/lib/anthropic/models/beta/beta_tool_union.rb +3 -1
  12. data/lib/anthropic/models/beta/message_count_tokens_params.rb +5 -3
  13. data/lib/anthropic/models/beta/message_create_params.rb +2 -2
  14. data/lib/anthropic/models/beta/messages/batch_create_params.rb +2 -2
  15. data/lib/anthropic/models/citation_char_location.rb +7 -1
  16. data/lib/anthropic/models/citation_content_block_location.rb +7 -1
  17. data/lib/anthropic/models/citation_page_location.rb +7 -1
  18. data/lib/anthropic/models/message_count_tokens_params.rb +2 -2
  19. data/lib/anthropic/models/message_count_tokens_tool.rb +4 -34
  20. data/lib/anthropic/models/message_create_params.rb +2 -2
  21. data/lib/anthropic/models/messages/batch_create_params.rb +2 -2
  22. data/lib/anthropic/models/model.rb +5 -0
  23. data/lib/anthropic/models/tool_text_editor_20250429.rb +36 -0
  24. data/lib/anthropic/models/tool_text_editor_20250728.rb +45 -0
  25. data/lib/anthropic/models/tool_union.rb +4 -33
  26. data/lib/anthropic/models.rb +4 -0
  27. data/lib/anthropic/resources/beta/messages.rb +3 -3
  28. data/lib/anthropic/resources/messages.rb +3 -3
  29. data/lib/anthropic/version.rb +1 -1
  30. data/lib/anthropic.rb +3 -0
  31. data/rbi/anthropic/internal/transport/base_client.rbi +1 -1
  32. data/rbi/anthropic/models/beta/beta_citation_char_location.rbi +6 -0
  33. data/rbi/anthropic/models/beta/beta_citation_content_block_location.rbi +6 -0
  34. data/rbi/anthropic/models/beta/beta_citation_page_location.rbi +6 -0
  35. data/rbi/anthropic/models/beta/beta_tool_text_editor_20250728.rbi +82 -0
  36. data/rbi/anthropic/models/beta/beta_tool_union.rbi +1 -0
  37. data/rbi/anthropic/models/beta/message_count_tokens_params.rbi +5 -0
  38. data/rbi/anthropic/models/beta/message_create_params.rbi +4 -0
  39. data/rbi/anthropic/models/beta/messages/batch_create_params.rbi +4 -0
  40. data/rbi/anthropic/models/citation_char_location.rbi +6 -0
  41. data/rbi/anthropic/models/citation_content_block_location.rbi +6 -0
  42. data/rbi/anthropic/models/citation_page_location.rbi +6 -0
  43. data/rbi/anthropic/models/message_count_tokens_params.rbi +8 -4
  44. data/rbi/anthropic/models/message_count_tokens_tool.rbi +2 -61
  45. data/rbi/anthropic/models/message_create_params.rbi +8 -4
  46. data/rbi/anthropic/models/messages/batch_create_params.rbi +8 -4
  47. data/rbi/anthropic/models/model.rbi +4 -0
  48. data/rbi/anthropic/models/tool_text_editor_20250429.rbi +62 -0
  49. data/rbi/anthropic/models/tool_text_editor_20250728.rbi +72 -0
  50. data/rbi/anthropic/models/tool_union.rbi +2 -61
  51. data/rbi/anthropic/models.rbi +4 -0
  52. data/rbi/anthropic/resources/beta/messages.rbi +3 -0
  53. data/rbi/anthropic/resources/messages.rbi +6 -3
  54. data/sig/anthropic/internal/transport/base_client.rbs +1 -1
  55. data/sig/anthropic/models/beta/beta_citation_char_location.rbs +5 -0
  56. data/sig/anthropic/models/beta/beta_citation_content_block_location.rbs +5 -0
  57. data/sig/anthropic/models/beta/beta_citation_page_location.rbs +5 -0
  58. data/sig/anthropic/models/beta/beta_tool_text_editor_20250728.rbs +39 -0
  59. data/sig/anthropic/models/beta/beta_tool_union.rbs +1 -0
  60. data/sig/anthropic/models/beta/message_count_tokens_params.rbs +1 -0
  61. data/sig/anthropic/models/citation_char_location.rbs +5 -0
  62. data/sig/anthropic/models/citation_content_block_location.rbs +5 -0
  63. data/sig/anthropic/models/citation_page_location.rbs +5 -0
  64. data/sig/anthropic/models/message_count_tokens_tool.rbs +2 -28
  65. data/sig/anthropic/models/model.rbs +4 -0
  66. data/sig/anthropic/models/tool_text_editor_20250429.rbs +30 -0
  67. data/sig/anthropic/models/tool_text_editor_20250728.rbs +35 -0
  68. data/sig/anthropic/models/tool_union.rbs +2 -28
  69. data/sig/anthropic/models.rbs +4 -0
  70. metadata +11 -2
@@ -6,6 +6,7 @@ module Anthropic
6
6
  document_index: Integer,
7
7
  document_title: String?,
8
8
  end_block_index: Integer,
9
+ file_id: String?,
9
10
  start_block_index: Integer,
10
11
  type: :content_block_location
11
12
  }
@@ -19,6 +20,8 @@ module Anthropic
19
20
 
20
21
  attr_accessor end_block_index: Integer
21
22
 
23
+ attr_accessor file_id: String?
24
+
22
25
  attr_accessor start_block_index: Integer
23
26
 
24
27
  attr_accessor type: :content_block_location
@@ -28,6 +31,7 @@ module Anthropic
28
31
  document_index: Integer,
29
32
  document_title: String?,
30
33
  end_block_index: Integer,
34
+ file_id: String?,
31
35
  start_block_index: Integer,
32
36
  ?type: :content_block_location
33
37
  ) -> void
@@ -37,6 +41,7 @@ module Anthropic
37
41
  document_index: Integer,
38
42
  document_title: String?,
39
43
  end_block_index: Integer,
44
+ file_id: String?,
40
45
  start_block_index: Integer,
41
46
  type: :content_block_location
42
47
  }
@@ -6,6 +6,7 @@ module Anthropic
6
6
  document_index: Integer,
7
7
  document_title: String?,
8
8
  end_page_number: Integer,
9
+ file_id: String?,
9
10
  start_page_number: Integer,
10
11
  type: :page_location
11
12
  }
@@ -19,6 +20,8 @@ module Anthropic
19
20
 
20
21
  attr_accessor end_page_number: Integer
21
22
 
23
+ attr_accessor file_id: String?
24
+
22
25
  attr_accessor start_page_number: Integer
23
26
 
24
27
  attr_accessor type: :page_location
@@ -28,6 +31,7 @@ module Anthropic
28
31
  document_index: Integer,
29
32
  document_title: String?,
30
33
  end_page_number: Integer,
34
+ file_id: String?,
31
35
  start_page_number: Integer,
32
36
  ?type: :page_location
33
37
  ) -> void
@@ -37,6 +41,7 @@ module Anthropic
37
41
  document_index: Integer,
38
42
  document_title: String?,
39
43
  end_page_number: Integer,
44
+ file_id: String?,
40
45
  start_page_number: Integer,
41
46
  type: :page_location
42
47
  }
@@ -4,39 +4,13 @@ module Anthropic
4
4
  Anthropic::Tool
5
5
  | Anthropic::ToolBash20250124
6
6
  | Anthropic::ToolTextEditor20250124
7
- | Anthropic::MessageCountTokensTool::TextEditor20250429
7
+ | Anthropic::ToolTextEditor20250429
8
+ | Anthropic::ToolTextEditor20250728
8
9
  | Anthropic::WebSearchTool20250305
9
10
 
10
11
  module MessageCountTokensTool
11
12
  extend Anthropic::Internal::Type::Union
12
13
 
13
- type text_editor20250429 =
14
- {
15
- name: :str_replace_based_edit_tool,
16
- type: :text_editor_20250429,
17
- cache_control: Anthropic::CacheControlEphemeral?
18
- }
19
-
20
- class TextEditor20250429 < Anthropic::Internal::Type::BaseModel
21
- attr_accessor name: :str_replace_based_edit_tool
22
-
23
- attr_accessor type: :text_editor_20250429
24
-
25
- attr_accessor cache_control: Anthropic::CacheControlEphemeral?
26
-
27
- def initialize: (
28
- ?cache_control: Anthropic::CacheControlEphemeral?,
29
- ?name: :str_replace_based_edit_tool,
30
- ?type: :text_editor_20250429
31
- ) -> void
32
-
33
- def to_hash: -> {
34
- name: :str_replace_based_edit_tool,
35
- type: :text_editor_20250429,
36
- cache_control: Anthropic::CacheControlEphemeral?
37
- }
38
- end
39
-
40
14
  def self?.variants: -> ::Array[Anthropic::Models::message_count_tokens_tool]
41
15
  end
42
16
  end
@@ -14,6 +14,7 @@ module Anthropic
14
14
  | :"claude-opus-4-0"
15
15
  | :"claude-opus-4-20250514"
16
16
  | :"claude-4-opus-20250514"
17
+ | :"claude-opus-4-1-20250805"
17
18
  | :"claude-3-opus-latest"
18
19
  | :"claude-3-opus-20240229"
19
20
  | :"claude-3-haiku-20240307"
@@ -62,6 +63,9 @@ module Anthropic
62
63
  # Our most capable model
63
64
  CLAUDE_4_OPUS_20250514: :"claude-4-opus-20250514"
64
65
 
66
+ # Our most capable model
67
+ CLAUDE_OPUS_4_1_20250805: :"claude-opus-4-1-20250805"
68
+
65
69
  # Excels at writing and complex tasks
66
70
  CLAUDE_3_OPUS_LATEST: :"claude-3-opus-latest"
67
71
 
@@ -0,0 +1,30 @@
1
+ module Anthropic
2
+ module Models
3
+ type tool_text_editor20250429 =
4
+ {
5
+ name: :str_replace_based_edit_tool,
6
+ type: :text_editor_20250429,
7
+ cache_control: Anthropic::CacheControlEphemeral?
8
+ }
9
+
10
+ class ToolTextEditor20250429 < Anthropic::Internal::Type::BaseModel
11
+ attr_accessor name: :str_replace_based_edit_tool
12
+
13
+ attr_accessor type: :text_editor_20250429
14
+
15
+ attr_accessor cache_control: Anthropic::CacheControlEphemeral?
16
+
17
+ def initialize: (
18
+ ?cache_control: Anthropic::CacheControlEphemeral?,
19
+ ?name: :str_replace_based_edit_tool,
20
+ ?type: :text_editor_20250429
21
+ ) -> void
22
+
23
+ def to_hash: -> {
24
+ name: :str_replace_based_edit_tool,
25
+ type: :text_editor_20250429,
26
+ cache_control: Anthropic::CacheControlEphemeral?
27
+ }
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,35 @@
1
+ module Anthropic
2
+ module Models
3
+ type tool_text_editor20250728 =
4
+ {
5
+ name: :str_replace_based_edit_tool,
6
+ type: :text_editor_20250728,
7
+ cache_control: Anthropic::CacheControlEphemeral?,
8
+ max_characters: Integer?
9
+ }
10
+
11
+ class ToolTextEditor20250728 < Anthropic::Internal::Type::BaseModel
12
+ attr_accessor name: :str_replace_based_edit_tool
13
+
14
+ attr_accessor type: :text_editor_20250728
15
+
16
+ attr_accessor cache_control: Anthropic::CacheControlEphemeral?
17
+
18
+ attr_accessor max_characters: Integer?
19
+
20
+ def initialize: (
21
+ ?cache_control: Anthropic::CacheControlEphemeral?,
22
+ ?max_characters: Integer?,
23
+ ?name: :str_replace_based_edit_tool,
24
+ ?type: :text_editor_20250728
25
+ ) -> void
26
+
27
+ def to_hash: -> {
28
+ name: :str_replace_based_edit_tool,
29
+ type: :text_editor_20250728,
30
+ cache_control: Anthropic::CacheControlEphemeral?,
31
+ max_characters: Integer?
32
+ }
33
+ end
34
+ end
35
+ end
@@ -4,39 +4,13 @@ module Anthropic
4
4
  Anthropic::Tool
5
5
  | Anthropic::ToolBash20250124
6
6
  | Anthropic::ToolTextEditor20250124
7
- | Anthropic::ToolUnion::TextEditor20250429
7
+ | Anthropic::ToolTextEditor20250429
8
+ | Anthropic::ToolTextEditor20250728
8
9
  | Anthropic::WebSearchTool20250305
9
10
 
10
11
  module ToolUnion
11
12
  extend Anthropic::Internal::Type::Union
12
13
 
13
- type text_editor20250429 =
14
- {
15
- name: :str_replace_based_edit_tool,
16
- type: :text_editor_20250429,
17
- cache_control: Anthropic::CacheControlEphemeral?
18
- }
19
-
20
- class TextEditor20250429 < Anthropic::Internal::Type::BaseModel
21
- attr_accessor name: :str_replace_based_edit_tool
22
-
23
- attr_accessor type: :text_editor_20250429
24
-
25
- attr_accessor cache_control: Anthropic::CacheControlEphemeral?
26
-
27
- def initialize: (
28
- ?cache_control: Anthropic::CacheControlEphemeral?,
29
- ?name: :str_replace_based_edit_tool,
30
- ?type: :text_editor_20250429
31
- ) -> void
32
-
33
- def to_hash: -> {
34
- name: :str_replace_based_edit_tool,
35
- type: :text_editor_20250429,
36
- cache_control: Anthropic::CacheControlEphemeral?
37
- }
38
- end
39
-
40
14
  def self?.variants: -> ::Array[Anthropic::Models::tool_union]
41
15
  end
42
16
  end
@@ -189,6 +189,10 @@ module Anthropic
189
189
 
190
190
  class ToolTextEditor20250124 = Anthropic::Models::ToolTextEditor20250124
191
191
 
192
+ class ToolTextEditor20250429 = Anthropic::Models::ToolTextEditor20250429
193
+
194
+ class ToolTextEditor20250728 = Anthropic::Models::ToolTextEditor20250728
195
+
192
196
  module ToolUnion = Anthropic::Models::ToolUnion
193
197
 
194
198
  class ToolUseBlock = Anthropic::Models::ToolUseBlock
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anthropic
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anthropic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-07-28 00:00:00.000000000 Z
11
+ date: 2025-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: connection_pool
@@ -165,6 +165,7 @@ files:
165
165
  - lib/anthropic/models/beta/beta_tool_text_editor_20241022.rb
166
166
  - lib/anthropic/models/beta/beta_tool_text_editor_20250124.rb
167
167
  - lib/anthropic/models/beta/beta_tool_text_editor_20250429.rb
168
+ - lib/anthropic/models/beta/beta_tool_text_editor_20250728.rb
168
169
  - lib/anthropic/models/beta/beta_tool_union.rb
169
170
  - lib/anthropic/models/beta/beta_tool_use_block.rb
170
171
  - lib/anthropic/models/beta/beta_tool_use_block_param.rb
@@ -310,6 +311,8 @@ files:
310
311
  - lib/anthropic/models/tool_choice_tool.rb
311
312
  - lib/anthropic/models/tool_result_block_param.rb
312
313
  - lib/anthropic/models/tool_text_editor_20250124.rb
314
+ - lib/anthropic/models/tool_text_editor_20250429.rb
315
+ - lib/anthropic/models/tool_text_editor_20250728.rb
313
316
  - lib/anthropic/models/tool_union.rb
314
317
  - lib/anthropic/models/tool_use_block.rb
315
318
  - lib/anthropic/models/tool_use_block_param.rb
@@ -467,6 +470,7 @@ files:
467
470
  - rbi/anthropic/models/beta/beta_tool_text_editor_20241022.rbi
468
471
  - rbi/anthropic/models/beta/beta_tool_text_editor_20250124.rbi
469
472
  - rbi/anthropic/models/beta/beta_tool_text_editor_20250429.rbi
473
+ - rbi/anthropic/models/beta/beta_tool_text_editor_20250728.rbi
470
474
  - rbi/anthropic/models/beta/beta_tool_union.rbi
471
475
  - rbi/anthropic/models/beta/beta_tool_use_block.rbi
472
476
  - rbi/anthropic/models/beta/beta_tool_use_block_param.rbi
@@ -612,6 +616,8 @@ files:
612
616
  - rbi/anthropic/models/tool_choice_tool.rbi
613
617
  - rbi/anthropic/models/tool_result_block_param.rbi
614
618
  - rbi/anthropic/models/tool_text_editor_20250124.rbi
619
+ - rbi/anthropic/models/tool_text_editor_20250429.rbi
620
+ - rbi/anthropic/models/tool_text_editor_20250728.rbi
615
621
  - rbi/anthropic/models/tool_union.rbi
616
622
  - rbi/anthropic/models/tool_use_block.rbi
617
623
  - rbi/anthropic/models/tool_use_block_param.rbi
@@ -768,6 +774,7 @@ files:
768
774
  - sig/anthropic/models/beta/beta_tool_text_editor_20241022.rbs
769
775
  - sig/anthropic/models/beta/beta_tool_text_editor_20250124.rbs
770
776
  - sig/anthropic/models/beta/beta_tool_text_editor_20250429.rbs
777
+ - sig/anthropic/models/beta/beta_tool_text_editor_20250728.rbs
771
778
  - sig/anthropic/models/beta/beta_tool_union.rbs
772
779
  - sig/anthropic/models/beta/beta_tool_use_block.rbs
773
780
  - sig/anthropic/models/beta/beta_tool_use_block_param.rbs
@@ -913,6 +920,8 @@ files:
913
920
  - sig/anthropic/models/tool_choice_tool.rbs
914
921
  - sig/anthropic/models/tool_result_block_param.rbs
915
922
  - sig/anthropic/models/tool_text_editor_20250124.rbs
923
+ - sig/anthropic/models/tool_text_editor_20250429.rbs
924
+ - sig/anthropic/models/tool_text_editor_20250728.rbs
916
925
  - sig/anthropic/models/tool_union.rbs
917
926
  - sig/anthropic/models/tool_use_block.rbs
918
927
  - sig/anthropic/models/tool_use_block_param.rbs