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
@@ -6,6 +6,15 @@ module Anthropic
|
|
6
6
|
OrHash =
|
7
7
|
T.type_alias { T.any(Anthropic::Usage, Anthropic::Internal::AnyHash) }
|
8
8
|
|
9
|
+
# Breakdown of cached tokens by TTL
|
10
|
+
sig { returns(T.nilable(Anthropic::CacheCreation)) }
|
11
|
+
attr_reader :cache_creation
|
12
|
+
|
13
|
+
sig do
|
14
|
+
params(cache_creation: T.nilable(Anthropic::CacheCreation::OrHash)).void
|
15
|
+
end
|
16
|
+
attr_writer :cache_creation
|
17
|
+
|
9
18
|
# The number of input tokens used to create the cache entry.
|
10
19
|
sig { returns(T.nilable(Integer)) }
|
11
20
|
attr_accessor :cache_creation_input_tokens
|
@@ -39,6 +48,7 @@ module Anthropic
|
|
39
48
|
|
40
49
|
sig do
|
41
50
|
params(
|
51
|
+
cache_creation: T.nilable(Anthropic::CacheCreation::OrHash),
|
42
52
|
cache_creation_input_tokens: T.nilable(Integer),
|
43
53
|
cache_read_input_tokens: T.nilable(Integer),
|
44
54
|
input_tokens: Integer,
|
@@ -48,6 +58,8 @@ module Anthropic
|
|
48
58
|
).returns(T.attached_class)
|
49
59
|
end
|
50
60
|
def self.new(
|
61
|
+
# Breakdown of cached tokens by TTL
|
62
|
+
cache_creation:,
|
51
63
|
# The number of input tokens used to create the cache entry.
|
52
64
|
cache_creation_input_tokens:,
|
53
65
|
# The number of input tokens read from the cache.
|
@@ -66,6 +78,7 @@ module Anthropic
|
|
66
78
|
sig do
|
67
79
|
override.returns(
|
68
80
|
{
|
81
|
+
cache_creation: T.nilable(Anthropic::CacheCreation),
|
69
82
|
cache_creation_input_tokens: T.nilable(Integer),
|
70
83
|
cache_read_input_tokens: T.nilable(Integer),
|
71
84
|
input_tokens: Integer,
|
data/rbi/anthropic/models.rbi
CHANGED
@@ -39,6 +39,8 @@ module Anthropic
|
|
39
39
|
|
40
40
|
CacheControlEphemeral = Anthropic::Models::CacheControlEphemeral
|
41
41
|
|
42
|
+
CacheCreation = Anthropic::Models::CacheCreation
|
43
|
+
|
42
44
|
CitationCharLocation = Anthropic::Models::CitationCharLocation
|
43
45
|
|
44
46
|
CitationCharLocationParam = Anthropic::Models::CitationCharLocationParam
|
@@ -56,6 +58,12 @@ module Anthropic
|
|
56
58
|
|
57
59
|
CitationsDelta = Anthropic::Models::CitationsDelta
|
58
60
|
|
61
|
+
CitationSearchResultLocationParam =
|
62
|
+
Anthropic::Models::CitationSearchResultLocationParam
|
63
|
+
|
64
|
+
CitationsSearchResultLocation =
|
65
|
+
Anthropic::Models::CitationsSearchResultLocation
|
66
|
+
|
59
67
|
CitationsWebSearchResultLocation =
|
60
68
|
Anthropic::Models::CitationsWebSearchResultLocation
|
61
69
|
|
@@ -144,6 +152,8 @@ module Anthropic
|
|
144
152
|
|
145
153
|
RedactedThinkingBlockParam = Anthropic::Models::RedactedThinkingBlockParam
|
146
154
|
|
155
|
+
SearchResultBlockParam = Anthropic::Models::SearchResultBlockParam
|
156
|
+
|
147
157
|
ServerToolUsage = Anthropic::Models::ServerToolUsage
|
148
158
|
|
149
159
|
ServerToolUseBlock = Anthropic::Models::ServerToolUseBlock
|
@@ -194,6 +204,10 @@ module Anthropic
|
|
194
204
|
|
195
205
|
ToolTextEditor20250124 = Anthropic::Models::ToolTextEditor20250124
|
196
206
|
|
207
|
+
ToolTextEditor20250429 = Anthropic::Models::ToolTextEditor20250429
|
208
|
+
|
209
|
+
ToolTextEditor20250728 = Anthropic::Models::ToolTextEditor20250728
|
210
|
+
|
197
211
|
ToolUnion = Anthropic::Models::ToolUnion
|
198
212
|
|
199
213
|
ToolUseBlock = Anthropic::Models::ToolUseBlock
|
@@ -48,15 +48,18 @@ module Anthropic
|
|
48
48
|
T::Array[
|
49
49
|
T.any(
|
50
50
|
Anthropic::Beta::BetaTool::OrHash,
|
51
|
-
Anthropic::Beta::BetaToolComputerUse20241022::OrHash,
|
52
51
|
Anthropic::Beta::BetaToolBash20241022::OrHash,
|
53
|
-
Anthropic::Beta::BetaToolTextEditor20241022::OrHash,
|
54
|
-
Anthropic::Beta::BetaToolComputerUse20250124::OrHash,
|
55
52
|
Anthropic::Beta::BetaToolBash20250124::OrHash,
|
53
|
+
Anthropic::Beta::BetaCodeExecutionTool20250522::OrHash,
|
54
|
+
Anthropic::Beta::BetaCodeExecutionTool20250825::OrHash,
|
55
|
+
Anthropic::Beta::BetaToolComputerUse20241022::OrHash,
|
56
|
+
Anthropic::Beta::BetaToolComputerUse20250124::OrHash,
|
57
|
+
Anthropic::Beta::BetaToolTextEditor20241022::OrHash,
|
56
58
|
Anthropic::Beta::BetaToolTextEditor20250124::OrHash,
|
57
59
|
Anthropic::Beta::BetaToolTextEditor20250429::OrHash,
|
60
|
+
Anthropic::Beta::BetaToolTextEditor20250728::OrHash,
|
58
61
|
Anthropic::Beta::BetaWebSearchTool20250305::OrHash,
|
59
|
-
Anthropic::Beta::
|
62
|
+
Anthropic::Beta::BetaWebFetchTool20250910::OrHash
|
60
63
|
)
|
61
64
|
],
|
62
65
|
top_k: Integer,
|
@@ -132,37 +135,14 @@ module Anthropic
|
|
132
135
|
# { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
|
133
136
|
# ```
|
134
137
|
#
|
135
|
-
#
|
136
|
-
#
|
137
|
-
# ```json
|
138
|
-
# {
|
139
|
-
# "role": "user",
|
140
|
-
# "content": [
|
141
|
-
# {
|
142
|
-
# "type": "image",
|
143
|
-
# "source": {
|
144
|
-
# "type": "base64",
|
145
|
-
# "media_type": "image/jpeg",
|
146
|
-
# "data": "/9j/4AAQSkZJRg..."
|
147
|
-
# }
|
148
|
-
# },
|
149
|
-
# { "type": "text", "text": "What is in this image?" }
|
150
|
-
# ]
|
151
|
-
# }
|
152
|
-
# ```
|
153
|
-
#
|
154
|
-
# We currently support the `base64` source type for images, and the `image/jpeg`,
|
155
|
-
# `image/png`, `image/gif`, and `image/webp` media types.
|
156
|
-
#
|
157
|
-
# See [examples](https://docs.anthropic.com/en/api/messages-examples#vision) for
|
158
|
-
# more input examples.
|
138
|
+
# See [input examples](https://docs.anthropic.com/en/api/messages-examples).
|
159
139
|
#
|
160
140
|
# Note that if you want to include a
|
161
141
|
# [system prompt](https://docs.anthropic.com/en/docs/system-prompts), you can use
|
162
142
|
# the top-level `system` parameter — there is no `"system"` role for input
|
163
143
|
# messages in the Messages API.
|
164
144
|
#
|
165
|
-
# There is a limit of
|
145
|
+
# There is a limit of 100,000 messages in a single request.
|
166
146
|
messages:,
|
167
147
|
# Body param: The model that will complete your prompt.\n\nSee
|
168
148
|
# [models](https://docs.anthropic.com/en/docs/models-overview) for additional
|
@@ -225,6 +205,12 @@ module Anthropic
|
|
225
205
|
# those tools using the tool input generated by the model and then optionally
|
226
206
|
# return results back to the model using `tool_result` content blocks.
|
227
207
|
#
|
208
|
+
# There are two types of tools: **client tools** and **server tools**. The
|
209
|
+
# behavior described below applies to client tools. For
|
210
|
+
# [server tools](https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/overview#server-tools),
|
211
|
+
# see their individual documentation as each has its own behavior (e.g., the
|
212
|
+
# [web search tool](https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/web-search-tool)).
|
213
|
+
#
|
228
214
|
# Each tool definition includes:
|
229
215
|
#
|
230
216
|
# - `name`: Name of the tool.
|
@@ -356,15 +342,18 @@ module Anthropic
|
|
356
342
|
T::Array[
|
357
343
|
T.any(
|
358
344
|
Anthropic::Beta::BetaTool::OrHash,
|
359
|
-
Anthropic::Beta::BetaToolComputerUse20241022::OrHash,
|
360
345
|
Anthropic::Beta::BetaToolBash20241022::OrHash,
|
361
|
-
Anthropic::Beta::BetaToolTextEditor20241022::OrHash,
|
362
|
-
Anthropic::Beta::BetaToolComputerUse20250124::OrHash,
|
363
346
|
Anthropic::Beta::BetaToolBash20250124::OrHash,
|
347
|
+
Anthropic::Beta::BetaCodeExecutionTool20250522::OrHash,
|
348
|
+
Anthropic::Beta::BetaCodeExecutionTool20250825::OrHash,
|
349
|
+
Anthropic::Beta::BetaToolComputerUse20241022::OrHash,
|
350
|
+
Anthropic::Beta::BetaToolComputerUse20250124::OrHash,
|
351
|
+
Anthropic::Beta::BetaToolTextEditor20241022::OrHash,
|
364
352
|
Anthropic::Beta::BetaToolTextEditor20250124::OrHash,
|
365
353
|
Anthropic::Beta::BetaToolTextEditor20250429::OrHash,
|
354
|
+
Anthropic::Beta::BetaToolTextEditor20250728::OrHash,
|
366
355
|
Anthropic::Beta::BetaWebSearchTool20250305::OrHash,
|
367
|
-
Anthropic::Beta::
|
356
|
+
Anthropic::Beta::BetaWebFetchTool20250910::OrHash
|
368
357
|
)
|
369
358
|
],
|
370
359
|
top_k: Integer,
|
@@ -444,37 +433,14 @@ module Anthropic
|
|
444
433
|
# { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
|
445
434
|
# ```
|
446
435
|
#
|
447
|
-
#
|
448
|
-
#
|
449
|
-
# ```json
|
450
|
-
# {
|
451
|
-
# "role": "user",
|
452
|
-
# "content": [
|
453
|
-
# {
|
454
|
-
# "type": "image",
|
455
|
-
# "source": {
|
456
|
-
# "type": "base64",
|
457
|
-
# "media_type": "image/jpeg",
|
458
|
-
# "data": "/9j/4AAQSkZJRg..."
|
459
|
-
# }
|
460
|
-
# },
|
461
|
-
# { "type": "text", "text": "What is in this image?" }
|
462
|
-
# ]
|
463
|
-
# }
|
464
|
-
# ```
|
465
|
-
#
|
466
|
-
# We currently support the `base64` source type for images, and the `image/jpeg`,
|
467
|
-
# `image/png`, `image/gif`, and `image/webp` media types.
|
468
|
-
#
|
469
|
-
# See [examples](https://docs.anthropic.com/en/api/messages-examples#vision) for
|
470
|
-
# more input examples.
|
436
|
+
# See [input examples](https://docs.anthropic.com/en/api/messages-examples).
|
471
437
|
#
|
472
438
|
# Note that if you want to include a
|
473
439
|
# [system prompt](https://docs.anthropic.com/en/docs/system-prompts), you can use
|
474
440
|
# the top-level `system` parameter — there is no `"system"` role for input
|
475
441
|
# messages in the Messages API.
|
476
442
|
#
|
477
|
-
# There is a limit of
|
443
|
+
# There is a limit of 100,000 messages in a single request.
|
478
444
|
messages:,
|
479
445
|
# Body param: The model that will complete your prompt.\n\nSee
|
480
446
|
# [models](https://docs.anthropic.com/en/docs/models-overview) for additional
|
@@ -537,6 +503,12 @@ module Anthropic
|
|
537
503
|
# those tools using the tool input generated by the model and then optionally
|
538
504
|
# return results back to the model using `tool_result` content blocks.
|
539
505
|
#
|
506
|
+
# There are two types of tools: **client tools** and **server tools**. The
|
507
|
+
# behavior described below applies to client tools. For
|
508
|
+
# [server tools](https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/overview#server-tools),
|
509
|
+
# see their individual documentation as each has its own behavior (e.g., the
|
510
|
+
# [web search tool](https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/web-search-tool)).
|
511
|
+
#
|
540
512
|
# Each tool definition includes:
|
541
513
|
#
|
542
514
|
# - `name`: Name of the tool.
|
@@ -660,15 +632,18 @@ module Anthropic
|
|
660
632
|
T::Array[
|
661
633
|
T.any(
|
662
634
|
Anthropic::Beta::BetaTool::OrHash,
|
663
|
-
Anthropic::Beta::BetaToolComputerUse20241022::OrHash,
|
664
635
|
Anthropic::Beta::BetaToolBash20241022::OrHash,
|
665
|
-
Anthropic::Beta::BetaToolTextEditor20241022::OrHash,
|
666
|
-
Anthropic::Beta::BetaToolComputerUse20250124::OrHash,
|
667
636
|
Anthropic::Beta::BetaToolBash20250124::OrHash,
|
637
|
+
Anthropic::Beta::BetaCodeExecutionTool20250522::OrHash,
|
638
|
+
Anthropic::Beta::BetaCodeExecutionTool20250825::OrHash,
|
639
|
+
Anthropic::Beta::BetaToolComputerUse20241022::OrHash,
|
640
|
+
Anthropic::Beta::BetaToolComputerUse20250124::OrHash,
|
641
|
+
Anthropic::Beta::BetaToolTextEditor20241022::OrHash,
|
668
642
|
Anthropic::Beta::BetaToolTextEditor20250124::OrHash,
|
669
643
|
Anthropic::Beta::BetaToolTextEditor20250429::OrHash,
|
644
|
+
Anthropic::Beta::BetaToolTextEditor20250728::OrHash,
|
670
645
|
Anthropic::Beta::BetaWebSearchTool20250305::OrHash,
|
671
|
-
Anthropic::Beta::
|
646
|
+
Anthropic::Beta::BetaWebFetchTool20250910::OrHash
|
672
647
|
)
|
673
648
|
],
|
674
649
|
betas: T::Array[T.any(String, Anthropic::AnthropicBeta::OrSymbol)],
|
@@ -733,37 +708,14 @@ module Anthropic
|
|
733
708
|
# { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
|
734
709
|
# ```
|
735
710
|
#
|
736
|
-
#
|
737
|
-
#
|
738
|
-
# ```json
|
739
|
-
# {
|
740
|
-
# "role": "user",
|
741
|
-
# "content": [
|
742
|
-
# {
|
743
|
-
# "type": "image",
|
744
|
-
# "source": {
|
745
|
-
# "type": "base64",
|
746
|
-
# "media_type": "image/jpeg",
|
747
|
-
# "data": "/9j/4AAQSkZJRg..."
|
748
|
-
# }
|
749
|
-
# },
|
750
|
-
# { "type": "text", "text": "What is in this image?" }
|
751
|
-
# ]
|
752
|
-
# }
|
753
|
-
# ```
|
754
|
-
#
|
755
|
-
# We currently support the `base64` source type for images, and the `image/jpeg`,
|
756
|
-
# `image/png`, `image/gif`, and `image/webp` media types.
|
757
|
-
#
|
758
|
-
# See [examples](https://docs.anthropic.com/en/api/messages-examples#vision) for
|
759
|
-
# more input examples.
|
711
|
+
# See [input examples](https://docs.anthropic.com/en/api/messages-examples).
|
760
712
|
#
|
761
713
|
# Note that if you want to include a
|
762
714
|
# [system prompt](https://docs.anthropic.com/en/docs/system-prompts), you can use
|
763
715
|
# the top-level `system` parameter — there is no `"system"` role for input
|
764
716
|
# messages in the Messages API.
|
765
717
|
#
|
766
|
-
# There is a limit of
|
718
|
+
# There is a limit of 100,000 messages in a single request.
|
767
719
|
messages:,
|
768
720
|
# Body param: The model that will complete your prompt.\n\nSee
|
769
721
|
# [models](https://docs.anthropic.com/en/docs/models-overview) for additional
|
@@ -797,6 +749,12 @@ module Anthropic
|
|
797
749
|
# those tools using the tool input generated by the model and then optionally
|
798
750
|
# return results back to the model using `tool_result` content blocks.
|
799
751
|
#
|
752
|
+
# There are two types of tools: **client tools** and **server tools**. The
|
753
|
+
# behavior described below applies to client tools. For
|
754
|
+
# [server tools](https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/overview#server-tools),
|
755
|
+
# see their individual documentation as each has its own behavior (e.g., the
|
756
|
+
# [web search tool](https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/web-search-tool)).
|
757
|
+
#
|
800
758
|
# Each tool definition includes:
|
801
759
|
#
|
802
760
|
# - `name`: Name of the tool.
|