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,91 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Anthropic
|
4
|
+
module Models
|
5
|
+
BetaSearchResultBlockParam = Beta::BetaSearchResultBlockParam
|
6
|
+
|
7
|
+
module Beta
|
8
|
+
class BetaSearchResultBlockParam < Anthropic::Internal::Type::BaseModel
|
9
|
+
OrHash =
|
10
|
+
T.type_alias do
|
11
|
+
T.any(
|
12
|
+
Anthropic::Beta::BetaSearchResultBlockParam,
|
13
|
+
Anthropic::Internal::AnyHash
|
14
|
+
)
|
15
|
+
end
|
16
|
+
|
17
|
+
sig { returns(T::Array[Anthropic::Beta::BetaTextBlockParam]) }
|
18
|
+
attr_accessor :content
|
19
|
+
|
20
|
+
sig { returns(String) }
|
21
|
+
attr_accessor :source
|
22
|
+
|
23
|
+
sig { returns(String) }
|
24
|
+
attr_accessor :title
|
25
|
+
|
26
|
+
sig { returns(Symbol) }
|
27
|
+
attr_accessor :type
|
28
|
+
|
29
|
+
# Create a cache control breakpoint at this content block.
|
30
|
+
sig { returns(T.nilable(Anthropic::Beta::BetaCacheControlEphemeral)) }
|
31
|
+
attr_reader :cache_control
|
32
|
+
|
33
|
+
sig do
|
34
|
+
params(
|
35
|
+
cache_control:
|
36
|
+
T.nilable(Anthropic::Beta::BetaCacheControlEphemeral::OrHash)
|
37
|
+
).void
|
38
|
+
end
|
39
|
+
attr_writer :cache_control
|
40
|
+
|
41
|
+
sig { returns(T.nilable(Anthropic::Beta::BetaCitationsConfigParam)) }
|
42
|
+
attr_reader :citations
|
43
|
+
|
44
|
+
sig do
|
45
|
+
params(
|
46
|
+
citations: Anthropic::Beta::BetaCitationsConfigParam::OrHash
|
47
|
+
).void
|
48
|
+
end
|
49
|
+
attr_writer :citations
|
50
|
+
|
51
|
+
sig do
|
52
|
+
params(
|
53
|
+
content: T::Array[Anthropic::Beta::BetaTextBlockParam::OrHash],
|
54
|
+
source: String,
|
55
|
+
title: String,
|
56
|
+
cache_control:
|
57
|
+
T.nilable(Anthropic::Beta::BetaCacheControlEphemeral::OrHash),
|
58
|
+
citations: Anthropic::Beta::BetaCitationsConfigParam::OrHash,
|
59
|
+
type: Symbol
|
60
|
+
).returns(T.attached_class)
|
61
|
+
end
|
62
|
+
def self.new(
|
63
|
+
content:,
|
64
|
+
source:,
|
65
|
+
title:,
|
66
|
+
# Create a cache control breakpoint at this content block.
|
67
|
+
cache_control: nil,
|
68
|
+
citations: nil,
|
69
|
+
type: :search_result
|
70
|
+
)
|
71
|
+
end
|
72
|
+
|
73
|
+
sig do
|
74
|
+
override.returns(
|
75
|
+
{
|
76
|
+
content: T::Array[Anthropic::Beta::BetaTextBlockParam],
|
77
|
+
source: String,
|
78
|
+
title: String,
|
79
|
+
type: Symbol,
|
80
|
+
cache_control:
|
81
|
+
T.nilable(Anthropic::Beta::BetaCacheControlEphemeral),
|
82
|
+
citations: Anthropic::Beta::BetaCitationsConfigParam
|
83
|
+
}
|
84
|
+
)
|
85
|
+
end
|
86
|
+
def to_hash
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
@@ -14,18 +14,33 @@ module Anthropic
|
|
14
14
|
)
|
15
15
|
end
|
16
16
|
|
17
|
+
# The number of web fetch tool requests.
|
18
|
+
sig { returns(Integer) }
|
19
|
+
attr_accessor :web_fetch_requests
|
20
|
+
|
17
21
|
# The number of web search tool requests.
|
18
22
|
sig { returns(Integer) }
|
19
23
|
attr_accessor :web_search_requests
|
20
24
|
|
21
|
-
sig
|
25
|
+
sig do
|
26
|
+
params(
|
27
|
+
web_fetch_requests: Integer,
|
28
|
+
web_search_requests: Integer
|
29
|
+
).returns(T.attached_class)
|
30
|
+
end
|
22
31
|
def self.new(
|
32
|
+
# The number of web fetch tool requests.
|
33
|
+
web_fetch_requests:,
|
23
34
|
# The number of web search tool requests.
|
24
35
|
web_search_requests:
|
25
36
|
)
|
26
37
|
end
|
27
38
|
|
28
|
-
sig
|
39
|
+
sig do
|
40
|
+
override.returns(
|
41
|
+
{ web_fetch_requests: Integer, web_search_requests: Integer }
|
42
|
+
)
|
43
|
+
end
|
29
44
|
def to_hash
|
30
45
|
end
|
31
46
|
end
|
@@ -66,11 +66,26 @@ module Anthropic
|
|
66
66
|
:web_search,
|
67
67
|
Anthropic::Beta::BetaServerToolUseBlock::Name::TaggedSymbol
|
68
68
|
)
|
69
|
+
WEB_FETCH =
|
70
|
+
T.let(
|
71
|
+
:web_fetch,
|
72
|
+
Anthropic::Beta::BetaServerToolUseBlock::Name::TaggedSymbol
|
73
|
+
)
|
69
74
|
CODE_EXECUTION =
|
70
75
|
T.let(
|
71
76
|
:code_execution,
|
72
77
|
Anthropic::Beta::BetaServerToolUseBlock::Name::TaggedSymbol
|
73
78
|
)
|
79
|
+
BASH_CODE_EXECUTION =
|
80
|
+
T.let(
|
81
|
+
:bash_code_execution,
|
82
|
+
Anthropic::Beta::BetaServerToolUseBlock::Name::TaggedSymbol
|
83
|
+
)
|
84
|
+
TEXT_EDITOR_CODE_EXECUTION =
|
85
|
+
T.let(
|
86
|
+
:text_editor_code_execution,
|
87
|
+
Anthropic::Beta::BetaServerToolUseBlock::Name::TaggedSymbol
|
88
|
+
)
|
74
89
|
|
75
90
|
sig do
|
76
91
|
override.returns(
|
@@ -90,11 +90,26 @@ module Anthropic
|
|
90
90
|
:web_search,
|
91
91
|
Anthropic::Beta::BetaServerToolUseBlockParam::Name::TaggedSymbol
|
92
92
|
)
|
93
|
+
WEB_FETCH =
|
94
|
+
T.let(
|
95
|
+
:web_fetch,
|
96
|
+
Anthropic::Beta::BetaServerToolUseBlockParam::Name::TaggedSymbol
|
97
|
+
)
|
93
98
|
CODE_EXECUTION =
|
94
99
|
T.let(
|
95
100
|
:code_execution,
|
96
101
|
Anthropic::Beta::BetaServerToolUseBlockParam::Name::TaggedSymbol
|
97
102
|
)
|
103
|
+
BASH_CODE_EXECUTION =
|
104
|
+
T.let(
|
105
|
+
:bash_code_execution,
|
106
|
+
Anthropic::Beta::BetaServerToolUseBlockParam::Name::TaggedSymbol
|
107
|
+
)
|
108
|
+
TEXT_EDITOR_CODE_EXECUTION =
|
109
|
+
T.let(
|
110
|
+
:text_editor_code_execution,
|
111
|
+
Anthropic::Beta::BetaServerToolUseBlockParam::Name::TaggedSymbol
|
112
|
+
)
|
98
113
|
|
99
114
|
sig do
|
100
115
|
override.returns(
|
@@ -38,7 +38,8 @@ module Anthropic
|
|
38
38
|
Anthropic::Beta::BetaCitationCharLocation::OrHash,
|
39
39
|
Anthropic::Beta::BetaCitationPageLocation::OrHash,
|
40
40
|
Anthropic::Beta::BetaCitationContentBlockLocation::OrHash,
|
41
|
-
Anthropic::Beta::BetaCitationsWebSearchResultLocation::OrHash
|
41
|
+
Anthropic::Beta::BetaCitationsWebSearchResultLocation::OrHash,
|
42
|
+
Anthropic::Beta::BetaCitationSearchResultLocation::OrHash
|
42
43
|
)
|
43
44
|
]
|
44
45
|
),
|
@@ -40,7 +40,8 @@ module Anthropic
|
|
40
40
|
Anthropic::Beta::BetaCitationCharLocationParam,
|
41
41
|
Anthropic::Beta::BetaCitationPageLocationParam,
|
42
42
|
Anthropic::Beta::BetaCitationContentBlockLocationParam,
|
43
|
-
Anthropic::Beta::BetaCitationWebSearchResultLocationParam
|
43
|
+
Anthropic::Beta::BetaCitationWebSearchResultLocationParam,
|
44
|
+
Anthropic::Beta::BetaCitationSearchResultLocationParam
|
44
45
|
)
|
45
46
|
]
|
46
47
|
)
|
@@ -60,7 +61,8 @@ module Anthropic
|
|
60
61
|
Anthropic::Beta::BetaCitationCharLocationParam::OrHash,
|
61
62
|
Anthropic::Beta::BetaCitationPageLocationParam::OrHash,
|
62
63
|
Anthropic::Beta::BetaCitationContentBlockLocationParam::OrHash,
|
63
|
-
Anthropic::Beta::BetaCitationWebSearchResultLocationParam::OrHash
|
64
|
+
Anthropic::Beta::BetaCitationWebSearchResultLocationParam::OrHash,
|
65
|
+
Anthropic::Beta::BetaCitationSearchResultLocationParam::OrHash
|
64
66
|
)
|
65
67
|
]
|
66
68
|
),
|
@@ -90,7 +92,8 @@ module Anthropic
|
|
90
92
|
Anthropic::Beta::BetaCitationCharLocationParam,
|
91
93
|
Anthropic::Beta::BetaCitationPageLocationParam,
|
92
94
|
Anthropic::Beta::BetaCitationContentBlockLocationParam,
|
93
|
-
Anthropic::Beta::BetaCitationWebSearchResultLocationParam
|
95
|
+
Anthropic::Beta::BetaCitationWebSearchResultLocationParam,
|
96
|
+
Anthropic::Beta::BetaCitationSearchResultLocationParam
|
94
97
|
)
|
95
98
|
]
|
96
99
|
)
|
@@ -14,7 +14,8 @@ module Anthropic
|
|
14
14
|
Anthropic::Beta::BetaCitationCharLocation,
|
15
15
|
Anthropic::Beta::BetaCitationPageLocation,
|
16
16
|
Anthropic::Beta::BetaCitationContentBlockLocation,
|
17
|
-
Anthropic::Beta::BetaCitationsWebSearchResultLocation
|
17
|
+
Anthropic::Beta::BetaCitationsWebSearchResultLocation,
|
18
|
+
Anthropic::Beta::BetaCitationSearchResultLocation
|
18
19
|
)
|
19
20
|
end
|
20
21
|
|
@@ -14,7 +14,8 @@ module Anthropic
|
|
14
14
|
Anthropic::Beta::BetaCitationCharLocationParam,
|
15
15
|
Anthropic::Beta::BetaCitationPageLocationParam,
|
16
16
|
Anthropic::Beta::BetaCitationContentBlockLocationParam,
|
17
|
-
Anthropic::Beta::BetaCitationWebSearchResultLocationParam
|
17
|
+
Anthropic::Beta::BetaCitationWebSearchResultLocationParam,
|
18
|
+
Anthropic::Beta::BetaCitationSearchResultLocationParam
|
18
19
|
)
|
19
20
|
end
|
20
21
|
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Anthropic
|
4
|
+
module Models
|
5
|
+
BetaTextEditorCodeExecutionCreateResultBlock =
|
6
|
+
Beta::BetaTextEditorCodeExecutionCreateResultBlock
|
7
|
+
|
8
|
+
module Beta
|
9
|
+
class BetaTextEditorCodeExecutionCreateResultBlock < Anthropic::Internal::Type::BaseModel
|
10
|
+
OrHash =
|
11
|
+
T.type_alias do
|
12
|
+
T.any(
|
13
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionCreateResultBlock,
|
14
|
+
Anthropic::Internal::AnyHash
|
15
|
+
)
|
16
|
+
end
|
17
|
+
|
18
|
+
sig { returns(T::Boolean) }
|
19
|
+
attr_accessor :is_file_update
|
20
|
+
|
21
|
+
sig { returns(Symbol) }
|
22
|
+
attr_accessor :type
|
23
|
+
|
24
|
+
sig do
|
25
|
+
params(is_file_update: T::Boolean, type: Symbol).returns(
|
26
|
+
T.attached_class
|
27
|
+
)
|
28
|
+
end
|
29
|
+
def self.new(
|
30
|
+
is_file_update:,
|
31
|
+
type: :text_editor_code_execution_create_result
|
32
|
+
)
|
33
|
+
end
|
34
|
+
|
35
|
+
sig { override.returns({ is_file_update: T::Boolean, type: Symbol }) }
|
36
|
+
def to_hash
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Anthropic
|
4
|
+
module Models
|
5
|
+
BetaTextEditorCodeExecutionCreateResultBlockParam =
|
6
|
+
Beta::BetaTextEditorCodeExecutionCreateResultBlockParam
|
7
|
+
|
8
|
+
module Beta
|
9
|
+
class BetaTextEditorCodeExecutionCreateResultBlockParam < Anthropic::Internal::Type::BaseModel
|
10
|
+
OrHash =
|
11
|
+
T.type_alias do
|
12
|
+
T.any(
|
13
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionCreateResultBlockParam,
|
14
|
+
Anthropic::Internal::AnyHash
|
15
|
+
)
|
16
|
+
end
|
17
|
+
|
18
|
+
sig { returns(T::Boolean) }
|
19
|
+
attr_accessor :is_file_update
|
20
|
+
|
21
|
+
sig { returns(Symbol) }
|
22
|
+
attr_accessor :type
|
23
|
+
|
24
|
+
sig do
|
25
|
+
params(is_file_update: T::Boolean, type: Symbol).returns(
|
26
|
+
T.attached_class
|
27
|
+
)
|
28
|
+
end
|
29
|
+
def self.new(
|
30
|
+
is_file_update:,
|
31
|
+
type: :text_editor_code_execution_create_result
|
32
|
+
)
|
33
|
+
end
|
34
|
+
|
35
|
+
sig { override.returns({ is_file_update: T::Boolean, type: Symbol }) }
|
36
|
+
def to_hash
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,73 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Anthropic
|
4
|
+
module Models
|
5
|
+
BetaTextEditorCodeExecutionStrReplaceResultBlock =
|
6
|
+
Beta::BetaTextEditorCodeExecutionStrReplaceResultBlock
|
7
|
+
|
8
|
+
module Beta
|
9
|
+
class BetaTextEditorCodeExecutionStrReplaceResultBlock < Anthropic::Internal::Type::BaseModel
|
10
|
+
OrHash =
|
11
|
+
T.type_alias do
|
12
|
+
T.any(
|
13
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionStrReplaceResultBlock,
|
14
|
+
Anthropic::Internal::AnyHash
|
15
|
+
)
|
16
|
+
end
|
17
|
+
|
18
|
+
sig { returns(T.nilable(T::Array[String])) }
|
19
|
+
attr_accessor :lines
|
20
|
+
|
21
|
+
sig { returns(T.nilable(Integer)) }
|
22
|
+
attr_accessor :new_lines
|
23
|
+
|
24
|
+
sig { returns(T.nilable(Integer)) }
|
25
|
+
attr_accessor :new_start
|
26
|
+
|
27
|
+
sig { returns(T.nilable(Integer)) }
|
28
|
+
attr_accessor :old_lines
|
29
|
+
|
30
|
+
sig { returns(T.nilable(Integer)) }
|
31
|
+
attr_accessor :old_start
|
32
|
+
|
33
|
+
sig { returns(Symbol) }
|
34
|
+
attr_accessor :type
|
35
|
+
|
36
|
+
sig do
|
37
|
+
params(
|
38
|
+
lines: T.nilable(T::Array[String]),
|
39
|
+
new_lines: T.nilable(Integer),
|
40
|
+
new_start: T.nilable(Integer),
|
41
|
+
old_lines: T.nilable(Integer),
|
42
|
+
old_start: T.nilable(Integer),
|
43
|
+
type: Symbol
|
44
|
+
).returns(T.attached_class)
|
45
|
+
end
|
46
|
+
def self.new(
|
47
|
+
lines:,
|
48
|
+
new_lines:,
|
49
|
+
new_start:,
|
50
|
+
old_lines:,
|
51
|
+
old_start:,
|
52
|
+
type: :text_editor_code_execution_str_replace_result
|
53
|
+
)
|
54
|
+
end
|
55
|
+
|
56
|
+
sig do
|
57
|
+
override.returns(
|
58
|
+
{
|
59
|
+
lines: T.nilable(T::Array[String]),
|
60
|
+
new_lines: T.nilable(Integer),
|
61
|
+
new_start: T.nilable(Integer),
|
62
|
+
old_lines: T.nilable(Integer),
|
63
|
+
old_start: T.nilable(Integer),
|
64
|
+
type: Symbol
|
65
|
+
}
|
66
|
+
)
|
67
|
+
end
|
68
|
+
def to_hash
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
data/rbi/anthropic/models/beta/beta_text_editor_code_execution_str_replace_result_block_param.rbi
ADDED
@@ -0,0 +1,73 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Anthropic
|
4
|
+
module Models
|
5
|
+
BetaTextEditorCodeExecutionStrReplaceResultBlockParam =
|
6
|
+
Beta::BetaTextEditorCodeExecutionStrReplaceResultBlockParam
|
7
|
+
|
8
|
+
module Beta
|
9
|
+
class BetaTextEditorCodeExecutionStrReplaceResultBlockParam < Anthropic::Internal::Type::BaseModel
|
10
|
+
OrHash =
|
11
|
+
T.type_alias do
|
12
|
+
T.any(
|
13
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionStrReplaceResultBlockParam,
|
14
|
+
Anthropic::Internal::AnyHash
|
15
|
+
)
|
16
|
+
end
|
17
|
+
|
18
|
+
sig { returns(Symbol) }
|
19
|
+
attr_accessor :type
|
20
|
+
|
21
|
+
sig { returns(T.nilable(T::Array[String])) }
|
22
|
+
attr_accessor :lines
|
23
|
+
|
24
|
+
sig { returns(T.nilable(Integer)) }
|
25
|
+
attr_accessor :new_lines
|
26
|
+
|
27
|
+
sig { returns(T.nilable(Integer)) }
|
28
|
+
attr_accessor :new_start
|
29
|
+
|
30
|
+
sig { returns(T.nilable(Integer)) }
|
31
|
+
attr_accessor :old_lines
|
32
|
+
|
33
|
+
sig { returns(T.nilable(Integer)) }
|
34
|
+
attr_accessor :old_start
|
35
|
+
|
36
|
+
sig do
|
37
|
+
params(
|
38
|
+
lines: T.nilable(T::Array[String]),
|
39
|
+
new_lines: T.nilable(Integer),
|
40
|
+
new_start: T.nilable(Integer),
|
41
|
+
old_lines: T.nilable(Integer),
|
42
|
+
old_start: T.nilable(Integer),
|
43
|
+
type: Symbol
|
44
|
+
).returns(T.attached_class)
|
45
|
+
end
|
46
|
+
def self.new(
|
47
|
+
lines: nil,
|
48
|
+
new_lines: nil,
|
49
|
+
new_start: nil,
|
50
|
+
old_lines: nil,
|
51
|
+
old_start: nil,
|
52
|
+
type: :text_editor_code_execution_str_replace_result
|
53
|
+
)
|
54
|
+
end
|
55
|
+
|
56
|
+
sig do
|
57
|
+
override.returns(
|
58
|
+
{
|
59
|
+
type: Symbol,
|
60
|
+
lines: T.nilable(T::Array[String]),
|
61
|
+
new_lines: T.nilable(Integer),
|
62
|
+
new_start: T.nilable(Integer),
|
63
|
+
old_lines: T.nilable(Integer),
|
64
|
+
old_start: T.nilable(Integer)
|
65
|
+
}
|
66
|
+
)
|
67
|
+
end
|
68
|
+
def to_hash
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
@@ -0,0 +1,90 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Anthropic
|
4
|
+
module Models
|
5
|
+
BetaTextEditorCodeExecutionToolResultBlock =
|
6
|
+
Beta::BetaTextEditorCodeExecutionToolResultBlock
|
7
|
+
|
8
|
+
module Beta
|
9
|
+
class BetaTextEditorCodeExecutionToolResultBlock < Anthropic::Internal::Type::BaseModel
|
10
|
+
OrHash =
|
11
|
+
T.type_alias do
|
12
|
+
T.any(
|
13
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultBlock,
|
14
|
+
Anthropic::Internal::AnyHash
|
15
|
+
)
|
16
|
+
end
|
17
|
+
|
18
|
+
sig do
|
19
|
+
returns(
|
20
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultBlock::Content::Variants
|
21
|
+
)
|
22
|
+
end
|
23
|
+
attr_accessor :content
|
24
|
+
|
25
|
+
sig { returns(String) }
|
26
|
+
attr_accessor :tool_use_id
|
27
|
+
|
28
|
+
sig { returns(Symbol) }
|
29
|
+
attr_accessor :type
|
30
|
+
|
31
|
+
sig do
|
32
|
+
params(
|
33
|
+
content:
|
34
|
+
T.any(
|
35
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultError::OrHash,
|
36
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionViewResultBlock::OrHash,
|
37
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionCreateResultBlock::OrHash,
|
38
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionStrReplaceResultBlock::OrHash
|
39
|
+
),
|
40
|
+
tool_use_id: String,
|
41
|
+
type: Symbol
|
42
|
+
).returns(T.attached_class)
|
43
|
+
end
|
44
|
+
def self.new(
|
45
|
+
content:,
|
46
|
+
tool_use_id:,
|
47
|
+
type: :text_editor_code_execution_tool_result
|
48
|
+
)
|
49
|
+
end
|
50
|
+
|
51
|
+
sig do
|
52
|
+
override.returns(
|
53
|
+
{
|
54
|
+
content:
|
55
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultBlock::Content::Variants,
|
56
|
+
tool_use_id: String,
|
57
|
+
type: Symbol
|
58
|
+
}
|
59
|
+
)
|
60
|
+
end
|
61
|
+
def to_hash
|
62
|
+
end
|
63
|
+
|
64
|
+
module Content
|
65
|
+
extend Anthropic::Internal::Type::Union
|
66
|
+
|
67
|
+
Variants =
|
68
|
+
T.type_alias do
|
69
|
+
T.any(
|
70
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultError,
|
71
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionViewResultBlock,
|
72
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionCreateResultBlock,
|
73
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionStrReplaceResultBlock
|
74
|
+
)
|
75
|
+
end
|
76
|
+
|
77
|
+
sig do
|
78
|
+
override.returns(
|
79
|
+
T::Array[
|
80
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultBlock::Content::Variants
|
81
|
+
]
|
82
|
+
)
|
83
|
+
end
|
84
|
+
def self.variants
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
@@ -0,0 +1,118 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Anthropic
|
4
|
+
module Models
|
5
|
+
BetaTextEditorCodeExecutionToolResultBlockParam =
|
6
|
+
Beta::BetaTextEditorCodeExecutionToolResultBlockParam
|
7
|
+
|
8
|
+
module Beta
|
9
|
+
class BetaTextEditorCodeExecutionToolResultBlockParam < Anthropic::Internal::Type::BaseModel
|
10
|
+
OrHash =
|
11
|
+
T.type_alias do
|
12
|
+
T.any(
|
13
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultBlockParam,
|
14
|
+
Anthropic::Internal::AnyHash
|
15
|
+
)
|
16
|
+
end
|
17
|
+
|
18
|
+
sig do
|
19
|
+
returns(
|
20
|
+
T.any(
|
21
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultErrorParam,
|
22
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionViewResultBlockParam,
|
23
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionCreateResultBlockParam,
|
24
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionStrReplaceResultBlockParam
|
25
|
+
)
|
26
|
+
)
|
27
|
+
end
|
28
|
+
attr_accessor :content
|
29
|
+
|
30
|
+
sig { returns(String) }
|
31
|
+
attr_accessor :tool_use_id
|
32
|
+
|
33
|
+
sig { returns(Symbol) }
|
34
|
+
attr_accessor :type
|
35
|
+
|
36
|
+
# Create a cache control breakpoint at this content block.
|
37
|
+
sig { returns(T.nilable(Anthropic::Beta::BetaCacheControlEphemeral)) }
|
38
|
+
attr_reader :cache_control
|
39
|
+
|
40
|
+
sig do
|
41
|
+
params(
|
42
|
+
cache_control:
|
43
|
+
T.nilable(Anthropic::Beta::BetaCacheControlEphemeral::OrHash)
|
44
|
+
).void
|
45
|
+
end
|
46
|
+
attr_writer :cache_control
|
47
|
+
|
48
|
+
sig do
|
49
|
+
params(
|
50
|
+
content:
|
51
|
+
T.any(
|
52
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultErrorParam::OrHash,
|
53
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionViewResultBlockParam::OrHash,
|
54
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionCreateResultBlockParam::OrHash,
|
55
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionStrReplaceResultBlockParam::OrHash
|
56
|
+
),
|
57
|
+
tool_use_id: String,
|
58
|
+
cache_control:
|
59
|
+
T.nilable(Anthropic::Beta::BetaCacheControlEphemeral::OrHash),
|
60
|
+
type: Symbol
|
61
|
+
).returns(T.attached_class)
|
62
|
+
end
|
63
|
+
def self.new(
|
64
|
+
content:,
|
65
|
+
tool_use_id:,
|
66
|
+
# Create a cache control breakpoint at this content block.
|
67
|
+
cache_control: nil,
|
68
|
+
type: :text_editor_code_execution_tool_result
|
69
|
+
)
|
70
|
+
end
|
71
|
+
|
72
|
+
sig do
|
73
|
+
override.returns(
|
74
|
+
{
|
75
|
+
content:
|
76
|
+
T.any(
|
77
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultErrorParam,
|
78
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionViewResultBlockParam,
|
79
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionCreateResultBlockParam,
|
80
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionStrReplaceResultBlockParam
|
81
|
+
),
|
82
|
+
tool_use_id: String,
|
83
|
+
type: Symbol,
|
84
|
+
cache_control:
|
85
|
+
T.nilable(Anthropic::Beta::BetaCacheControlEphemeral)
|
86
|
+
}
|
87
|
+
)
|
88
|
+
end
|
89
|
+
def to_hash
|
90
|
+
end
|
91
|
+
|
92
|
+
module Content
|
93
|
+
extend Anthropic::Internal::Type::Union
|
94
|
+
|
95
|
+
Variants =
|
96
|
+
T.type_alias do
|
97
|
+
T.any(
|
98
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultErrorParam,
|
99
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionViewResultBlockParam,
|
100
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionCreateResultBlockParam,
|
101
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionStrReplaceResultBlockParam
|
102
|
+
)
|
103
|
+
end
|
104
|
+
|
105
|
+
sig do
|
106
|
+
override.returns(
|
107
|
+
T::Array[
|
108
|
+
Anthropic::Beta::BetaTextEditorCodeExecutionToolResultBlockParam::Content::Variants
|
109
|
+
]
|
110
|
+
)
|
111
|
+
end
|
112
|
+
def self.variants
|
113
|
+
end
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|