anthropic 1.7.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 +34 -0
- data/README.md +1 -1
- data/lib/anthropic/helpers/input_schema/array_of.rb +41 -0
- data/lib/anthropic/helpers/input_schema/base_model.rb +86 -0
- data/lib/anthropic/helpers/input_schema/boolean.rb +29 -0
- data/lib/anthropic/helpers/input_schema/enum_of.rb +63 -0
- data/lib/anthropic/helpers/input_schema/json_schema_converter.rb +199 -0
- data/lib/anthropic/helpers/input_schema/parsed_json.rb +39 -0
- data/lib/anthropic/helpers/input_schema/property_mapping.rb +47 -0
- data/lib/anthropic/helpers/input_schema/union_of.rb +56 -0
- data/lib/anthropic/helpers/input_schema.rb +16 -0
- data/lib/anthropic/helpers/streaming/message_stream.rb +41 -1
- data/lib/anthropic/input_schema.rb +10 -0
- data/lib/anthropic/internal/stream.rb +2 -1
- data/lib/anthropic/internal/transport/base_client.rb +1 -2
- data/lib/anthropic/internal/transport/pooled_net_requester.rb +1 -9
- data/lib/anthropic/internal/type/base_model.rb +2 -9
- data/lib/anthropic/internal/util.rb +2 -2
- data/lib/anthropic/models/beta/beta_bash_code_execution_output_block.rb +25 -0
- data/lib/anthropic/models/beta/beta_bash_code_execution_output_block_param.rb +25 -0
- data/lib/anthropic/models/beta/beta_bash_code_execution_result_block.rb +44 -0
- data/lib/anthropic/models/beta/beta_bash_code_execution_result_block_param.rb +44 -0
- data/lib/anthropic/models/beta/beta_bash_code_execution_tool_result_block.rb +43 -0
- data/lib/anthropic/models/beta/beta_bash_code_execution_tool_result_block_param.rb +53 -0
- data/lib/anthropic/models/beta/beta_bash_code_execution_tool_result_error.rb +39 -0
- data/lib/anthropic/models/beta/beta_bash_code_execution_tool_result_error_param.rb +39 -0
- data/lib/anthropic/models/beta/beta_citation_config.rb +19 -0
- data/lib/anthropic/models/beta/beta_code_execution_tool_20250825.rb +40 -0
- data/lib/anthropic/models/beta/beta_content_block.rb +8 -1
- data/lib/anthropic/models/beta/beta_content_block_param.rb +9 -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 +10 -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 +3 -0
- data/lib/anthropic/models/beta/beta_server_tool_use_block_param.rb +3 -0
- data/lib/anthropic/models/beta/beta_text_editor_code_execution_create_result_block.rb +25 -0
- data/lib/anthropic/models/beta/beta_text_editor_code_execution_create_result_block_param.rb +26 -0
- data/lib/anthropic/models/beta/beta_text_editor_code_execution_str_replace_result_block.rb +49 -0
- data/lib/anthropic/models/beta/beta_text_editor_code_execution_str_replace_result_block_param.rb +50 -0
- data/lib/anthropic/models/beta/beta_text_editor_code_execution_tool_result_block.rb +47 -0
- data/lib/anthropic/models/beta/beta_text_editor_code_execution_tool_result_block_param.rb +57 -0
- data/lib/anthropic/models/beta/beta_text_editor_code_execution_tool_result_error.rb +45 -0
- data/lib/anthropic/models/beta/beta_text_editor_code_execution_tool_result_error_param.rb +46 -0
- data/lib/anthropic/models/beta/beta_text_editor_code_execution_view_result_block.rb +61 -0
- data/lib/anthropic/models/beta/beta_text_editor_code_execution_view_result_block_param.rb +62 -0
- data/lib/anthropic/models/beta/beta_tool_result_block_param.rb +6 -4
- data/lib/anthropic/models/beta/beta_tool_union.rb +5 -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 +9 -30
- data/lib/anthropic/models/beta/message_create_params.rb +3 -26
- data/lib/anthropic/models/beta/messages/batch_create_params.rb +6 -36
- data/lib/anthropic/models/beta/messages/beta_message_batch.rb +1 -4
- data/lib/anthropic/models/beta_error_response.rb +7 -1
- data/lib/anthropic/models/document_block_param.rb +2 -2
- data/lib/anthropic/models/error_response.rb +7 -1
- data/lib/anthropic/models/message_count_tokens_params.rb +1 -24
- data/lib/anthropic/models/message_create_params.rb +1 -24
- data/lib/anthropic/models/messages/batch_create_params.rb +2 -28
- data/lib/anthropic/models/tool_result_block_param.rb +6 -4
- data/lib/anthropic/models/tool_use_block.rb +8 -0
- data/lib/anthropic/resources/beta/messages.rb +3 -3
- data/lib/anthropic/resources/messages.rb +85 -1
- data/lib/anthropic/version.rb +1 -1
- data/lib/anthropic.rb +39 -0
- data/rbi/anthropic/errors.rbi +2 -2
- data/rbi/anthropic/helpers/input_schema/array_of.rbi +16 -0
- data/rbi/anthropic/helpers/input_schema/base_model.rbi +21 -0
- data/rbi/anthropic/helpers/input_schema/boolean.rbi +11 -0
- data/rbi/anthropic/helpers/input_schema/enum_of.rbi +30 -0
- data/rbi/anthropic/helpers/input_schema/json_schema_converter.rbi +89 -0
- data/rbi/anthropic/helpers/input_schema/union_of.rbi +23 -0
- data/rbi/anthropic/helpers/structured_output.rbi +16 -0
- data/rbi/anthropic/input_schema.rbi +12 -0
- data/rbi/anthropic/models/beta/beta_bash_code_execution_output_block.rbi +33 -0
- data/rbi/anthropic/models/beta/beta_bash_code_execution_output_block_param.rbi +34 -0
- data/rbi/anthropic/models/beta/beta_bash_code_execution_result_block.rbi +72 -0
- data/rbi/anthropic/models/beta/beta_bash_code_execution_result_block_param.rbi +77 -0
- data/rbi/anthropic/models/beta/beta_bash_code_execution_tool_result_block.rbi +86 -0
- data/rbi/anthropic/models/beta/beta_bash_code_execution_tool_result_block_param.rbi +110 -0
- data/rbi/anthropic/models/beta/beta_bash_code_execution_tool_result_error.rbi +101 -0
- data/rbi/anthropic/models/beta/beta_bash_code_execution_tool_result_error_param.rbi +101 -0
- data/rbi/anthropic/models/beta/beta_citation_config.rbi +30 -0
- data/rbi/anthropic/models/beta/beta_code_execution_tool_20250825.rbi +72 -0
- data/rbi/anthropic/models/beta/beta_content_block.rbi +3 -0
- data/rbi/anthropic/models/beta/beta_content_block_param.rbi +3 -0
- data/rbi/anthropic/models/beta/beta_document_block.rbi +95 -0
- data/rbi/anthropic/models/beta/beta_message.rbi +3 -0
- data/rbi/anthropic/models/beta/beta_raw_content_block_start_event.rbi +6 -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 +15 -0
- data/rbi/anthropic/models/beta/beta_server_tool_use_block_param.rbi +15 -0
- data/rbi/anthropic/models/beta/beta_text_editor_code_execution_create_result_block.rbi +41 -0
- data/rbi/anthropic/models/beta/beta_text_editor_code_execution_create_result_block_param.rbi +41 -0
- data/rbi/anthropic/models/beta/beta_text_editor_code_execution_str_replace_result_block.rbi +73 -0
- data/rbi/anthropic/models/beta/beta_text_editor_code_execution_str_replace_result_block_param.rbi +73 -0
- data/rbi/anthropic/models/beta/beta_text_editor_code_execution_tool_result_block.rbi +90 -0
- data/rbi/anthropic/models/beta/beta_text_editor_code_execution_tool_result_block_param.rbi +118 -0
- data/rbi/anthropic/models/beta/beta_text_editor_code_execution_tool_result_error.rbi +110 -0
- data/rbi/anthropic/models/beta/beta_text_editor_code_execution_tool_result_error_param.rbi +110 -0
- data/rbi/anthropic/models/beta/beta_text_editor_code_execution_view_result_block.rbi +118 -0
- data/rbi/anthropic/models/beta/beta_text_editor_code_execution_view_result_block_param.rbi +118 -0
- data/rbi/anthropic/models/beta/beta_tool_result_block_param.rbi +2 -1
- data/rbi/anthropic/models/beta/beta_tool_union.rbi +3 -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 +17 -53
- data/rbi/anthropic/models/beta/message_create_params.rbi +14 -52
- data/rbi/anthropic/models/beta/messages/batch_create_params.rbi +14 -52
- data/rbi/anthropic/models/beta_error_response.rbi +10 -2
- data/rbi/anthropic/models/document_block_param.rbi +7 -3
- data/rbi/anthropic/models/error_response.rbi +10 -2
- data/rbi/anthropic/models/message_count_tokens_params.rbi +2 -48
- data/rbi/anthropic/models/message_create_params.rbi +2 -48
- data/rbi/anthropic/models/messages/batch_create_params.rbi +2 -48
- data/rbi/anthropic/models/tool_result_block_param.rbi +2 -1
- data/rbi/anthropic/resources/beta/messages.rbi +12 -75
- data/rbi/anthropic/resources/messages.rbi +3 -72
- data/sig/anthropic/models/beta/beta_bash_code_execution_output_block.rbs +23 -0
- data/sig/anthropic/models/beta/beta_bash_code_execution_output_block_param.rbs +23 -0
- data/sig/anthropic/models/beta/beta_bash_code_execution_result_block.rbs +44 -0
- data/sig/anthropic/models/beta/beta_bash_code_execution_result_block_param.rbs +44 -0
- data/sig/anthropic/models/beta/beta_bash_code_execution_tool_result_block.rbs +44 -0
- data/sig/anthropic/models/beta/beta_bash_code_execution_tool_result_block_param.rbs +49 -0
- data/sig/anthropic/models/beta/beta_bash_code_execution_tool_result_error.rbs +48 -0
- data/sig/anthropic/models/beta/beta_bash_code_execution_tool_result_error_param.rbs +48 -0
- data/sig/anthropic/models/beta/beta_citation_config.rbs +17 -0
- data/sig/anthropic/models/beta/beta_code_execution_tool_20250825.rbs +34 -0
- data/sig/anthropic/models/beta/beta_content_block.rbs +3 -0
- data/sig/anthropic/models/beta/beta_content_block_param.rbs +3 -0
- data/sig/anthropic/models/beta/beta_document_block.rbs +49 -0
- data/sig/anthropic/models/beta/beta_raw_content_block_start_event.rbs +3 -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 +9 -1
- data/sig/anthropic/models/beta/beta_server_tool_use_block_param.rbs +9 -1
- data/sig/anthropic/models/beta/beta_text_editor_code_execution_create_result_block.rbs +29 -0
- data/sig/anthropic/models/beta/beta_text_editor_code_execution_create_result_block_param.rbs +29 -0
- data/sig/anthropic/models/beta/beta_text_editor_code_execution_str_replace_result_block.rbs +49 -0
- data/sig/anthropic/models/beta/beta_text_editor_code_execution_str_replace_result_block_param.rbs +49 -0
- data/sig/anthropic/models/beta/beta_text_editor_code_execution_tool_result_block.rbs +46 -0
- data/sig/anthropic/models/beta/beta_text_editor_code_execution_tool_result_block_param.rbs +51 -0
- data/sig/anthropic/models/beta/beta_text_editor_code_execution_tool_result_error.rbs +53 -0
- data/sig/anthropic/models/beta/beta_text_editor_code_execution_tool_result_error_param.rbs +53 -0
- data/sig/anthropic/models/beta/beta_text_editor_code_execution_view_result_block.rbs +61 -0
- data/sig/anthropic/models/beta/beta_text_editor_code_execution_view_result_block_param.rbs +61 -0
- data/sig/anthropic/models/beta/beta_tool_result_block_param.rbs +1 -0
- data/sig/anthropic/models/beta/beta_tool_union.rbs +2 -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 +2 -0
- data/sig/anthropic/models/beta_error_response.rbs +13 -2
- data/sig/anthropic/models/document_block_param.rbs +4 -8
- data/sig/anthropic/models/error_response.rbs +13 -2
- data/sig/anthropic/models/tool_result_block_param.rbs +1 -0
- metadata +107 -2
@@ -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 =
|
@@ -14,6 +14,8 @@ module Anthropic
|
|
14
14
|
|
15
15
|
variant -> { Anthropic::Beta::BetaCodeExecutionTool20250522 }
|
16
16
|
|
17
|
+
variant -> { Anthropic::Beta::BetaCodeExecutionTool20250825 }
|
18
|
+
|
17
19
|
variant -> { Anthropic::Beta::BetaToolComputerUse20241022 }
|
18
20
|
|
19
21
|
variant -> { Anthropic::Beta::BetaToolComputerUse20250124 }
|
@@ -28,8 +30,10 @@ module Anthropic
|
|
28
30
|
|
29
31
|
variant -> { Anthropic::Beta::BetaWebSearchTool20250305 }
|
30
32
|
|
33
|
+
variant -> { Anthropic::Beta::BetaWebFetchTool20250910 }
|
34
|
+
|
31
35
|
# @!method self.variants
|
32
|
-
# @return [Array(Anthropic::Models::Beta::BetaTool, Anthropic::Models::Beta::BetaToolBash20241022, Anthropic::Models::Beta::BetaToolBash20250124, Anthropic::Models::Beta::BetaCodeExecutionTool20250522, 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)]
|
33
37
|
end
|
34
38
|
end
|
35
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
|
@@ -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
|
@@ -66,30 +66,7 @@ module Anthropic
|
|
66
66
|
# { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
|
67
67
|
# ```
|
68
68
|
#
|
69
|
-
#
|
70
|
-
#
|
71
|
-
# ```json
|
72
|
-
# {
|
73
|
-
# "role": "user",
|
74
|
-
# "content": [
|
75
|
-
# {
|
76
|
-
# "type": "image",
|
77
|
-
# "source": {
|
78
|
-
# "type": "base64",
|
79
|
-
# "media_type": "image/jpeg",
|
80
|
-
# "data": "/9j/4AAQSkZJRg..."
|
81
|
-
# }
|
82
|
-
# },
|
83
|
-
# { "type": "text", "text": "What is in this image?" }
|
84
|
-
# ]
|
85
|
-
# }
|
86
|
-
# ```
|
87
|
-
#
|
88
|
-
# We currently support the `base64` source type for images, and the `image/jpeg`,
|
89
|
-
# `image/png`, `image/gif`, and `image/webp` media types.
|
90
|
-
#
|
91
|
-
# See [examples](https://docs.anthropic.com/en/api/messages-examples#vision) for
|
92
|
-
# more input examples.
|
69
|
+
# See [input examples](https://docs.anthropic.com/en/api/messages-examples).
|
93
70
|
#
|
94
71
|
# Note that if you want to include a
|
95
72
|
# [system prompt](https://docs.anthropic.com/en/docs/system-prompts), you can use
|
@@ -224,11 +201,9 @@ module Anthropic
|
|
224
201
|
#
|
225
202
|
# See our [guide](https://docs.anthropic.com/en/docs/tool-use) for more details.
|
226
203
|
#
|
227
|
-
# @return [Array<Anthropic::Models::Beta::BetaTool, Anthropic::Models::Beta::BetaToolBash20241022, Anthropic::Models::Beta::BetaToolBash20250124, Anthropic::Models::Beta::BetaCodeExecutionTool20250522, 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]
|
228
205
|
optional :tools,
|
229
|
-
-> {
|
230
|
-
Anthropic::Internal::Type::ArrayOf[union: Anthropic::Beta::MessageCountTokensParams::Tool]
|
231
|
-
}
|
206
|
+
-> { Anthropic::Internal::Type::ArrayOf[union: Anthropic::Beta::MessageCountTokensParams::Tool] }
|
232
207
|
|
233
208
|
# @!attribute betas
|
234
209
|
# Optional header to specify the beta version(s) you want to use.
|
@@ -252,7 +227,7 @@ module Anthropic
|
|
252
227
|
#
|
253
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,
|
254
229
|
#
|
255
|
-
# @param tools [Array<Anthropic::Models::Beta::BetaTool, Anthropic::Models::Beta::BetaToolBash20241022, Anthropic::Models::Beta::BetaToolBash20250124, Anthropic::Models::Beta::BetaCodeExecutionTool20250522, 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.
|
256
231
|
#
|
257
232
|
# @param betas [Array<String, Symbol, Anthropic::Models::AnthropicBeta>] Optional header to specify the beta version(s) you want to use.
|
258
233
|
#
|
@@ -290,6 +265,8 @@ module Anthropic
|
|
290
265
|
|
291
266
|
variant -> { Anthropic::Beta::BetaCodeExecutionTool20250522 }
|
292
267
|
|
268
|
+
variant -> { Anthropic::Beta::BetaCodeExecutionTool20250825 }
|
269
|
+
|
293
270
|
variant -> { Anthropic::Beta::BetaToolComputerUse20241022 }
|
294
271
|
|
295
272
|
variant -> { Anthropic::Beta::BetaToolComputerUse20250124 }
|
@@ -304,8 +281,10 @@ module Anthropic
|
|
304
281
|
|
305
282
|
variant -> { Anthropic::Beta::BetaWebSearchTool20250305 }
|
306
283
|
|
284
|
+
variant -> { Anthropic::Beta::BetaWebFetchTool20250910 }
|
285
|
+
|
307
286
|
# @!method self.variants
|
308
|
-
# @return [Array(Anthropic::Models::Beta::BetaTool, Anthropic::Models::Beta::BetaToolBash20241022, Anthropic::Models::Beta::BetaToolBash20250124, Anthropic::Models::Beta::BetaCodeExecutionTool20250522, 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)]
|
309
288
|
end
|
310
289
|
end
|
311
290
|
end
|
@@ -80,30 +80,7 @@ module Anthropic
|
|
80
80
|
# { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
|
81
81
|
# ```
|
82
82
|
#
|
83
|
-
#
|
84
|
-
#
|
85
|
-
# ```json
|
86
|
-
# {
|
87
|
-
# "role": "user",
|
88
|
-
# "content": [
|
89
|
-
# {
|
90
|
-
# "type": "image",
|
91
|
-
# "source": {
|
92
|
-
# "type": "base64",
|
93
|
-
# "media_type": "image/jpeg",
|
94
|
-
# "data": "/9j/4AAQSkZJRg..."
|
95
|
-
# }
|
96
|
-
# },
|
97
|
-
# { "type": "text", "text": "What is in this image?" }
|
98
|
-
# ]
|
99
|
-
# }
|
100
|
-
# ```
|
101
|
-
#
|
102
|
-
# We currently support the `base64` source type for images, and the `image/jpeg`,
|
103
|
-
# `image/png`, `image/gif`, and `image/webp` media types.
|
104
|
-
#
|
105
|
-
# See [examples](https://docs.anthropic.com/en/api/messages-examples#vision) for
|
106
|
-
# more input examples.
|
83
|
+
# See [input examples](https://docs.anthropic.com/en/api/messages-examples).
|
107
84
|
#
|
108
85
|
# Note that if you want to include a
|
109
86
|
# [system prompt](https://docs.anthropic.com/en/docs/system-prompts), you can use
|
@@ -287,7 +264,7 @@ module Anthropic
|
|
287
264
|
#
|
288
265
|
# See our [guide](https://docs.anthropic.com/en/docs/tool-use) for more details.
|
289
266
|
#
|
290
|
-
# @return [Array<Anthropic::Models::Beta::BetaTool, Anthropic::Models::Beta::BetaToolBash20241022, Anthropic::Models::Beta::BetaToolBash20250124, Anthropic::Models::Beta::BetaCodeExecutionTool20250522, 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]
|
291
268
|
optional :tools, -> { Anthropic::Internal::Type::ArrayOf[union: Anthropic::Beta::BetaToolUnion] }
|
292
269
|
|
293
270
|
# @!attribute top_k
|
@@ -350,7 +327,7 @@ module Anthropic
|
|
350
327
|
#
|
351
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,
|
352
329
|
#
|
353
|
-
# @param tools [Array<Anthropic::Models::Beta::BetaTool, Anthropic::Models::Beta::BetaToolBash20241022, Anthropic::Models::Beta::BetaToolBash20250124, Anthropic::Models::Beta::BetaCodeExecutionTool20250522, 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.
|
354
331
|
#
|
355
332
|
# @param top_k [Integer] Only sample from the top K options for each subsequent token.
|
356
333
|
#
|
@@ -15,9 +15,7 @@ module Anthropic
|
|
15
15
|
#
|
16
16
|
# @return [Array<Anthropic::Models::Beta::Messages::BatchCreateParams::Request>]
|
17
17
|
required :requests,
|
18
|
-
-> {
|
19
|
-
Anthropic::Internal::Type::ArrayOf[Anthropic::Beta::Messages::BatchCreateParams::Request]
|
20
|
-
}
|
18
|
+
-> { Anthropic::Internal::Type::ArrayOf[Anthropic::Beta::Messages::BatchCreateParams::Request] }
|
21
19
|
|
22
20
|
# @!attribute betas
|
23
21
|
# Optional header to specify the beta version(s) you want to use.
|
@@ -135,30 +133,7 @@ module Anthropic
|
|
135
133
|
# { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
|
136
134
|
# ```
|
137
135
|
#
|
138
|
-
#
|
139
|
-
#
|
140
|
-
# ```json
|
141
|
-
# {
|
142
|
-
# "role": "user",
|
143
|
-
# "content": [
|
144
|
-
# {
|
145
|
-
# "type": "image",
|
146
|
-
# "source": {
|
147
|
-
# "type": "base64",
|
148
|
-
# "media_type": "image/jpeg",
|
149
|
-
# "data": "/9j/4AAQSkZJRg..."
|
150
|
-
# }
|
151
|
-
# },
|
152
|
-
# { "type": "text", "text": "What is in this image?" }
|
153
|
-
# ]
|
154
|
-
# }
|
155
|
-
# ```
|
156
|
-
#
|
157
|
-
# We currently support the `base64` source type for images, and the `image/jpeg`,
|
158
|
-
# `image/png`, `image/gif`, and `image/webp` media types.
|
159
|
-
#
|
160
|
-
# See [examples](https://docs.anthropic.com/en/api/messages-examples#vision) for
|
161
|
-
# more input examples.
|
136
|
+
# See [input examples](https://docs.anthropic.com/en/api/messages-examples).
|
162
137
|
#
|
163
138
|
# Note that if you want to include a
|
164
139
|
# [system prompt](https://docs.anthropic.com/en/docs/system-prompts), you can use
|
@@ -189,9 +164,7 @@ module Anthropic
|
|
189
164
|
#
|
190
165
|
# @return [Array<Anthropic::Models::Beta::BetaRequestMCPServerURLDefinition>, nil]
|
191
166
|
optional :mcp_servers,
|
192
|
-
-> {
|
193
|
-
Anthropic::Internal::Type::ArrayOf[Anthropic::Beta::BetaRequestMCPServerURLDefinition]
|
194
|
-
}
|
167
|
+
-> { Anthropic::Internal::Type::ArrayOf[Anthropic::Beta::BetaRequestMCPServerURLDefinition] }
|
195
168
|
|
196
169
|
# @!attribute metadata
|
197
170
|
# An object describing metadata about the request.
|
@@ -356,11 +329,8 @@ module Anthropic
|
|
356
329
|
#
|
357
330
|
# See our [guide](https://docs.anthropic.com/en/docs/tool-use) for more details.
|
358
331
|
#
|
359
|
-
# @return [Array<Anthropic::Models::Beta::BetaTool, Anthropic::Models::Beta::BetaToolBash20241022, Anthropic::Models::Beta::BetaToolBash20250124, Anthropic::Models::Beta::BetaCodeExecutionTool20250522, 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]
|
360
|
-
optional :tools,
|
361
|
-
-> {
|
362
|
-
Anthropic::Internal::Type::ArrayOf[union: Anthropic::Beta::BetaToolUnion]
|
363
|
-
}
|
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
|
+
optional :tools, -> { Anthropic::Internal::Type::ArrayOf[union: Anthropic::Beta::BetaToolUnion] }
|
364
334
|
|
365
335
|
# @!attribute top_k
|
366
336
|
# Only sample from the top K options for each subsequent token.
|
@@ -424,7 +394,7 @@ module Anthropic
|
|
424
394
|
#
|
425
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,
|
426
396
|
#
|
427
|
-
# @param tools [Array<Anthropic::Models::Beta::BetaTool, Anthropic::Models::Beta::BetaToolBash20241022, Anthropic::Models::Beta::BetaToolBash20250124, Anthropic::Models::Beta::BetaCodeExecutionTool20250522, 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.
|
428
398
|
#
|
429
399
|
# @param top_k [Integer] Only sample from the top K options for each subsequent token.
|
430
400
|
#
|
@@ -56,10 +56,7 @@ module Anthropic
|
|
56
56
|
# Processing status of the Message Batch.
|
57
57
|
#
|
58
58
|
# @return [Symbol, Anthropic::Models::Beta::Messages::BetaMessageBatch::ProcessingStatus]
|
59
|
-
required :processing_status,
|
60
|
-
enum: -> {
|
61
|
-
Anthropic::Beta::Messages::BetaMessageBatch::ProcessingStatus
|
62
|
-
}
|
59
|
+
required :processing_status, enum: -> { Anthropic::Beta::Messages::BetaMessageBatch::ProcessingStatus }
|
63
60
|
|
64
61
|
# @!attribute request_counts
|
65
62
|
# Tallies requests within the Message Batch, categorized by their status.
|
@@ -8,13 +8,19 @@ module Anthropic
|
|
8
8
|
# @return [Anthropic::Models::BetaInvalidRequestError, Anthropic::Models::BetaAuthenticationError, Anthropic::Models::BetaBillingError, Anthropic::Models::BetaPermissionError, Anthropic::Models::BetaNotFoundError, Anthropic::Models::BetaRateLimitError, Anthropic::Models::BetaGatewayTimeoutError, Anthropic::Models::BetaAPIError, Anthropic::Models::BetaOverloadedError]
|
9
9
|
required :error, union: -> { Anthropic::BetaError }
|
10
10
|
|
11
|
+
# @!attribute request_id
|
12
|
+
#
|
13
|
+
# @return [String, nil]
|
14
|
+
required :request_id, String, nil?: true
|
15
|
+
|
11
16
|
# @!attribute type
|
12
17
|
#
|
13
18
|
# @return [Symbol, :error]
|
14
19
|
required :type, const: :error
|
15
20
|
|
16
|
-
# @!method initialize(error:, type: :error)
|
21
|
+
# @!method initialize(error:, request_id:, type: :error)
|
17
22
|
# @param error [Anthropic::Models::BetaInvalidRequestError, Anthropic::Models::BetaAuthenticationError, Anthropic::Models::BetaBillingError, Anthropic::Models::BetaPermissionError, Anthropic::Models::BetaNotFoundError, Anthropic::Models::BetaRateLimitError, Anthropic::Models::BetaGatewayTimeoutError, Anthropic::Models::BetaAPIError, Anthropic::Models::BetaOverloadedError]
|
23
|
+
# @param request_id [String, nil]
|
18
24
|
# @param type [Symbol, :error]
|
19
25
|
end
|
20
26
|
end
|