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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9508f2174591353cfaa66f66d1ec7d72fbd3dced9f88e64aae101ad0b370ec51
|
4
|
+
data.tar.gz: 4e10f3b7dcdfe9e1fc2bf5efec9bb8578d63f2d49a0ed36b08db2153109a0ada
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5eeb2c0701c8ab45b86c58f28c4fd49344ae4b9ac1539486ba282ce3b9154cd3b7e8466fb933b61206f18ef2024f50de8366d5aa89336e86307e2ab22a8f1c2
|
7
|
+
data.tar.gz: c6f369c9cd95b5501e4416dd8c46ba936f2b09134ccb1a7fec65e7a7948b0e734db46bc3836dee43deac948c4fd216162a5395301c71b837e6277cdbabbbc7a9
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,19 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 1.9.0 (2025-09-10)
|
4
|
+
|
5
|
+
Full Changelog: [v1.8.0...v1.9.0](https://github.com/anthropics/anthropic-sdk-ruby/compare/v1.8.0...v1.9.0)
|
6
|
+
|
7
|
+
### Features
|
8
|
+
|
9
|
+
* **api:** adds support for Documents in tool results ([91e23c1](https://github.com/anthropics/anthropic-sdk-ruby/commit/91e23c14525ba91fa63eab1ab901c7d8782aa6b3))
|
10
|
+
* **api:** adds support for web_fetch_20250910 tool ([631783d](https://github.com/anthropics/anthropic-sdk-ruby/commit/631783ddbbcc0aab95172b3dd4d6cbd29e0ec507))
|
11
|
+
|
12
|
+
|
13
|
+
### Bug Fixes
|
14
|
+
|
15
|
+
* unnecessarily long multipart boundary length ([#124](https://github.com/anthropics/anthropic-sdk-ruby/issues/124)) ([69aa4c8](https://github.com/anthropics/anthropic-sdk-ruby/commit/69aa4c8c918b3d401933efaba6440164c6eb6962))
|
16
|
+
|
3
17
|
## 1.8.0 (2025-09-02)
|
4
18
|
|
5
19
|
Full Changelog: [v1.7.0...v1.8.0](https://github.com/anthropics/anthropic-sdk-ruby/compare/v1.7.0...v1.8.0)
|
data/README.md
CHANGED
@@ -566,7 +566,7 @@ module Anthropic
|
|
566
566
|
#
|
567
567
|
# @return [Array(String, Enumerable<String>)]
|
568
568
|
private def encode_multipart_streaming(body)
|
569
|
-
boundary = SecureRandom.urlsafe_base64(
|
569
|
+
boundary = SecureRandom.urlsafe_base64(30)
|
570
570
|
|
571
571
|
closing = []
|
572
572
|
strio = writable_enum do |y|
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Anthropic
|
4
|
+
module Models
|
5
|
+
module Beta
|
6
|
+
class BetaCitationConfig < Anthropic::Internal::Type::BaseModel
|
7
|
+
# @!attribute enabled
|
8
|
+
#
|
9
|
+
# @return [Boolean]
|
10
|
+
required :enabled, Anthropic::Internal::Type::Boolean
|
11
|
+
|
12
|
+
# @!method initialize(enabled:)
|
13
|
+
# @param enabled [Boolean]
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
BetaCitationConfig = Beta::BetaCitationConfig
|
18
|
+
end
|
19
|
+
end
|
@@ -21,6 +21,8 @@ module Anthropic
|
|
21
21
|
|
22
22
|
variant :web_search_tool_result, -> { Anthropic::Beta::BetaWebSearchToolResultBlock }
|
23
23
|
|
24
|
+
variant :web_fetch_tool_result, -> { Anthropic::Beta::BetaWebFetchToolResultBlock }
|
25
|
+
|
24
26
|
variant :code_execution_tool_result, -> { Anthropic::Beta::BetaCodeExecutionToolResultBlock }
|
25
27
|
|
26
28
|
variant :bash_code_execution_tool_result, -> { Anthropic::Beta::BetaBashCodeExecutionToolResultBlock }
|
@@ -36,7 +38,7 @@ module Anthropic
|
|
36
38
|
variant :container_upload, -> { Anthropic::Beta::BetaContainerUploadBlock }
|
37
39
|
|
38
40
|
# @!method self.variants
|
39
|
-
# @return [Array(Anthropic::Models::Beta::BetaTextBlock, Anthropic::Models::Beta::BetaThinkingBlock, Anthropic::Models::Beta::BetaRedactedThinkingBlock, Anthropic::Models::Beta::BetaToolUseBlock, Anthropic::Models::Beta::BetaServerToolUseBlock, Anthropic::Models::Beta::BetaWebSearchToolResultBlock, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaMCPToolUseBlock, Anthropic::Models::Beta::BetaMCPToolResultBlock, Anthropic::Models::Beta::BetaContainerUploadBlock)]
|
41
|
+
# @return [Array(Anthropic::Models::Beta::BetaTextBlock, Anthropic::Models::Beta::BetaThinkingBlock, Anthropic::Models::Beta::BetaRedactedThinkingBlock, Anthropic::Models::Beta::BetaToolUseBlock, Anthropic::Models::Beta::BetaServerToolUseBlock, Anthropic::Models::Beta::BetaWebSearchToolResultBlock, Anthropic::Models::Beta::BetaWebFetchToolResultBlock, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaMCPToolUseBlock, Anthropic::Models::Beta::BetaMCPToolResultBlock, Anthropic::Models::Beta::BetaContainerUploadBlock)]
|
40
42
|
end
|
41
43
|
end
|
42
44
|
|
@@ -37,6 +37,8 @@ module Anthropic
|
|
37
37
|
|
38
38
|
variant :web_search_tool_result, -> { Anthropic::Beta::BetaWebSearchToolResultBlockParam }
|
39
39
|
|
40
|
+
variant :web_fetch_tool_result, -> { Anthropic::Beta::BetaWebFetchToolResultBlockParam }
|
41
|
+
|
40
42
|
variant :code_execution_tool_result, -> { Anthropic::Beta::BetaCodeExecutionToolResultBlockParam }
|
41
43
|
|
42
44
|
variant :bash_code_execution_tool_result,
|
@@ -54,7 +56,7 @@ module Anthropic
|
|
54
56
|
variant :container_upload, -> { Anthropic::Beta::BetaContainerUploadBlockParam }
|
55
57
|
|
56
58
|
# @!method self.variants
|
57
|
-
# @return [Array(Anthropic::Models::Beta::BetaTextBlockParam, Anthropic::Models::Beta::BetaImageBlockParam, Anthropic::Models::Beta::BetaRequestDocumentBlock, Anthropic::Models::Beta::BetaSearchResultBlockParam, Anthropic::Models::Beta::BetaThinkingBlockParam, Anthropic::Models::Beta::BetaRedactedThinkingBlockParam, Anthropic::Models::Beta::BetaToolUseBlockParam, Anthropic::Models::Beta::BetaToolResultBlockParam, Anthropic::Models::Beta::BetaServerToolUseBlockParam, Anthropic::Models::Beta::BetaWebSearchToolResultBlockParam, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaMCPToolUseBlockParam, Anthropic::Models::Beta::BetaRequestMCPToolResultBlockParam, Anthropic::Models::Beta::BetaContainerUploadBlockParam)]
|
59
|
+
# @return [Array(Anthropic::Models::Beta::BetaTextBlockParam, Anthropic::Models::Beta::BetaImageBlockParam, Anthropic::Models::Beta::BetaRequestDocumentBlock, Anthropic::Models::Beta::BetaSearchResultBlockParam, Anthropic::Models::Beta::BetaThinkingBlockParam, Anthropic::Models::Beta::BetaRedactedThinkingBlockParam, Anthropic::Models::Beta::BetaToolUseBlockParam, Anthropic::Models::Beta::BetaToolResultBlockParam, Anthropic::Models::Beta::BetaServerToolUseBlockParam, Anthropic::Models::Beta::BetaWebSearchToolResultBlockParam, Anthropic::Models::Beta::BetaWebFetchToolResultBlockParam, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaMCPToolUseBlockParam, Anthropic::Models::Beta::BetaRequestMCPToolResultBlockParam, Anthropic::Models::Beta::BetaContainerUploadBlockParam)]
|
58
60
|
end
|
59
61
|
end
|
60
62
|
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Anthropic
|
4
|
+
module Models
|
5
|
+
module Beta
|
6
|
+
class BetaDocumentBlock < Anthropic::Internal::Type::BaseModel
|
7
|
+
# @!attribute citations
|
8
|
+
# Citation configuration for the document
|
9
|
+
#
|
10
|
+
# @return [Anthropic::Models::Beta::BetaCitationConfig, nil]
|
11
|
+
required :citations, -> { Anthropic::Beta::BetaCitationConfig }, nil?: true
|
12
|
+
|
13
|
+
# @!attribute source
|
14
|
+
#
|
15
|
+
# @return [Anthropic::Models::Beta::BetaBase64PDFSource, Anthropic::Models::Beta::BetaPlainTextSource]
|
16
|
+
required :source, union: -> { Anthropic::Beta::BetaDocumentBlock::Source }
|
17
|
+
|
18
|
+
# @!attribute title
|
19
|
+
# The title of the document
|
20
|
+
#
|
21
|
+
# @return [String, nil]
|
22
|
+
required :title, String, nil?: true
|
23
|
+
|
24
|
+
# @!attribute type
|
25
|
+
#
|
26
|
+
# @return [Symbol, :document]
|
27
|
+
required :type, const: :document
|
28
|
+
|
29
|
+
# @!method initialize(citations:, source:, title:, type: :document)
|
30
|
+
# @param citations [Anthropic::Models::Beta::BetaCitationConfig, nil] Citation configuration for the document
|
31
|
+
#
|
32
|
+
# @param source [Anthropic::Models::Beta::BetaBase64PDFSource, Anthropic::Models::Beta::BetaPlainTextSource]
|
33
|
+
#
|
34
|
+
# @param title [String, nil] The title of the document
|
35
|
+
#
|
36
|
+
# @param type [Symbol, :document]
|
37
|
+
|
38
|
+
# @see Anthropic::Models::Beta::BetaDocumentBlock#source
|
39
|
+
module Source
|
40
|
+
extend Anthropic::Internal::Type::Union
|
41
|
+
|
42
|
+
discriminator :type
|
43
|
+
|
44
|
+
variant :base64, -> { Anthropic::Beta::BetaBase64PDFSource }
|
45
|
+
|
46
|
+
variant :text, -> { Anthropic::Beta::BetaPlainTextSource }
|
47
|
+
|
48
|
+
# @!method self.variants
|
49
|
+
# @return [Array(Anthropic::Models::Beta::BetaBase64PDFSource, Anthropic::Models::Beta::BetaPlainTextSource)]
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
BetaDocumentBlock = Beta::BetaDocumentBlock
|
55
|
+
end
|
56
|
+
end
|
@@ -56,7 +56,7 @@ module Anthropic
|
|
56
56
|
# [{ "type": "text", "text": "B)" }]
|
57
57
|
# ```
|
58
58
|
#
|
59
|
-
# @return [Array<Anthropic::Models::Beta::BetaTextBlock, Anthropic::Models::Beta::BetaThinkingBlock, Anthropic::Models::Beta::BetaRedactedThinkingBlock, Anthropic::Models::Beta::BetaToolUseBlock, Anthropic::Models::Beta::BetaServerToolUseBlock, Anthropic::Models::Beta::BetaWebSearchToolResultBlock, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaMCPToolUseBlock, Anthropic::Models::Beta::BetaMCPToolResultBlock, Anthropic::Models::Beta::BetaContainerUploadBlock>]
|
59
|
+
# @return [Array<Anthropic::Models::Beta::BetaTextBlock, Anthropic::Models::Beta::BetaThinkingBlock, Anthropic::Models::Beta::BetaRedactedThinkingBlock, Anthropic::Models::Beta::BetaToolUseBlock, Anthropic::Models::Beta::BetaServerToolUseBlock, Anthropic::Models::Beta::BetaWebSearchToolResultBlock, Anthropic::Models::Beta::BetaWebFetchToolResultBlock, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaMCPToolUseBlock, Anthropic::Models::Beta::BetaMCPToolResultBlock, Anthropic::Models::Beta::BetaContainerUploadBlock>]
|
60
60
|
required :content, -> { Anthropic::Internal::Type::ArrayOf[union: Anthropic::Beta::BetaContentBlock] }
|
61
61
|
|
62
62
|
# @!attribute model
|
@@ -140,7 +140,7 @@ module Anthropic
|
|
140
140
|
#
|
141
141
|
# @param container [Anthropic::Models::Beta::BetaContainer, nil] Information about the container used in the request (for the code execution tool
|
142
142
|
#
|
143
|
-
# @param content [Array<Anthropic::Models::Beta::BetaTextBlock, Anthropic::Models::Beta::BetaThinkingBlock, Anthropic::Models::Beta::BetaRedactedThinkingBlock, Anthropic::Models::Beta::BetaToolUseBlock, Anthropic::Models::Beta::BetaServerToolUseBlock, Anthropic::Models::Beta::BetaWebSearchToolResultBlock, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaMCPToolUseBlock, Anthropic::Models::Beta::BetaMCPToolResultBlock, Anthropic::Models::Beta::BetaContainerUploadBlock>] Content generated by the model.
|
143
|
+
# @param content [Array<Anthropic::Models::Beta::BetaTextBlock, Anthropic::Models::Beta::BetaThinkingBlock, Anthropic::Models::Beta::BetaRedactedThinkingBlock, Anthropic::Models::Beta::BetaToolUseBlock, Anthropic::Models::Beta::BetaServerToolUseBlock, Anthropic::Models::Beta::BetaWebSearchToolResultBlock, Anthropic::Models::Beta::BetaWebFetchToolResultBlock, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaMCPToolUseBlock, Anthropic::Models::Beta::BetaMCPToolResultBlock, Anthropic::Models::Beta::BetaContainerUploadBlock>] Content generated by the model.
|
144
144
|
#
|
145
145
|
# @param model [Symbol, String, Anthropic::Models::Model] The model that will complete your prompt.\n\nSee [models](https://docs.anthropic
|
146
146
|
#
|
@@ -6,7 +6,7 @@ module Anthropic
|
|
6
6
|
class BetaMessageParam < Anthropic::Internal::Type::BaseModel
|
7
7
|
# @!attribute content
|
8
8
|
#
|
9
|
-
# @return [String, Array<Anthropic::Models::Beta::BetaTextBlockParam, Anthropic::Models::Beta::BetaImageBlockParam, Anthropic::Models::Beta::BetaRequestDocumentBlock, Anthropic::Models::Beta::BetaSearchResultBlockParam, Anthropic::Models::Beta::BetaThinkingBlockParam, Anthropic::Models::Beta::BetaRedactedThinkingBlockParam, Anthropic::Models::Beta::BetaToolUseBlockParam, Anthropic::Models::Beta::BetaToolResultBlockParam, Anthropic::Models::Beta::BetaServerToolUseBlockParam, Anthropic::Models::Beta::BetaWebSearchToolResultBlockParam, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaMCPToolUseBlockParam, Anthropic::Models::Beta::BetaRequestMCPToolResultBlockParam, Anthropic::Models::Beta::BetaContainerUploadBlockParam>]
|
9
|
+
# @return [String, Array<Anthropic::Models::Beta::BetaTextBlockParam, Anthropic::Models::Beta::BetaImageBlockParam, Anthropic::Models::Beta::BetaRequestDocumentBlock, Anthropic::Models::Beta::BetaSearchResultBlockParam, Anthropic::Models::Beta::BetaThinkingBlockParam, Anthropic::Models::Beta::BetaRedactedThinkingBlockParam, Anthropic::Models::Beta::BetaToolUseBlockParam, Anthropic::Models::Beta::BetaToolResultBlockParam, Anthropic::Models::Beta::BetaServerToolUseBlockParam, Anthropic::Models::Beta::BetaWebSearchToolResultBlockParam, Anthropic::Models::Beta::BetaWebFetchToolResultBlockParam, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaMCPToolUseBlockParam, Anthropic::Models::Beta::BetaRequestMCPToolResultBlockParam, Anthropic::Models::Beta::BetaContainerUploadBlockParam>]
|
10
10
|
required :content, union: -> { Anthropic::Beta::BetaMessageParam::Content }
|
11
11
|
|
12
12
|
# @!attribute role
|
@@ -15,7 +15,7 @@ module Anthropic
|
|
15
15
|
required :role, enum: -> { Anthropic::Beta::BetaMessageParam::Role }
|
16
16
|
|
17
17
|
# @!method initialize(content:, role:)
|
18
|
-
# @param content [String, Array<Anthropic::Models::Beta::BetaTextBlockParam, Anthropic::Models::Beta::BetaImageBlockParam, Anthropic::Models::Beta::BetaRequestDocumentBlock, Anthropic::Models::Beta::BetaSearchResultBlockParam, Anthropic::Models::Beta::BetaThinkingBlockParam, Anthropic::Models::Beta::BetaRedactedThinkingBlockParam, Anthropic::Models::Beta::BetaToolUseBlockParam, Anthropic::Models::Beta::BetaToolResultBlockParam, Anthropic::Models::Beta::BetaServerToolUseBlockParam, Anthropic::Models::Beta::BetaWebSearchToolResultBlockParam, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaMCPToolUseBlockParam, Anthropic::Models::Beta::BetaRequestMCPToolResultBlockParam, Anthropic::Models::Beta::BetaContainerUploadBlockParam>]
|
18
|
+
# @param content [String, Array<Anthropic::Models::Beta::BetaTextBlockParam, Anthropic::Models::Beta::BetaImageBlockParam, Anthropic::Models::Beta::BetaRequestDocumentBlock, Anthropic::Models::Beta::BetaSearchResultBlockParam, Anthropic::Models::Beta::BetaThinkingBlockParam, Anthropic::Models::Beta::BetaRedactedThinkingBlockParam, Anthropic::Models::Beta::BetaToolUseBlockParam, Anthropic::Models::Beta::BetaToolResultBlockParam, Anthropic::Models::Beta::BetaServerToolUseBlockParam, Anthropic::Models::Beta::BetaWebSearchToolResultBlockParam, Anthropic::Models::Beta::BetaWebFetchToolResultBlockParam, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaMCPToolUseBlockParam, Anthropic::Models::Beta::BetaRequestMCPToolResultBlockParam, Anthropic::Models::Beta::BetaContainerUploadBlockParam>]
|
19
19
|
# @param role [Symbol, Anthropic::Models::Beta::BetaMessageParam::Role]
|
20
20
|
|
21
21
|
# @see Anthropic::Models::Beta::BetaMessageParam#content
|
@@ -27,7 +27,7 @@ module Anthropic
|
|
27
27
|
variant -> { Anthropic::Models::Beta::BetaMessageParam::Content::BetaContentBlockParamArray }
|
28
28
|
|
29
29
|
# @!method self.variants
|
30
|
-
# @return [Array(String, Array<Anthropic::Models::Beta::BetaTextBlockParam, Anthropic::Models::Beta::BetaImageBlockParam, Anthropic::Models::Beta::BetaRequestDocumentBlock, Anthropic::Models::Beta::BetaSearchResultBlockParam, Anthropic::Models::Beta::BetaThinkingBlockParam, Anthropic::Models::Beta::BetaRedactedThinkingBlockParam, Anthropic::Models::Beta::BetaToolUseBlockParam, Anthropic::Models::Beta::BetaToolResultBlockParam, Anthropic::Models::Beta::BetaServerToolUseBlockParam, Anthropic::Models::Beta::BetaWebSearchToolResultBlockParam, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaMCPToolUseBlockParam, Anthropic::Models::Beta::BetaRequestMCPToolResultBlockParam, Anthropic::Models::Beta::BetaContainerUploadBlockParam>)]
|
30
|
+
# @return [Array(String, Array<Anthropic::Models::Beta::BetaTextBlockParam, Anthropic::Models::Beta::BetaImageBlockParam, Anthropic::Models::Beta::BetaRequestDocumentBlock, Anthropic::Models::Beta::BetaSearchResultBlockParam, Anthropic::Models::Beta::BetaThinkingBlockParam, Anthropic::Models::Beta::BetaRedactedThinkingBlockParam, Anthropic::Models::Beta::BetaToolUseBlockParam, Anthropic::Models::Beta::BetaToolResultBlockParam, Anthropic::Models::Beta::BetaServerToolUseBlockParam, Anthropic::Models::Beta::BetaWebSearchToolResultBlockParam, Anthropic::Models::Beta::BetaWebFetchToolResultBlockParam, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaMCPToolUseBlockParam, Anthropic::Models::Beta::BetaRequestMCPToolResultBlockParam, Anthropic::Models::Beta::BetaContainerUploadBlockParam>)]
|
31
31
|
|
32
32
|
# @type [Anthropic::Internal::Type::Converter]
|
33
33
|
BetaContentBlockParamArray =
|
@@ -7,7 +7,7 @@ module Anthropic
|
|
7
7
|
# @!attribute content_block
|
8
8
|
# Response model for a file uploaded to the container.
|
9
9
|
#
|
10
|
-
# @return [Anthropic::Models::Beta::BetaTextBlock, Anthropic::Models::Beta::BetaThinkingBlock, Anthropic::Models::Beta::BetaRedactedThinkingBlock, Anthropic::Models::Beta::BetaToolUseBlock, Anthropic::Models::Beta::BetaServerToolUseBlock, Anthropic::Models::Beta::BetaWebSearchToolResultBlock, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaMCPToolUseBlock, Anthropic::Models::Beta::BetaMCPToolResultBlock, Anthropic::Models::Beta::BetaContainerUploadBlock]
|
10
|
+
# @return [Anthropic::Models::Beta::BetaTextBlock, Anthropic::Models::Beta::BetaThinkingBlock, Anthropic::Models::Beta::BetaRedactedThinkingBlock, Anthropic::Models::Beta::BetaToolUseBlock, Anthropic::Models::Beta::BetaServerToolUseBlock, Anthropic::Models::Beta::BetaWebSearchToolResultBlock, Anthropic::Models::Beta::BetaWebFetchToolResultBlock, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaMCPToolUseBlock, Anthropic::Models::Beta::BetaMCPToolResultBlock, Anthropic::Models::Beta::BetaContainerUploadBlock]
|
11
11
|
required :content_block, union: -> { Anthropic::Beta::BetaRawContentBlockStartEvent::ContentBlock }
|
12
12
|
|
13
13
|
# @!attribute index
|
@@ -21,7 +21,7 @@ module Anthropic
|
|
21
21
|
required :type, const: :content_block_start
|
22
22
|
|
23
23
|
# @!method initialize(content_block:, index:, type: :content_block_start)
|
24
|
-
# @param content_block [Anthropic::Models::Beta::BetaTextBlock, Anthropic::Models::Beta::BetaThinkingBlock, Anthropic::Models::Beta::BetaRedactedThinkingBlock, Anthropic::Models::Beta::BetaToolUseBlock, Anthropic::Models::Beta::BetaServerToolUseBlock, Anthropic::Models::Beta::BetaWebSearchToolResultBlock, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaMCPToolUseBlock, Anthropic::Models::Beta::BetaMCPToolResultBlock, Anthropic::Models::Beta::BetaContainerUploadBlock] Response model for a file uploaded to the container.
|
24
|
+
# @param content_block [Anthropic::Models::Beta::BetaTextBlock, Anthropic::Models::Beta::BetaThinkingBlock, Anthropic::Models::Beta::BetaRedactedThinkingBlock, Anthropic::Models::Beta::BetaToolUseBlock, Anthropic::Models::Beta::BetaServerToolUseBlock, Anthropic::Models::Beta::BetaWebSearchToolResultBlock, Anthropic::Models::Beta::BetaWebFetchToolResultBlock, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaMCPToolUseBlock, Anthropic::Models::Beta::BetaMCPToolResultBlock, Anthropic::Models::Beta::BetaContainerUploadBlock] Response model for a file uploaded to the container.
|
25
25
|
#
|
26
26
|
# @param index [Integer]
|
27
27
|
#
|
@@ -47,6 +47,8 @@ module Anthropic
|
|
47
47
|
|
48
48
|
variant :web_search_tool_result, -> { Anthropic::Beta::BetaWebSearchToolResultBlock }
|
49
49
|
|
50
|
+
variant :web_fetch_tool_result, -> { Anthropic::Beta::BetaWebFetchToolResultBlock }
|
51
|
+
|
50
52
|
variant :code_execution_tool_result, -> { Anthropic::Beta::BetaCodeExecutionToolResultBlock }
|
51
53
|
|
52
54
|
variant :bash_code_execution_tool_result, -> { Anthropic::Beta::BetaBashCodeExecutionToolResultBlock }
|
@@ -62,7 +64,7 @@ module Anthropic
|
|
62
64
|
variant :container_upload, -> { Anthropic::Beta::BetaContainerUploadBlock }
|
63
65
|
|
64
66
|
# @!method self.variants
|
65
|
-
# @return [Array(Anthropic::Models::Beta::BetaTextBlock, Anthropic::Models::Beta::BetaThinkingBlock, Anthropic::Models::Beta::BetaRedactedThinkingBlock, Anthropic::Models::Beta::BetaToolUseBlock, Anthropic::Models::Beta::BetaServerToolUseBlock, Anthropic::Models::Beta::BetaWebSearchToolResultBlock, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaMCPToolUseBlock, Anthropic::Models::Beta::BetaMCPToolResultBlock, Anthropic::Models::Beta::BetaContainerUploadBlock)]
|
67
|
+
# @return [Array(Anthropic::Models::Beta::BetaTextBlock, Anthropic::Models::Beta::BetaThinkingBlock, Anthropic::Models::Beta::BetaRedactedThinkingBlock, Anthropic::Models::Beta::BetaToolUseBlock, Anthropic::Models::Beta::BetaServerToolUseBlock, Anthropic::Models::Beta::BetaWebSearchToolResultBlock, Anthropic::Models::Beta::BetaWebFetchToolResultBlock, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaMCPToolUseBlock, Anthropic::Models::Beta::BetaMCPToolResultBlock, Anthropic::Models::Beta::BetaContainerUploadBlock)]
|
66
68
|
end
|
67
69
|
end
|
68
70
|
end
|
@@ -23,7 +23,7 @@ module Anthropic
|
|
23
23
|
# @!attribute citations
|
24
24
|
#
|
25
25
|
# @return [Anthropic::Models::Beta::BetaCitationsConfigParam, nil]
|
26
|
-
optional :citations, -> { Anthropic::Beta::BetaCitationsConfigParam }
|
26
|
+
optional :citations, -> { Anthropic::Beta::BetaCitationsConfigParam }, nil?: true
|
27
27
|
|
28
28
|
# @!attribute context
|
29
29
|
#
|
@@ -40,7 +40,7 @@ module Anthropic
|
|
40
40
|
#
|
41
41
|
# @param cache_control [Anthropic::Models::Beta::BetaCacheControlEphemeral, nil] Create a cache control breakpoint at this content block.
|
42
42
|
#
|
43
|
-
# @param citations [Anthropic::Models::Beta::BetaCitationsConfigParam]
|
43
|
+
# @param citations [Anthropic::Models::Beta::BetaCitationsConfigParam, nil]
|
44
44
|
#
|
45
45
|
# @param context [String, nil]
|
46
46
|
#
|
@@ -4,13 +4,21 @@ module Anthropic
|
|
4
4
|
module Models
|
5
5
|
module Beta
|
6
6
|
class BetaServerToolUsage < Anthropic::Internal::Type::BaseModel
|
7
|
+
# @!attribute web_fetch_requests
|
8
|
+
# The number of web fetch tool requests.
|
9
|
+
#
|
10
|
+
# @return [Integer]
|
11
|
+
required :web_fetch_requests, Integer
|
12
|
+
|
7
13
|
# @!attribute web_search_requests
|
8
14
|
# The number of web search tool requests.
|
9
15
|
#
|
10
16
|
# @return [Integer]
|
11
17
|
required :web_search_requests, Integer
|
12
18
|
|
13
|
-
# @!method initialize(web_search_requests:)
|
19
|
+
# @!method initialize(web_fetch_requests:, web_search_requests:)
|
20
|
+
# @param web_fetch_requests [Integer] The number of web fetch tool requests.
|
21
|
+
#
|
14
22
|
# @param web_search_requests [Integer] The number of web search tool requests.
|
15
23
|
end
|
16
24
|
end
|
@@ -22,7 +22,7 @@ module Anthropic
|
|
22
22
|
|
23
23
|
# @!attribute content
|
24
24
|
#
|
25
|
-
# @return [String, Array<Anthropic::Models::Beta::BetaTextBlockParam, Anthropic::Models::Beta::BetaImageBlockParam, Anthropic::Models::Beta::BetaSearchResultBlockParam>, nil]
|
25
|
+
# @return [String, Array<Anthropic::Models::Beta::BetaTextBlockParam, Anthropic::Models::Beta::BetaImageBlockParam, Anthropic::Models::Beta::BetaSearchResultBlockParam, Anthropic::Models::Beta::BetaRequestDocumentBlock>, nil]
|
26
26
|
optional :content, union: -> { Anthropic::Beta::BetaToolResultBlockParam::Content }
|
27
27
|
|
28
28
|
# @!attribute is_error
|
@@ -35,7 +35,7 @@ module Anthropic
|
|
35
35
|
#
|
36
36
|
# @param cache_control [Anthropic::Models::Beta::BetaCacheControlEphemeral, nil] Create a cache control breakpoint at this content block.
|
37
37
|
#
|
38
|
-
# @param content [String, Array<Anthropic::Models::Beta::BetaTextBlockParam, Anthropic::Models::Beta::BetaImageBlockParam, Anthropic::Models::Beta::BetaSearchResultBlockParam>]
|
38
|
+
# @param content [String, Array<Anthropic::Models::Beta::BetaTextBlockParam, Anthropic::Models::Beta::BetaImageBlockParam, Anthropic::Models::Beta::BetaSearchResultBlockParam, Anthropic::Models::Beta::BetaRequestDocumentBlock>]
|
39
39
|
#
|
40
40
|
# @param is_error [Boolean]
|
41
41
|
#
|
@@ -60,12 +60,14 @@ module Anthropic
|
|
60
60
|
|
61
61
|
variant :search_result, -> { Anthropic::Beta::BetaSearchResultBlockParam }
|
62
62
|
|
63
|
+
variant :document, -> { Anthropic::Beta::BetaRequestDocumentBlock }
|
64
|
+
|
63
65
|
# @!method self.variants
|
64
|
-
# @return [Array(Anthropic::Models::Beta::BetaTextBlockParam, Anthropic::Models::Beta::BetaImageBlockParam, Anthropic::Models::Beta::BetaSearchResultBlockParam)]
|
66
|
+
# @return [Array(Anthropic::Models::Beta::BetaTextBlockParam, Anthropic::Models::Beta::BetaImageBlockParam, Anthropic::Models::Beta::BetaSearchResultBlockParam, Anthropic::Models::Beta::BetaRequestDocumentBlock)]
|
65
67
|
end
|
66
68
|
|
67
69
|
# @!method self.variants
|
68
|
-
# @return [Array(String, Array<Anthropic::Models::Beta::BetaTextBlockParam, Anthropic::Models::Beta::BetaImageBlockParam, Anthropic::Models::Beta::BetaSearchResultBlockParam>)]
|
70
|
+
# @return [Array(String, Array<Anthropic::Models::Beta::BetaTextBlockParam, Anthropic::Models::Beta::BetaImageBlockParam, Anthropic::Models::Beta::BetaSearchResultBlockParam, Anthropic::Models::Beta::BetaRequestDocumentBlock>)]
|
69
71
|
|
70
72
|
# @type [Anthropic::Internal::Type::Converter]
|
71
73
|
ContentArray =
|
@@ -30,8 +30,10 @@ module Anthropic
|
|
30
30
|
|
31
31
|
variant -> { Anthropic::Beta::BetaWebSearchTool20250305 }
|
32
32
|
|
33
|
+
variant -> { Anthropic::Beta::BetaWebFetchTool20250910 }
|
34
|
+
|
33
35
|
# @!method self.variants
|
34
|
-
# @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)]
|
36
|
+
# @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)]
|
35
37
|
end
|
36
38
|
end
|
37
39
|
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Anthropic
|
4
|
+
module Models
|
5
|
+
module Beta
|
6
|
+
class BetaWebFetchBlock < Anthropic::Internal::Type::BaseModel
|
7
|
+
# @!attribute content
|
8
|
+
#
|
9
|
+
# @return [Anthropic::Models::Beta::BetaDocumentBlock]
|
10
|
+
required :content, -> { Anthropic::Beta::BetaDocumentBlock }
|
11
|
+
|
12
|
+
# @!attribute retrieved_at
|
13
|
+
# ISO 8601 timestamp when the content was retrieved
|
14
|
+
#
|
15
|
+
# @return [String, nil]
|
16
|
+
required :retrieved_at, String, nil?: true
|
17
|
+
|
18
|
+
# @!attribute type
|
19
|
+
#
|
20
|
+
# @return [Symbol, :web_fetch_result]
|
21
|
+
required :type, const: :web_fetch_result
|
22
|
+
|
23
|
+
# @!attribute url
|
24
|
+
# Fetched content URL
|
25
|
+
#
|
26
|
+
# @return [String]
|
27
|
+
required :url, String
|
28
|
+
|
29
|
+
# @!method initialize(content:, retrieved_at:, url:, type: :web_fetch_result)
|
30
|
+
# @param content [Anthropic::Models::Beta::BetaDocumentBlock]
|
31
|
+
#
|
32
|
+
# @param retrieved_at [String, nil] ISO 8601 timestamp when the content was retrieved
|
33
|
+
#
|
34
|
+
# @param url [String] Fetched content URL
|
35
|
+
#
|
36
|
+
# @param type [Symbol, :web_fetch_result]
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
BetaWebFetchBlock = Beta::BetaWebFetchBlock
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Anthropic
|
4
|
+
module Models
|
5
|
+
module Beta
|
6
|
+
class BetaWebFetchBlockParam < Anthropic::Internal::Type::BaseModel
|
7
|
+
# @!attribute content
|
8
|
+
#
|
9
|
+
# @return [Anthropic::Models::Beta::BetaRequestDocumentBlock]
|
10
|
+
required :content, -> { Anthropic::Beta::BetaRequestDocumentBlock }
|
11
|
+
|
12
|
+
# @!attribute type
|
13
|
+
#
|
14
|
+
# @return [Symbol, :web_fetch_result]
|
15
|
+
required :type, const: :web_fetch_result
|
16
|
+
|
17
|
+
# @!attribute url
|
18
|
+
# Fetched content URL
|
19
|
+
#
|
20
|
+
# @return [String]
|
21
|
+
required :url, String
|
22
|
+
|
23
|
+
# @!attribute retrieved_at
|
24
|
+
# ISO 8601 timestamp when the content was retrieved
|
25
|
+
#
|
26
|
+
# @return [String, nil]
|
27
|
+
optional :retrieved_at, String, nil?: true
|
28
|
+
|
29
|
+
# @!method initialize(content:, url:, retrieved_at: nil, type: :web_fetch_result)
|
30
|
+
# @param content [Anthropic::Models::Beta::BetaRequestDocumentBlock]
|
31
|
+
#
|
32
|
+
# @param url [String] Fetched content URL
|
33
|
+
#
|
34
|
+
# @param retrieved_at [String, nil] ISO 8601 timestamp when the content was retrieved
|
35
|
+
#
|
36
|
+
# @param type [Symbol, :web_fetch_result]
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
BetaWebFetchBlockParam = Beta::BetaWebFetchBlockParam
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,82 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Anthropic
|
4
|
+
module Models
|
5
|
+
module Beta
|
6
|
+
class BetaWebFetchTool20250910 < Anthropic::Internal::Type::BaseModel
|
7
|
+
# @!attribute name
|
8
|
+
# Name of the tool.
|
9
|
+
#
|
10
|
+
# This is how the tool will be called by the model and in `tool_use` blocks.
|
11
|
+
#
|
12
|
+
# @return [Symbol, :web_fetch]
|
13
|
+
required :name, const: :web_fetch
|
14
|
+
|
15
|
+
# @!attribute type
|
16
|
+
#
|
17
|
+
# @return [Symbol, :web_fetch_20250910]
|
18
|
+
required :type, const: :web_fetch_20250910
|
19
|
+
|
20
|
+
# @!attribute allowed_domains
|
21
|
+
# List of domains to allow fetching from
|
22
|
+
#
|
23
|
+
# @return [Array<String>, nil]
|
24
|
+
optional :allowed_domains, Anthropic::Internal::Type::ArrayOf[String], nil?: true
|
25
|
+
|
26
|
+
# @!attribute blocked_domains
|
27
|
+
# List of domains to block fetching from
|
28
|
+
#
|
29
|
+
# @return [Array<String>, nil]
|
30
|
+
optional :blocked_domains, Anthropic::Internal::Type::ArrayOf[String], nil?: true
|
31
|
+
|
32
|
+
# @!attribute cache_control
|
33
|
+
# Create a cache control breakpoint at this content block.
|
34
|
+
#
|
35
|
+
# @return [Anthropic::Models::Beta::BetaCacheControlEphemeral, nil]
|
36
|
+
optional :cache_control, -> { Anthropic::Beta::BetaCacheControlEphemeral }, nil?: true
|
37
|
+
|
38
|
+
# @!attribute citations
|
39
|
+
# Citations configuration for fetched documents. Citations are disabled by
|
40
|
+
# default.
|
41
|
+
#
|
42
|
+
# @return [Anthropic::Models::Beta::BetaCitationsConfigParam, nil]
|
43
|
+
optional :citations, -> { Anthropic::Beta::BetaCitationsConfigParam }, nil?: true
|
44
|
+
|
45
|
+
# @!attribute max_content_tokens
|
46
|
+
# Maximum number of tokens used by including web page text content in the context.
|
47
|
+
# The limit is approximate and does not apply to binary content such as PDFs.
|
48
|
+
#
|
49
|
+
# @return [Integer, nil]
|
50
|
+
optional :max_content_tokens, Integer, nil?: true
|
51
|
+
|
52
|
+
# @!attribute max_uses
|
53
|
+
# Maximum number of times the tool can be used in the API request.
|
54
|
+
#
|
55
|
+
# @return [Integer, nil]
|
56
|
+
optional :max_uses, Integer, nil?: true
|
57
|
+
|
58
|
+
# @!method initialize(allowed_domains: nil, blocked_domains: nil, cache_control: nil, citations: nil, max_content_tokens: nil, max_uses: nil, name: :web_fetch, type: :web_fetch_20250910)
|
59
|
+
# Some parameter documentations has been truncated, see
|
60
|
+
# {Anthropic::Models::Beta::BetaWebFetchTool20250910} for more details.
|
61
|
+
#
|
62
|
+
# @param allowed_domains [Array<String>, nil] List of domains to allow fetching from
|
63
|
+
#
|
64
|
+
# @param blocked_domains [Array<String>, nil] List of domains to block fetching from
|
65
|
+
#
|
66
|
+
# @param cache_control [Anthropic::Models::Beta::BetaCacheControlEphemeral, nil] Create a cache control breakpoint at this content block.
|
67
|
+
#
|
68
|
+
# @param citations [Anthropic::Models::Beta::BetaCitationsConfigParam, nil] Citations configuration for fetched documents. Citations are disabled by default
|
69
|
+
#
|
70
|
+
# @param max_content_tokens [Integer, nil] Maximum number of tokens used by including web page text content in the context.
|
71
|
+
#
|
72
|
+
# @param max_uses [Integer, nil] Maximum number of times the tool can be used in the API request.
|
73
|
+
#
|
74
|
+
# @param name [Symbol, :web_fetch] Name of the tool.
|
75
|
+
#
|
76
|
+
# @param type [Symbol, :web_fetch_20250910]
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
BetaWebFetchTool20250910 = Beta::BetaWebFetchTool20250910
|
81
|
+
end
|
82
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Anthropic
|
4
|
+
module Models
|
5
|
+
module Beta
|
6
|
+
class BetaWebFetchToolResultBlock < Anthropic::Internal::Type::BaseModel
|
7
|
+
# @!attribute content
|
8
|
+
#
|
9
|
+
# @return [Anthropic::Models::Beta::BetaWebFetchToolResultErrorBlock, Anthropic::Models::Beta::BetaWebFetchBlock]
|
10
|
+
required :content, union: -> { Anthropic::Beta::BetaWebFetchToolResultBlock::Content }
|
11
|
+
|
12
|
+
# @!attribute tool_use_id
|
13
|
+
#
|
14
|
+
# @return [String]
|
15
|
+
required :tool_use_id, String
|
16
|
+
|
17
|
+
# @!attribute type
|
18
|
+
#
|
19
|
+
# @return [Symbol, :web_fetch_tool_result]
|
20
|
+
required :type, const: :web_fetch_tool_result
|
21
|
+
|
22
|
+
# @!method initialize(content:, tool_use_id:, type: :web_fetch_tool_result)
|
23
|
+
# @param content [Anthropic::Models::Beta::BetaWebFetchToolResultErrorBlock, Anthropic::Models::Beta::BetaWebFetchBlock]
|
24
|
+
# @param tool_use_id [String]
|
25
|
+
# @param type [Symbol, :web_fetch_tool_result]
|
26
|
+
|
27
|
+
# @see Anthropic::Models::Beta::BetaWebFetchToolResultBlock#content
|
28
|
+
module Content
|
29
|
+
extend Anthropic::Internal::Type::Union
|
30
|
+
|
31
|
+
variant -> { Anthropic::Beta::BetaWebFetchToolResultErrorBlock }
|
32
|
+
|
33
|
+
variant -> { Anthropic::Beta::BetaWebFetchBlock }
|
34
|
+
|
35
|
+
# @!method self.variants
|
36
|
+
# @return [Array(Anthropic::Models::Beta::BetaWebFetchToolResultErrorBlock, Anthropic::Models::Beta::BetaWebFetchBlock)]
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
BetaWebFetchToolResultBlock = Beta::BetaWebFetchToolResultBlock
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Anthropic
|
4
|
+
module Models
|
5
|
+
module Beta
|
6
|
+
class BetaWebFetchToolResultBlockParam < Anthropic::Internal::Type::BaseModel
|
7
|
+
# @!attribute content
|
8
|
+
#
|
9
|
+
# @return [Anthropic::Models::Beta::BetaWebFetchToolResultErrorBlockParam, Anthropic::Models::Beta::BetaWebFetchBlockParam]
|
10
|
+
required :content, union: -> { Anthropic::Beta::BetaWebFetchToolResultBlockParam::Content }
|
11
|
+
|
12
|
+
# @!attribute tool_use_id
|
13
|
+
#
|
14
|
+
# @return [String]
|
15
|
+
required :tool_use_id, String
|
16
|
+
|
17
|
+
# @!attribute type
|
18
|
+
#
|
19
|
+
# @return [Symbol, :web_fetch_tool_result]
|
20
|
+
required :type, const: :web_fetch_tool_result
|
21
|
+
|
22
|
+
# @!attribute cache_control
|
23
|
+
# Create a cache control breakpoint at this content block.
|
24
|
+
#
|
25
|
+
# @return [Anthropic::Models::Beta::BetaCacheControlEphemeral, nil]
|
26
|
+
optional :cache_control, -> { Anthropic::Beta::BetaCacheControlEphemeral }, nil?: true
|
27
|
+
|
28
|
+
# @!method initialize(content:, tool_use_id:, cache_control: nil, type: :web_fetch_tool_result)
|
29
|
+
# @param content [Anthropic::Models::Beta::BetaWebFetchToolResultErrorBlockParam, Anthropic::Models::Beta::BetaWebFetchBlockParam]
|
30
|
+
#
|
31
|
+
# @param tool_use_id [String]
|
32
|
+
#
|
33
|
+
# @param cache_control [Anthropic::Models::Beta::BetaCacheControlEphemeral, nil] Create a cache control breakpoint at this content block.
|
34
|
+
#
|
35
|
+
# @param type [Symbol, :web_fetch_tool_result]
|
36
|
+
|
37
|
+
# @see Anthropic::Models::Beta::BetaWebFetchToolResultBlockParam#content
|
38
|
+
module Content
|
39
|
+
extend Anthropic::Internal::Type::Union
|
40
|
+
|
41
|
+
variant -> { Anthropic::Beta::BetaWebFetchToolResultErrorBlockParam }
|
42
|
+
|
43
|
+
variant -> { Anthropic::Beta::BetaWebFetchBlockParam }
|
44
|
+
|
45
|
+
# @!method self.variants
|
46
|
+
# @return [Array(Anthropic::Models::Beta::BetaWebFetchToolResultErrorBlockParam, Anthropic::Models::Beta::BetaWebFetchBlockParam)]
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
BetaWebFetchToolResultBlockParam = Beta::BetaWebFetchToolResultBlockParam
|
52
|
+
end
|
53
|
+
end
|