anthropic 1.14.0 → 1.15.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 +8 -0
  3. data/README.md +1 -1
  4. data/lib/anthropic/models/beta/beta_code_execution_tool_20250522.rb +8 -1
  5. data/lib/anthropic/models/beta/beta_code_execution_tool_20250825.rb +8 -1
  6. data/lib/anthropic/models/beta/beta_json_output_format.rb +27 -0
  7. data/lib/anthropic/models/beta/beta_memory_tool_20250818.rb +8 -1
  8. data/lib/anthropic/models/beta/beta_tool.rb +8 -1
  9. data/lib/anthropic/models/beta/beta_tool_bash_20241022.rb +8 -1
  10. data/lib/anthropic/models/beta/beta_tool_bash_20250124.rb +8 -1
  11. data/lib/anthropic/models/beta/beta_tool_computer_use_20241022.rb +8 -1
  12. data/lib/anthropic/models/beta/beta_tool_computer_use_20250124.rb +8 -1
  13. data/lib/anthropic/models/beta/beta_tool_text_editor_20241022.rb +8 -1
  14. data/lib/anthropic/models/beta/beta_tool_text_editor_20250124.rb +8 -1
  15. data/lib/anthropic/models/beta/beta_tool_text_editor_20250429.rb +8 -1
  16. data/lib/anthropic/models/beta/beta_tool_text_editor_20250728.rb +8 -1
  17. data/lib/anthropic/models/beta/beta_web_fetch_tool_20250910.rb +8 -1
  18. data/lib/anthropic/models/beta/beta_web_search_tool_20250305.rb +8 -1
  19. data/lib/anthropic/models/beta/message_count_tokens_params.rb +9 -1
  20. data/lib/anthropic/models/beta/message_create_params.rb +9 -1
  21. data/lib/anthropic/models/beta/messages/batch_create_params.rb +9 -1
  22. data/lib/anthropic/resources/beta/messages/batches.rb +6 -6
  23. data/lib/anthropic/resources/beta/messages.rb +14 -6
  24. data/lib/anthropic/resources/messages/batches.rb +6 -6
  25. data/lib/anthropic/resources/messages.rb +5 -3
  26. data/lib/anthropic/version.rb +1 -1
  27. data/lib/anthropic.rb +1 -0
  28. data/rbi/anthropic/models/beta/beta_code_execution_tool_20250522.rbi +10 -1
  29. data/rbi/anthropic/models/beta/beta_code_execution_tool_20250825.rbi +10 -1
  30. data/rbi/anthropic/models/beta/beta_json_output_format.rbi +46 -0
  31. data/rbi/anthropic/models/beta/beta_memory_tool_20250818.rbi +10 -1
  32. data/rbi/anthropic/models/beta/beta_tool.rbi +9 -0
  33. data/rbi/anthropic/models/beta/beta_tool_bash_20241022.rbi +10 -1
  34. data/rbi/anthropic/models/beta/beta_tool_bash_20250124.rbi +10 -1
  35. data/rbi/anthropic/models/beta/beta_tool_computer_use_20241022.rbi +10 -1
  36. data/rbi/anthropic/models/beta/beta_tool_computer_use_20250124.rbi +10 -1
  37. data/rbi/anthropic/models/beta/beta_tool_text_editor_20241022.rbi +10 -1
  38. data/rbi/anthropic/models/beta/beta_tool_text_editor_20250124.rbi +10 -1
  39. data/rbi/anthropic/models/beta/beta_tool_text_editor_20250429.rbi +10 -1
  40. data/rbi/anthropic/models/beta/beta_tool_text_editor_20250728.rbi +10 -1
  41. data/rbi/anthropic/models/beta/beta_web_fetch_tool_20250910.rbi +10 -1
  42. data/rbi/anthropic/models/beta/beta_web_search_tool_20250305.rbi +9 -0
  43. data/rbi/anthropic/models/beta/message_count_tokens_params.rbi +17 -0
  44. data/rbi/anthropic/models/beta/message_create_params.rbi +17 -0
  45. data/rbi/anthropic/models/beta/messages/batch_create_params.rbi +18 -0
  46. data/rbi/anthropic/resources/beta/messages/batches.rbi +6 -6
  47. data/rbi/anthropic/resources/beta/messages.rbi +17 -3
  48. data/rbi/anthropic/resources/messages/batches.rbi +6 -6
  49. data/rbi/anthropic/resources/messages.rbi +5 -3
  50. data/sig/anthropic/models/beta/beta_code_execution_tool_20250522.rbs +9 -2
  51. data/sig/anthropic/models/beta/beta_code_execution_tool_20250825.rbs +9 -2
  52. data/sig/anthropic/models/beta/beta_json_output_format.rbs +23 -0
  53. data/sig/anthropic/models/beta/beta_memory_tool_20250818.rbs +9 -2
  54. data/sig/anthropic/models/beta/beta_tool.rbs +7 -0
  55. data/sig/anthropic/models/beta/beta_tool_bash_20241022.rbs +9 -2
  56. data/sig/anthropic/models/beta/beta_tool_bash_20250124.rbs +9 -2
  57. data/sig/anthropic/models/beta/beta_tool_computer_use_20241022.rbs +9 -2
  58. data/sig/anthropic/models/beta/beta_tool_computer_use_20250124.rbs +9 -2
  59. data/sig/anthropic/models/beta/beta_tool_text_editor_20241022.rbs +9 -2
  60. data/sig/anthropic/models/beta/beta_tool_text_editor_20250124.rbs +9 -2
  61. data/sig/anthropic/models/beta/beta_tool_text_editor_20250429.rbs +9 -2
  62. data/sig/anthropic/models/beta/beta_tool_text_editor_20250728.rbs +9 -2
  63. data/sig/anthropic/models/beta/beta_web_fetch_tool_20250910.rbs +9 -2
  64. data/sig/anthropic/models/beta/beta_web_search_tool_20250305.rbs +7 -0
  65. data/sig/anthropic/models/beta/message_count_tokens_params.rbs +5 -0
  66. data/sig/anthropic/models/beta/message_create_params.rbs +5 -0
  67. data/sig/anthropic/models/beta/messages/batch_create_params.rbs +5 -0
  68. data/sig/anthropic/resources/beta/messages.rbs +3 -0
  69. metadata +5 -2
