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
@@ -190,30 +190,7 @@ module Anthropic
|
|
190
190
|
# { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
|
191
191
|
# ```
|
192
192
|
#
|
193
|
-
#
|
194
|
-
#
|
195
|
-
# ```json
|
196
|
-
# {
|
197
|
-
# "role": "user",
|
198
|
-
# "content": [
|
199
|
-
# {
|
200
|
-
# "type": "image",
|
201
|
-
# "source": {
|
202
|
-
# "type": "base64",
|
203
|
-
# "media_type": "image/jpeg",
|
204
|
-
# "data": "/9j/4AAQSkZJRg..."
|
205
|
-
# }
|
206
|
-
# },
|
207
|
-
# { "type": "text", "text": "What is in this image?" }
|
208
|
-
# ]
|
209
|
-
# }
|
210
|
-
# ```
|
211
|
-
#
|
212
|
-
# We currently support the `base64` source type for images, and the `image/jpeg`,
|
213
|
-
# `image/png`, `image/gif`, and `image/webp` media types.
|
214
|
-
#
|
215
|
-
# See [examples](https://docs.anthropic.com/en/api/messages-examples#vision) for
|
216
|
-
# more input examples.
|
193
|
+
# See [input examples](https://docs.anthropic.com/en/api/messages-examples).
|
217
194
|
#
|
218
195
|
# Note that if you want to include a
|
219
196
|
# [system prompt](https://docs.anthropic.com/en/docs/system-prompts), you can use
|
@@ -629,30 +606,7 @@ module Anthropic
|
|
629
606
|
# { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
|
630
607
|
# ```
|
631
608
|
#
|
632
|
-
#
|
633
|
-
#
|
634
|
-
# ```json
|
635
|
-
# {
|
636
|
-
# "role": "user",
|
637
|
-
# "content": [
|
638
|
-
# {
|
639
|
-
# "type": "image",
|
640
|
-
# "source": {
|
641
|
-
# "type": "base64",
|
642
|
-
# "media_type": "image/jpeg",
|
643
|
-
# "data": "/9j/4AAQSkZJRg..."
|
644
|
-
# }
|
645
|
-
# },
|
646
|
-
# { "type": "text", "text": "What is in this image?" }
|
647
|
-
# ]
|
648
|
-
# }
|
649
|
-
# ```
|
650
|
-
#
|
651
|
-
# We currently support the `base64` source type for images, and the `image/jpeg`,
|
652
|
-
# `image/png`, `image/gif`, and `image/webp` media types.
|
653
|
-
#
|
654
|
-
# See [examples](https://docs.anthropic.com/en/api/messages-examples#vision) for
|
655
|
-
# more input examples.
|
609
|
+
# See [input examples](https://docs.anthropic.com/en/api/messages-examples).
|
656
610
|
#
|
657
611
|
# Note that if you want to include a
|
658
612
|
# [system prompt](https://docs.anthropic.com/en/docs/system-prompts), you can use
|
@@ -51,13 +51,15 @@ module Anthropic
|
|
51
51
|
Anthropic::Beta::BetaToolBash20241022::OrHash,
|
52
52
|
Anthropic::Beta::BetaToolBash20250124::OrHash,
|
53
53
|
Anthropic::Beta::BetaCodeExecutionTool20250522::OrHash,
|
54
|
+
Anthropic::Beta::BetaCodeExecutionTool20250825::OrHash,
|
54
55
|
Anthropic::Beta::BetaToolComputerUse20241022::OrHash,
|
55
56
|
Anthropic::Beta::BetaToolComputerUse20250124::OrHash,
|
56
57
|
Anthropic::Beta::BetaToolTextEditor20241022::OrHash,
|
57
58
|
Anthropic::Beta::BetaToolTextEditor20250124::OrHash,
|
58
59
|
Anthropic::Beta::BetaToolTextEditor20250429::OrHash,
|
59
60
|
Anthropic::Beta::BetaToolTextEditor20250728::OrHash,
|
60
|
-
Anthropic::Beta::BetaWebSearchTool20250305::OrHash
|
61
|
+
Anthropic::Beta::BetaWebSearchTool20250305::OrHash,
|
62
|
+
Anthropic::Beta::BetaWebFetchTool20250910::OrHash
|
61
63
|
)
|
62
64
|
],
|
63
65
|
top_k: Integer,
|
@@ -133,30 +135,7 @@ module Anthropic
|
|
133
135
|
# { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
|
134
136
|
# ```
|
135
137
|
#
|
136
|
-
#
|
137
|
-
#
|
138
|
-
# ```json
|
139
|
-
# {
|
140
|
-
# "role": "user",
|
141
|
-
# "content": [
|
142
|
-
# {
|
143
|
-
# "type": "image",
|
144
|
-
# "source": {
|
145
|
-
# "type": "base64",
|
146
|
-
# "media_type": "image/jpeg",
|
147
|
-
# "data": "/9j/4AAQSkZJRg..."
|
148
|
-
# }
|
149
|
-
# },
|
150
|
-
# { "type": "text", "text": "What is in this image?" }
|
151
|
-
# ]
|
152
|
-
# }
|
153
|
-
# ```
|
154
|
-
#
|
155
|
-
# We currently support the `base64` source type for images, and the `image/jpeg`,
|
156
|
-
# `image/png`, `image/gif`, and `image/webp` media types.
|
157
|
-
#
|
158
|
-
# See [examples](https://docs.anthropic.com/en/api/messages-examples#vision) for
|
159
|
-
# more input examples.
|
138
|
+
# See [input examples](https://docs.anthropic.com/en/api/messages-examples).
|
160
139
|
#
|
161
140
|
# Note that if you want to include a
|
162
141
|
# [system prompt](https://docs.anthropic.com/en/docs/system-prompts), you can use
|
@@ -366,13 +345,15 @@ module Anthropic
|
|
366
345
|
Anthropic::Beta::BetaToolBash20241022::OrHash,
|
367
346
|
Anthropic::Beta::BetaToolBash20250124::OrHash,
|
368
347
|
Anthropic::Beta::BetaCodeExecutionTool20250522::OrHash,
|
348
|
+
Anthropic::Beta::BetaCodeExecutionTool20250825::OrHash,
|
369
349
|
Anthropic::Beta::BetaToolComputerUse20241022::OrHash,
|
370
350
|
Anthropic::Beta::BetaToolComputerUse20250124::OrHash,
|
371
351
|
Anthropic::Beta::BetaToolTextEditor20241022::OrHash,
|
372
352
|
Anthropic::Beta::BetaToolTextEditor20250124::OrHash,
|
373
353
|
Anthropic::Beta::BetaToolTextEditor20250429::OrHash,
|
374
354
|
Anthropic::Beta::BetaToolTextEditor20250728::OrHash,
|
375
|
-
Anthropic::Beta::BetaWebSearchTool20250305::OrHash
|
355
|
+
Anthropic::Beta::BetaWebSearchTool20250305::OrHash,
|
356
|
+
Anthropic::Beta::BetaWebFetchTool20250910::OrHash
|
376
357
|
)
|
377
358
|
],
|
378
359
|
top_k: Integer,
|
@@ -452,30 +433,7 @@ module Anthropic
|
|
452
433
|
# { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
|
453
434
|
# ```
|
454
435
|
#
|
455
|
-
#
|
456
|
-
#
|
457
|
-
# ```json
|
458
|
-
# {
|
459
|
-
# "role": "user",
|
460
|
-
# "content": [
|
461
|
-
# {
|
462
|
-
# "type": "image",
|
463
|
-
# "source": {
|
464
|
-
# "type": "base64",
|
465
|
-
# "media_type": "image/jpeg",
|
466
|
-
# "data": "/9j/4AAQSkZJRg..."
|
467
|
-
# }
|
468
|
-
# },
|
469
|
-
# { "type": "text", "text": "What is in this image?" }
|
470
|
-
# ]
|
471
|
-
# }
|
472
|
-
# ```
|
473
|
-
#
|
474
|
-
# We currently support the `base64` source type for images, and the `image/jpeg`,
|
475
|
-
# `image/png`, `image/gif`, and `image/webp` media types.
|
476
|
-
#
|
477
|
-
# See [examples](https://docs.anthropic.com/en/api/messages-examples#vision) for
|
478
|
-
# more input examples.
|
436
|
+
# See [input examples](https://docs.anthropic.com/en/api/messages-examples).
|
479
437
|
#
|
480
438
|
# Note that if you want to include a
|
481
439
|
# [system prompt](https://docs.anthropic.com/en/docs/system-prompts), you can use
|
@@ -677,13 +635,15 @@ module Anthropic
|
|
677
635
|
Anthropic::Beta::BetaToolBash20241022::OrHash,
|
678
636
|
Anthropic::Beta::BetaToolBash20250124::OrHash,
|
679
637
|
Anthropic::Beta::BetaCodeExecutionTool20250522::OrHash,
|
638
|
+
Anthropic::Beta::BetaCodeExecutionTool20250825::OrHash,
|
680
639
|
Anthropic::Beta::BetaToolComputerUse20241022::OrHash,
|
681
640
|
Anthropic::Beta::BetaToolComputerUse20250124::OrHash,
|
682
641
|
Anthropic::Beta::BetaToolTextEditor20241022::OrHash,
|
683
642
|
Anthropic::Beta::BetaToolTextEditor20250124::OrHash,
|
684
643
|
Anthropic::Beta::BetaToolTextEditor20250429::OrHash,
|
685
644
|
Anthropic::Beta::BetaToolTextEditor20250728::OrHash,
|
686
|
-
Anthropic::Beta::BetaWebSearchTool20250305::OrHash
|
645
|
+
Anthropic::Beta::BetaWebSearchTool20250305::OrHash,
|
646
|
+
Anthropic::Beta::BetaWebFetchTool20250910::OrHash
|
687
647
|
)
|
688
648
|
],
|
689
649
|
betas: T::Array[T.any(String, Anthropic::AnthropicBeta::OrSymbol)],
|
@@ -748,30 +708,7 @@ module Anthropic
|
|
748
708
|
# { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
|
749
709
|
# ```
|
750
710
|
#
|
751
|
-
#
|
752
|
-
#
|
753
|
-
# ```json
|
754
|
-
# {
|
755
|
-
# "role": "user",
|
756
|
-
# "content": [
|
757
|
-
# {
|
758
|
-
# "type": "image",
|
759
|
-
# "source": {
|
760
|
-
# "type": "base64",
|
761
|
-
# "media_type": "image/jpeg",
|
762
|
-
# "data": "/9j/4AAQSkZJRg..."
|
763
|
-
# }
|
764
|
-
# },
|
765
|
-
# { "type": "text", "text": "What is in this image?" }
|
766
|
-
# ]
|
767
|
-
# }
|
768
|
-
# ```
|
769
|
-
#
|
770
|
-
# We currently support the `base64` source type for images, and the `image/jpeg`,
|
771
|
-
# `image/png`, `image/gif`, and `image/webp` media types.
|
772
|
-
#
|
773
|
-
# See [examples](https://docs.anthropic.com/en/api/messages-examples#vision) for
|
774
|
-
# more input examples.
|
711
|
+
# See [input examples](https://docs.anthropic.com/en/api/messages-examples).
|
775
712
|
#
|
776
713
|
# Note that if you want to include a
|
777
714
|
# [system prompt](https://docs.anthropic.com/en/docs/system-prompts), you can use
|
@@ -120,30 +120,7 @@ module Anthropic
|
|
120
120
|
# { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
|
121
121
|
# ```
|
122
122
|
#
|
123
|
-
#
|
124
|
-
#
|
125
|
-
# ```json
|
126
|
-
# {
|
127
|
-
# "role": "user",
|
128
|
-
# "content": [
|
129
|
-
# {
|
130
|
-
# "type": "image",
|
131
|
-
# "source": {
|
132
|
-
# "type": "base64",
|
133
|
-
# "media_type": "image/jpeg",
|
134
|
-
# "data": "/9j/4AAQSkZJRg..."
|
135
|
-
# }
|
136
|
-
# },
|
137
|
-
# { "type": "text", "text": "What is in this image?" }
|
138
|
-
# ]
|
139
|
-
# }
|
140
|
-
# ```
|
141
|
-
#
|
142
|
-
# We currently support the `base64` source type for images, and the `image/jpeg`,
|
143
|
-
# `image/png`, `image/gif`, and `image/webp` media types.
|
144
|
-
#
|
145
|
-
# See [examples](https://docs.anthropic.com/en/api/messages-examples#vision) for
|
146
|
-
# more input examples.
|
123
|
+
# See [input examples](https://docs.anthropic.com/en/api/messages-examples).
|
147
124
|
#
|
148
125
|
# Note that if you want to include a
|
149
126
|
# [system prompt](https://docs.anthropic.com/en/docs/system-prompts), you can use
|
@@ -712,30 +689,7 @@ module Anthropic
|
|
712
689
|
# { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
|
713
690
|
# ```
|
714
691
|
#
|
715
|
-
#
|
716
|
-
#
|
717
|
-
# ```json
|
718
|
-
# {
|
719
|
-
# "role": "user",
|
720
|
-
# "content": [
|
721
|
-
# {
|
722
|
-
# "type": "image",
|
723
|
-
# "source": {
|
724
|
-
# "type": "base64",
|
725
|
-
# "media_type": "image/jpeg",
|
726
|
-
# "data": "/9j/4AAQSkZJRg..."
|
727
|
-
# }
|
728
|
-
# },
|
729
|
-
# { "type": "text", "text": "What is in this image?" }
|
730
|
-
# ]
|
731
|
-
# }
|
732
|
-
# ```
|
733
|
-
#
|
734
|
-
# We currently support the `base64` source type for images, and the `image/jpeg`,
|
735
|
-
# `image/png`, `image/gif`, and `image/webp` media types.
|
736
|
-
#
|
737
|
-
# See [examples](https://docs.anthropic.com/en/api/messages-examples#vision) for
|
738
|
-
# more input examples.
|
692
|
+
# See [input examples](https://docs.anthropic.com/en/api/messages-examples).
|
739
693
|
#
|
740
694
|
# Note that if you want to include a
|
741
695
|
# [system prompt](https://docs.anthropic.com/en/docs/system-prompts), you can use
|
@@ -991,30 +945,7 @@ module Anthropic
|
|
991
945
|
# { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
|
992
946
|
# ```
|
993
947
|
#
|
994
|
-
#
|
995
|
-
#
|
996
|
-
# ```json
|
997
|
-
# {
|
998
|
-
# "role": "user",
|
999
|
-
# "content": [
|
1000
|
-
# {
|
1001
|
-
# "type": "image",
|
1002
|
-
# "source": {
|
1003
|
-
# "type": "base64",
|
1004
|
-
# "media_type": "image/jpeg",
|
1005
|
-
# "data": "/9j/4AAQSkZJRg..."
|
1006
|
-
# }
|
1007
|
-
# },
|
1008
|
-
# { "type": "text", "text": "What is in this image?" }
|
1009
|
-
# ]
|
1010
|
-
# }
|
1011
|
-
# ```
|
1012
|
-
#
|
1013
|
-
# We currently support the `base64` source type for images, and the `image/jpeg`,
|
1014
|
-
# `image/png`, `image/gif`, and `image/webp` media types.
|
1015
|
-
#
|
1016
|
-
# See [examples](https://docs.anthropic.com/en/api/messages-examples#vision) for
|
1017
|
-
# more input examples.
|
948
|
+
# See [input examples](https://docs.anthropic.com/en/api/messages-examples).
|
1018
949
|
#
|
1019
950
|
# Note that if you want to include a
|
1020
951
|
# [system prompt](https://docs.anthropic.com/en/docs/system-prompts), you can use
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module Anthropic
|
2
|
+
module Models
|
3
|
+
class BetaBashCodeExecutionOutputBlock = Beta::BetaBashCodeExecutionOutputBlock
|
4
|
+
|
5
|
+
module Beta
|
6
|
+
type beta_bash_code_execution_output_block =
|
7
|
+
{ file_id: String, type: :bash_code_execution_output }
|
8
|
+
|
9
|
+
class BetaBashCodeExecutionOutputBlock < Anthropic::Internal::Type::BaseModel
|
10
|
+
attr_accessor file_id: String
|
11
|
+
|
12
|
+
attr_accessor type: :bash_code_execution_output
|
13
|
+
|
14
|
+
def initialize: (
|
15
|
+
file_id: String,
|
16
|
+
?type: :bash_code_execution_output
|
17
|
+
) -> void
|
18
|
+
|
19
|
+
def to_hash: -> { file_id: String, type: :bash_code_execution_output }
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module Anthropic
|
2
|
+
module Models
|
3
|
+
class BetaBashCodeExecutionOutputBlockParam = Beta::BetaBashCodeExecutionOutputBlockParam
|
4
|
+
|
5
|
+
module Beta
|
6
|
+
type beta_bash_code_execution_output_block_param =
|
7
|
+
{ file_id: String, type: :bash_code_execution_output }
|
8
|
+
|
9
|
+
class BetaBashCodeExecutionOutputBlockParam < Anthropic::Internal::Type::BaseModel
|
10
|
+
attr_accessor file_id: String
|
11
|
+
|
12
|
+
attr_accessor type: :bash_code_execution_output
|
13
|
+
|
14
|
+
def initialize: (
|
15
|
+
file_id: String,
|
16
|
+
?type: :bash_code_execution_output
|
17
|
+
) -> void
|
18
|
+
|
19
|
+
def to_hash: -> { file_id: String, type: :bash_code_execution_output }
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
module Anthropic
|
2
|
+
module Models
|
3
|
+
class BetaBashCodeExecutionResultBlock = Beta::BetaBashCodeExecutionResultBlock
|
4
|
+
|
5
|
+
module Beta
|
6
|
+
type beta_bash_code_execution_result_block =
|
7
|
+
{
|
8
|
+
content: ::Array[Anthropic::Beta::BetaBashCodeExecutionOutputBlock],
|
9
|
+
return_code: Integer,
|
10
|
+
stderr: String,
|
11
|
+
stdout: String,
|
12
|
+
type: :bash_code_execution_result
|
13
|
+
}
|
14
|
+
|
15
|
+
class BetaBashCodeExecutionResultBlock < Anthropic::Internal::Type::BaseModel
|
16
|
+
attr_accessor content: ::Array[Anthropic::Beta::BetaBashCodeExecutionOutputBlock]
|
17
|
+
|
18
|
+
attr_accessor return_code: Integer
|
19
|
+
|
20
|
+
attr_accessor stderr: String
|
21
|
+
|
22
|
+
attr_accessor stdout: String
|
23
|
+
|
24
|
+
attr_accessor type: :bash_code_execution_result
|
25
|
+
|
26
|
+
def initialize: (
|
27
|
+
content: ::Array[Anthropic::Beta::BetaBashCodeExecutionOutputBlock],
|
28
|
+
return_code: Integer,
|
29
|
+
stderr: String,
|
30
|
+
stdout: String,
|
31
|
+
?type: :bash_code_execution_result
|
32
|
+
) -> void
|
33
|
+
|
34
|
+
def to_hash: -> {
|
35
|
+
content: ::Array[Anthropic::Beta::BetaBashCodeExecutionOutputBlock],
|
36
|
+
return_code: Integer,
|
37
|
+
stderr: String,
|
38
|
+
stdout: String,
|
39
|
+
type: :bash_code_execution_result
|
40
|
+
}
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
module Anthropic
|
2
|
+
module Models
|
3
|
+
class BetaBashCodeExecutionResultBlockParam = Beta::BetaBashCodeExecutionResultBlockParam
|
4
|
+
|
5
|
+
module Beta
|
6
|
+
type beta_bash_code_execution_result_block_param =
|
7
|
+
{
|
8
|
+
content: ::Array[Anthropic::Beta::BetaBashCodeExecutionOutputBlockParam],
|
9
|
+
return_code: Integer,
|
10
|
+
stderr: String,
|
11
|
+
stdout: String,
|
12
|
+
type: :bash_code_execution_result
|
13
|
+
}
|
14
|
+
|
15
|
+
class BetaBashCodeExecutionResultBlockParam < Anthropic::Internal::Type::BaseModel
|
16
|
+
attr_accessor content: ::Array[Anthropic::Beta::BetaBashCodeExecutionOutputBlockParam]
|
17
|
+
|
18
|
+
attr_accessor return_code: Integer
|
19
|
+
|
20
|
+
attr_accessor stderr: String
|
21
|
+
|
22
|
+
attr_accessor stdout: String
|
23
|
+
|
24
|
+
attr_accessor type: :bash_code_execution_result
|
25
|
+
|
26
|
+
def initialize: (
|
27
|
+
content: ::Array[Anthropic::Beta::BetaBashCodeExecutionOutputBlockParam],
|
28
|
+
return_code: Integer,
|
29
|
+
stderr: String,
|
30
|
+
stdout: String,
|
31
|
+
?type: :bash_code_execution_result
|
32
|
+
) -> void
|
33
|
+
|
34
|
+
def to_hash: -> {
|
35
|
+
content: ::Array[Anthropic::Beta::BetaBashCodeExecutionOutputBlockParam],
|
36
|
+
return_code: Integer,
|
37
|
+
stderr: String,
|
38
|
+
stdout: String,
|
39
|
+
type: :bash_code_execution_result
|
40
|
+
}
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
module Anthropic
|
2
|
+
module Models
|
3
|
+
class BetaBashCodeExecutionToolResultBlock = Beta::BetaBashCodeExecutionToolResultBlock
|
4
|
+
|
5
|
+
module Beta
|
6
|
+
type beta_bash_code_execution_tool_result_block =
|
7
|
+
{
|
8
|
+
content: Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlock::content,
|
9
|
+
tool_use_id: String,
|
10
|
+
type: :bash_code_execution_tool_result
|
11
|
+
}
|
12
|
+
|
13
|
+
class BetaBashCodeExecutionToolResultBlock < Anthropic::Internal::Type::BaseModel
|
14
|
+
attr_accessor content: Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlock::content
|
15
|
+
|
16
|
+
attr_accessor tool_use_id: String
|
17
|
+
|
18
|
+
attr_accessor type: :bash_code_execution_tool_result
|
19
|
+
|
20
|
+
def initialize: (
|
21
|
+
content: Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlock::content,
|
22
|
+
tool_use_id: String,
|
23
|
+
?type: :bash_code_execution_tool_result
|
24
|
+
) -> void
|
25
|
+
|
26
|
+
def to_hash: -> {
|
27
|
+
content: Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlock::content,
|
28
|
+
tool_use_id: String,
|
29
|
+
type: :bash_code_execution_tool_result
|
30
|
+
}
|
31
|
+
|
32
|
+
type content =
|
33
|
+
Anthropic::Beta::BetaBashCodeExecutionToolResultError
|
34
|
+
| Anthropic::Beta::BetaBashCodeExecutionResultBlock
|
35
|
+
|
36
|
+
module Content
|
37
|
+
extend Anthropic::Internal::Type::Union
|
38
|
+
|
39
|
+
def self?.variants: -> ::Array[Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlock::content]
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
module Anthropic
|
2
|
+
module Models
|
3
|
+
class BetaBashCodeExecutionToolResultBlockParam = Beta::BetaBashCodeExecutionToolResultBlockParam
|
4
|
+
|
5
|
+
module Beta
|
6
|
+
type beta_bash_code_execution_tool_result_block_param =
|
7
|
+
{
|
8
|
+
content: Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlockParam::content,
|
9
|
+
tool_use_id: String,
|
10
|
+
type: :bash_code_execution_tool_result,
|
11
|
+
cache_control: Anthropic::Beta::BetaCacheControlEphemeral?
|
12
|
+
}
|
13
|
+
|
14
|
+
class BetaBashCodeExecutionToolResultBlockParam < Anthropic::Internal::Type::BaseModel
|
15
|
+
attr_accessor content: Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlockParam::content
|
16
|
+
|
17
|
+
attr_accessor tool_use_id: String
|
18
|
+
|
19
|
+
attr_accessor type: :bash_code_execution_tool_result
|
20
|
+
|
21
|
+
attr_accessor cache_control: Anthropic::Beta::BetaCacheControlEphemeral?
|
22
|
+
|
23
|
+
def initialize: (
|
24
|
+
content: Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlockParam::content,
|
25
|
+
tool_use_id: String,
|
26
|
+
?cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
|
27
|
+
?type: :bash_code_execution_tool_result
|
28
|
+
) -> void
|
29
|
+
|
30
|
+
def to_hash: -> {
|
31
|
+
content: Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlockParam::content,
|
32
|
+
tool_use_id: String,
|
33
|
+
type: :bash_code_execution_tool_result,
|
34
|
+
cache_control: Anthropic::Beta::BetaCacheControlEphemeral?
|
35
|
+
}
|
36
|
+
|
37
|
+
type content =
|
38
|
+
Anthropic::Beta::BetaBashCodeExecutionToolResultErrorParam
|
39
|
+
| Anthropic::Beta::BetaBashCodeExecutionResultBlockParam
|
40
|
+
|
41
|
+
module Content
|
42
|
+
extend Anthropic::Internal::Type::Union
|
43
|
+
|
44
|
+
def self?.variants: -> ::Array[Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlockParam::content]
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
module Anthropic
|
2
|
+
module Models
|
3
|
+
class BetaBashCodeExecutionToolResultError = Beta::BetaBashCodeExecutionToolResultError
|
4
|
+
|
5
|
+
module Beta
|
6
|
+
type beta_bash_code_execution_tool_result_error =
|
7
|
+
{
|
8
|
+
error_code: Anthropic::Models::Beta::BetaBashCodeExecutionToolResultError::error_code,
|
9
|
+
type: :bash_code_execution_tool_result_error
|
10
|
+
}
|
11
|
+
|
12
|
+
class BetaBashCodeExecutionToolResultError < Anthropic::Internal::Type::BaseModel
|
13
|
+
attr_accessor error_code: Anthropic::Models::Beta::BetaBashCodeExecutionToolResultError::error_code
|
14
|
+
|
15
|
+
attr_accessor type: :bash_code_execution_tool_result_error
|
16
|
+
|
17
|
+
def initialize: (
|
18
|
+
error_code: Anthropic::Models::Beta::BetaBashCodeExecutionToolResultError::error_code,
|
19
|
+
?type: :bash_code_execution_tool_result_error
|
20
|
+
) -> void
|
21
|
+
|
22
|
+
def to_hash: -> {
|
23
|
+
error_code: Anthropic::Models::Beta::BetaBashCodeExecutionToolResultError::error_code,
|
24
|
+
type: :bash_code_execution_tool_result_error
|
25
|
+
}
|
26
|
+
|
27
|
+
type error_code =
|
28
|
+
:invalid_tool_input
|
29
|
+
| :unavailable
|
30
|
+
| :too_many_requests
|
31
|
+
| :execution_time_exceeded
|
32
|
+
| :output_file_too_large
|
33
|
+
|
34
|
+
module ErrorCode
|
35
|
+
extend Anthropic::Internal::Type::Enum
|
36
|
+
|
37
|
+
INVALID_TOOL_INPUT: :invalid_tool_input
|
38
|
+
UNAVAILABLE: :unavailable
|
39
|
+
TOO_MANY_REQUESTS: :too_many_requests
|
40
|
+
EXECUTION_TIME_EXCEEDED: :execution_time_exceeded
|
41
|
+
OUTPUT_FILE_TOO_LARGE: :output_file_too_large
|
42
|
+
|
43
|
+
def self?.values: -> ::Array[Anthropic::Models::Beta::BetaBashCodeExecutionToolResultError::error_code]
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
module Anthropic
|
2
|
+
module Models
|
3
|
+
class BetaBashCodeExecutionToolResultErrorParam = Beta::BetaBashCodeExecutionToolResultErrorParam
|
4
|
+
|
5
|
+
module Beta
|
6
|
+
type beta_bash_code_execution_tool_result_error_param =
|
7
|
+
{
|
8
|
+
error_code: Anthropic::Models::Beta::BetaBashCodeExecutionToolResultErrorParam::error_code,
|
9
|
+
type: :bash_code_execution_tool_result_error
|
10
|
+
}
|
11
|
+
|
12
|
+
class BetaBashCodeExecutionToolResultErrorParam < Anthropic::Internal::Type::BaseModel
|
13
|
+
attr_accessor error_code: Anthropic::Models::Beta::BetaBashCodeExecutionToolResultErrorParam::error_code
|
14
|
+
|
15
|
+
attr_accessor type: :bash_code_execution_tool_result_error
|
16
|
+
|
17
|
+
def initialize: (
|
18
|
+
error_code: Anthropic::Models::Beta::BetaBashCodeExecutionToolResultErrorParam::error_code,
|
19
|
+
?type: :bash_code_execution_tool_result_error
|
20
|
+
) -> void
|
21
|
+
|
22
|
+
def to_hash: -> {
|
23
|
+
error_code: Anthropic::Models::Beta::BetaBashCodeExecutionToolResultErrorParam::error_code,
|
24
|
+
type: :bash_code_execution_tool_result_error
|
25
|
+
}
|
26
|
+
|
27
|
+
type error_code =
|
28
|
+
:invalid_tool_input
|
29
|
+
| :unavailable
|
30
|
+
| :too_many_requests
|
31
|
+
| :execution_time_exceeded
|
32
|
+
| :output_file_too_large
|
33
|
+
|
34
|
+
module ErrorCode
|
35
|
+
extend Anthropic::Internal::Type::Enum
|
36
|
+
|
37
|
+
INVALID_TOOL_INPUT: :invalid_tool_input
|
38
|
+
UNAVAILABLE: :unavailable
|
39
|
+
TOO_MANY_REQUESTS: :too_many_requests
|
40
|
+
EXECUTION_TIME_EXCEEDED: :execution_time_exceeded
|
41
|
+
OUTPUT_FILE_TOO_LARGE: :output_file_too_large
|
42
|
+
|
43
|
+
def self?.values: -> ::Array[Anthropic::Models::Beta::BetaBashCodeExecutionToolResultErrorParam::error_code]
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Anthropic
|
2
|
+
module Models
|
3
|
+
class BetaCitationConfig = Beta::BetaCitationConfig
|
4
|
+
|
5
|
+
module Beta
|
6
|
+
type beta_citation_config = { enabled: bool }
|
7
|
+
|
8
|
+
class BetaCitationConfig < Anthropic::Internal::Type::BaseModel
|
9
|
+
attr_accessor enabled: bool
|
10
|
+
|
11
|
+
def initialize: (enabled: bool) -> void
|
12
|
+
|
13
|
+
def to_hash: -> { enabled: bool }
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|