anthropic 1.1.1 → 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 +170 -0
- data/README.md +32 -16
- data/lib/anthropic/client.rb +5 -2
- data/lib/anthropic/errors.rb +22 -0
- data/lib/anthropic/helpers/bedrock/client.rb +34 -4
- 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/events.rb +141 -0
- data/lib/anthropic/helpers/streaming/message_stream.rb +278 -0
- data/lib/anthropic/helpers/streaming.rb +37 -0
- data/lib/anthropic/helpers/vertex/client.rb +4 -1
- data/lib/anthropic/input_schema.rb +10 -0
- data/lib/anthropic/internal/stream.rb +6 -3
- data/lib/anthropic/internal/transport/base_client.rb +30 -5
- data/lib/anthropic/internal/transport/pooled_net_requester.rb +1 -9
- data/lib/anthropic/internal/type/array_of.rb +7 -1
- data/lib/anthropic/internal/type/base_model.rb +81 -32
- data/lib/anthropic/internal/type/base_stream.rb +3 -1
- data/lib/anthropic/internal/type/boolean.rb +7 -1
- data/lib/anthropic/internal/type/converter.rb +69 -34
- data/lib/anthropic/internal/type/enum.rb +16 -5
- data/lib/anthropic/internal/type/file_input.rb +6 -1
- data/lib/anthropic/internal/type/hash_of.rb +7 -1
- data/lib/anthropic/internal/type/union.rb +26 -16
- data/lib/anthropic/internal/type/unknown.rb +7 -1
- data/lib/anthropic/internal/util.rb +10 -11
- data/lib/anthropic/models/anthropic_beta.rb +3 -0
- data/lib/anthropic/models/beta/beta_base64_pdf_block.rb +1 -65
- 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_char_location.rb +7 -1
- data/lib/anthropic/models/beta/beta_citation_config.rb +19 -0
- data/lib/anthropic/models/beta/beta_citation_content_block_location.rb +7 -1
- data/lib/anthropic/models/beta/beta_citation_page_location.rb +7 -1
- data/lib/anthropic/models/beta/beta_citation_search_result_location.rb +55 -0
- data/lib/anthropic/models/beta/beta_citation_search_result_location_param.rb +55 -0
- data/lib/anthropic/models/beta/beta_citations_delta.rb +5 -3
- data/lib/anthropic/models/beta/beta_code_execution_tool_20250825.rb +40 -0
- data/lib/anthropic/models/beta/beta_content_block.rb +12 -5
- data/lib/anthropic/models/beta/beta_content_block_param.rb +28 -17
- data/lib/anthropic/models/beta/beta_document_block.rb +56 -0
- data/lib/anthropic/models/beta/beta_message.rb +6 -2
- data/lib/anthropic/models/beta/beta_message_param.rb +3 -3
- data/lib/anthropic/models/beta/beta_raw_content_block_start_event.rb +14 -7
- data/lib/anthropic/models/beta/beta_request_document_block.rb +75 -0
- data/lib/anthropic/models/beta/beta_search_result_block_param.rb +55 -0
- 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_block.rb +2 -2
- data/lib/anthropic/models/beta/beta_text_block_param.rb +2 -2
- data/lib/anthropic/models/beta/beta_text_citation.rb +3 -1
- data/lib/anthropic/models/beta/beta_text_citation_param.rb +3 -1
- 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.rb +7 -1
- data/lib/anthropic/models/beta/beta_tool_result_block_param.rb +8 -4
- data/lib/anthropic/models/beta/beta_tool_text_editor_20250728.rb +49 -0
- data/lib/anthropic/models/beta/beta_tool_union.rb +12 -6
- 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 +23 -36
- data/lib/anthropic/models/beta/message_create_params.rb +10 -27
- data/lib/anthropic/models/beta/messages/batch_create_params.rb +13 -37
- 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/cache_control_ephemeral.rb +39 -1
- data/lib/anthropic/models/cache_creation.rb +24 -0
- data/lib/anthropic/models/citation_char_location.rb +7 -1
- data/lib/anthropic/models/citation_content_block_location.rb +7 -1
- data/lib/anthropic/models/citation_page_location.rb +7 -1
- data/lib/anthropic/models/citation_search_result_location_param.rb +51 -0
- data/lib/anthropic/models/citations_delta.rb +5 -3
- data/lib/anthropic/models/citations_search_result_location.rb +51 -0
- data/lib/anthropic/models/content_block.rb +5 -5
- data/lib/anthropic/models/content_block_param.rb +14 -11
- data/lib/anthropic/models/document_block_param.rb +2 -2
- data/lib/anthropic/models/error_response.rb +7 -1
- data/lib/anthropic/models/message.rb +6 -2
- data/lib/anthropic/models/message_count_tokens_params.rb +10 -27
- data/lib/anthropic/models/message_count_tokens_tool.rb +5 -1
- data/lib/anthropic/models/message_create_params.rb +10 -27
- data/lib/anthropic/models/message_param.rb +3 -3
- data/lib/anthropic/models/messages/batch_create_params.rb +11 -31
- data/lib/anthropic/models/model.rb +16 -21
- data/lib/anthropic/models/raw_content_block_start_event.rb +7 -7
- data/lib/anthropic/models/search_result_block_param.rb +51 -0
- data/lib/anthropic/models/text_block.rb +2 -2
- data/lib/anthropic/models/text_block_param.rb +2 -2
- data/lib/anthropic/models/text_citation.rb +3 -1
- data/lib/anthropic/models/text_citation_param.rb +3 -1
- data/lib/anthropic/models/tool.rb +7 -1
- data/lib/anthropic/models/tool_result_block_param.rb +8 -4
- data/lib/anthropic/models/tool_text_editor_20250429.rb +36 -0
- data/lib/anthropic/models/tool_text_editor_20250728.rb +45 -0
- data/lib/anthropic/models/tool_union.rb +5 -1
- data/lib/anthropic/models/tool_use_block.rb +14 -0
- data/lib/anthropic/models/usage.rb +9 -1
- data/lib/anthropic/models.rb +16 -4
- data/lib/anthropic/resources/beta/messages.rb +73 -6
- data/lib/anthropic/resources/messages.rb +152 -7
- data/lib/anthropic/streaming.rb +5 -0
- data/lib/anthropic/version.rb +1 -1
- data/lib/anthropic.rb +54 -0
- data/rbi/anthropic/errors.rbi +18 -2
- data/rbi/anthropic/helpers/bedrock/client.rbi +17 -6
- 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/streaming/events.rbi +95 -0
- data/rbi/anthropic/helpers/streaming/message_stream.rbi +73 -0
- data/rbi/anthropic/helpers/structured_output.rbi +16 -0
- data/rbi/anthropic/helpers/vertex/client.rbi +17 -6
- data/rbi/anthropic/input_schema.rbi +12 -0
- data/rbi/anthropic/internal/transport/base_client.rbi +1 -1
- data/rbi/anthropic/internal/type/base_stream.rbi +8 -1
- data/rbi/anthropic/internal/type/boolean.rbi +2 -0
- data/rbi/anthropic/internal/type/converter.rbi +69 -15
- data/rbi/anthropic/internal/type/union.rbi +14 -2
- data/rbi/anthropic/internal/type/unknown.rbi +2 -0
- data/rbi/anthropic/internal/util.rbi +2 -0
- data/rbi/anthropic/models/anthropic_beta.rbi +2 -0
- data/rbi/anthropic/models/beta/beta_base64_pdf_block.rbi +1 -128
- 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_char_location.rbi +6 -0
- data/rbi/anthropic/models/beta/beta_citation_config.rbi +30 -0
- data/rbi/anthropic/models/beta/beta_citation_content_block_location.rbi +6 -0
- data/rbi/anthropic/models/beta/beta_citation_page_location.rbi +6 -0
- data/rbi/anthropic/models/beta/beta_citation_search_result_location.rbi +78 -0
- data/rbi/anthropic/models/beta/beta_citation_search_result_location_param.rbi +79 -0
- data/rbi/anthropic/models/beta/beta_citations_delta.rbi +4 -2
- data/rbi/anthropic/models/beta/beta_code_execution_tool_20250825.rbi +72 -0
- data/rbi/anthropic/models/beta/beta_content_block.rbi +6 -3
- data/rbi/anthropic/models/beta/beta_content_block_param.rbi +11 -7
- data/rbi/anthropic/models/beta/beta_document_block.rbi +95 -0
- data/rbi/anthropic/models/beta/beta_message.rbi +14 -3
- data/rbi/anthropic/models/beta/beta_raw_content_block_start_event.rbi +12 -6
- data/rbi/anthropic/models/beta/beta_request_document_block.rbi +142 -0
- data/rbi/anthropic/models/beta/beta_search_result_block_param.rbi +91 -0
- 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_block.rbi +2 -1
- data/rbi/anthropic/models/beta/beta_text_block_param.rbi +6 -3
- data/rbi/anthropic/models/beta/beta_text_citation.rbi +2 -1
- data/rbi/anthropic/models/beta/beta_text_citation_param.rbi +2 -1
- 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.rbi +14 -5
- data/rbi/anthropic/models/beta/beta_tool_result_block_param.rbi +3 -1
- data/rbi/anthropic/models/beta/beta_tool_text_editor_20250728.rbi +82 -0
- data/rbi/anthropic/models/beta/beta_tool_union.rbi +7 -4
- 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 +51 -70
- data/rbi/anthropic/models/beta/message_create_params.rbi +44 -66
- data/rbi/anthropic/models/beta/messages/batch_create_params.rbi +44 -66
- data/rbi/anthropic/models/beta_error_response.rbi +10 -2
- data/rbi/anthropic/models/cache_control_ephemeral.rbi +68 -3
- data/rbi/anthropic/models/cache_creation.rbi +45 -0
- data/rbi/anthropic/models/citation_char_location.rbi +6 -0
- data/rbi/anthropic/models/citation_content_block_location.rbi +6 -0
- data/rbi/anthropic/models/citation_page_location.rbi +6 -0
- data/rbi/anthropic/models/citation_search_result_location_param.rbi +74 -0
- data/rbi/anthropic/models/citations_delta.rbi +4 -2
- data/rbi/anthropic/models/citations_search_result_location.rbi +74 -0
- data/rbi/anthropic/models/content_block.rbi +3 -3
- data/rbi/anthropic/models/content_block_param.rbi +6 -5
- data/rbi/anthropic/models/document_block_param.rbi +7 -3
- data/rbi/anthropic/models/error_response.rbi +10 -2
- data/rbi/anthropic/models/message.rbi +11 -3
- data/rbi/anthropic/models/message_count_tokens_params.rbi +24 -50
- data/rbi/anthropic/models/message_count_tokens_tool.rbi +2 -0
- data/rbi/anthropic/models/message_create_params.rbi +24 -50
- data/rbi/anthropic/models/messages/batch_create_params.rbi +24 -50
- data/rbi/anthropic/models/model.rbi +4 -8
- data/rbi/anthropic/models/raw_content_block_start_event.rbi +6 -6
- data/rbi/anthropic/models/search_result_block_param.rbi +77 -0
- data/rbi/anthropic/models/text_block.rbi +2 -1
- data/rbi/anthropic/models/text_block_param.rbi +6 -3
- data/rbi/anthropic/models/text_citation.rbi +2 -1
- data/rbi/anthropic/models/text_citation_param.rbi +2 -1
- data/rbi/anthropic/models/tool.rbi +16 -5
- data/rbi/anthropic/models/tool_result_block_param.rbi +6 -1
- data/rbi/anthropic/models/tool_text_editor_20250429.rbi +62 -0
- data/rbi/anthropic/models/tool_text_editor_20250728.rbi +72 -0
- data/rbi/anthropic/models/tool_union.rbi +2 -0
- data/rbi/anthropic/models/usage.rbi +13 -0
- data/rbi/anthropic/models.rbi +14 -0
- data/rbi/anthropic/resources/beta/messages.rbi +45 -87
- data/rbi/anthropic/resources/messages.rbi +315 -69
- data/rbi/anthropic/streaming.rbi +5 -0
- data/sig/anthropic/errors.rbs +9 -0
- data/sig/anthropic/helpers/streaming/events.rbs +117 -0
- data/sig/anthropic/helpers/streaming/message_stream.rbs +57 -0
- data/sig/anthropic/internal/transport/base_client.rbs +1 -1
- data/sig/anthropic/internal/type/base_stream.rbs +4 -0
- data/sig/anthropic/internal/type/converter.rbs +24 -1
- data/sig/anthropic/internal/type/union.rbs +2 -2
- data/sig/anthropic/models/anthropic_beta.rbs +2 -0
- data/sig/anthropic/models/beta/beta_base64_pdf_block.rbs +1 -58
- 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_char_location.rbs +5 -0
- data/sig/anthropic/models/beta/beta_citation_config.rbs +17 -0
- data/sig/anthropic/models/beta/beta_citation_content_block_location.rbs +5 -0
- data/sig/anthropic/models/beta/beta_citation_page_location.rbs +5 -0
- data/sig/anthropic/models/beta/beta_citation_search_result_location.rbs +54 -0
- data/sig/anthropic/models/beta/beta_citation_search_result_location_param.rbs +54 -0
- data/sig/anthropic/models/beta/beta_citations_delta.rbs +1 -0
- data/sig/anthropic/models/beta/beta_code_execution_tool_20250825.rbs +34 -0
- data/sig/anthropic/models/beta/beta_content_block.rbs +5 -2
- data/sig/anthropic/models/beta/beta_content_block_param.rbs +12 -8
- data/sig/anthropic/models/beta/beta_document_block.rbs +49 -0
- data/sig/anthropic/models/beta/beta_raw_content_block_start_event.rbs +5 -2
- data/sig/anthropic/models/beta/beta_request_document_block.rbs +62 -0
- data/sig/anthropic/models/beta/beta_search_result_block_param.rbs +53 -0
- 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_citation.rbs +1 -0
- data/sig/anthropic/models/beta/beta_text_citation_param.rbs +1 -0
- 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.rbs +14 -3
- data/sig/anthropic/models/beta/beta_tool_result_block_param.rbs +2 -0
- data/sig/anthropic/models/beta/beta_tool_text_editor_20250728.rbs +39 -0
- data/sig/anthropic/models/beta/beta_tool_union.rbs +7 -4
- 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 +7 -4
- data/sig/anthropic/models/beta_error_response.rbs +13 -2
- data/sig/anthropic/models/cache_control_ephemeral.rbs +27 -3
- data/sig/anthropic/models/cache_creation.rbs +25 -0
- data/sig/anthropic/models/citation_char_location.rbs +5 -0
- data/sig/anthropic/models/citation_content_block_location.rbs +5 -0
- data/sig/anthropic/models/citation_page_location.rbs +5 -0
- data/sig/anthropic/models/citation_search_result_location_param.rbs +50 -0
- data/sig/anthropic/models/citations_delta.rbs +1 -0
- data/sig/anthropic/models/citations_search_result_location.rbs +50 -0
- data/sig/anthropic/models/content_block.rbs +2 -2
- data/sig/anthropic/models/content_block_param.rbs +6 -5
- data/sig/anthropic/models/document_block_param.rbs +4 -8
- data/sig/anthropic/models/error_response.rbs +13 -2
- data/sig/anthropic/models/message_count_tokens_tool.rbs +2 -0
- data/sig/anthropic/models/model.rbs +4 -10
- data/sig/anthropic/models/raw_content_block_start_event.rbs +2 -2
- data/sig/anthropic/models/search_result_block_param.rbs +49 -0
- data/sig/anthropic/models/text_citation.rbs +1 -0
- data/sig/anthropic/models/text_citation_param.rbs +1 -0
- data/sig/anthropic/models/tool.rbs +14 -3
- data/sig/anthropic/models/tool_result_block_param.rbs +5 -1
- data/sig/anthropic/models/tool_text_editor_20250429.rbs +30 -0
- data/sig/anthropic/models/tool_text_editor_20250728.rbs +35 -0
- data/sig/anthropic/models/tool_union.rbs +2 -0
- data/sig/anthropic/models/usage.rbs +5 -0
- data/sig/anthropic/models.rbs +12 -0
- data/sig/anthropic/streaming.rbs +3 -0
- metadata +152 -3
@@ -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,37 +66,14 @@ 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
|
96
73
|
# the top-level `system` parameter — there is no `"system"` role for input
|
97
74
|
# messages in the Messages API.
|
98
75
|
#
|
99
|
-
# There is a limit of
|
76
|
+
# There is a limit of 100,000 messages in a single request.
|
100
77
|
#
|
101
78
|
# @return [Array<Anthropic::Models::Beta::BetaMessageParam>]
|
102
79
|
required :messages, -> { Anthropic::Internal::Type::ArrayOf[Anthropic::Beta::BetaMessageParam] }
|
@@ -155,6 +132,12 @@ module Anthropic
|
|
155
132
|
# those tools using the tool input generated by the model and then optionally
|
156
133
|
# return results back to the model using `tool_result` content blocks.
|
157
134
|
#
|
135
|
+
# There are two types of tools: **client tools** and **server tools**. The
|
136
|
+
# behavior described below applies to client tools. For
|
137
|
+
# [server tools](https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/overview#server-tools),
|
138
|
+
# see their individual documentation as each has its own behavior (e.g., the
|
139
|
+
# [web search tool](https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/web-search-tool)).
|
140
|
+
#
|
158
141
|
# Each tool definition includes:
|
159
142
|
#
|
160
143
|
# - `name`: Name of the tool.
|
@@ -218,11 +201,9 @@ module Anthropic
|
|
218
201
|
#
|
219
202
|
# See our [guide](https://docs.anthropic.com/en/docs/tool-use) for more details.
|
220
203
|
#
|
221
|
-
# @return [Array<Anthropic::Models::Beta::BetaTool, Anthropic::Models::Beta::
|
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]
|
222
205
|
optional :tools,
|
223
|
-
-> {
|
224
|
-
Anthropic::Internal::Type::ArrayOf[union: Anthropic::Beta::MessageCountTokensParams::Tool]
|
225
|
-
}
|
206
|
+
-> { Anthropic::Internal::Type::ArrayOf[union: Anthropic::Beta::MessageCountTokensParams::Tool] }
|
226
207
|
|
227
208
|
# @!attribute betas
|
228
209
|
# Optional header to specify the beta version(s) you want to use.
|
@@ -246,7 +227,7 @@ module Anthropic
|
|
246
227
|
#
|
247
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,
|
248
229
|
#
|
249
|
-
# @param tools [Array<Anthropic::Models::Beta::BetaTool, Anthropic::Models::Beta::
|
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.
|
250
231
|
#
|
251
232
|
# @param betas [Array<String, Symbol, Anthropic::Models::AnthropicBeta>] Optional header to specify the beta version(s) you want to use.
|
252
233
|
#
|
@@ -278,26 +259,32 @@ module Anthropic
|
|
278
259
|
|
279
260
|
variant -> { Anthropic::Beta::BetaTool }
|
280
261
|
|
281
|
-
variant -> { Anthropic::Beta::BetaToolComputerUse20241022 }
|
282
|
-
|
283
262
|
variant -> { Anthropic::Beta::BetaToolBash20241022 }
|
284
263
|
|
285
|
-
variant -> { Anthropic::Beta::
|
264
|
+
variant -> { Anthropic::Beta::BetaToolBash20250124 }
|
265
|
+
|
266
|
+
variant -> { Anthropic::Beta::BetaCodeExecutionTool20250522 }
|
267
|
+
|
268
|
+
variant -> { Anthropic::Beta::BetaCodeExecutionTool20250825 }
|
269
|
+
|
270
|
+
variant -> { Anthropic::Beta::BetaToolComputerUse20241022 }
|
286
271
|
|
287
272
|
variant -> { Anthropic::Beta::BetaToolComputerUse20250124 }
|
288
273
|
|
289
|
-
variant -> { Anthropic::Beta::
|
274
|
+
variant -> { Anthropic::Beta::BetaToolTextEditor20241022 }
|
290
275
|
|
291
276
|
variant -> { Anthropic::Beta::BetaToolTextEditor20250124 }
|
292
277
|
|
293
278
|
variant -> { Anthropic::Beta::BetaToolTextEditor20250429 }
|
294
279
|
|
280
|
+
variant -> { Anthropic::Beta::BetaToolTextEditor20250728 }
|
281
|
+
|
295
282
|
variant -> { Anthropic::Beta::BetaWebSearchTool20250305 }
|
296
283
|
|
297
|
-
variant -> { Anthropic::Beta::
|
284
|
+
variant -> { Anthropic::Beta::BetaWebFetchTool20250910 }
|
298
285
|
|
299
286
|
# @!method self.variants
|
300
|
-
# @return [Array(Anthropic::Models::Beta::BetaTool, Anthropic::Models::Beta::
|
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)]
|
301
288
|
end
|
302
289
|
end
|
303
290
|
end
|
@@ -80,37 +80,14 @@ 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
|
110
87
|
# the top-level `system` parameter — there is no `"system"` role for input
|
111
88
|
# messages in the Messages API.
|
112
89
|
#
|
113
|
-
# There is a limit of
|
90
|
+
# There is a limit of 100,000 messages in a single request.
|
114
91
|
#
|
115
92
|
# @return [Array<Anthropic::Models::Beta::BetaMessageParam>]
|
116
93
|
required :messages, -> { Anthropic::Internal::Type::ArrayOf[Anthropic::Beta::BetaMessageParam] }
|
@@ -218,6 +195,12 @@ module Anthropic
|
|
218
195
|
# those tools using the tool input generated by the model and then optionally
|
219
196
|
# return results back to the model using `tool_result` content blocks.
|
220
197
|
#
|
198
|
+
# There are two types of tools: **client tools** and **server tools**. The
|
199
|
+
# behavior described below applies to client tools. For
|
200
|
+
# [server tools](https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/overview#server-tools),
|
201
|
+
# see their individual documentation as each has its own behavior (e.g., the
|
202
|
+
# [web search tool](https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/web-search-tool)).
|
203
|
+
#
|
221
204
|
# Each tool definition includes:
|
222
205
|
#
|
223
206
|
# - `name`: Name of the tool.
|
@@ -281,7 +264,7 @@ module Anthropic
|
|
281
264
|
#
|
282
265
|
# See our [guide](https://docs.anthropic.com/en/docs/tool-use) for more details.
|
283
266
|
#
|
284
|
-
# @return [Array<Anthropic::Models::Beta::BetaTool, Anthropic::Models::Beta::
|
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]
|
285
268
|
optional :tools, -> { Anthropic::Internal::Type::ArrayOf[union: Anthropic::Beta::BetaToolUnion] }
|
286
269
|
|
287
270
|
# @!attribute top_k
|
@@ -344,7 +327,7 @@ module Anthropic
|
|
344
327
|
#
|
345
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,
|
346
329
|
#
|
347
|
-
# @param tools [Array<Anthropic::Models::Beta::BetaTool, Anthropic::Models::Beta::
|
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.
|
348
331
|
#
|
349
332
|
# @param top_k [Integer] Only sample from the top K options for each subsequent token.
|
350
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,37 +133,14 @@ 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
|
165
140
|
# the top-level `system` parameter — there is no `"system"` role for input
|
166
141
|
# messages in the Messages API.
|
167
142
|
#
|
168
|
-
# There is a limit of
|
143
|
+
# There is a limit of 100,000 messages in a single request.
|
169
144
|
#
|
170
145
|
# @return [Array<Anthropic::Models::Beta::BetaMessageParam>]
|
171
146
|
required :messages, -> { Anthropic::Internal::Type::ArrayOf[Anthropic::Beta::BetaMessageParam] }
|
@@ -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.
|
@@ -287,6 +260,12 @@ module Anthropic
|
|
287
260
|
# those tools using the tool input generated by the model and then optionally
|
288
261
|
# return results back to the model using `tool_result` content blocks.
|
289
262
|
#
|
263
|
+
# There are two types of tools: **client tools** and **server tools**. The
|
264
|
+
# behavior described below applies to client tools. For
|
265
|
+
# [server tools](https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/overview#server-tools),
|
266
|
+
# see their individual documentation as each has its own behavior (e.g., the
|
267
|
+
# [web search tool](https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/web-search-tool)).
|
268
|
+
#
|
290
269
|
# Each tool definition includes:
|
291
270
|
#
|
292
271
|
# - `name`: Name of the tool.
|
@@ -350,11 +329,8 @@ module Anthropic
|
|
350
329
|
#
|
351
330
|
# See our [guide](https://docs.anthropic.com/en/docs/tool-use) for more details.
|
352
331
|
#
|
353
|
-
# @return [Array<Anthropic::Models::Beta::BetaTool, Anthropic::Models::Beta::
|
354
|
-
optional :tools,
|
355
|
-
-> {
|
356
|
-
Anthropic::Internal::Type::ArrayOf[union: Anthropic::Beta::BetaToolUnion]
|
357
|
-
}
|
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] }
|
358
334
|
|
359
335
|
# @!attribute top_k
|
360
336
|
# Only sample from the top K options for each subsequent token.
|
@@ -418,7 +394,7 @@ module Anthropic
|
|
418
394
|
#
|
419
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,
|
420
396
|
#
|
421
|
-
# @param tools [Array<Anthropic::Models::Beta::BetaTool, Anthropic::Models::Beta::
|
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.
|
422
398
|
#
|
423
399
|
# @param top_k [Integer] Only sample from the top K options for each subsequent token.
|
424
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
|
@@ -8,8 +8,46 @@ module Anthropic
|
|
8
8
|
# @return [Symbol, :ephemeral]
|
9
9
|
required :type, const: :ephemeral
|
10
10
|
|
11
|
-
# @!
|
11
|
+
# @!attribute ttl
|
12
|
+
# The time-to-live for the cache control breakpoint.
|
13
|
+
#
|
14
|
+
# This may be one the following values:
|
15
|
+
#
|
16
|
+
# - `5m`: 5 minutes
|
17
|
+
# - `1h`: 1 hour
|
18
|
+
#
|
19
|
+
# Defaults to `5m`.
|
20
|
+
#
|
21
|
+
# @return [Symbol, Anthropic::Models::CacheControlEphemeral::TTL, nil]
|
22
|
+
optional :ttl, enum: -> { Anthropic::CacheControlEphemeral::TTL }
|
23
|
+
|
24
|
+
# @!method initialize(ttl: nil, type: :ephemeral)
|
25
|
+
# Some parameter documentations has been truncated, see
|
26
|
+
# {Anthropic::Models::CacheControlEphemeral} for more details.
|
27
|
+
#
|
28
|
+
# @param ttl [Symbol, Anthropic::Models::CacheControlEphemeral::TTL] The time-to-live for the cache control breakpoint.
|
29
|
+
#
|
12
30
|
# @param type [Symbol, :ephemeral]
|
31
|
+
|
32
|
+
# The time-to-live for the cache control breakpoint.
|
33
|
+
#
|
34
|
+
# This may be one the following values:
|
35
|
+
#
|
36
|
+
# - `5m`: 5 minutes
|
37
|
+
# - `1h`: 1 hour
|
38
|
+
#
|
39
|
+
# Defaults to `5m`.
|
40
|
+
#
|
41
|
+
# @see Anthropic::Models::CacheControlEphemeral#ttl
|
42
|
+
module TTL
|
43
|
+
extend Anthropic::Internal::Type::Enum
|
44
|
+
|
45
|
+
TTL_5M = :"5m"
|
46
|
+
TTL_1H = :"1h"
|
47
|
+
|
48
|
+
# @!method self.values
|
49
|
+
# @return [Array<Symbol>]
|
50
|
+
end
|
13
51
|
end
|
14
52
|
end
|
15
53
|
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Anthropic
|
4
|
+
module Models
|
5
|
+
class CacheCreation < Anthropic::Internal::Type::BaseModel
|
6
|
+
# @!attribute ephemeral_1h_input_tokens
|
7
|
+
# The number of input tokens used to create the 1 hour cache entry.
|
8
|
+
#
|
9
|
+
# @return [Integer]
|
10
|
+
required :ephemeral_1h_input_tokens, Integer
|
11
|
+
|
12
|
+
# @!attribute ephemeral_5m_input_tokens
|
13
|
+
# The number of input tokens used to create the 5 minute cache entry.
|
14
|
+
#
|
15
|
+
# @return [Integer]
|
16
|
+
required :ephemeral_5m_input_tokens, Integer
|
17
|
+
|
18
|
+
# @!method initialize(ephemeral_1h_input_tokens:, ephemeral_5m_input_tokens:)
|
19
|
+
# @param ephemeral_1h_input_tokens [Integer] The number of input tokens used to create the 1 hour cache entry.
|
20
|
+
#
|
21
|
+
# @param ephemeral_5m_input_tokens [Integer] The number of input tokens used to create the 5 minute cache entry.
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|