@@ -14,7 +14,7 @@ module Anthropic
14
14
  # can take up to 24 hours to complete.
15
15
  #
16
16
  # Learn more about the Message Batches API in our
17
- # [user guide](/en/docs/build-with-claude/batch-processing)
17
+ # [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
18
18
  #
19
19
  # @overload create(requests:, request_options: {})
20
20
  #
@@ -41,7 +41,7 @@ module Anthropic
41
41
  # `results_url` field in the response.
42
42
  #
43
43
  # Learn more about the Message Batches API in our
44
- # [user guide](/en/docs/build-with-claude/batch-processing)
44
+ # [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
45
45
  #
46
46
  # @overload retrieve(message_batch_id, request_options: {})
47
47
  #
@@ -68,7 +68,7 @@ module Anthropic
68
68
  # returned first.
69
69
  #
70
70
  # Learn more about the Message Batches API in our
71
- # [user guide](/en/docs/build-with-claude/batch-processing)
71
+ # [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
72
72
  #
73
73
  # @overload list(after_id: nil, before_id: nil, limit: nil, request_options: {})
74
74
  #
@@ -101,7 +101,7 @@ module Anthropic
101
101
  # like to delete an in-progress batch, you must first cancel it.
102
102
  #
103
103
  # Learn more about the Message Batches API in our
104
- # [user guide](/en/docs/build-with-claude/batch-processing)
104
+ # [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
105
105
  #
106
106
  # @overload delete(message_batch_id, request_options: {})
107
107
  #
@@ -132,7 +132,7 @@ module Anthropic
132
132
  # non-interruptible.
133
133
  #
134
134
  # Learn more about the Message Batches API in our
135
- # [user guide](/en/docs/build-with-claude/batch-processing)
135
+ # [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
136
136
  #
137
137
  # @overload cancel(message_batch_id, request_options: {})
138
138
  #
@@ -159,7 +159,7 @@ module Anthropic
159
159
  # requests. Use the `custom_id` field to match results to requests.
160
160
  #
161
161
  # Learn more about the Message Batches API in our
