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,110 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Anthropic
|
4
|
+
module Models
|
5
|
+
BetaTextEditorCodeExecutionToolResultError =
|
6
|
+
Beta::BetaTextEditorCodeExecutionToolResultError
|
7
|
+
|
8
|
+
module Beta
|
9
|
+
class BetaTextEditorCodeExecutionToolResultError < Anthropic::Internal::Type::BaseModel
|
10
|
+
OrHash =
|
11
|
+
T.type_alias do
|
12
|
+
T.any(
|
13
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultError,
|
14
|
+
Anthropic::Internal::AnyHash
|
15
|
+
)
|
16
|
+
end
|
17
|
+
|
18
|
+
sig do
|
19
|
+
returns(
|
20
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultError::ErrorCode::TaggedSymbol
|
21
|
+
)
|
22
|
+
end
|
23
|
+
attr_accessor :error_code
|
24
|
+
|
25
|
+
sig { returns(T.nilable(String)) }
|
26
|
+
attr_accessor :error_message
|
27
|
+
|
28
|
+
sig { returns(Symbol) }
|
29
|
+
attr_accessor :type
|
30
|
+
|
31
|
+
sig do
|
32
|
+
params(
|
33
|
+
error_code:
|
34
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultError::ErrorCode::OrSymbol,
|
35
|
+
error_message: T.nilable(String),
|
36
|
+
type: Symbol
|
37
|
+
).returns(T.attached_class)
|
38
|
+
end
|
39
|
+
def self.new(
|
40
|
+
error_code:,
|
41
|
+
error_message:,
|
42
|
+
type: :text_editor_code_execution_tool_result_error
|
43
|
+
)
|
44
|
+
end
|
45
|
+
|
46
|
+
sig do
|
47
|
+
override.returns(
|
48
|
+
{
|
49
|
+
error_code:
|
50
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultError::ErrorCode::TaggedSymbol,
|
51
|
+
error_message: T.nilable(String),
|
52
|
+
type: Symbol
|
53
|
+
}
|
54
|
+
)
|
55
|
+
end
|
56
|
+
def to_hash
|
57
|
+
end
|
58
|
+
|
59
|
+
module ErrorCode
|
60
|
+
extend Anthropic::Internal::Type::Enum
|
61
|
+
|
62
|
+
TaggedSymbol =
|
63
|
+
T.type_alias do
|
64
|
+
T.all(
|
65
|
+
Symbol,
|
66
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultError::ErrorCode
|
67
|
+
)
|
68
|
+
end
|
69
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
70
|
+
|
71
|
+
INVALID_TOOL_INPUT =
|
72
|
+
T.let(
|
73
|
+
:invalid_tool_input,
|
74
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultError::ErrorCode::TaggedSymbol
|
75
|
+
)
|
76
|
+
UNAVAILABLE =
|
77
|
+
T.let(
|
78
|
+
:unavailable,
|
79
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultError::ErrorCode::TaggedSymbol
|
80
|
+
)
|
81
|
+
TOO_MANY_REQUESTS =
|
82
|
+
T.let(
|
83
|
+
:too_many_requests,
|
84
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultError::ErrorCode::TaggedSymbol
|
85
|
+
)
|
86
|
+
EXECUTION_TIME_EXCEEDED =
|
87
|
+
T.let(
|
88
|
+
:execution_time_exceeded,
|
89
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultError::ErrorCode::TaggedSymbol
|
90
|
+
)
|
91
|
+
FILE_NOT_FOUND =
|
92
|
+
T.let(
|
93
|
+
:file_not_found,
|
94
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultError::ErrorCode::TaggedSymbol
|
95
|
+
)
|
96
|
+
|
97
|
+
sig do
|
98
|
+
override.returns(
|
99
|
+
T::Array[
|
100
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultError::ErrorCode::TaggedSymbol
|
101
|
+
]
|
102
|
+
)
|
103
|
+
end
|
104
|
+
def self.values
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
@@ -0,0 +1,110 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Anthropic
|
4
|
+
module Models
|
5
|
+
BetaTextEditorCodeExecutionToolResultErrorParam =
|
6
|
+
Beta::BetaTextEditorCodeExecutionToolResultErrorParam
|
7
|
+
|
8
|
+
module Beta
|
9
|
+
class BetaTextEditorCodeExecutionToolResultErrorParam < Anthropic::Internal::Type::BaseModel
|
10
|
+
OrHash =
|
11
|
+
T.type_alias do
|
12
|
+
T.any(
|
13
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultErrorParam,
|
14
|
+
Anthropic::Internal::AnyHash
|
15
|
+
)
|
16
|
+
end
|
17
|
+
|
18
|
+
sig do
|
19
|
+
returns(
|
20
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultErrorParam::ErrorCode::OrSymbol
|
21
|
+
)
|
22
|
+
end
|
23
|
+
attr_accessor :error_code
|
24
|
+
|
25
|
+
sig { returns(Symbol) }
|
26
|
+
attr_accessor :type
|
27
|
+
|
28
|
+
sig { returns(T.nilable(String)) }
|
29
|
+
attr_accessor :error_message
|
30
|
+
|
31
|
+
sig do
|
32
|
+
params(
|
33
|
+
error_code:
|
34
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultErrorParam::ErrorCode::OrSymbol,
|
35
|
+
error_message: T.nilable(String),
|
36
|
+
type: Symbol
|
37
|
+
).returns(T.attached_class)
|
38
|
+
end
|
39
|
+
def self.new(
|
40
|
+
error_code:,
|
41
|
+
error_message: nil,
|
42
|
+
type: :text_editor_code_execution_tool_result_error
|
43
|
+
)
|
44
|
+
end
|
45
|
+
|
46
|
+
sig do
|
47
|
+
override.returns(
|
48
|
+
{
|
49
|
+
error_code:
|
50
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultErrorParam::ErrorCode::OrSymbol,
|
51
|
+
type: Symbol,
|
52
|
+
error_message: T.nilable(String)
|
53
|
+
}
|
54
|
+
)
|
55
|
+
end
|
56
|
+
def to_hash
|
57
|
+
end
|
58
|
+
|
59
|
+
module ErrorCode
|
60
|
+
extend Anthropic::Internal::Type::Enum
|
61
|
+
|
62
|
+
TaggedSymbol =
|
63
|
+
T.type_alias do
|
64
|
+
T.all(
|
65
|
+
Symbol,
|
66
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultErrorParam::ErrorCode
|
67
|
+
)
|
68
|
+
end
|
69
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
70
|
+
|
71
|
+
INVALID_TOOL_INPUT =
|
72
|
+
T.let(
|
73
|
+
:invalid_tool_input,
|
74
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultErrorParam::ErrorCode::TaggedSymbol
|
75
|
+
)
|
76
|
+
UNAVAILABLE =
|
77
|
+
T.let(
|
78
|
+
:unavailable,
|
79
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultErrorParam::ErrorCode::TaggedSymbol
|
80
|
+
)
|
81
|
+
TOO_MANY_REQUESTS =
|
82
|
+
T.let(
|
83
|
+
:too_many_requests,
|
84
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultErrorParam::ErrorCode::TaggedSymbol
|
85
|
+
)
|
86
|
+
EXECUTION_TIME_EXCEEDED =
|
87
|
+
T.let(
|
88
|
+
:execution_time_exceeded,
|
89
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultErrorParam::ErrorCode::TaggedSymbol
|
90
|
+
)
|
91
|
+
FILE_NOT_FOUND =
|
92
|
+
T.let(
|
93
|
+
:file_not_found,
|
94
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultErrorParam::ErrorCode::TaggedSymbol
|
95
|
+
)
|
96
|
+
|
97
|
+
sig do
|
98
|
+
override.returns(
|
99
|
+
T::Array[
|
100
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultErrorParam::ErrorCode::TaggedSymbol
|
101
|
+
]
|
102
|
+
)
|
103
|
+
end
|
104
|
+
def self.values
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
@@ -0,0 +1,118 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Anthropic
|
4
|
+
module Models
|
5
|
+
BetaTextEditorCodeExecutionViewResultBlock =
|
6
|
+
Beta::BetaTextEditorCodeExecutionViewResultBlock
|
7
|
+
|
8
|
+
module Beta
|
9
|
+
class BetaTextEditorCodeExecutionViewResultBlock < Anthropic::Internal::Type::BaseModel
|
10
|
+
OrHash =
|
11
|
+
T.type_alias do
|
12
|
+
T.any(
|
13
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionViewResultBlock,
|
14
|
+
Anthropic::Internal::AnyHash
|
15
|
+
)
|
16
|
+
end
|
17
|
+
|
18
|
+
sig { returns(String) }
|
19
|
+
attr_accessor :content
|
20
|
+
|
21
|
+
sig do
|
22
|
+
returns(
|
23
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionViewResultBlock::FileType::TaggedSymbol
|
24
|
+
)
|
25
|
+
end
|
26
|
+
attr_accessor :file_type
|
27
|
+
|
28
|
+
sig { returns(T.nilable(Integer)) }
|
29
|
+
attr_accessor :num_lines
|
30
|
+
|
31
|
+
sig { returns(T.nilable(Integer)) }
|
32
|
+
attr_accessor :start_line
|
33
|
+
|
34
|
+
sig { returns(T.nilable(Integer)) }
|
35
|
+
attr_accessor :total_lines
|
36
|
+
|
37
|
+
sig { returns(Symbol) }
|
38
|
+
attr_accessor :type
|
39
|
+
|
40
|
+
sig do
|
41
|
+
params(
|
42
|
+
content: String,
|
43
|
+
file_type:
|
44
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionViewResultBlock::FileType::OrSymbol,
|
45
|
+
num_lines: T.nilable(Integer),
|
46
|
+
start_line: T.nilable(Integer),
|
47
|
+
total_lines: T.nilable(Integer),
|
48
|
+
type: Symbol
|
49
|
+
).returns(T.attached_class)
|
50
|
+
end
|
51
|
+
def self.new(
|
52
|
+
content:,
|
53
|
+
file_type:,
|
54
|
+
num_lines:,
|
55
|
+
start_line:,
|
56
|
+
total_lines:,
|
57
|
+
type: :text_editor_code_execution_view_result
|
58
|
+
)
|
59
|
+
end
|
60
|
+
|
61
|
+
sig do
|
62
|
+
override.returns(
|
63
|
+
{
|
64
|
+
content: String,
|
65
|
+
file_type:
|
66
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionViewResultBlock::FileType::TaggedSymbol,
|
67
|
+
num_lines: T.nilable(Integer),
|
68
|
+
start_line: T.nilable(Integer),
|
69
|
+
total_lines: T.nilable(Integer),
|
70
|
+
type: Symbol
|
71
|
+
}
|
72
|
+
)
|
73
|
+
end
|
74
|
+
def to_hash
|
75
|
+
end
|
76
|
+
|
77
|
+
module FileType
|
78
|
+
extend Anthropic::Internal::Type::Enum
|
79
|
+
|
80
|
+
TaggedSymbol =
|
81
|
+
T.type_alias do
|
82
|
+
T.all(
|
83
|
+
Symbol,
|
84
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionViewResultBlock::FileType
|
85
|
+
)
|
86
|
+
end
|
87
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
88
|
+
|
89
|
+
TEXT =
|
90
|
+
T.let(
|
91
|
+
:text,
|
92
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionViewResultBlock::FileType::TaggedSymbol
|
93
|
+
)
|
94
|
+
IMAGE =
|
95
|
+
T.let(
|
96
|
+
:image,
|
97
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionViewResultBlock::FileType::TaggedSymbol
|
98
|
+
)
|
99
|
+
PDF =
|
100
|
+
T.let(
|
101
|
+
:pdf,
|
102
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionViewResultBlock::FileType::TaggedSymbol
|
103
|
+
)
|
104
|
+
|
105
|
+
sig do
|
106
|
+
override.returns(
|
107
|
+
T::Array[
|
108
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionViewResultBlock::FileType::TaggedSymbol
|
109
|
+
]
|
110
|
+
)
|
111
|
+
end
|
112
|
+
def self.values
|
113
|
+
end
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|
@@ -0,0 +1,118 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Anthropic
|
4
|
+
module Models
|
5
|
+
BetaTextEditorCodeExecutionViewResultBlockParam =
|
6
|
+
Beta::BetaTextEditorCodeExecutionViewResultBlockParam
|
7
|
+
|
8
|
+
module Beta
|
9
|
+
class BetaTextEditorCodeExecutionViewResultBlockParam < Anthropic::Internal::Type::BaseModel
|
10
|
+
OrHash =
|
11
|
+
T.type_alias do
|
12
|
+
T.any(
|
13
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionViewResultBlockParam,
|
14
|
+
Anthropic::Internal::AnyHash
|
15
|
+
)
|
16
|
+
end
|
17
|
+
|
18
|
+
sig { returns(String) }
|
19
|
+
attr_accessor :content
|
20
|
+
|
21
|
+
sig do
|
22
|
+
returns(
|
23
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionViewResultBlockParam::FileType::OrSymbol
|
24
|
+
)
|
25
|
+
end
|
26
|
+
attr_accessor :file_type
|
27
|
+
|
28
|
+
sig { returns(Symbol) }
|
29
|
+
attr_accessor :type
|
30
|
+
|
31
|
+
sig { returns(T.nilable(Integer)) }
|
32
|
+
attr_accessor :num_lines
|
33
|
+
|
34
|
+
sig { returns(T.nilable(Integer)) }
|
35
|
+
attr_accessor :start_line
|
36
|
+
|
37
|
+
sig { returns(T.nilable(Integer)) }
|
38
|
+
attr_accessor :total_lines
|
39
|
+
|
40
|
+
sig do
|
41
|
+
params(
|
42
|
+
content: String,
|
43
|
+
file_type:
|
44
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionViewResultBlockParam::FileType::OrSymbol,
|
45
|
+
num_lines: T.nilable(Integer),
|
46
|
+
start_line: T.nilable(Integer),
|
47
|
+
total_lines: T.nilable(Integer),
|
48
|
+
type: Symbol
|
49
|
+
).returns(T.attached_class)
|
50
|
+
end
|
51
|
+
def self.new(
|
52
|
+
content:,
|
53
|
+
file_type:,
|
54
|
+
num_lines: nil,
|
55
|
+
start_line: nil,
|
56
|
+
total_lines: nil,
|
57
|
+
type: :text_editor_code_execution_view_result
|
58
|
+
)
|
59
|
+
end
|
60
|
+
|
61
|
+
sig do
|
62
|
+
override.returns(
|
63
|
+
{
|
64
|
+
content: String,
|
65
|
+
file_type:
|
66
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionViewResultBlockParam::FileType::OrSymbol,
|
67
|
+
type: Symbol,
|
68
|
+
num_lines: T.nilable(Integer),
|
69
|
+
start_line: T.nilable(Integer),
|
70
|
+
total_lines: T.nilable(Integer)
|
71
|
+
}
|
72
|
+
)
|
73
|
+
end
|
74
|
+
def to_hash
|
75
|
+
end
|
76
|
+
|
77
|
+
module FileType
|
78
|
+
extend Anthropic::Internal::Type::Enum
|
79
|
+
|
80
|
+
TaggedSymbol =
|
81
|
+
T.type_alias do
|
82
|
+
T.all(
|
83
|
+
Symbol,
|
84
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionViewResultBlockParam::FileType
|
85
|
+
)
|
86
|
+
end
|
87
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
88
|
+
|
89
|
+
TEXT =
|
90
|
+
T.let(
|
91
|
+
:text,
|
92
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionViewResultBlockParam::FileType::TaggedSymbol
|
93
|
+
)
|
94
|
+
IMAGE =
|
95
|
+
T.let(
|
96
|
+
:image,
|
97
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionViewResultBlockParam::FileType::TaggedSymbol
|
98
|
+
)
|
99
|
+
PDF =
|
100
|
+
T.let(
|
101
|
+
:pdf,
|
102
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionViewResultBlockParam::FileType::TaggedSymbol
|
103
|
+
)
|
104
|
+
|
105
|
+
sig do
|
106
|
+
override.returns(
|
107
|
+
T::Array[
|
108
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionViewResultBlockParam::FileType::TaggedSymbol
|
109
|
+
]
|
110
|
+
)
|
111
|
+
end
|
112
|
+
def self.values
|
113
|
+
end
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|
@@ -121,21 +121,30 @@ module Anthropic
|
|
121
121
|
sig { returns(T.nilable(T.anything)) }
|
122
122
|
attr_accessor :properties
|
123
123
|
|
124
|
+
sig { returns(T.nilable(T::Array[String])) }
|
125
|
+
attr_accessor :required
|
126
|
+
|
124
127
|
# [JSON schema](https://json-schema.org/draft/2020-12) for this tool's input.
|
125
128
|
#
|
126
129
|
# This defines the shape of the `input` that your tool accepts and that the model
|
127
130
|
# will produce.
|
128
131
|
sig do
|
129
|
-
params(
|
130
|
-
T.
|
131
|
-
|
132
|
+
params(
|
133
|
+
properties: T.nilable(T.anything),
|
134
|
+
required: T.nilable(T::Array[String]),
|
135
|
+
type: Symbol
|
136
|
+
).returns(T.attached_class)
|
132
137
|
end
|
133
|
-
def self.new(properties: nil, type: :object)
|
138
|
+
def self.new(properties: nil, required: nil, type: :object)
|
134
139
|
end
|
135
140
|
|
136
141
|
sig do
|
137
142
|
override.returns(
|
138
|
-
{
|
143
|
+
{
|
144
|
+
type: Symbol,
|
145
|
+
properties: T.nilable(T.anything),
|
146
|
+
required: T.nilable(T::Array[String])
|
147
|
+
}
|
139
148
|
)
|
140
149
|
end
|
141
150
|
def to_hash
|
@@ -112,7 +112,9 @@ module Anthropic
|
|
112
112
|
T.type_alias do
|
113
113
|
T.any(
|
114
114
|
Anthropic::Beta::BetaTextBlockParam,
|
115
|
-
Anthropic::Beta::BetaImageBlockParam
|
115
|
+
Anthropic::Beta::BetaImageBlockParam,
|
116
|
+
Anthropic::Beta::BetaSearchResultBlockParam,
|
117
|
+
Anthropic::Beta::BetaRequestDocumentBlock
|
116
118
|
)
|
117
119
|
end
|
118
120
|
|
@@ -0,0 +1,82 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Anthropic
|
4
|
+
module Models
|
5
|
+
BetaToolTextEditor20250728 = Beta::BetaToolTextEditor20250728
|
6
|
+
|
7
|
+
module Beta
|
8
|
+
class BetaToolTextEditor20250728 < Anthropic::Internal::Type::BaseModel
|
9
|
+
OrHash =
|
10
|
+
T.type_alias do
|
11
|
+
T.any(
|
12
|
+
Anthropic::Beta::BetaToolTextEditor20250728,
|
13
|
+
Anthropic::Internal::AnyHash
|
14
|
+
)
|
15
|
+
end
|
16
|
+
|
17
|
+
# Name of the tool.
|
18
|
+
#
|
19
|
+
# This is how the tool will be called by the model and in `tool_use` blocks.
|
20
|
+
sig { returns(Symbol) }
|
21
|
+
attr_accessor :name
|
22
|
+
|
23
|
+
sig { returns(Symbol) }
|
24
|
+
attr_accessor :type
|
25
|
+
|
26
|
+
# Create a cache control breakpoint at this content block.
|
27
|
+
sig { returns(T.nilable(Anthropic::Beta::BetaCacheControlEphemeral)) }
|
28
|
+
attr_reader :cache_control
|
29
|
+
|
30
|
+
sig do
|
31
|
+
params(
|
32
|
+
cache_control:
|
33
|
+
T.nilable(Anthropic::Beta::BetaCacheControlEphemeral::OrHash)
|
34
|
+
).void
|
35
|
+
end
|
36
|
+
attr_writer :cache_control
|
37
|
+
|
38
|
+
# Maximum number of characters to display when viewing a file. If not specified,
|
39
|
+
# defaults to displaying the full file.
|
40
|
+
sig { returns(T.nilable(Integer)) }
|
41
|
+
attr_accessor :max_characters
|
42
|
+
|
43
|
+
sig do
|
44
|
+
params(
|
45
|
+
cache_control:
|
46
|
+
T.nilable(Anthropic::Beta::BetaCacheControlEphemeral::OrHash),
|
47
|
+
max_characters: T.nilable(Integer),
|
48
|
+
name: Symbol,
|
49
|
+
type: Symbol
|
50
|
+
).returns(T.attached_class)
|
51
|
+
end
|
52
|
+
def self.new(
|
53
|
+
# Create a cache control breakpoint at this content block.
|
54
|
+
cache_control: nil,
|
55
|
+
# Maximum number of characters to display when viewing a file. If not specified,
|
56
|
+
# defaults to displaying the full file.
|
57
|
+
max_characters: nil,
|
58
|
+
# Name of the tool.
|
59
|
+
#
|
60
|
+
# This is how the tool will be called by the model and in `tool_use` blocks.
|
61
|
+
name: :str_replace_based_edit_tool,
|
62
|
+
type: :text_editor_20250728
|
63
|
+
)
|
64
|
+
end
|
65
|
+
|
66
|
+
sig do
|
67
|
+
override.returns(
|
68
|
+
{
|
69
|
+
name: Symbol,
|
70
|
+
type: Symbol,
|
71
|
+
cache_control:
|
72
|
+
T.nilable(Anthropic::Beta::BetaCacheControlEphemeral),
|
73
|
+
max_characters: T.nilable(Integer)
|
74
|
+
}
|
75
|
+
)
|
76
|
+
end
|
77
|
+
def to_hash
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
@@ -12,15 +12,18 @@ module Anthropic
|
|
12
12
|
T.type_alias do
|
13
13
|
T.any(
|
14
14
|
Anthropic::Beta::BetaTool,
|
15
|
-
Anthropic::Beta::BetaToolComputerUse20241022,
|
16
15
|
Anthropic::Beta::BetaToolBash20241022,
|
17
|
-
Anthropic::Beta::BetaToolTextEditor20241022,
|
18
|
-
Anthropic::Beta::BetaToolComputerUse20250124,
|
19
16
|
Anthropic::Beta::BetaToolBash20250124,
|
17
|
+
Anthropic::Beta::BetaCodeExecutionTool20250522,
|
18
|
+
Anthropic::Beta::BetaCodeExecutionTool20250825,
|
19
|
+
Anthropic::Beta::BetaToolComputerUse20241022,
|
20
|
+
Anthropic::Beta::BetaToolComputerUse20250124,
|
21
|
+
Anthropic::Beta::BetaToolTextEditor20241022,
|
20
22
|
Anthropic::Beta::BetaToolTextEditor20250124,
|
21
23
|
Anthropic::Beta::BetaToolTextEditor20250429,
|
24
|
+
Anthropic::Beta::BetaToolTextEditor20250728,
|
22
25
|
Anthropic::Beta::BetaWebSearchTool20250305,
|
23
|
-
Anthropic::Beta::
|
26
|
+
Anthropic::Beta::BetaWebFetchTool20250910
|
24
27
|
)
|
25
28
|
end
|
26
29
|
|
@@ -0,0 +1,67 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Anthropic
|
4
|
+
module Models
|
5
|
+
BetaWebFetchBlock = Beta::BetaWebFetchBlock
|
6
|
+
|
7
|
+
module Beta
|
8
|
+
class BetaWebFetchBlock < Anthropic::Internal::Type::BaseModel
|
9
|
+
OrHash =
|
10
|
+
T.type_alias do
|
11
|
+
T.any(
|
12
|
+
Anthropic::Beta::BetaWebFetchBlock,
|
13
|
+
Anthropic::Internal::AnyHash
|
14
|
+
)
|
15
|
+
end
|
16
|
+
|
17
|
+
sig { returns(Anthropic::Beta::BetaDocumentBlock) }
|
18
|
+
attr_reader :content
|
19
|
+
|
20
|
+
sig { params(content: Anthropic::Beta::BetaDocumentBlock::OrHash).void }
|
21
|
+
attr_writer :content
|
22
|
+
|
23
|
+
# ISO 8601 timestamp when the content was retrieved
|
24
|
+
sig { returns(T.nilable(String)) }
|
25
|
+
attr_accessor :retrieved_at
|
26
|
+
|
27
|
+
sig { returns(Symbol) }
|
28
|
+
attr_accessor :type
|
29
|
+
|
30
|
+
# Fetched content URL
|
31
|
+
sig { returns(String) }
|
32
|
+
attr_accessor :url
|
33
|
+
|
34
|
+
sig do
|
35
|
+
params(
|
36
|
+
content: Anthropic::Beta::BetaDocumentBlock::OrHash,
|
37
|
+
retrieved_at: T.nilable(String),
|
38
|
+
url: String,
|
39
|
+
type: Symbol
|
40
|
+
).returns(T.attached_class)
|
41
|
+
end
|
42
|
+
def self.new(
|
43
|
+
content:,
|
44
|
+
# ISO 8601 timestamp when the content was retrieved
|
45
|
+
retrieved_at:,
|
46
|
+
# Fetched content URL
|
47
|
+
url:,
|
48
|
+
type: :web_fetch_result
|
49
|
+
)
|
50
|
+
end
|
51
|
+
|
52
|
+
sig do
|
53
|
+
override.returns(
|
54
|
+
{
|
55
|
+
content: Anthropic::Beta::BetaDocumentBlock,
|
56
|
+
retrieved_at: T.nilable(String),
|
57
|
+
type: Symbol,
|
58
|
+
url: String
|
59
|
+
}
|
60
|
+
)
|
61
|
+
end
|
62
|
+
def to_hash
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|