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
@@ -0,0 +1,61 @@
|
|
1
|
+
module Anthropic
|
2
|
+
module Models
|
3
|
+
class BetaTextEditorCodeExecutionViewResultBlockParam = Beta::BetaTextEditorCodeExecutionViewResultBlockParam
|
4
|
+
|
5
|
+
module Beta
|
6
|
+
type beta_text_editor_code_execution_view_result_block_param =
|
7
|
+
{
|
8
|
+
content: String,
|
9
|
+
file_type: Anthropic::Models::Beta::BetaTextEditorCodeExecutionViewResultBlockParam::file_type,
|
10
|
+
type: :text_editor_code_execution_view_result,
|
11
|
+
num_lines: Integer?,
|
12
|
+
start_line: Integer?,
|
13
|
+
total_lines: Integer?
|
14
|
+
}
|
15
|
+
|
16
|
+
class BetaTextEditorCodeExecutionViewResultBlockParam < Anthropic::Internal::Type::BaseModel
|
17
|
+
attr_accessor content: String
|
18
|
+
|
19
|
+
attr_accessor file_type: Anthropic::Models::Beta::BetaTextEditorCodeExecutionViewResultBlockParam::file_type
|
20
|
+
|
21
|
+
attr_accessor type: :text_editor_code_execution_view_result
|
22
|
+
|
23
|
+
attr_accessor num_lines: Integer?
|
24
|
+
|
25
|
+
attr_accessor start_line: Integer?
|
26
|
+
|
27
|
+
attr_accessor total_lines: Integer?
|
28
|
+
|
29
|
+
def initialize: (
|
30
|
+
content: String,
|
31
|
+
file_type: Anthropic::Models::Beta::BetaTextEditorCodeExecutionViewResultBlockParam::file_type,
|
32
|
+
?num_lines: Integer?,
|
33
|
+
?start_line: Integer?,
|
34
|
+
?total_lines: Integer?,
|
35
|
+
?type: :text_editor_code_execution_view_result
|
36
|
+
) -> void
|
37
|
+
|
38
|
+
def to_hash: -> {
|
39
|
+
content: String,
|
40
|
+
file_type: Anthropic::Models::Beta::BetaTextEditorCodeExecutionViewResultBlockParam::file_type,
|
41
|
+
type: :text_editor_code_execution_view_result,
|
42
|
+
num_lines: Integer?,
|
43
|
+
start_line: Integer?,
|
44
|
+
total_lines: Integer?
|
45
|
+
}
|
46
|
+
|
47
|
+
type file_type = :text | :image | :pdf
|
48
|
+
|
49
|
+
module FileType
|
50
|
+
extend Anthropic::Internal::Type::Enum
|
51
|
+
|
52
|
+
TEXT: :text
|
53
|
+
IMAGE: :image
|
54
|
+
PDF: :pdf
|
55
|
+
|
56
|
+
def self?.values: -> ::Array[Anthropic::Models::Beta::BetaTextEditorCodeExecutionViewResultBlockParam::file_type]
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
@@ -8,6 +8,7 @@ module Anthropic
|
|
8
8
|
| Anthropic::Beta::BetaToolBash20241022
|
9
9
|
| Anthropic::Beta::BetaToolBash20250124
|
10
10
|
| Anthropic::Beta::BetaCodeExecutionTool20250522
|
11
|
+
| Anthropic::Beta::BetaCodeExecutionTool20250825
|
11
12
|
| Anthropic::Beta::BetaToolComputerUse20241022
|
12
13
|
| Anthropic::Beta::BetaToolComputerUse20250124
|
13
14
|
| Anthropic::Beta::BetaToolTextEditor20241022
|
@@ -15,6 +16,7 @@ module Anthropic
|
|
15
16
|
| Anthropic::Beta::BetaToolTextEditor20250429
|
16
17
|
| Anthropic::Beta::BetaToolTextEditor20250728
|
17
18
|
| Anthropic::Beta::BetaWebSearchTool20250305
|
19
|
+
| Anthropic::Beta::BetaWebFetchTool20250910
|
18
20
|
|
19
21
|
module BetaToolUnion
|
20
22
|
extend Anthropic::Internal::Type::Union
|
@@ -0,0 +1,39 @@
|
|
1
|
+
module Anthropic
|
2
|
+
module Models
|
3
|
+
class BetaWebFetchBlock = Beta::BetaWebFetchBlock
|
4
|
+
|
5
|
+
module Beta
|
6
|
+
type beta_web_fetch_block =
|
7
|
+
{
|
8
|
+
content: Anthropic::Beta::BetaDocumentBlock,
|
9
|
+
retrieved_at: String?,
|
10
|
+
type: :web_fetch_result,
|
11
|
+
url: String
|
12
|
+
}
|
13
|
+
|
14
|
+
class BetaWebFetchBlock < Anthropic::Internal::Type::BaseModel
|
15
|
+
attr_accessor content: Anthropic::Beta::BetaDocumentBlock
|
16
|
+
|
17
|
+
attr_accessor retrieved_at: String?
|
18
|
+
|
19
|
+
attr_accessor type: :web_fetch_result
|
20
|
+
|
21
|
+
attr_accessor url: String
|
22
|
+
|
23
|
+
def initialize: (
|
24
|
+
content: Anthropic::Beta::BetaDocumentBlock,
|
25
|
+
retrieved_at: String?,
|
26
|
+
url: String,
|
27
|
+
?type: :web_fetch_result
|
28
|
+
) -> void
|
29
|
+
|
30
|
+
def to_hash: -> {
|
31
|
+
content: Anthropic::Beta::BetaDocumentBlock,
|
32
|
+
retrieved_at: String?,
|
33
|
+
type: :web_fetch_result,
|
34
|
+
url: String
|
35
|
+
}
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
module Anthropic
|
2
|
+
module Models
|
3
|
+
class BetaWebFetchBlockParam = Beta::BetaWebFetchBlockParam
|
4
|
+
|
5
|
+
module Beta
|
6
|
+
type beta_web_fetch_block_param =
|
7
|
+
{
|
8
|
+
content: Anthropic::Beta::BetaRequestDocumentBlock,
|
9
|
+
type: :web_fetch_result,
|
10
|
+
url: String,
|
11
|
+
retrieved_at: String?
|
12
|
+
}
|
13
|
+
|
14
|
+
class BetaWebFetchBlockParam < Anthropic::Internal::Type::BaseModel
|
15
|
+
attr_accessor content: Anthropic::Beta::BetaRequestDocumentBlock
|
16
|
+
|
17
|
+
attr_accessor type: :web_fetch_result
|
18
|
+
|
19
|
+
attr_accessor url: String
|
20
|
+
|
21
|
+
attr_accessor retrieved_at: String?
|
22
|
+
|
23
|
+
def initialize: (
|
24
|
+
content: Anthropic::Beta::BetaRequestDocumentBlock,
|
25
|
+
url: String,
|
26
|
+
?retrieved_at: String?,
|
27
|
+
?type: :web_fetch_result
|
28
|
+
) -> void
|
29
|
+
|
30
|
+
def to_hash: -> {
|
31
|
+
content: Anthropic::Beta::BetaRequestDocumentBlock,
|
32
|
+
type: :web_fetch_result,
|
33
|
+
url: String,
|
34
|
+
retrieved_at: String?
|
35
|
+
}
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
module Anthropic
|
2
|
+
module Models
|
3
|
+
class BetaWebFetchTool20250910 = Beta::BetaWebFetchTool20250910
|
4
|
+
|
5
|
+
module Beta
|
6
|
+
type beta_web_fetch_tool20250910 =
|
7
|
+
{
|
8
|
+
name: :web_fetch,
|
9
|
+
type: :web_fetch_20250910,
|
10
|
+
allowed_domains: ::Array[String]?,
|
11
|
+
blocked_domains: ::Array[String]?,
|
12
|
+
cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
|
13
|
+
citations: Anthropic::Beta::BetaCitationsConfigParam?,
|
14
|
+
max_content_tokens: Integer?,
|
15
|
+
max_uses: Integer?
|
16
|
+
}
|
17
|
+
|
18
|
+
class BetaWebFetchTool20250910 < Anthropic::Internal::Type::BaseModel
|
19
|
+
attr_accessor name: :web_fetch
|
20
|
+
|
21
|
+
attr_accessor type: :web_fetch_20250910
|
22
|
+
|
23
|
+
attr_accessor allowed_domains: ::Array[String]?
|
24
|
+
|
25
|
+
attr_accessor blocked_domains: ::Array[String]?
|
26
|
+
|
27
|
+
attr_accessor cache_control: Anthropic::Beta::BetaCacheControlEphemeral?
|
28
|
+
|
29
|
+
attr_accessor citations: Anthropic::Beta::BetaCitationsConfigParam?
|
30
|
+
|
31
|
+
attr_accessor max_content_tokens: Integer?
|
32
|
+
|
33
|
+
attr_accessor max_uses: Integer?
|
34
|
+
|
35
|
+
def initialize: (
|
36
|
+
?allowed_domains: ::Array[String]?,
|
37
|
+
?blocked_domains: ::Array[String]?,
|
38
|
+
?cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
|
39
|
+
?citations: Anthropic::Beta::BetaCitationsConfigParam?,
|
40
|
+
?max_content_tokens: Integer?,
|
41
|
+
?max_uses: Integer?,
|
42
|
+
?name: :web_fetch,
|
43
|
+
?type: :web_fetch_20250910
|
44
|
+
) -> void
|
45
|
+
|
46
|
+
def to_hash: -> {
|
47
|
+
name: :web_fetch,
|
48
|
+
type: :web_fetch_20250910,
|
49
|
+
allowed_domains: ::Array[String]?,
|
50
|
+
blocked_domains: ::Array[String]?,
|
51
|
+
cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
|
52
|
+
citations: Anthropic::Beta::BetaCitationsConfigParam?,
|
53
|
+
max_content_tokens: Integer?,
|
54
|
+
max_uses: Integer?
|
55
|
+
}
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
module Anthropic
|
2
|
+
module Models
|
3
|
+
class BetaWebFetchToolResultBlock = Beta::BetaWebFetchToolResultBlock
|
4
|
+
|
5
|
+
module Beta
|
6
|
+
type beta_web_fetch_tool_result_block =
|
7
|
+
{
|
8
|
+
content: Anthropic::Models::Beta::BetaWebFetchToolResultBlock::content,
|
9
|
+
tool_use_id: String,
|
10
|
+
type: :web_fetch_tool_result
|
11
|
+
}
|
12
|
+
|
13
|
+
class BetaWebFetchToolResultBlock < Anthropic::Internal::Type::BaseModel
|
14
|
+
attr_accessor content: Anthropic::Models::Beta::BetaWebFetchToolResultBlock::content
|
15
|
+
|
16
|
+
attr_accessor tool_use_id: String
|
17
|
+
|
18
|
+
attr_accessor type: :web_fetch_tool_result
|
19
|
+
|
20
|
+
def initialize: (
|
21
|
+
content: Anthropic::Models::Beta::BetaWebFetchToolResultBlock::content,
|
22
|
+
tool_use_id: String,
|
23
|
+
?type: :web_fetch_tool_result
|
24
|
+
) -> void
|
25
|
+
|
26
|
+
def to_hash: -> {
|
27
|
+
content: Anthropic::Models::Beta::BetaWebFetchToolResultBlock::content,
|
28
|
+
tool_use_id: String,
|
29
|
+
type: :web_fetch_tool_result
|
30
|
+
}
|
31
|
+
|
32
|
+
type content =
|
33
|
+
Anthropic::Beta::BetaWebFetchToolResultErrorBlock
|
34
|
+
| Anthropic::Beta::BetaWebFetchBlock
|
35
|
+
|
36
|
+
module Content
|
37
|
+
extend Anthropic::Internal::Type::Union
|
38
|
+
|
39
|
+
def self?.variants: -> ::Array[Anthropic::Models::Beta::BetaWebFetchToolResultBlock::content]
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
module Anthropic
|
2
|
+
module Models
|
3
|
+
class BetaWebFetchToolResultBlockParam = Beta::BetaWebFetchToolResultBlockParam
|
4
|
+
|
5
|
+
module Beta
|
6
|
+
type beta_web_fetch_tool_result_block_param =
|
7
|
+
{
|
8
|
+
content: Anthropic::Models::Beta::BetaWebFetchToolResultBlockParam::content,
|
9
|
+
tool_use_id: String,
|
10
|
+
type: :web_fetch_tool_result,
|
11
|
+
cache_control: Anthropic::Beta::BetaCacheControlEphemeral?
|
12
|
+
}
|
13
|
+
|
14
|
+
class BetaWebFetchToolResultBlockParam < Anthropic::Internal::Type::BaseModel
|
15
|
+
attr_accessor content: Anthropic::Models::Beta::BetaWebFetchToolResultBlockParam::content
|
16
|
+
|
17
|
+
attr_accessor tool_use_id: String
|
18
|
+
|
19
|
+
attr_accessor type: :web_fetch_tool_result
|
20
|
+
|
21
|
+
attr_accessor cache_control: Anthropic::Beta::BetaCacheControlEphemeral?
|
22
|
+
|
23
|
+
def initialize: (
|
24
|
+
content: Anthropic::Models::Beta::BetaWebFetchToolResultBlockParam::content,
|
25
|
+
tool_use_id: String,
|
26
|
+
?cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
|
27
|
+
?type: :web_fetch_tool_result
|
28
|
+
) -> void
|
29
|
+
|
30
|
+
def to_hash: -> {
|
31
|
+
content: Anthropic::Models::Beta::BetaWebFetchToolResultBlockParam::content,
|
32
|
+
tool_use_id: String,
|
33
|
+
type: :web_fetch_tool_result,
|
34
|
+
cache_control: Anthropic::Beta::BetaCacheControlEphemeral?
|
35
|
+
}
|
36
|
+
|
37
|
+
type content =
|
38
|
+
Anthropic::Beta::BetaWebFetchToolResultErrorBlockParam
|
39
|
+
| Anthropic::Beta::BetaWebFetchBlockParam
|
40
|
+
|
41
|
+
module Content
|
42
|
+
extend Anthropic::Internal::Type::Union
|
43
|
+
|
44
|
+
def self?.variants: -> ::Array[Anthropic::Models::Beta::BetaWebFetchToolResultBlockParam::content]
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module Anthropic
|
2
|
+
module Models
|
3
|
+
class BetaWebFetchToolResultErrorBlock = Beta::BetaWebFetchToolResultErrorBlock
|
4
|
+
|
5
|
+
module Beta
|
6
|
+
type beta_web_fetch_tool_result_error_block =
|
7
|
+
{
|
8
|
+
error_code: Anthropic::Models::Beta::beta_web_fetch_tool_result_error_code,
|
9
|
+
type: :web_fetch_tool_result_error
|
10
|
+
}
|
11
|
+
|
12
|
+
class BetaWebFetchToolResultErrorBlock < Anthropic::Internal::Type::BaseModel
|
13
|
+
attr_accessor error_code: Anthropic::Models::Beta::beta_web_fetch_tool_result_error_code
|
14
|
+
|
15
|
+
attr_accessor type: :web_fetch_tool_result_error
|
16
|
+
|
17
|
+
def initialize: (
|
18
|
+
error_code: Anthropic::Models::Beta::beta_web_fetch_tool_result_error_code,
|
19
|
+
?type: :web_fetch_tool_result_error
|
20
|
+
) -> void
|
21
|
+
|
22
|
+
def to_hash: -> {
|
23
|
+
error_code: Anthropic::Models::Beta::beta_web_fetch_tool_result_error_code,
|
24
|
+
type: :web_fetch_tool_result_error
|
25
|
+
}
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module Anthropic
|
2
|
+
module Models
|
3
|
+
class BetaWebFetchToolResultErrorBlockParam = Beta::BetaWebFetchToolResultErrorBlockParam
|
4
|
+
|
5
|
+
module Beta
|
6
|
+
type beta_web_fetch_tool_result_error_block_param =
|
7
|
+
{
|
8
|
+
error_code: Anthropic::Models::Beta::beta_web_fetch_tool_result_error_code,
|
9
|
+
type: :web_fetch_tool_result_error
|
10
|
+
}
|
11
|
+
|
12
|
+
class BetaWebFetchToolResultErrorBlockParam < Anthropic::Internal::Type::BaseModel
|
13
|
+
attr_accessor error_code: Anthropic::Models::Beta::beta_web_fetch_tool_result_error_code
|
14
|
+
|
15
|
+
attr_accessor type: :web_fetch_tool_result_error
|
16
|
+
|
17
|
+
def initialize: (
|
18
|
+
error_code: Anthropic::Models::Beta::beta_web_fetch_tool_result_error_code,
|
19
|
+
?type: :web_fetch_tool_result_error
|
20
|
+
) -> void
|
21
|
+
|
22
|
+
def to_hash: -> {
|
23
|
+
error_code: Anthropic::Models::Beta::beta_web_fetch_tool_result_error_code,
|
24
|
+
type: :web_fetch_tool_result_error
|
25
|
+
}
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module Anthropic
|
2
|
+
module Models
|
3
|
+
module BetaWebFetchToolResultErrorCode = Beta::BetaWebFetchToolResultErrorCode
|
4
|
+
|
5
|
+
module Beta
|
6
|
+
type beta_web_fetch_tool_result_error_code =
|
7
|
+
:invalid_tool_input
|
8
|
+
| :url_too_long
|
9
|
+
| :url_not_allowed
|
10
|
+
| :url_not_accessible
|
11
|
+
| :unsupported_content_type
|
12
|
+
| :too_many_requests
|
13
|
+
| :max_uses_exceeded
|
14
|
+
| :unavailable
|
15
|
+
|
16
|
+
module BetaWebFetchToolResultErrorCode
|
17
|
+
extend Anthropic::Internal::Type::Enum
|
18
|
+
|
19
|
+
INVALID_TOOL_INPUT: :invalid_tool_input
|
20
|
+
URL_TOO_LONG: :url_too_long
|
21
|
+
URL_NOT_ALLOWED: :url_not_allowed
|
22
|
+
URL_NOT_ACCESSIBLE: :url_not_accessible
|
23
|
+
UNSUPPORTED_CONTENT_TYPE: :unsupported_content_type
|
24
|
+
TOO_MANY_REQUESTS: :too_many_requests
|
25
|
+
MAX_USES_EXCEEDED: :max_uses_exceeded
|
26
|
+
UNAVAILABLE: :unavailable
|
27
|
+
|
28
|
+
def self?.values: -> ::Array[Anthropic::Models::Beta::beta_web_fetch_tool_result_error_code]
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -97,6 +97,7 @@ module Anthropic
|
|
97
97
|
| Anthropic::Beta::BetaToolBash20241022
|
98
98
|
| Anthropic::Beta::BetaToolBash20250124
|
99
99
|
| Anthropic::Beta::BetaCodeExecutionTool20250522
|
100
|
+
| Anthropic::Beta::BetaCodeExecutionTool20250825
|
100
101
|
| Anthropic::Beta::BetaToolComputerUse20241022
|
101
102
|
| Anthropic::Beta::BetaToolComputerUse20250124
|
102
103
|
| Anthropic::Beta::BetaToolTextEditor20241022
|
@@ -104,6 +105,7 @@ module Anthropic
|
|
104
105
|
| Anthropic::Beta::BetaToolTextEditor20250429
|
105
106
|
| Anthropic::Beta::BetaToolTextEditor20250728
|
106
107
|
| Anthropic::Beta::BetaWebSearchTool20250305
|
108
|
+
| Anthropic::Beta::BetaWebFetchTool20250910
|
107
109
|
|
108
110
|
module Tool
|
109
111
|
extend Anthropic::Internal::Type::Union
|
@@ -1,19 +1,30 @@
|
|
1
1
|
module Anthropic
|
2
2
|
module Models
|
3
3
|
type beta_error_response =
|
4
|
-
{
|
4
|
+
{
|
5
|
+
error: Anthropic::Models::beta_error,
|
6
|
+
request_id: String?,
|
7
|
+
type: :error
|
8
|
+
}
|
5
9
|
|
6
10
|
class BetaErrorResponse < Anthropic::Internal::Type::BaseModel
|
7
11
|
attr_accessor error: Anthropic::Models::beta_error
|
8
12
|
|
13
|
+
attr_accessor request_id: String?
|
14
|
+
|
9
15
|
attr_accessor type: :error
|
10
16
|
|
11
17
|
def initialize: (
|
12
18
|
error: Anthropic::Models::beta_error,
|
19
|
+
request_id: String?,
|
13
20
|
?type: :error
|
14
21
|
) -> void
|
15
22
|
|
16
|
-
def to_hash: -> {
|
23
|
+
def to_hash: -> {
|
24
|
+
error: Anthropic::Models::beta_error,
|
25
|
+
request_id: String?,
|
26
|
+
type: :error
|
27
|
+
}
|
17
28
|
end
|
18
29
|
end
|
19
30
|
end
|
@@ -5,7 +5,7 @@ module Anthropic
|
|
5
5
|
source: Anthropic::Models::DocumentBlockParam::source,
|
6
6
|
type: :document,
|
7
7
|
cache_control: Anthropic::CacheControlEphemeral?,
|
8
|
-
citations: Anthropic::CitationsConfigParam
|
8
|
+
citations: Anthropic::CitationsConfigParam?,
|
9
9
|
context: String?,
|
10
10
|
title: String?
|
11
11
|
}
|
@@ -17,11 +17,7 @@ module Anthropic
|
|
17
17
|
|
18
18
|
attr_accessor cache_control: Anthropic::CacheControlEphemeral?
|
19
19
|
|
20
|
-
|
21
|
-
|
22
|
-
def citations=: (
|
23
|
-
Anthropic::CitationsConfigParam
|
24
|
-
) -> Anthropic::CitationsConfigParam
|
20
|
+
attr_accessor citations: Anthropic::CitationsConfigParam?
|
25
21
|
|
26
22
|
attr_accessor context: String?
|
27
23
|
|
@@ -30,7 +26,7 @@ module Anthropic
|
|
30
26
|
def initialize: (
|
31
27
|
source: Anthropic::Models::DocumentBlockParam::source,
|
32
28
|
?cache_control: Anthropic::CacheControlEphemeral?,
|
33
|
-
?citations: Anthropic::CitationsConfigParam
|
29
|
+
?citations: Anthropic::CitationsConfigParam?,
|
34
30
|
?context: String?,
|
35
31
|
?title: String?,
|
36
32
|
?type: :document
|
@@ -40,7 +36,7 @@ module Anthropic
|
|
40
36
|
source: Anthropic::Models::DocumentBlockParam::source,
|
41
37
|
type: :document,
|
42
38
|
cache_control: Anthropic::CacheControlEphemeral?,
|
43
|
-
citations: Anthropic::CitationsConfigParam
|
39
|
+
citations: Anthropic::CitationsConfigParam?,
|
44
40
|
context: String?,
|
45
41
|
title: String?
|
46
42
|
}
|
@@ -1,19 +1,30 @@
|
|
1
1
|
module Anthropic
|
2
2
|
module Models
|
3
3
|
type error_response =
|
4
|
-
{
|
4
|
+
{
|
5
|
+
error: Anthropic::Models::error_object,
|
6
|
+
request_id: String?,
|
7
|
+
type: :error
|
8
|
+
}
|
5
9
|
|
6
10
|
class ErrorResponse < Anthropic::Internal::Type::BaseModel
|
7
11
|
attr_accessor error: Anthropic::Models::error_object
|
8
12
|
|
13
|
+
attr_accessor request_id: String?
|
14
|
+
|
9
15
|
attr_accessor type: :error
|
10
16
|
|
11
17
|
def initialize: (
|
12
18
|
error: Anthropic::Models::error_object,
|
19
|
+
request_id: String?,
|
13
20
|
?type: :error
|
14
21
|
) -> void
|
15
22
|
|
16
|
-
def to_hash: -> {
|
23
|
+
def to_hash: -> {
|
24
|
+
error: Anthropic::Models::error_object,
|
25
|
+
request_id: String?,
|
26
|
+
type: :error
|
27
|
+
}
|
17
28
|
end
|
18
29
|
end
|
19
30
|
end
|