162
- # [user guide](/en/docs/build-with-claude/batch-processing)
162
+ # [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
163
163
  #
164
164
  # @overload results_streaming(message_batch_id, request_options: {})
165
165
  #
@@ -17,7 +17,8 @@ module Anthropic
17
17
  # The Messages API can be used for either single queries or stateless multi-turn
18
18
  # conversations.
19
19
  #
20
- # Learn more about the Messages API in our [user guide](/en/docs/initial-setup)
20
+ # Learn more about the Messages API in our
21
+ # [user guide](https://docs.claude.com/en/docs/initial-setup)
21
22
  #
22
23
  # @overload create(max_tokens:, messages:, model:, metadata: nil, service_tier: nil, stop_sequences: nil, system_: nil, temperature: nil, thinking: nil, tool_choice: nil, tools: nil, top_k: nil, top_p: nil, request_options: {})
23
24
  #
@@ -166,7 +167,8 @@ module Anthropic
166
167
  # The Messages API can be used for either single queries or stateless multi-turn
167
168
  # conversations.
168
169
  #
169
- # Learn more about the Messages API in our [user guide](/en/docs/initial-setup)
170
+ # Learn more about the Messages API in our
171
+ # [user guide](https://docs.claude.com/en/docs/initial-setup)
170
172
  #
171
173
  # @overload stream_raw(max_tokens:, messages:, model:, metadata: nil, service_tier: nil, stop_sequences: nil, system_: nil, temperature: nil, thinking: nil, tool_choice: nil, tools: nil, top_k: nil, top_p: nil, request_options: {})
172
174
  #
@@ -228,7 +230,7 @@ module Anthropic
228
230
  # including tools, images, and documents, without creating it.
229
231
  #
230
232
  # Learn more about token counting in our
231
- # [user guide](/en/docs/build-with-claude/token-counting)
233
+ # [user guide](https://docs.claude.com/en/docs/build-with-claude/token-counting)
232
234
  #
233
235
  # @overload count_tokens(messages:, model:, system_: nil, thinking: nil, tool_choice: nil, tools: nil, request_options: {})
234
236
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Anthropic
4
- VERSION = "1.14.0"
4
+ VERSION = "1.15.0"
5
5
  end
data/lib/anthropic.rb CHANGED
@@ -140,6 +140,7 @@ require_relative "anthropic/models/beta/beta_image_block_param"
140
140
  require_relative "anthropic/models/beta/beta_input_json_delta"
141
141
  require_relative "anthropic/models/beta/beta_input_tokens_clear_at_least"
142
142
  require_relative "anthropic/models/beta/beta_input_tokens_trigger"
143
+ require_relative "anthropic/models/beta/beta_json_output_format"
143
144
  require_relative "anthropic/models/beta/beta_mcp_tool_result_block"
144
145
  require_relative "anthropic/models/beta/beta_mcp_tool_use_block"
145
146
  require_relative "anthropic/models/beta/beta_mcp_tool_use_block_param"
@@ -35,10 +35,17 @@ module Anthropic
35
35
  end
36
36
  attr_writer :cache_control
37
37
 
38
+ sig { returns(T.nilable(T::Boolean)) }
39
+ attr_reader :strict
40
+
41
+ sig { params(strict: T::Boolean).void }
42
+ attr_writer :strict
43
+
38
44
  sig do
39
45
  params(
40
46
  cache_control:
41
47
  T.nilable(Anthropic::Beta::BetaCacheControlEphemeral::OrHash),
48
+ strict: T::Boolean,
42
49
  name: Symbol,
43
50
  type: Symbol
44
51
  ).returns(T.attached_class)
@@ -46,6 +53,7 @@ module Anthropic
46
53
  def self.new(
47
54
  # Create a cache control breakpoint at this content block.
48
55
  cache_control: nil,
56
+ strict: nil,
49
57
  # Name of the tool.
50
58
  #
51
59
  # This is how the tool will be called by the model and in `tool_use` blocks.
@@ -60,7 +68,8 @@ module Anthropic
60
68
  name: Symbol,
61
69
  type: Symbol,
62
70
  cache_control:
63
- T.nilable(Anthropic::Beta::BetaCacheControlEphemeral)
71
+ T.nilable(Anthropic::Beta::BetaCacheControlEphemeral),
72
+ strict: T::Boolean
64
73
  }
