anthropic 1.8.0 → 1.9.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -0
- data/README.md +1 -1
- data/lib/anthropic/internal/util.rb +1 -1
- data/lib/anthropic/models/beta/beta_citation_config.rb +19 -0
- data/lib/anthropic/models/beta/beta_content_block.rb +3 -1
- data/lib/anthropic/models/beta/beta_content_block_param.rb +3 -1
- data/lib/anthropic/models/beta/beta_document_block.rb +56 -0
- data/lib/anthropic/models/beta/beta_message.rb +2 -2
- data/lib/anthropic/models/beta/beta_message_param.rb +3 -3
- data/lib/anthropic/models/beta/beta_raw_content_block_start_event.rb +5 -3
- data/lib/anthropic/models/beta/beta_request_document_block.rb +2 -2
- data/lib/anthropic/models/beta/beta_server_tool_usage.rb +9 -1
- data/lib/anthropic/models/beta/beta_server_tool_use_block.rb +1 -0
- data/lib/anthropic/models/beta/beta_server_tool_use_block_param.rb +1 -0
- data/lib/anthropic/models/beta/beta_tool_result_block_param.rb +6 -4
- data/lib/anthropic/models/beta/beta_tool_union.rb +3 -1
- data/lib/anthropic/models/beta/beta_web_fetch_block.rb +42 -0
- data/lib/anthropic/models/beta/beta_web_fetch_block_param.rb +42 -0
- data/lib/anthropic/models/beta/beta_web_fetch_tool_20250910.rb +82 -0
- data/lib/anthropic/models/beta/beta_web_fetch_tool_result_block.rb +43 -0
- data/lib/anthropic/models/beta/beta_web_fetch_tool_result_block_param.rb +53 -0
- data/lib/anthropic/models/beta/beta_web_fetch_tool_result_error_block.rb +25 -0
- data/lib/anthropic/models/beta/beta_web_fetch_tool_result_error_block_param.rb +25 -0
- data/lib/anthropic/models/beta/beta_web_fetch_tool_result_error_code.rb +25 -0
- data/lib/anthropic/models/beta/message_count_tokens_params.rb +5 -3
- data/lib/anthropic/models/beta/message_create_params.rb +2 -2
- data/lib/anthropic/models/beta/messages/batch_create_params.rb +2 -2
- data/lib/anthropic/models/document_block_param.rb +2 -2
- data/lib/anthropic/models/tool_result_block_param.rb +6 -4
- data/lib/anthropic/resources/beta/messages.rb +3 -3
- data/lib/anthropic/version.rb +1 -1
- data/lib/anthropic.rb +10 -0
- data/rbi/anthropic/models/beta/beta_citation_config.rbi +30 -0
- data/rbi/anthropic/models/beta/beta_content_block.rbi +1 -0
- data/rbi/anthropic/models/beta/beta_content_block_param.rbi +1 -0
- data/rbi/anthropic/models/beta/beta_document_block.rbi +95 -0
- data/rbi/anthropic/models/beta/beta_message.rbi +1 -0
- data/rbi/anthropic/models/beta/beta_raw_content_block_start_event.rbi +2 -0
- data/rbi/anthropic/models/beta/beta_request_document_block.rbi +5 -3
- data/rbi/anthropic/models/beta/beta_server_tool_usage.rbi +17 -2
- data/rbi/anthropic/models/beta/beta_server_tool_use_block.rbi +5 -0
- data/rbi/anthropic/models/beta/beta_server_tool_use_block_param.rbi +5 -0
- data/rbi/anthropic/models/beta/beta_tool_result_block_param.rbi +2 -1
- data/rbi/anthropic/models/beta/beta_tool_union.rbi +2 -1
- data/rbi/anthropic/models/beta/beta_web_fetch_block.rbi +67 -0
- data/rbi/anthropic/models/beta/beta_web_fetch_block_param.rbi +71 -0
- data/rbi/anthropic/models/beta/beta_web_fetch_tool_20250910.rbi +125 -0
- data/rbi/anthropic/models/beta/beta_web_fetch_tool_result_block.rbi +81 -0
- data/rbi/anthropic/models/beta/beta_web_fetch_tool_result_block_param.rbi +109 -0
- data/rbi/anthropic/models/beta/beta_web_fetch_tool_result_error_block.rbi +51 -0
- data/rbi/anthropic/models/beta/beta_web_fetch_tool_result_error_block_param.rbi +50 -0
- data/rbi/anthropic/models/beta/beta_web_fetch_tool_result_error_code.rbi +70 -0
- data/rbi/anthropic/models/beta/message_count_tokens_params.rbi +10 -5
- data/rbi/anthropic/models/beta/message_create_params.rbi +8 -4
- data/rbi/anthropic/models/beta/messages/batch_create_params.rbi +8 -4
- data/rbi/anthropic/models/document_block_param.rbi +7 -3
- data/rbi/anthropic/models/tool_result_block_param.rbi +2 -1
- data/rbi/anthropic/resources/beta/messages.rbi +6 -3
- data/sig/anthropic/models/beta/beta_citation_config.rbs +17 -0
- data/sig/anthropic/models/beta/beta_content_block.rbs +1 -0
- data/sig/anthropic/models/beta/beta_content_block_param.rbs +1 -0
- data/sig/anthropic/models/beta/beta_document_block.rbs +49 -0
- data/sig/anthropic/models/beta/beta_raw_content_block_start_event.rbs +1 -0
- data/sig/anthropic/models/beta/beta_request_document_block.rbs +4 -8
- data/sig/anthropic/models/beta/beta_server_tool_usage.rbs +12 -3
- data/sig/anthropic/models/beta/beta_server_tool_use_block.rbs +2 -0
- data/sig/anthropic/models/beta/beta_server_tool_use_block_param.rbs +2 -0
- data/sig/anthropic/models/beta/beta_tool_result_block_param.rbs +1 -0
- data/sig/anthropic/models/beta/beta_tool_union.rbs +1 -0
- data/sig/anthropic/models/beta/beta_web_fetch_block.rbs +39 -0
- data/sig/anthropic/models/beta/beta_web_fetch_block_param.rbs +39 -0
- data/sig/anthropic/models/beta/beta_web_fetch_tool_20250910.rbs +59 -0
- data/sig/anthropic/models/beta/beta_web_fetch_tool_result_block.rbs +44 -0
- data/sig/anthropic/models/beta/beta_web_fetch_tool_result_block_param.rbs +49 -0
- data/sig/anthropic/models/beta/beta_web_fetch_tool_result_error_block.rbs +29 -0
- data/sig/anthropic/models/beta/beta_web_fetch_tool_result_error_block_param.rbs +29 -0
- data/sig/anthropic/models/beta/beta_web_fetch_tool_result_error_code.rbs +32 -0
- data/sig/anthropic/models/beta/message_count_tokens_params.rbs +1 -0
- data/sig/anthropic/models/document_block_param.rbs +4 -8
- data/sig/anthropic/models/tool_result_block_param.rbs +1 -0
- metadata +32 -2
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Anthropic
|
4
|
+
module Models
|
5
|
+
module Beta
|
6
|
+
class BetaWebFetchToolResultErrorBlock < Anthropic::Internal::Type::BaseModel
|
7
|
+
# @!attribute error_code
|
8
|
+
#
|
9
|
+
# @return [Symbol, Anthropic::Models::Beta::BetaWebFetchToolResultErrorCode]
|
10
|
+
required :error_code, enum: -> { Anthropic::Beta::BetaWebFetchToolResultErrorCode }
|
11
|
+
|
12
|
+
# @!attribute type
|
13
|
+
#
|
14
|
+
# @return [Symbol, :web_fetch_tool_result_error]
|
15
|
+
required :type, const: :web_fetch_tool_result_error
|
16
|
+
|
17
|
+
# @!method initialize(error_code:, type: :web_fetch_tool_result_error)
|
18
|
+
# @param error_code [Symbol, Anthropic::Models::Beta::BetaWebFetchToolResultErrorCode]
|
19
|
+
# @param type [Symbol, :web_fetch_tool_result_error]
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
BetaWebFetchToolResultErrorBlock = Beta::BetaWebFetchToolResultErrorBlock
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Anthropic
|
4
|
+
module Models
|
5
|
+
module Beta
|
6
|
+
class BetaWebFetchToolResultErrorBlockParam < Anthropic::Internal::Type::BaseModel
|
7
|
+
# @!attribute error_code
|
8
|
+
#
|
9
|
+
# @return [Symbol, Anthropic::Models::Beta::BetaWebFetchToolResultErrorCode]
|
10
|
+
required :error_code, enum: -> { Anthropic::Beta::BetaWebFetchToolResultErrorCode }
|
11
|
+
|
12
|
+
# @!attribute type
|
13
|
+
#
|
14
|
+
# @return [Symbol, :web_fetch_tool_result_error]
|
15
|
+
required :type, const: :web_fetch_tool_result_error
|
16
|
+
|
17
|
+
# @!method initialize(error_code:, type: :web_fetch_tool_result_error)
|
18
|
+
# @param error_code [Symbol, Anthropic::Models::Beta::BetaWebFetchToolResultErrorCode]
|
19
|
+
# @param type [Symbol, :web_fetch_tool_result_error]
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
BetaWebFetchToolResultErrorBlockParam = Beta::BetaWebFetchToolResultErrorBlockParam
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Anthropic
|
4
|
+
module Models
|
5
|
+
module Beta
|
6
|
+
module BetaWebFetchToolResultErrorCode
|
7
|
+
extend Anthropic::Internal::Type::Enum
|
8
|
+
|
9
|
+
INVALID_TOOL_INPUT = :invalid_tool_input
|
10
|
+
URL_TOO_LONG = :url_too_long
|
11
|
+
URL_NOT_ALLOWED = :url_not_allowed
|
12
|
+
URL_NOT_ACCESSIBLE = :url_not_accessible
|
13
|
+
UNSUPPORTED_CONTENT_TYPE = :unsupported_content_type
|
14
|
+
TOO_MANY_REQUESTS = :too_many_requests
|
15
|
+
MAX_USES_EXCEEDED = :max_uses_exceeded
|
16
|
+
UNAVAILABLE = :unavailable
|
17
|
+
|
18
|
+
# @!method self.values
|
19
|
+
# @return [Array<Symbol>]
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
BetaWebFetchToolResultErrorCode = Beta::BetaWebFetchToolResultErrorCode
|
24
|
+
end
|
25
|
+
end
|
@@ -201,7 +201,7 @@ module Anthropic
|
|
201
201
|
#
|
202
202
|
# See our [guide](https://docs.anthropic.com/en/docs/tool-use) for more details.
|
203
203
|
#
|
204
|
-
# @return [Array<Anthropic::Models::Beta::BetaTool, Anthropic::Models::Beta::BetaToolBash20241022, Anthropic::Models::Beta::BetaToolBash20250124, Anthropic::Models::Beta::BetaCodeExecutionTool20250522, Anthropic::Models::Beta::BetaCodeExecutionTool20250825, 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>, nil]
|
204
|
+
# @return [Array<Anthropic::Models::Beta::BetaTool, Anthropic::Models::Beta::BetaToolBash20241022, Anthropic::Models::Beta::BetaToolBash20250124, Anthropic::Models::Beta::BetaCodeExecutionTool20250522, Anthropic::Models::Beta::BetaCodeExecutionTool20250825, 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, Anthropic::Models::Beta::BetaWebFetchTool20250910>, nil]
|
205
205
|
optional :tools,
|
206
206
|
-> { Anthropic::Internal::Type::ArrayOf[union: Anthropic::Beta::MessageCountTokensParams::Tool] }
|
207
207
|
|
@@ -227,7 +227,7 @@ module Anthropic
|
|
227
227
|
#
|
228
228
|
# @param tool_choice [Anthropic::Models::Beta::BetaToolChoiceAuto, Anthropic::Models::Beta::BetaToolChoiceAny, Anthropic::Models::Beta::BetaToolChoiceTool, Anthropic::Models::Beta::BetaToolChoiceNone] How the model should use the provided tools. The model can use a specific tool,
|
229
229
|
#
|
230
|
-
# @param tools [Array<Anthropic::Models::Beta::BetaTool, Anthropic::Models::Beta::BetaToolBash20241022, Anthropic::Models::Beta::BetaToolBash20250124, Anthropic::Models::Beta::BetaCodeExecutionTool20250522, Anthropic::Models::Beta::BetaCodeExecutionTool20250825, 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>] Definitions of tools that the model may use.
|
230
|
+
# @param tools [Array<Anthropic::Models::Beta::BetaTool, Anthropic::Models::Beta::BetaToolBash20241022, Anthropic::Models::Beta::BetaToolBash20250124, Anthropic::Models::Beta::BetaCodeExecutionTool20250522, Anthropic::Models::Beta::BetaCodeExecutionTool20250825, 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, Anthropic::Models::Beta::BetaWebFetchTool20250910>] Definitions of tools that the model may use.
|
231
231
|
#
|
232
232
|
# @param betas [Array<String, Symbol, Anthropic::Models::AnthropicBeta>] Optional header to specify the beta version(s) you want to use.
|
233
233
|
#
|
@@ -281,8 +281,10 @@ module Anthropic
|
|
281
281
|
|
282
282
|
variant -> { Anthropic::Beta::BetaWebSearchTool20250305 }
|
283
283
|
|
284
|
+
variant -> { Anthropic::Beta::BetaWebFetchTool20250910 }
|
285
|
+
|
284
286
|
# @!method self.variants
|
285
|
-
# @return [Array(Anthropic::Models::Beta::BetaTool, Anthropic::Models::Beta::BetaToolBash20241022, Anthropic::Models::Beta::BetaToolBash20250124, Anthropic::Models::Beta::BetaCodeExecutionTool20250522, Anthropic::Models::Beta::BetaCodeExecutionTool20250825, 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)]
|
287
|
+
# @return [Array(Anthropic::Models::Beta::BetaTool, Anthropic::Models::Beta::BetaToolBash20241022, Anthropic::Models::Beta::BetaToolBash20250124, Anthropic::Models::Beta::BetaCodeExecutionTool20250522, Anthropic::Models::Beta::BetaCodeExecutionTool20250825, 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, Anthropic::Models::Beta::BetaWebFetchTool20250910)]
|
286
288
|
end
|
287
289
|
end
|
288
290
|
end
|
@@ -264,7 +264,7 @@ module Anthropic
|
|
264
264
|
#
|
265
265
|
# See our [guide](https://docs.anthropic.com/en/docs/tool-use) for more details.
|
266
266
|
#
|
267
|
-
# @return [Array<Anthropic::Models::Beta::BetaTool, Anthropic::Models::Beta::BetaToolBash20241022, Anthropic::Models::Beta::BetaToolBash20250124, Anthropic::Models::Beta::BetaCodeExecutionTool20250522, Anthropic::Models::Beta::BetaCodeExecutionTool20250825, 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>, nil]
|
267
|
+
# @return [Array<Anthropic::Models::Beta::BetaTool, Anthropic::Models::Beta::BetaToolBash20241022, Anthropic::Models::Beta::BetaToolBash20250124, Anthropic::Models::Beta::BetaCodeExecutionTool20250522, Anthropic::Models::Beta::BetaCodeExecutionTool20250825, 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, Anthropic::Models::Beta::BetaWebFetchTool20250910>, nil]
|
268
268
|
optional :tools, -> { Anthropic::Internal::Type::ArrayOf[union: Anthropic::Beta::BetaToolUnion] }
|
269
269
|
|
270
270
|
# @!attribute top_k
|
@@ -327,7 +327,7 @@ module Anthropic
|
|
327
327
|
#
|
328
328
|
# @param tool_choice [Anthropic::Models::Beta::BetaToolChoiceAuto, Anthropic::Models::Beta::BetaToolChoiceAny, Anthropic::Models::Beta::BetaToolChoiceTool, Anthropic::Models::Beta::BetaToolChoiceNone] How the model should use the provided tools. The model can use a specific tool,
|
329
329
|
#
|
330
|
-
# @param tools [Array<Anthropic::Models::Beta::BetaTool, Anthropic::Models::Beta::BetaToolBash20241022, Anthropic::Models::Beta::BetaToolBash20250124, Anthropic::Models::Beta::BetaCodeExecutionTool20250522, Anthropic::Models::Beta::BetaCodeExecutionTool20250825, 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>] Definitions of tools that the model may use.
|
330
|
+
# @param tools [Array<Anthropic::Models::Beta::BetaTool, Anthropic::Models::Beta::BetaToolBash20241022, Anthropic::Models::Beta::BetaToolBash20250124, Anthropic::Models::Beta::BetaCodeExecutionTool20250522, Anthropic::Models::Beta::BetaCodeExecutionTool20250825, 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, Anthropic::Models::Beta::BetaWebFetchTool20250910>] Definitions of tools that the model may use.
|
331
331
|
#
|
332
332
|
# @param top_k [Integer] Only sample from the top K options for each subsequent token.
|
333
333
|
#
|
@@ -329,7 +329,7 @@ module Anthropic
|
|
329
329
|
#
|
330
330
|
# See our [guide](https://docs.anthropic.com/en/docs/tool-use) for more details.
|
331
331
|
#
|
332
|
-
# @return [Array<Anthropic::Models::Beta::BetaTool, Anthropic::Models::Beta::BetaToolBash20241022, Anthropic::Models::Beta::BetaToolBash20250124, Anthropic::Models::Beta::BetaCodeExecutionTool20250522, Anthropic::Models::Beta::BetaCodeExecutionTool20250825, 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>, nil]
|
332
|
+
# @return [Array<Anthropic::Models::Beta::BetaTool, Anthropic::Models::Beta::BetaToolBash20241022, Anthropic::Models::Beta::BetaToolBash20250124, Anthropic::Models::Beta::BetaCodeExecutionTool20250522, Anthropic::Models::Beta::BetaCodeExecutionTool20250825, 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, Anthropic::Models::Beta::BetaWebFetchTool20250910>, nil]
|
333
333
|
optional :tools, -> { Anthropic::Internal::Type::ArrayOf[union: Anthropic::Beta::BetaToolUnion] }
|
334
334
|
|
335
335
|
# @!attribute top_k
|
@@ -394,7 +394,7 @@ module Anthropic
|
|
394
394
|
#
|
395
395
|
# @param tool_choice [Anthropic::Models::Beta::BetaToolChoiceAuto, Anthropic::Models::Beta::BetaToolChoiceAny, Anthropic::Models::Beta::BetaToolChoiceTool, Anthropic::Models::Beta::BetaToolChoiceNone] How the model should use the provided tools. The model can use a specific tool,
|
396
396
|
#
|
397
|
-
# @param tools [Array<Anthropic::Models::Beta::BetaTool, Anthropic::Models::Beta::BetaToolBash20241022, Anthropic::Models::Beta::BetaToolBash20250124, Anthropic::Models::Beta::BetaCodeExecutionTool20250522, Anthropic::Models::Beta::BetaCodeExecutionTool20250825, 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>] Definitions of tools that the model may use.
|
397
|
+
# @param tools [Array<Anthropic::Models::Beta::BetaTool, Anthropic::Models::Beta::BetaToolBash20241022, Anthropic::Models::Beta::BetaToolBash20250124, Anthropic::Models::Beta::BetaCodeExecutionTool20250522, Anthropic::Models::Beta::BetaCodeExecutionTool20250825, 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, Anthropic::Models::Beta::BetaWebFetchTool20250910>] Definitions of tools that the model may use.
|
398
398
|
#
|
399
399
|
# @param top_k [Integer] Only sample from the top K options for each subsequent token.
|
400
400
|
#
|
@@ -22,7 +22,7 @@ module Anthropic
|
|
22
22
|
# @!attribute citations
|
23
23
|
#
|
24
24
|
# @return [Anthropic::Models::CitationsConfigParam, nil]
|
25
|
-
optional :citations, -> { Anthropic::CitationsConfigParam }
|
25
|
+
optional :citations, -> { Anthropic::CitationsConfigParam }, nil?: true
|
26
26
|
|
27
27
|
# @!attribute context
|
28
28
|
#
|
@@ -39,7 +39,7 @@ module Anthropic
|
|
39
39
|
#
|
40
40
|
# @param cache_control [Anthropic::Models::CacheControlEphemeral, nil] Create a cache control breakpoint at this content block.
|
41
41
|
#
|
42
|
-
# @param citations [Anthropic::Models::CitationsConfigParam]
|
42
|
+
# @param citations [Anthropic::Models::CitationsConfigParam, nil]
|
43
43
|
#
|
44
44
|
# @param context [String, nil]
|
45
45
|
#
|
@@ -21,7 +21,7 @@ module Anthropic
|
|
21
21
|
|
22
22
|
# @!attribute content
|
23
23
|
#
|
24
|
-
# @return [String, Array<Anthropic::Models::TextBlockParam, Anthropic::Models::ImageBlockParam, Anthropic::Models::SearchResultBlockParam>, nil]
|
24
|
+
# @return [String, Array<Anthropic::Models::TextBlockParam, Anthropic::Models::ImageBlockParam, Anthropic::Models::SearchResultBlockParam, Anthropic::Models::DocumentBlockParam>, nil]
|
25
25
|
optional :content, union: -> { Anthropic::ToolResultBlockParam::Content }
|
26
26
|
|
27
27
|
# @!attribute is_error
|
@@ -34,7 +34,7 @@ module Anthropic
|
|
34
34
|
#
|
35
35
|
# @param cache_control [Anthropic::Models::CacheControlEphemeral, nil] Create a cache control breakpoint at this content block.
|
36
36
|
#
|
37
|
-
# @param content [String, Array<Anthropic::Models::TextBlockParam, Anthropic::Models::ImageBlockParam, Anthropic::Models::SearchResultBlockParam>]
|
37
|
+
# @param content [String, Array<Anthropic::Models::TextBlockParam, Anthropic::Models::ImageBlockParam, Anthropic::Models::SearchResultBlockParam, Anthropic::Models::DocumentBlockParam>]
|
38
38
|
#
|
39
39
|
# @param is_error [Boolean]
|
40
40
|
#
|
@@ -59,12 +59,14 @@ module Anthropic
|
|
59
59
|
|
60
60
|
variant :search_result, -> { Anthropic::SearchResultBlockParam }
|
61
61
|
|
62
|
+
variant :document, -> { Anthropic::DocumentBlockParam }
|
63
|
+
|
62
64
|
# @!method self.variants
|
63
|
-
# @return [Array(Anthropic::Models::TextBlockParam, Anthropic::Models::ImageBlockParam, Anthropic::Models::SearchResultBlockParam)]
|
65
|
+
# @return [Array(Anthropic::Models::TextBlockParam, Anthropic::Models::ImageBlockParam, Anthropic::Models::SearchResultBlockParam, Anthropic::Models::DocumentBlockParam)]
|
64
66
|
end
|
65
67
|
|
66
68
|
# @!method self.variants
|
67
|
-
# @return [Array(String, Array<Anthropic::Models::TextBlockParam, Anthropic::Models::ImageBlockParam, Anthropic::Models::SearchResultBlockParam>)]
|
69
|
+
# @return [Array(String, Array<Anthropic::Models::TextBlockParam, Anthropic::Models::ImageBlockParam, Anthropic::Models::SearchResultBlockParam, Anthropic::Models::DocumentBlockParam>)]
|
68
70
|
|
69
71
|
# @type [Anthropic::Internal::Type::Converter]
|
70
72
|
ContentArray =
|
@@ -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::BetaCodeExecutionTool20250825, 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.
|
49
|
+
# @param tools [Array<Anthropic::Models::Beta::BetaTool, Anthropic::Models::Beta::BetaToolBash20241022, Anthropic::Models::Beta::BetaToolBash20250124, Anthropic::Models::Beta::BetaCodeExecutionTool20250522, Anthropic::Models::Beta::BetaCodeExecutionTool20250825, 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, Anthropic::Models::Beta::BetaWebFetchTool20250910>] 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::BetaCodeExecutionTool20250825, 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.
|
131
|
+
# @param tools [Array<Anthropic::Models::Beta::BetaTool, Anthropic::Models::Beta::BetaToolBash20241022, Anthropic::Models::Beta::BetaToolBash20250124, Anthropic::Models::Beta::BetaCodeExecutionTool20250522, Anthropic::Models::Beta::BetaCodeExecutionTool20250825, 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, Anthropic::Models::Beta::BetaWebFetchTool20250910>] 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::BetaCodeExecutionTool20250825, 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.
|
262
|
+
# @param tools [Array<Anthropic::Models::Beta::BetaTool, Anthropic::Models::Beta::BetaToolBash20241022, Anthropic::Models::Beta::BetaToolBash20250124, Anthropic::Models::Beta::BetaCodeExecutionTool20250522, Anthropic::Models::Beta::BetaCodeExecutionTool20250825, 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, Anthropic::Models::Beta::BetaWebFetchTool20250910>] 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
|
#
|
data/lib/anthropic/version.rb
CHANGED
data/lib/anthropic.rb
CHANGED
@@ -79,6 +79,7 @@ require_relative "anthropic/models/beta/beta_cache_control_ephemeral"
|
|
79
79
|
require_relative "anthropic/models/beta/beta_cache_creation"
|
80
80
|
require_relative "anthropic/models/beta/beta_citation_char_location"
|
81
81
|
require_relative "anthropic/models/beta/beta_citation_char_location_param"
|
82
|
+
require_relative "anthropic/models/beta/beta_citation_config"
|
82
83
|
require_relative "anthropic/models/beta/beta_citation_content_block_location"
|
83
84
|
require_relative "anthropic/models/beta/beta_citation_content_block_location_param"
|
84
85
|
require_relative "anthropic/models/beta/beta_citation_page_location"
|
@@ -109,6 +110,7 @@ require_relative "anthropic/models/beta/beta_content_block"
|
|
109
110
|
require_relative "anthropic/models/beta/beta_content_block_param"
|
110
111
|
require_relative "anthropic/models/beta/beta_content_block_source"
|
111
112
|
require_relative "anthropic/models/beta/beta_content_block_source_content"
|
113
|
+
require_relative "anthropic/models/beta/beta_document_block"
|
112
114
|
require_relative "anthropic/models/beta/beta_file_document_source"
|
113
115
|
require_relative "anthropic/models/beta/beta_file_image_source"
|
114
116
|
require_relative "anthropic/models/beta/beta_image_block_param"
|
@@ -184,6 +186,14 @@ require_relative "anthropic/models/beta/beta_tool_use_block_param"
|
|
184
186
|
require_relative "anthropic/models/beta/beta_url_image_source"
|
185
187
|
require_relative "anthropic/models/beta/beta_url_pdf_source"
|
186
188
|
require_relative "anthropic/models/beta/beta_usage"
|
189
|
+
require_relative "anthropic/models/beta/beta_web_fetch_block"
|
190
|
+
require_relative "anthropic/models/beta/beta_web_fetch_block_param"
|
191
|
+
require_relative "anthropic/models/beta/beta_web_fetch_tool_20250910"
|
192
|
+
require_relative "anthropic/models/beta/beta_web_fetch_tool_result_block"
|
193
|
+
require_relative "anthropic/models/beta/beta_web_fetch_tool_result_block_param"
|
194
|
+
require_relative "anthropic/models/beta/beta_web_fetch_tool_result_error_block"
|
195
|
+
require_relative "anthropic/models/beta/beta_web_fetch_tool_result_error_block_param"
|
196
|
+
require_relative "anthropic/models/beta/beta_web_fetch_tool_result_error_code"
|
187
197
|
require_relative "anthropic/models/beta/beta_web_search_result_block"
|
188
198
|
require_relative "anthropic/models/beta/beta_web_search_result_block_param"
|
189
199
|
require_relative "anthropic/models/beta/beta_web_search_tool_20250305"
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Anthropic
|
4
|
+
module Models
|
5
|
+
BetaCitationConfig = Beta::BetaCitationConfig
|
6
|
+
|
7
|
+
module Beta
|
8
|
+
class BetaCitationConfig < Anthropic::Internal::Type::BaseModel
|
9
|
+
OrHash =
|
10
|
+
T.type_alias do
|
11
|
+
T.any(
|
12
|
+
Anthropic::Beta::BetaCitationConfig,
|
13
|
+
Anthropic::Internal::AnyHash
|
14
|
+
)
|
15
|
+
end
|
16
|
+
|
17
|
+
sig { returns(T::Boolean) }
|
18
|
+
attr_accessor :enabled
|
19
|
+
|
20
|
+
sig { params(enabled: T::Boolean).returns(T.attached_class) }
|
21
|
+
def self.new(enabled:)
|
22
|
+
end
|
23
|
+
|
24
|
+
sig { override.returns({ enabled: T::Boolean }) }
|
25
|
+
def to_hash
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -18,6 +18,7 @@ module Anthropic
|
|
18
18
|
Anthropic::Beta::BetaToolUseBlock,
|
19
19
|
Anthropic::Beta::BetaServerToolUseBlock,
|
20
20
|
Anthropic::Beta::BetaWebSearchToolResultBlock,
|
21
|
+
Anthropic::Beta::BetaWebFetchToolResultBlock,
|
21
22
|
Anthropic::Beta::BetaCodeExecutionToolResultBlock,
|
22
23
|
Anthropic::Beta::BetaBashCodeExecutionToolResultBlock,
|
23
24
|
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultBlock,
|
@@ -22,6 +22,7 @@ module Anthropic
|
|
22
22
|
Anthropic::Beta::BetaToolResultBlockParam,
|
23
23
|
Anthropic::Beta::BetaServerToolUseBlockParam,
|
24
24
|
Anthropic::Beta::BetaWebSearchToolResultBlockParam,
|
25
|
+
Anthropic::Beta::BetaWebFetchToolResultBlockParam,
|
25
26
|
Anthropic::Beta::BetaCodeExecutionToolResultBlockParam,
|
26
27
|
Anthropic::Beta::BetaBashCodeExecutionToolResultBlockParam,
|
27
28
|
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultBlockParam,
|
@@ -0,0 +1,95 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Anthropic
|
4
|
+
module Models
|
5
|
+
BetaDocumentBlock = Beta::BetaDocumentBlock
|
6
|
+
|
7
|
+
module Beta
|
8
|
+
class BetaDocumentBlock < Anthropic::Internal::Type::BaseModel
|
9
|
+
OrHash =
|
10
|
+
T.type_alias do
|
11
|
+
T.any(
|
12
|
+
Anthropic::Beta::BetaDocumentBlock,
|
13
|
+
Anthropic::Internal::AnyHash
|
14
|
+
)
|
15
|
+
end
|
16
|
+
|
17
|
+
# Citation configuration for the document
|
18
|
+
sig { returns(T.nilable(Anthropic::Beta::BetaCitationConfig)) }
|
19
|
+
attr_reader :citations
|
20
|
+
|
21
|
+
sig do
|
22
|
+
params(
|
23
|
+
citations: T.nilable(Anthropic::Beta::BetaCitationConfig::OrHash)
|
24
|
+
).void
|
25
|
+
end
|
26
|
+
attr_writer :citations
|
27
|
+
|
28
|
+
sig { returns(Anthropic::Beta::BetaDocumentBlock::Source::Variants) }
|
29
|
+
attr_accessor :source
|
30
|
+
|
31
|
+
# The title of the document
|
32
|
+
sig { returns(T.nilable(String)) }
|
33
|
+
attr_accessor :title
|
34
|
+
|
35
|
+
sig { returns(Symbol) }
|
36
|
+
attr_accessor :type
|
37
|
+
|
38
|
+
sig do
|
39
|
+
params(
|
40
|
+
citations: T.nilable(Anthropic::Beta::BetaCitationConfig::OrHash),
|
41
|
+
source:
|
42
|
+
T.any(
|
43
|
+
Anthropic::Beta::BetaBase64PDFSource::OrHash,
|
44
|
+
Anthropic::Beta::BetaPlainTextSource::OrHash
|
45
|
+
),
|
46
|
+
title: T.nilable(String),
|
47
|
+
type: Symbol
|
48
|
+
).returns(T.attached_class)
|
49
|
+
end
|
50
|
+
def self.new(
|
51
|
+
# Citation configuration for the document
|
52
|
+
citations:,
|
53
|
+
source:,
|
54
|
+
# The title of the document
|
55
|
+
title:,
|
56
|
+
type: :document
|
57
|
+
)
|
58
|
+
end
|
59
|
+
|
60
|
+
sig do
|
61
|
+
override.returns(
|
62
|
+
{
|
63
|
+
citations: T.nilable(Anthropic::Beta::BetaCitationConfig),
|
64
|
+
source: Anthropic::Beta::BetaDocumentBlock::Source::Variants,
|
65
|
+
title: T.nilable(String),
|
66
|
+
type: Symbol
|
67
|
+
}
|
68
|
+
)
|
69
|
+
end
|
70
|
+
def to_hash
|
71
|
+
end
|
72
|
+
|
73
|
+
module Source
|
74
|
+
extend Anthropic::Internal::Type::Union
|
75
|
+
|
76
|
+
Variants =
|
77
|
+
T.type_alias do
|
78
|
+
T.any(
|
79
|
+
Anthropic::Beta::BetaBase64PDFSource,
|
80
|
+
Anthropic::Beta::BetaPlainTextSource
|
81
|
+
)
|
82
|
+
end
|
83
|
+
|
84
|
+
sig do
|
85
|
+
override.returns(
|
86
|
+
T::Array[Anthropic::Beta::BetaDocumentBlock::Source::Variants]
|
87
|
+
)
|
88
|
+
end
|
89
|
+
def self.variants
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
@@ -143,6 +143,7 @@ module Anthropic
|
|
143
143
|
Anthropic::Beta::BetaToolUseBlock::OrHash,
|
144
144
|
Anthropic::Beta::BetaServerToolUseBlock::OrHash,
|
145
145
|
Anthropic::Beta::BetaWebSearchToolResultBlock::OrHash,
|
146
|
+
Anthropic::Beta::BetaWebFetchToolResultBlock::OrHash,
|
146
147
|
Anthropic::Beta::BetaCodeExecutionToolResultBlock::OrHash,
|
147
148
|
Anthropic::Beta::BetaBashCodeExecutionToolResultBlock::OrHash,
|
148
149
|
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultBlock::OrHash,
|
@@ -38,6 +38,7 @@ module Anthropic
|
|
38
38
|
Anthropic::Beta::BetaToolUseBlock::OrHash,
|
39
39
|
Anthropic::Beta::BetaServerToolUseBlock::OrHash,
|
40
40
|
Anthropic::Beta::BetaWebSearchToolResultBlock::OrHash,
|
41
|
+
Anthropic::Beta::BetaWebFetchToolResultBlock::OrHash,
|
41
42
|
Anthropic::Beta::BetaCodeExecutionToolResultBlock::OrHash,
|
42
43
|
Anthropic::Beta::BetaBashCodeExecutionToolResultBlock::OrHash,
|
43
44
|
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultBlock::OrHash,
|
@@ -83,6 +84,7 @@ module Anthropic
|
|
83
84
|
Anthropic::Beta::BetaToolUseBlock,
|
84
85
|
Anthropic::Beta::BetaServerToolUseBlock,
|
85
86
|
Anthropic::Beta::BetaWebSearchToolResultBlock,
|
87
|
+
Anthropic::Beta::BetaWebFetchToolResultBlock,
|
86
88
|
Anthropic::Beta::BetaCodeExecutionToolResultBlock,
|
87
89
|
Anthropic::Beta::BetaBashCodeExecutionToolResultBlock,
|
88
90
|
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultBlock,
|
@@ -47,7 +47,8 @@ module Anthropic
|
|
47
47
|
|
48
48
|
sig do
|
49
49
|
params(
|
50
|
-
citations:
|
50
|
+
citations:
|
51
|
+
T.nilable(Anthropic::Beta::BetaCitationsConfigParam::OrHash)
|
51
52
|
).void
|
52
53
|
end
|
53
54
|
attr_writer :citations
|
@@ -70,7 +71,8 @@ module Anthropic
|
|
70
71
|
),
|
71
72
|
cache_control:
|
72
73
|
T.nilable(Anthropic::Beta::BetaCacheControlEphemeral::OrHash),
|
73
|
-
citations:
|
74
|
+
citations:
|
75
|
+
T.nilable(Anthropic::Beta::BetaCitationsConfigParam::OrHash),
|
74
76
|
context: T.nilable(String),
|
75
77
|
title: T.nilable(String),
|
76
78
|
type: Symbol
|
@@ -101,7 +103,7 @@ module Anthropic
|
|
101
103
|
type: Symbol,
|
102
104
|
cache_control:
|
103
105
|
T.nilable(Anthropic::Beta::BetaCacheControlEphemeral),
|
104
|
-
citations: Anthropic::Beta::BetaCitationsConfigParam,
|
106
|
+
citations: T.nilable(Anthropic::Beta::BetaCitationsConfigParam),
|
105
107
|
context: T.nilable(String),
|
106
108
|
title: T.nilable(String)
|
107
109
|
}
|
@@ -14,18 +14,33 @@ module Anthropic
|
|
14
14
|
)
|
15
15
|
end
|
16
16
|
|
17
|
+
# The number of web fetch tool requests.
|
18
|
+
sig { returns(Integer) }
|
19
|
+
attr_accessor :web_fetch_requests
|
20
|
+
|
17
21
|
# The number of web search tool requests.
|
18
22
|
sig { returns(Integer) }
|
19
23
|
attr_accessor :web_search_requests
|
20
24
|
|
21
|
-
sig
|
25
|
+
sig do
|
26
|
+
params(
|
27
|
+
web_fetch_requests: Integer,
|
28
|
+
web_search_requests: Integer
|
29
|
+
).returns(T.attached_class)
|
30
|
+
end
|
22
31
|
def self.new(
|
32
|
+
# The number of web fetch tool requests.
|
33
|
+
web_fetch_requests:,
|
23
34
|
# The number of web search tool requests.
|
24
35
|
web_search_requests:
|
25
36
|
)
|
26
37
|
end
|
27
38
|
|
28
|
-
sig
|
39
|
+
sig do
|
40
|
+
override.returns(
|
41
|
+
{ web_fetch_requests: Integer, web_search_requests: Integer }
|
42
|
+
)
|
43
|
+
end
|
29
44
|
def to_hash
|
30
45
|
end
|
31
46
|
end
|
@@ -66,6 +66,11 @@ module Anthropic
|
|
66
66
|
:web_search,
|
67
67
|
Anthropic::Beta::BetaServerToolUseBlock::Name::TaggedSymbol
|
68
68
|
)
|
69
|
+
WEB_FETCH =
|
70
|
+
T.let(
|
71
|
+
:web_fetch,
|
72
|
+
Anthropic::Beta::BetaServerToolUseBlock::Name::TaggedSymbol
|
73
|
+
)
|
69
74
|
CODE_EXECUTION =
|
70
75
|
T.let(
|
71
76
|
:code_execution,
|
@@ -90,6 +90,11 @@ module Anthropic
|
|
90
90
|
:web_search,
|
91
91
|
Anthropic::Beta::BetaServerToolUseBlockParam::Name::TaggedSymbol
|
92
92
|
)
|
93
|
+
WEB_FETCH =
|
94
|
+
T.let(
|
95
|
+
:web_fetch,
|
96
|
+
Anthropic::Beta::BetaServerToolUseBlockParam::Name::TaggedSymbol
|
97
|
+
)
|
93
98
|
CODE_EXECUTION =
|
94
99
|
T.let(
|
95
100
|
:code_execution,
|
@@ -113,7 +113,8 @@ module Anthropic
|
|
113
113
|
T.any(
|
114
114
|
Anthropic::Beta::BetaTextBlockParam,
|
115
115
|
Anthropic::Beta::BetaImageBlockParam,
|
116
|
-
Anthropic::Beta::BetaSearchResultBlockParam
|
116
|
+
Anthropic::Beta::BetaSearchResultBlockParam,
|
117
|
+
Anthropic::Beta::BetaRequestDocumentBlock
|
117
118
|
)
|
118
119
|
end
|
119
120
|
|
@@ -22,7 +22,8 @@ module Anthropic
|
|
22
22
|
Anthropic::Beta::BetaToolTextEditor20250124,
|
23
23
|
Anthropic::Beta::BetaToolTextEditor20250429,
|
24
24
|
Anthropic::Beta::BetaToolTextEditor20250728,
|
25
|
-
Anthropic::Beta::BetaWebSearchTool20250305
|
25
|
+
Anthropic::Beta::BetaWebSearchTool20250305,
|
26
|
+
Anthropic::Beta::BetaWebFetchTool20250910
|
26
27
|
)
|
27
28
|
end
|
28
29
|
|
@@ -0,0 +1,67 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Anthropic
|
4
|
+
module Models
|
5
|
+
BetaWebFetchBlock = Beta::BetaWebFetchBlock
|
6
|
+
|
7
|
+
module Beta
|
8
|
+
class BetaWebFetchBlock < Anthropic::Internal::Type::BaseModel
|
9
|
+
OrHash =
|
10
|
+
T.type_alias do
|
11
|
+
T.any(
|
12
|
+
Anthropic::Beta::BetaWebFetchBlock,
|
13
|
+
Anthropic::Internal::AnyHash
|
14
|
+
)
|
15
|
+
end
|
16
|
+
|
17
|
+
sig { returns(Anthropic::Beta::BetaDocumentBlock) }
|
18
|
+
attr_reader :content
|
19
|
+
|
20
|
+
sig { params(content: Anthropic::Beta::BetaDocumentBlock::OrHash).void }
|
21
|
+
attr_writer :content
|
22
|
+
|
23
|
+
# ISO 8601 timestamp when the content was retrieved
|
24
|
+
sig { returns(T.nilable(String)) }
|
25
|
+
attr_accessor :retrieved_at
|
26
|
+
|
27
|
+
sig { returns(Symbol) }
|
28
|
+
attr_accessor :type
|
29
|
+
|
30
|
+
# Fetched content URL
|
31
|
+
sig { returns(String) }
|
32
|
+
attr_accessor :url
|
33
|
+
|
34
|
+
sig do
|
35
|
+
params(
|
36
|
+
content: Anthropic::Beta::BetaDocumentBlock::OrHash,
|
37
|
+
retrieved_at: T.nilable(String),
|
38
|
+
url: String,
|
39
|
+
type: Symbol
|
40
|
+
).returns(T.attached_class)
|
41
|
+
end
|
42
|
+
def self.new(
|
43
|
+
content:,
|
44
|
+
# ISO 8601 timestamp when the content was retrieved
|
45
|
+
retrieved_at:,
|
46
|
+
# Fetched content URL
|
47
|
+
url:,
|
48
|
+
type: :web_fetch_result
|
49
|
+
)
|
50
|
+
end
|
51
|
+
|
52
|
+
sig do
|
53
|
+
override.returns(
|
54
|
+
{
|
55
|
+
content: Anthropic::Beta::BetaDocumentBlock,
|
56
|
+
retrieved_at: T.nilable(String),
|
57
|
+
type: Symbol,
|
58
|
+
url: String
|
59
|
+
}
|
60
|
+
)
|
61
|
+
end
|
62
|
+
def to_hash
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|