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,32 @@
|
|
1
|
+
module Anthropic
|
2
|
+
module Models
|
3
|
+
module BetaWebFetchToolResultErrorCode = Beta::BetaWebFetchToolResultErrorCode
|
4
|
+
|
5
|
+
module Beta
|
6
|
+
type beta_web_fetch_tool_result_error_code =
|
7
|
+
:invalid_tool_input
|
8
|
+
| :url_too_long
|
9
|
+
| :url_not_allowed
|
10
|
+
| :url_not_accessible
|
11
|
+
| :unsupported_content_type
|
12
|
+
| :too_many_requests
|
13
|
+
| :max_uses_exceeded
|
14
|
+
| :unavailable
|
15
|
+
|
16
|
+
module BetaWebFetchToolResultErrorCode
|
17
|
+
extend Anthropic::Internal::Type::Enum
|
18
|
+
|
19
|
+
INVALID_TOOL_INPUT: :invalid_tool_input
|
20
|
+
URL_TOO_LONG: :url_too_long
|
21
|
+
URL_NOT_ALLOWED: :url_not_allowed
|
22
|
+
URL_NOT_ACCESSIBLE: :url_not_accessible
|
23
|
+
UNSUPPORTED_CONTENT_TYPE: :unsupported_content_type
|
24
|
+
TOO_MANY_REQUESTS: :too_many_requests
|
25
|
+
MAX_USES_EXCEEDED: :max_uses_exceeded
|
26
|
+
UNAVAILABLE: :unavailable
|
27
|
+
|
28
|
+
def self?.values: -> ::Array[Anthropic::Models::Beta::beta_web_fetch_tool_result_error_code]
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -94,15 +94,18 @@ module Anthropic
|
|
94
94
|
|
95
95
|
type tool =
|
96
96
|
Anthropic::Beta::BetaTool
|
97
|
-
| Anthropic::Beta::BetaToolComputerUse20241022
|
98
97
|
| Anthropic::Beta::BetaToolBash20241022
|
99
|
-
| Anthropic::Beta::BetaToolTextEditor20241022
|
100
|
-
| Anthropic::Beta::BetaToolComputerUse20250124
|
101
98
|
| Anthropic::Beta::BetaToolBash20250124
|
99
|
+
| Anthropic::Beta::BetaCodeExecutionTool20250522
|
100
|
+
| Anthropic::Beta::BetaCodeExecutionTool20250825
|
101
|
+
| Anthropic::Beta::BetaToolComputerUse20241022
|
102
|
+
| Anthropic::Beta::BetaToolComputerUse20250124
|
103
|
+
| Anthropic::Beta::BetaToolTextEditor20241022
|
102
104
|
| Anthropic::Beta::BetaToolTextEditor20250124
|
103
105
|
| Anthropic::Beta::BetaToolTextEditor20250429
|
106
|
+
| Anthropic::Beta::BetaToolTextEditor20250728
|
104
107
|
| Anthropic::Beta::BetaWebSearchTool20250305
|
105
|
-
| Anthropic::Beta::
|
108
|
+
| Anthropic::Beta::BetaWebFetchTool20250910
|
106
109
|
|
107
110
|
module Tool
|
108
111
|
extend Anthropic::Internal::Type::Union
|
@@ -1,19 +1,30 @@
|
|
1
1
|
module Anthropic
|
2
2
|
module Models
|
3
3
|
type beta_error_response =
|
4
|
-
{
|
4
|
+
{
|
5
|
+
error: Anthropic::Models::beta_error,
|
6
|
+
request_id: String?,
|
7
|
+
type: :error
|
8
|
+
}
|
5
9
|
|
6
10
|
class BetaErrorResponse < Anthropic::Internal::Type::BaseModel
|
7
11
|
attr_accessor error: Anthropic::Models::beta_error
|
8
12
|
|
13
|
+
attr_accessor request_id: String?
|
14
|
+
|
9
15
|
attr_accessor type: :error
|
10
16
|
|
11
17
|
def initialize: (
|
12
18
|
error: Anthropic::Models::beta_error,
|
19
|
+
request_id: String?,
|
13
20
|
?type: :error
|
14
21
|
) -> void
|
15
22
|
|
16
|
-
def to_hash: -> {
|
23
|
+
def to_hash: -> {
|
24
|
+
error: Anthropic::Models::beta_error,
|
25
|
+
request_id: String?,
|
26
|
+
type: :error
|
27
|
+
}
|
17
28
|
end
|
18
29
|
end
|
19
30
|
end
|
@@ -1,13 +1,37 @@
|
|
1
1
|
module Anthropic
|
2
2
|
module Models
|
3
|
-
type cache_control_ephemeral =
|
3
|
+
type cache_control_ephemeral =
|
4
|
+
{ type: :ephemeral, ttl: Anthropic::Models::CacheControlEphemeral::ttl }
|
4
5
|
|
5
6
|
class CacheControlEphemeral < Anthropic::Internal::Type::BaseModel
|
6
7
|
attr_accessor type: :ephemeral
|
7
8
|
|
8
|
-
|
9
|
+
attr_reader ttl: Anthropic::Models::CacheControlEphemeral::ttl?
|
9
10
|
|
10
|
-
def
|
11
|
+
def ttl=: (
|
12
|
+
Anthropic::Models::CacheControlEphemeral::ttl
|
13
|
+
) -> Anthropic::Models::CacheControlEphemeral::ttl
|
14
|
+
|
15
|
+
def initialize: (
|
16
|
+
?ttl: Anthropic::Models::CacheControlEphemeral::ttl,
|
17
|
+
?type: :ephemeral
|
18
|
+
) -> void
|
19
|
+
|
20
|
+
def to_hash: -> {
|
21
|
+
type: :ephemeral,
|
22
|
+
ttl: Anthropic::Models::CacheControlEphemeral::ttl
|
23
|
+
}
|
24
|
+
|
25
|
+
type ttl = :"5m" | :"1h"
|
26
|
+
|
27
|
+
module TTL
|
28
|
+
extend Anthropic::Internal::Type::Enum
|
29
|
+
|
30
|
+
TTL_5M: :"5m"
|
31
|
+
TTL_1H: :"1h"
|
32
|
+
|
33
|
+
def self?.values: -> ::Array[Anthropic::Models::CacheControlEphemeral::ttl]
|
34
|
+
end
|
11
35
|
end
|
12
36
|
end
|
13
37
|
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Anthropic
|
2
|
+
module Models
|
3
|
+
type cache_creation =
|
4
|
+
{
|
5
|
+
:ephemeral_1h_input_tokens => Integer,
|
6
|
+
:ephemeral_5m_input_tokens => Integer
|
7
|
+
}
|
8
|
+
|
9
|
+
class CacheCreation < Anthropic::Internal::Type::BaseModel
|
10
|
+
attr_accessor ephemeral_1h_input_tokens: Integer
|
11
|
+
|
12
|
+
attr_accessor ephemeral_5m_input_tokens: Integer
|
13
|
+
|
14
|
+
def initialize: (
|
15
|
+
ephemeral_1h_input_tokens: Integer,
|
16
|
+
ephemeral_5m_input_tokens: Integer
|
17
|
+
) -> void
|
18
|
+
|
19
|
+
def to_hash: -> {
|
20
|
+
:ephemeral_1h_input_tokens => Integer,
|
21
|
+
:ephemeral_5m_input_tokens => Integer
|
22
|
+
}
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -6,6 +6,7 @@ module Anthropic
|
|
6
6
|
document_index: Integer,
|
7
7
|
document_title: String?,
|
8
8
|
end_char_index: Integer,
|
9
|
+
file_id: String?,
|
9
10
|
start_char_index: Integer,
|
10
11
|
type: :char_location
|
11
12
|
}
|
@@ -19,6 +20,8 @@ module Anthropic
|
|
19
20
|
|
20
21
|
attr_accessor end_char_index: Integer
|
21
22
|
|
23
|
+
attr_accessor file_id: String?
|
24
|
+
|
22
25
|
attr_accessor start_char_index: Integer
|
23
26
|
|
24
27
|
attr_accessor type: :char_location
|
@@ -28,6 +31,7 @@ module Anthropic
|
|
28
31
|
document_index: Integer,
|
29
32
|
document_title: String?,
|
30
33
|
end_char_index: Integer,
|
34
|
+
file_id: String?,
|
31
35
|
start_char_index: Integer,
|
32
36
|
?type: :char_location
|
33
37
|
) -> void
|
@@ -37,6 +41,7 @@ module Anthropic
|
|
37
41
|
document_index: Integer,
|
38
42
|
document_title: String?,
|
39
43
|
end_char_index: Integer,
|
44
|
+
file_id: String?,
|
40
45
|
start_char_index: Integer,
|
41
46
|
type: :char_location
|
42
47
|
}
|
@@ -6,6 +6,7 @@ module Anthropic
|
|
6
6
|
document_index: Integer,
|
7
7
|
document_title: String?,
|
8
8
|
end_block_index: Integer,
|
9
|
+
file_id: String?,
|
9
10
|
start_block_index: Integer,
|
10
11
|
type: :content_block_location
|
11
12
|
}
|
@@ -19,6 +20,8 @@ module Anthropic
|
|
19
20
|
|
20
21
|
attr_accessor end_block_index: Integer
|
21
22
|
|
23
|
+
attr_accessor file_id: String?
|
24
|
+
|
22
25
|
attr_accessor start_block_index: Integer
|
23
26
|
|
24
27
|
attr_accessor type: :content_block_location
|
@@ -28,6 +31,7 @@ module Anthropic
|
|
28
31
|
document_index: Integer,
|
29
32
|
document_title: String?,
|
30
33
|
end_block_index: Integer,
|
34
|
+
file_id: String?,
|
31
35
|
start_block_index: Integer,
|
32
36
|
?type: :content_block_location
|
33
37
|
) -> void
|
@@ -37,6 +41,7 @@ module Anthropic
|
|
37
41
|
document_index: Integer,
|
38
42
|
document_title: String?,
|
39
43
|
end_block_index: Integer,
|
44
|
+
file_id: String?,
|
40
45
|
start_block_index: Integer,
|
41
46
|
type: :content_block_location
|
42
47
|
}
|
@@ -6,6 +6,7 @@ module Anthropic
|
|
6
6
|
document_index: Integer,
|
7
7
|
document_title: String?,
|
8
8
|
end_page_number: Integer,
|
9
|
+
file_id: String?,
|
9
10
|
start_page_number: Integer,
|
10
11
|
type: :page_location
|
11
12
|
}
|
@@ -19,6 +20,8 @@ module Anthropic
|
|
19
20
|
|
20
21
|
attr_accessor end_page_number: Integer
|
21
22
|
|
23
|
+
attr_accessor file_id: String?
|
24
|
+
|
22
25
|
attr_accessor start_page_number: Integer
|
23
26
|
|
24
27
|
attr_accessor type: :page_location
|
@@ -28,6 +31,7 @@ module Anthropic
|
|
28
31
|
document_index: Integer,
|
29
32
|
document_title: String?,
|
30
33
|
end_page_number: Integer,
|
34
|
+
file_id: String?,
|
31
35
|
start_page_number: Integer,
|
32
36
|
?type: :page_location
|
33
37
|
) -> void
|
@@ -37,6 +41,7 @@ module Anthropic
|
|
37
41
|
document_index: Integer,
|
38
42
|
document_title: String?,
|
39
43
|
end_page_number: Integer,
|
44
|
+
file_id: String?,
|
40
45
|
start_page_number: Integer,
|
41
46
|
type: :page_location
|
42
47
|
}
|
@@ -0,0 +1,50 @@
|
|
1
|
+
module Anthropic
|
2
|
+
module Models
|
3
|
+
type citation_search_result_location_param =
|
4
|
+
{
|
5
|
+
cited_text: String,
|
6
|
+
end_block_index: Integer,
|
7
|
+
search_result_index: Integer,
|
8
|
+
source: String,
|
9
|
+
start_block_index: Integer,
|
10
|
+
title: String?,
|
11
|
+
type: :search_result_location
|
12
|
+
}
|
13
|
+
|
14
|
+
class CitationSearchResultLocationParam < Anthropic::Internal::Type::BaseModel
|
15
|
+
attr_accessor cited_text: String
|
16
|
+
|
17
|
+
attr_accessor end_block_index: Integer
|
18
|
+
|
19
|
+
attr_accessor search_result_index: Integer
|
20
|
+
|
21
|
+
attr_accessor source: String
|
22
|
+
|
23
|
+
attr_accessor start_block_index: Integer
|
24
|
+
|
25
|
+
attr_accessor title: String?
|
26
|
+
|
27
|
+
attr_accessor type: :search_result_location
|
28
|
+
|
29
|
+
def initialize: (
|
30
|
+
cited_text: String,
|
31
|
+
end_block_index: Integer,
|
32
|
+
search_result_index: Integer,
|
33
|
+
source: String,
|
34
|
+
start_block_index: Integer,
|
35
|
+
title: String?,
|
36
|
+
?type: :search_result_location
|
37
|
+
) -> void
|
38
|
+
|
39
|
+
def to_hash: -> {
|
40
|
+
cited_text: String,
|
41
|
+
end_block_index: Integer,
|
42
|
+
search_result_index: Integer,
|
43
|
+
source: String,
|
44
|
+
start_block_index: Integer,
|
45
|
+
title: String?,
|
46
|
+
type: :search_result_location
|
47
|
+
}
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
module Anthropic
|
2
|
+
module Models
|
3
|
+
type citations_search_result_location =
|
4
|
+
{
|
5
|
+
cited_text: String,
|
6
|
+
end_block_index: Integer,
|
7
|
+
search_result_index: Integer,
|
8
|
+
source: String,
|
9
|
+
start_block_index: Integer,
|
10
|
+
title: String?,
|
11
|
+
type: :search_result_location
|
12
|
+
}
|
13
|
+
|
14
|
+
class CitationsSearchResultLocation < Anthropic::Internal::Type::BaseModel
|
15
|
+
attr_accessor cited_text: String
|
16
|
+
|
17
|
+
attr_accessor end_block_index: Integer
|
18
|
+
|
19
|
+
attr_accessor search_result_index: Integer
|
20
|
+
|
21
|
+
attr_accessor source: String
|
22
|
+
|
23
|
+
attr_accessor start_block_index: Integer
|
24
|
+
|
25
|
+
attr_accessor title: String?
|
26
|
+
|
27
|
+
attr_accessor type: :search_result_location
|
28
|
+
|
29
|
+
def initialize: (
|
30
|
+
cited_text: String,
|
31
|
+
end_block_index: Integer,
|
32
|
+
search_result_index: Integer,
|
33
|
+
source: String,
|
34
|
+
start_block_index: Integer,
|
35
|
+
title: String?,
|
36
|
+
?type: :search_result_location
|
37
|
+
) -> void
|
38
|
+
|
39
|
+
def to_hash: -> {
|
40
|
+
cited_text: String,
|
41
|
+
end_block_index: Integer,
|
42
|
+
search_result_index: Integer,
|
43
|
+
source: String,
|
44
|
+
start_block_index: Integer,
|
45
|
+
title: String?,
|
46
|
+
type: :search_result_location
|
47
|
+
}
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -2,11 +2,11 @@ module Anthropic
|
|
2
2
|
module Models
|
3
3
|
type content_block =
|
4
4
|
Anthropic::TextBlock
|
5
|
+
| Anthropic::ThinkingBlock
|
6
|
+
| Anthropic::RedactedThinkingBlock
|
5
7
|
| Anthropic::ToolUseBlock
|
6
8
|
| Anthropic::ServerToolUseBlock
|
7
9
|
| Anthropic::WebSearchToolResultBlock
|
8
|
-
| Anthropic::ThinkingBlock
|
9
|
-
| Anthropic::RedactedThinkingBlock
|
10
10
|
|
11
11
|
module ContentBlock
|
12
12
|
extend Anthropic::Internal::Type::Union
|
@@ -1,15 +1,16 @@
|
|
1
1
|
module Anthropic
|
2
2
|
module Models
|
3
3
|
type content_block_param =
|
4
|
-
Anthropic::
|
5
|
-
| Anthropic::WebSearchToolResultBlockParam
|
6
|
-
| Anthropic::TextBlockParam
|
4
|
+
Anthropic::TextBlockParam
|
7
5
|
| Anthropic::ImageBlockParam
|
8
|
-
| Anthropic::ToolUseBlockParam
|
9
|
-
| Anthropic::ToolResultBlockParam
|
10
6
|
| Anthropic::DocumentBlockParam
|
7
|
+
| Anthropic::SearchResultBlockParam
|
11
8
|
| Anthropic::ThinkingBlockParam
|
12
9
|
| Anthropic::RedactedThinkingBlockParam
|
10
|
+
| Anthropic::ToolUseBlockParam
|
11
|
+
| Anthropic::ToolResultBlockParam
|
12
|
+
| Anthropic::ServerToolUseBlockParam
|
13
|
+
| Anthropic::WebSearchToolResultBlockParam
|
13
14
|
|
14
15
|
module ContentBlockParam
|
15
16
|
extend Anthropic::Internal::Type::Union
|
@@ -5,7 +5,7 @@ module Anthropic
|
|
5
5
|
source: Anthropic::Models::DocumentBlockParam::source,
|
6
6
|
type: :document,
|
7
7
|
cache_control: Anthropic::CacheControlEphemeral?,
|
8
|
-
citations: Anthropic::CitationsConfigParam
|
8
|
+
citations: Anthropic::CitationsConfigParam?,
|
9
9
|
context: String?,
|
10
10
|
title: String?
|
11
11
|
}
|
@@ -17,11 +17,7 @@ module Anthropic
|
|
17
17
|
|
18
18
|
attr_accessor cache_control: Anthropic::CacheControlEphemeral?
|
19
19
|
|
20
|
-
|
21
|
-
|
22
|
-
def citations=: (
|
23
|
-
Anthropic::CitationsConfigParam
|
24
|
-
) -> Anthropic::CitationsConfigParam
|
20
|
+
attr_accessor citations: Anthropic::CitationsConfigParam?
|
25
21
|
|
26
22
|
attr_accessor context: String?
|
27
23
|
|
@@ -30,7 +26,7 @@ module Anthropic
|
|
30
26
|
def initialize: (
|
31
27
|
source: Anthropic::Models::DocumentBlockParam::source,
|
32
28
|
?cache_control: Anthropic::CacheControlEphemeral?,
|
33
|
-
?citations: Anthropic::CitationsConfigParam
|
29
|
+
?citations: Anthropic::CitationsConfigParam?,
|
34
30
|
?context: String?,
|
35
31
|
?title: String?,
|
36
32
|
?type: :document
|
@@ -40,7 +36,7 @@ module Anthropic
|
|
40
36
|
source: Anthropic::Models::DocumentBlockParam::source,
|
41
37
|
type: :document,
|
42
38
|
cache_control: Anthropic::CacheControlEphemeral?,
|
43
|
-
citations: Anthropic::CitationsConfigParam
|
39
|
+
citations: Anthropic::CitationsConfigParam?,
|
44
40
|
context: String?,
|
45
41
|
title: String?
|
46
42
|
}
|
@@ -1,19 +1,30 @@
|
|
1
1
|
module Anthropic
|
2
2
|
module Models
|
3
3
|
type error_response =
|
4
|
-
{
|
4
|
+
{
|
5
|
+
error: Anthropic::Models::error_object,
|
6
|
+
request_id: String?,
|
7
|
+
type: :error
|
8
|
+
}
|
5
9
|
|
6
10
|
class ErrorResponse < Anthropic::Internal::Type::BaseModel
|
7
11
|
attr_accessor error: Anthropic::Models::error_object
|
8
12
|
|
13
|
+
attr_accessor request_id: String?
|
14
|
+
|
9
15
|
attr_accessor type: :error
|
10
16
|
|
11
17
|
def initialize: (
|
12
18
|
error: Anthropic::Models::error_object,
|
19
|
+
request_id: String?,
|
13
20
|
?type: :error
|
14
21
|
) -> void
|
15
22
|
|
16
|
-
def to_hash: -> {
|
23
|
+
def to_hash: -> {
|
24
|
+
error: Anthropic::Models::error_object,
|
25
|
+
request_id: String?,
|
26
|
+
type: :error
|
27
|
+
}
|
17
28
|
end
|
18
29
|
end
|
19
30
|
end
|
@@ -14,12 +14,10 @@ module Anthropic
|
|
14
14
|
| :"claude-opus-4-0"
|
15
15
|
| :"claude-opus-4-20250514"
|
16
16
|
| :"claude-4-opus-20250514"
|
17
|
+
| :"claude-opus-4-1-20250805"
|
17
18
|
| :"claude-3-opus-latest"
|
18
19
|
| :"claude-3-opus-20240229"
|
19
|
-
| :"claude-3-sonnet-20240229"
|
20
20
|
| :"claude-3-haiku-20240307"
|
21
|
-
| :"claude-2.1"
|
22
|
-
| :"claude-2.0"
|
23
21
|
| String
|
24
22
|
|
25
23
|
module Model
|
@@ -65,21 +63,17 @@ module Anthropic
|
|
65
63
|
# Our most capable model
|
66
64
|
CLAUDE_4_OPUS_20250514: :"claude-4-opus-20250514"
|
67
65
|
|
66
|
+
# Our most capable model
|
67
|
+
CLAUDE_OPUS_4_1_20250805: :"claude-opus-4-1-20250805"
|
68
|
+
|
68
69
|
# Excels at writing and complex tasks
|
69
70
|
CLAUDE_3_OPUS_LATEST: :"claude-3-opus-latest"
|
70
71
|
|
71
72
|
# Excels at writing and complex tasks
|
72
73
|
CLAUDE_3_OPUS_20240229: :"claude-3-opus-20240229"
|
73
74
|
|
74
|
-
# Balance of speed and intelligence
|
75
|
-
CLAUDE_3_SONNET_20240229: :"claude-3-sonnet-20240229"
|
76
|
-
|
77
75
|
# Our previous most fast and cost-effective
|
78
76
|
CLAUDE_3_HAIKU_20240307: :"claude-3-haiku-20240307"
|
79
|
-
|
80
|
-
CLAUDE_2_1: :"claude-2.1"
|
81
|
-
|
82
|
-
CLAUDE_2_0: :"claude-2.0"
|
83
77
|
end
|
84
78
|
end
|
85
79
|
end
|
@@ -28,11 +28,11 @@ module Anthropic
|
|
28
28
|
|
29
29
|
type content_block =
|
30
30
|
Anthropic::TextBlock
|
31
|
+
| Anthropic::ThinkingBlock
|
32
|
+
| Anthropic::RedactedThinkingBlock
|
31
33
|
| Anthropic::ToolUseBlock
|
32
34
|
| Anthropic::ServerToolUseBlock
|
33
35
|
| Anthropic::WebSearchToolResultBlock
|
34
|
-
| Anthropic::ThinkingBlock
|
35
|
-
| Anthropic::RedactedThinkingBlock
|
36
36
|
|
37
37
|
module ContentBlock
|
38
38
|
extend Anthropic::Internal::Type::Union
|
@@ -0,0 +1,49 @@
|
|
1
|
+
module Anthropic
|
2
|
+
module Models
|
3
|
+
type search_result_block_param =
|
4
|
+
{
|
5
|
+
content: ::Array[Anthropic::TextBlockParam],
|
6
|
+
source: String,
|
7
|
+
title: String,
|
8
|
+
type: :search_result,
|
9
|
+
cache_control: Anthropic::CacheControlEphemeral?,
|
10
|
+
citations: Anthropic::CitationsConfigParam
|
11
|
+
}
|
12
|
+
|
13
|
+
class SearchResultBlockParam < Anthropic::Internal::Type::BaseModel
|
14
|
+
attr_accessor content: ::Array[Anthropic::TextBlockParam]
|
15
|
+
|
16
|
+
attr_accessor source: String
|
17
|
+
|
18
|
+
attr_accessor title: String
|
19
|
+
|
20
|
+
attr_accessor type: :search_result
|
21
|
+
|
22
|
+
attr_accessor cache_control: Anthropic::CacheControlEphemeral?
|
23
|
+
|
24
|
+
attr_reader citations: Anthropic::CitationsConfigParam?
|
25
|
+
|
26
|
+
def citations=: (
|
27
|
+
Anthropic::CitationsConfigParam
|
28
|
+
) -> Anthropic::CitationsConfigParam
|
29
|
+
|
30
|
+
def initialize: (
|
31
|
+
content: ::Array[Anthropic::TextBlockParam],
|
32
|
+
source: String,
|
33
|
+
title: String,
|
34
|
+
?cache_control: Anthropic::CacheControlEphemeral?,
|
35
|
+
?citations: Anthropic::CitationsConfigParam,
|
36
|
+
?type: :search_result
|
37
|
+
) -> void
|
38
|
+
|
39
|
+
def to_hash: -> {
|
40
|
+
content: ::Array[Anthropic::TextBlockParam],
|
41
|
+
source: String,
|
42
|
+
title: String,
|
43
|
+
type: :search_result,
|
44
|
+
cache_control: Anthropic::CacheControlEphemeral?,
|
45
|
+
citations: Anthropic::CitationsConfigParam
|
46
|
+
}
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -5,6 +5,7 @@ module Anthropic
|
|
5
5
|
| Anthropic::CitationPageLocationParam
|
6
6
|
| Anthropic::CitationContentBlockLocationParam
|
7
7
|
| Anthropic::CitationWebSearchResultLocationParam
|
8
|
+
| Anthropic::CitationSearchResultLocationParam
|
8
9
|
|
9
10
|
module TextCitationParam
|
10
11
|
extend Anthropic::Internal::Type::Union
|
@@ -38,16 +38,27 @@ module Anthropic
|
|
38
38
|
type: Anthropic::Models::Tool::type_?
|
39
39
|
}
|
40
40
|
|
41
|
-
type input_schema =
|
41
|
+
type input_schema =
|
42
|
+
{ type: :object, properties: top?, required: ::Array[String]? }
|
42
43
|
|
43
44
|
class InputSchema < Anthropic::Internal::Type::BaseModel
|
44
45
|
attr_accessor type: :object
|
45
46
|
|
46
47
|
attr_accessor properties: top?
|
47
48
|
|
48
|
-
|
49
|
+
attr_accessor required: ::Array[String]?
|
49
50
|
|
50
|
-
def
|
51
|
+
def initialize: (
|
52
|
+
?properties: top?,
|
53
|
+
?required: ::Array[String]?,
|
54
|
+
?type: :object
|
55
|
+
) -> void
|
56
|
+
|
57
|
+
def to_hash: -> {
|
58
|
+
type: :object,
|
59
|
+
properties: top?,
|
60
|
+
required: ::Array[String]?
|
61
|
+
}
|
51
62
|
end
|
52
63
|
|
53
64
|
type type_ = :custom
|
@@ -49,7 +49,11 @@ module Anthropic
|
|
49
49
|
module Content
|
50
50
|
extend Anthropic::Internal::Type::Union
|
51
51
|
|
52
|
-
type content =
|
52
|
+
type content =
|
53
|
+
Anthropic::TextBlockParam
|
54
|
+
| Anthropic::ImageBlockParam
|
55
|
+
| Anthropic::SearchResultBlockParam
|
56
|
+
| Anthropic::DocumentBlockParam
|
53
57
|
|
54
58
|
module Content
|
55
59
|
extend Anthropic::Internal::Type::Union
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module Anthropic
|
2
|
+
module Models
|
3
|
+
type tool_text_editor20250429 =
|
4
|
+
{
|
5
|
+
name: :str_replace_based_edit_tool,
|
6
|
+
type: :text_editor_20250429,
|
7
|
+
cache_control: Anthropic::CacheControlEphemeral?
|
8
|
+
}
|
9
|
+
|
10
|
+
class ToolTextEditor20250429 < Anthropic::Internal::Type::BaseModel
|
11
|
+
attr_accessor name: :str_replace_based_edit_tool
|
12
|
+
|
13
|
+
attr_accessor type: :text_editor_20250429
|
14
|
+
|
15
|
+
attr_accessor cache_control: Anthropic::CacheControlEphemeral?
|
16
|
+
|
17
|
+
def initialize: (
|
18
|
+
?cache_control: Anthropic::CacheControlEphemeral?,
|
19
|
+
?name: :str_replace_based_edit_tool,
|
20
|
+
?type: :text_editor_20250429
|
21
|
+
) -> void
|
22
|
+
|
23
|
+
def to_hash: -> {
|
24
|
+
name: :str_replace_based_edit_tool,
|
25
|
+
type: :text_editor_20250429,
|
26
|
+
cache_control: Anthropic::CacheControlEphemeral?
|
27
|
+
}
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|