65
74
  )
66
75
  end
@@ -35,10 +35,17 @@ module Anthropic
35
35
  end
36
36
  attr_writer :cache_control
37
37
 
38
+ sig { returns(T.nilable(T::Boolean)) }
39
+ attr_reader :strict
40
+
41
+ sig { params(strict: T::Boolean).void }
42
+ attr_writer :strict
43
+
38
44
  sig do
39
45
  params(
40
46
  cache_control:
41
47
  T.nilable(Anthropic::Beta::BetaCacheControlEphemeral::OrHash),
48
+ strict: T::Boolean,
42
49
  name: Symbol,
43
50
  type: Symbol
44
51
  ).returns(T.attached_class)
@@ -46,6 +53,7 @@ module Anthropic
46
53
  def self.new(
47
54
  # Create a cache control breakpoint at this content block.
48
55
  cache_control: nil,
56
+ strict: nil,
49
57
  # Name of the tool.
50
58
  #
51
59
  # This is how the tool will be called by the model and in `tool_use` blocks.
@@ -60,7 +68,8 @@ module Anthropic
60
68
  name: Symbol,
61
69
  type: Symbol,
62
70
  cache_control:
63
- T.nilable(Anthropic::Beta::BetaCacheControlEphemeral)
71
+ T.nilable(Anthropic::Beta::BetaCacheControlEphemeral),
72
+ strict: T::Boolean
64
73
  }
65
74
  )
66
75
  end
@@ -0,0 +1,46 @@
1
+ # typed: strong
2
+
3
+ module Anthropic
4
+ module Models
5
+ BetaJSONOutputFormat = Beta::BetaJSONOutputFormat
6
+
7
+ module Beta
8
+ class BetaJSONOutputFormat < Anthropic::Internal::Type::BaseModel
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(
12
+ Anthropic::Beta::BetaJSONOutputFormat,
13
+ Anthropic::Internal::AnyHash
14
+ )
15
+ end
16
+
17
+ # The JSON schema of the format
18
+ sig { returns(T::Hash[Symbol, T.anything]) }
19
+ attr_accessor :schema
20
+
21
+ sig { returns(Symbol) }
22
+ attr_accessor :type
23
+
24
+ sig do
25
+ params(schema: T::Hash[Symbol, T.anything], type: Symbol).returns(
26
+ T.attached_class
27
+ )
28
+ end
29
+ def self.new(
30
+ # The JSON schema of the format
31
+ schema:,
32
+ type: :json_schema
33
+ )
34
+ end
35
+
36
+ sig do
37
+ override.returns(
38
+ { schema: T::Hash[Symbol, T.anything], type: Symbol }
39
+ )
40
+ end
41
+ def to_hash
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
@@ -35,10 +35,17 @@ module Anthropic
35
35
  end
36
36
  attr_writer :cache_control
37
37
 
38
+ sig { returns(T.nilable(T::Boolean)) }
39
+ attr_reader :strict
40
+
41
+ sig { params(strict: T::Boolean).void }
42
+ attr_writer :strict
43
+
38
44
  sig do
39
45
  params(
40
46
  cache_control:
41
47
  T.nilable(Anthropic::Beta::BetaCacheControlEphemeral::OrHash),
48
+ strict: T::Boolean,
42
49
  name: Symbol,
43
50
  type: Symbol
44
51
  ).returns(T.attached_class)
@@ -46,6 +53,7 @@ module Anthropic
46
53
  def self.new(
47
54
  # Create a cache control breakpoint at this content block.
48
55
  cache_control: nil,
56
+ strict: nil,
49
57
  # Name of the tool.
50
58
  #
51
59
  # This is how the tool will be called by the model and in `tool_use` blocks.
@@ -60,7 +68,8 @@ module Anthropic
60
68
  name: Symbol,
61
69
  type: Symbol,
62
70
  cache_control:
63
- T.nilable(Anthropic::Beta::BetaCacheControlEphemeral)
71
+ T.nilable(Anthropic::Beta::BetaCacheControlEphemeral),
72
+ strict: T::Boolean
64
73
  }
65
74
  )
66
75
  end
@@ -55,6 +55,12 @@ module Anthropic
55
55
  sig { params(description: String).void }
56
56
  attr_writer :description
57
57
 
58
+ sig { returns(T.nilable(T::Boolean)) }
59
+ attr_reader :strict
60
+
61
+ sig { params(strict: T::Boolean).void }
62
+ attr_writer :strict
63
+
58
64
  sig { returns(T.nilable(Anthropic::Beta::BetaTool::Type::OrSymbol)) }
59
65
  attr_accessor :type
60
66
 
@@ -65,6 +71,7 @@ module Anthropic
65
71
  cache_control:
66
72
  T.nilable(Anthropic::Beta::BetaCacheControlEphemeral::OrHash),
67
73
  description: String,
74
+ strict: T::Boolean,
68
75
  type: T.nilable(Anthropic::Beta::BetaTool::Type::OrSymbol)
69
76
  ).returns(T.attached_class)
70
77
  end
@@ -87,6 +94,7 @@ module Anthropic
87
94
  # perform. You can use natural language descriptions to reinforce important
88
95
  # aspects of the tool input JSON schema.
89
96
  description: nil,
97
+ strict: nil,
90
98
  type: nil
91
99
  )
92
100
  end
@@ -99,6 +107,7 @@ module Anthropic
99
107
  cache_control:
100
108
  T.nilable(Anthropic::Beta::BetaCacheControlEphemeral),
101
109
  description: String,
110
+ strict: T::Boolean,
102
111
  type: T.nilable(Anthropic::Beta::BetaTool::Type::OrSymbol)
103
112
  }
104
113
  )
@@ -35,10 +35,17 @@ module Anthropic
35
35
  end
36
36
  attr_writer :cache_control
37
37
 
38
+ sig { returns(T.nilable(T::Boolean)) }
39
+ attr_reader :strict
40
+
41
+ sig { params(strict: T::Boolean).void }
42
+ attr_writer :strict
43
+
38
44
  sig do
39
45
  params(
40
46
  cache_control:
41
47
  T.nilable(Anthropic::Beta::BetaCacheControlEphemeral::OrHash),
48
+ strict: T::Boolean,
42
49
  name: Symbol,
43
50
  type: Symbol
44
51
  ).returns(T.attached_class)
@@ -46,6 +53,7 @@ module Anthropic
46
53
  def self.new(
47
54
  # Create a cache control breakpoint at this content block.
48
55
  cache_control: nil,
56
+ strict: nil,
49
57
  # Name of the tool.
50
58
  #
51
59
  # This is how the tool will be called by the model and in `tool_use` blocks.
@@ -60,7 +68,8 @@ module Anthropic
60
68
  name: Symbol,
61
69
  type: Symbol,
62
70
  cache_control:
63
- T.nilable(Anthropic::Beta::BetaCacheControlEphemeral)
71
+ T.nilable(Anthropic::Beta::BetaCacheControlEphemeral),
72
+ strict: T::Boolean
64
73
  }
65
74
  )
66
75
  end
@@ -35,10 +35,17 @@ module Anthropic
35
35
  end
36
36
  attr_writer :cache_control
37
37
 
38
+ sig { returns(T.nilable(T::Boolean)) }
39
+ attr_reader :strict
40
+
41
+ sig { params(strict: T::Boolean).void }
42
+ attr_writer :strict
43
+
38
44
  sig do
39
45
  params(
40
46
  cache_control:
41
47
  T.nilable(Anthropic::Beta::BetaCacheControlEphemeral::OrHash),
48
+ strict: T::Boolean,
42
49
  name: Symbol,
43
50
  type: Symbol
44
51
  ).returns(T.attached_class)
@@ -46,6 +53,7 @@ module Anthropic
46
53
  def self.new(
47
54
  # Create a cache control breakpoint at this content block.
48
55
  cache_control: nil,
56
+ strict: nil,
49
57
  # Name of the tool.
50
58
  #
51
59
  # This is how the tool will be called by the model and in `tool_use` blocks.
@@ -60,7 +68,8 @@ module Anthropic
60
68
  name: Symbol,
61
69
  type: Symbol,
62
70
  cache_control:
63
- T.nilable(Anthropic::Beta::BetaCacheControlEphemeral)
71
+ T.nilable(Anthropic::Beta::BetaCacheControlEphemeral),
72
+ strict: T::Boolean
64
73
  }
65
74
  )
66
75
  end
@@ -47,6 +47,12 @@ module Anthropic
47
47
  sig { returns(T.nilable(Integer)) }
48
48
  attr_accessor :display_number
49
49
 
50
+ sig { returns(T.nilable(T::Boolean)) }
51
+ attr_reader :strict
52
+
53
+ sig { params(strict: T::Boolean).void }
54
+ attr_writer :strict
55
+
50
56
  sig do
51
57
  params(
52
58
  display_height_px: Integer,
@@ -54,6 +60,7 @@ module Anthropic
54
60
  cache_control:
55
61
  T.nilable(Anthropic::Beta::BetaCacheControlEphemeral::OrHash),
56
62
  display_number: T.nilable(Integer),
63
+ strict: T::Boolean,
57
64
  name: Symbol,
58
65
  type: Symbol
59
66
  ).returns(T.attached_class)
@@ -67,6 +74,7 @@ module Anthropic
67
74
  cache_control: nil,
68
75
  # The X11 display number (e.g. 0, 1) for the display.
69
76
  display_number: nil,
77
+ strict: nil,
70
78
  # Name of the tool.
71
79
  #
72
80
  # This is how the tool will be called by the model and in `tool_use` blocks.
@@ -84,7 +92,8 @@ module Anthropic
84
92
  type: Symbol,
85
93
  cache_control:
86
94
  T.nilable(Anthropic::Beta::BetaCacheControlEphemeral),
87
- display_number: T.nilable(Integer)
95
+ display_number: T.nilable(Integer),
96
+ strict: T::Boolean
88
97
  }
89
98
  )
90
99
  end
@@ -47,6 +47,12 @@ module Anthropic
47
47
  sig { returns(T.nilable(Integer)) }
48
48
  attr_accessor :display_number
49
49
 
50
+ sig { returns(T.nilable(T::Boolean)) }
51
+ attr_reader :strict
52
+
53
+ sig { params(strict: T::Boolean).void }
54
+ attr_writer :strict
55
+
50
56
  sig do
51
57
  params(
52
58
  display_height_px: Integer,
@@ -54,6 +60,7 @@ module Anthropic
54
60
  cache_control:
55
61
  T.nilable(Anthropic::Beta::BetaCacheControlEphemeral::OrHash),
56
62
  display_number: T.nilable(Integer),
63
+ strict: T::Boolean,
57
64
  name: Symbol,
58
65
  type: Symbol
59
66
  ).returns(T.attached_class)
@@ -67,6 +74,7 @@ module Anthropic
67
74
  cache_control: nil,
68
75
  # The X11 display number (e.g. 0, 1) for the display.
69
76
  display_number: nil,
77
+ strict: nil,
70
78
  # Name of the tool.
71
79
  #
72
80
  # This is how the tool will be called by the model and in `tool_use` blocks.
@@ -84,7 +92,8 @@ module Anthropic
84
92
  type: Symbol,
85
93
  cache_control:
86
94
  T.nilable(Anthropic::Beta::BetaCacheControlEphemeral),
87
- display_number: T.nilable(Integer)
95
+ display_number: T.nilable(Integer),
96
+ strict: T::Boolean
88
97
  }
89
98
  )
90
99
  end
@@ -35,10 +35,17 @@ module Anthropic
35
35
  end
36
36
  attr_writer :cache_control
37
37
 
38
+ sig { returns(T.nilable(T::Boolean)) }
39
+ attr_reader :strict
40
+
41
+ sig { params(strict: T::Boolean).void }
42
+ attr_writer :strict
43
+
38
44
  sig do
39
45
  params(
40
46
  cache_control:
41
47
  T.nilable(Anthropic::Beta::BetaCacheControlEphemeral::OrHash),
48
+ strict: T::Boolean,
42
49
  name: Symbol,
43
50
  type: Symbol
44
51
  ).returns(T.attached_class)
@@ -46,6 +53,7 @@ module Anthropic
46
53
  def self.new(
47
54
  # Create a cache control breakpoint at this content block.
48
55
  cache_control: nil,
56
+ strict: nil,
49
57
  # Name of the tool.
50
58
  #
51
59
  # This is how the tool will be called by the model and in `tool_use` blocks.
@@ -60,7 +68,8 @@ module Anthropic
60
68
  name: Symbol,
61
69
  type: Symbol,
62
70
  cache_control:
63
- T.nilable(Anthropic::Beta::BetaCacheControlEphemeral)
71
+ T.nilable(Anthropic::Beta::BetaCacheControlEphemeral),
72
+ strict: T::Boolean
64
73
  }
65
74
  )
66
75
  end
@@ -35,10 +35,17 @@ module Anthropic
35
35
  end
36
36
  attr_writer :cache_control
37
37
 
38
+ sig { returns(T.nilable(T::Boolean)) }
39
+ attr_reader :strict
40
+
41
+ sig { params(strict: T::Boolean).void }
42
+ attr_writer :strict
43
+
38
44
  sig do
39
45
  params(
40
46
  cache_control:
41
47
  T.nilable(Anthropic::Beta::BetaCacheControlEphemeral::OrHash),
48
+ strict: T::Boolean,
42
49
  name: Symbol,
43
50
  type: Symbol
44
51
  ).returns(T.attached_class)
@@ -46,6 +53,7 @@ module Anthropic
46
53
  def self.new(
47
54
  # Create a cache control breakpoint at this content block.
48
55
  cache_control: nil,
56
+ strict: nil,
49
57
  # Name of the tool.
50
58
  #
51
59
  # This is how the tool will be called by the model and in `tool_use` blocks.
@@ -60,7 +68,8 @@ module Anthropic
60
68
  name: Symbol,
61
69
  type: Symbol,
62
70
  cache_control:
63
- T.nilable(Anthropic::Beta::BetaCacheControlEphemeral)
71
+ T.nilable(Anthropic::Beta::BetaCacheControlEphemeral),
72
+ strict: T::Boolean
64
73
  }
65
74
  )
66
75
  end
@@ -35,10 +35,17 @@ module Anthropic
35
35
  end
36
36
  attr_writer :cache_control
37
37
 
38
+ sig { returns(T.nilable(T::Boolean)) }
39
+ attr_reader :strict
40
+
41
+ sig { params(strict: T::Boolean).void }
42
+ attr_writer :strict
43
+
38
44
  sig do
39
45
  params(
40
46
  cache_control:
41
47
  T.nilable(Anthropic::Beta::BetaCacheControlEphemeral::OrHash),
48
+ strict: T::Boolean,
42
49
  name: Symbol,
43
50
  type: Symbol
44
51
  ).returns(T.attached_class)
@@ -46,6 +53,7 @@ module Anthropic
46
53
  def self.new(
47
54
  # Create a cache control breakpoint at this content block.
48
55
  cache_control: nil,
56
+ strict: nil,
49
57
  # Name of the tool.
50
58
  #
51
59
  # This is how the tool will be called by the model and in `tool_use` blocks.
@@ -60,7 +68,8 @@ module Anthropic
60
68
  name: Symbol,
61
69
  type: Symbol,
62
70
  cache_control:
63
- T.nilable(Anthropic::Beta::BetaCacheControlEphemeral)
71
+ T.nilable(Anthropic::Beta::BetaCacheControlEphemeral),
72
+ strict: T::Boolean
64
73
  }
65
74
  )
66
75
  end
@@ -40,11 +40,18 @@ module Anthropic
40
40
  sig { returns(T.nilable(Integer)) }
41
41
  attr_accessor :max_characters
42
42
 
43
+ sig { returns(T.nilable(T::Boolean)) }
44
+ attr_reader :strict
45
+
46
+ sig { params(strict: T::Boolean).void }
47
+ attr_writer :strict
48
+
43
49
  sig do
44
50
  params(
45
51
  cache_control:
46
52
  T.nilable(Anthropic::Beta::BetaCacheControlEphemeral::OrHash),
47
53
  max_characters: T.nilable(Integer),
54
+ strict: T::Boolean,
48
55
  name: Symbol,
49
56
  type: Symbol
50
57
  ).returns(T.attached_class)
@@ -55,6 +62,7 @@ module Anthropic
55
62
  # Maximum number of characters to display when viewing a file. If not specified,
56
63
  # defaults to displaying the full file.
57
64
  max_characters: nil,
65
+ strict: nil,
58
66
  # Name of the tool.
59
67
  #
60
68
  # This is how the tool will be called by the model and in `tool_use` blocks.
@@ -70,7 +78,8 @@ module Anthropic
70
78
  type: Symbol,
71
79
  cache_control:
72
80
  T.nilable(Anthropic::Beta::BetaCacheControlEphemeral),
73
- max_characters: T.nilable(Integer)
81
+ max_characters: T.nilable(Integer),
82
+ strict: T::Boolean
74
83
  }
75
84
  )
76
85
  end
@@ -65,6 +65,12 @@ module Anthropic
65
65
  sig { returns(T.nilable(Integer)) }
66
66
  attr_accessor :max_uses
67
67
 
68
+ sig { returns(T.nilable(T::Boolean)) }
69
+ attr_reader :strict
70
+
71
+ sig { params(strict: T::Boolean).void }
72
+ attr_writer :strict
73
+
68
74
  sig do
69
75
  params(
70
76
  allowed_domains: T.nilable(T::Array[String]),
@@ -75,6 +81,7 @@ module Anthropic
75
81
  T.nilable(Anthropic::Beta::BetaCitationsConfigParam::OrHash),
76
82
  max_content_tokens: T.nilable(Integer),
77
83
  max_uses: T.nilable(Integer),
84
+ strict: T::Boolean,
78
85
  name: Symbol,
79
86
  type: Symbol
80
87
  ).returns(T.attached_class)
@@ -94,6 +101,7 @@ module Anthropic
94
101
  max_content_tokens: nil,
95
102
  # Maximum number of times the tool can be used in the API request.
96
103
  max_uses: nil,
104
+ strict: nil,
97
105
  # Name of the tool.
98
106
  #
99
107
  # This is how the tool will be called by the model and in `tool_use` blocks.
@@ -113,7 +121,8 @@ module Anthropic
113
121
  T.nilable(Anthropic::Beta::BetaCacheControlEphemeral),
114
122
  citations: T.nilable(Anthropic::Beta::BetaCitationsConfigParam),
115
123
  max_content_tokens: T.nilable(Integer),
116
- max_uses: T.nilable(Integer)
124
+ max_uses: T.nilable(Integer),
125
+ strict: T::Boolean
117
126
  }
118
127
  )
119
128
  end
@@ -49,6 +49,12 @@ module Anthropic
49
49
  sig { returns(T.nilable(Integer)) }
50
50
  attr_accessor :max_uses
51
51
 
52
+ sig { returns(T.nilable(T::Boolean)) }
53
+ attr_reader :strict
54
+
55
+ sig { params(strict: T::Boolean).void }
56
+ attr_writer :strict
57
+
52
58
  # Parameters for the user's location. Used to provide more relevant search
53
59
  # results.
54
60
  sig do
@@ -75,6 +81,7 @@ module Anthropic
75
81
  cache_control:
76
82
  T.nilable(Anthropic::Beta::BetaCacheControlEphemeral::OrHash),
77
83
  max_uses: T.nilable(Integer),
84
+ strict: T::Boolean,
78
85
  user_location:
79
86
  T.nilable(
80
87
  Anthropic::Beta::BetaWebSearchTool20250305::UserLocation::OrHash
@@ -94,6 +101,7 @@ module Anthropic
94
101
  cache_control: nil,
95
102
  # Maximum number of times the tool can be used in the API request.
96
103
  max_uses: nil,
104
+ strict: nil,
97
105
  # Parameters for the user's location. Used to provide more relevant search
98
106
  # results.
99
107
  user_location: nil,
@@ -115,6 +123,7 @@ module Anthropic
115
123
  cache_control:
116
124
  T.nilable(Anthropic::Beta::BetaCacheControlEphemeral),
117
125
  max_uses: T.nilable(Integer),
126
+ strict: T::Boolean,
118
127
  user_location:
119
128
  T.nilable(
120
129
  Anthropic::Beta::BetaWebSearchTool20250305::UserLocation