anthropic 2.8.0 → 2.10.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 +72 -0
- data/README.md +1 -1
- data/lib/anthropic/error_classes.rb +11 -0
- data/lib/anthropic/errors.rb +4 -0
- data/lib/anthropic/helpers/bedrock/client.rb +6 -6
- data/lib/anthropic/helpers/threads/beta_message_thread.rb +30 -6
- data/lib/anthropic/helpers/tools/runner.rb +21 -4
- data/lib/anthropic/helpers/tracing/streamed_message.rb +8 -1
- data/lib/anthropic/internal/tracing.rb +1 -0
- data/lib/anthropic/internal/type/file_input.rb +11 -0
- data/lib/anthropic/internal/type/union.rb +26 -0
- data/lib/anthropic/internal/util.rb +46 -12
- data/lib/anthropic/models/anthropic_beta.rb +47 -30
- data/lib/anthropic/models/authentication_error.rb +2 -22
- data/lib/anthropic/models/authentication_error_object.rb +28 -0
- data/lib/anthropic/models/bash_code_execution_tool_result_block.rb +4 -4
- data/lib/anthropic/models/bash_code_execution_tool_result_error.rb +3 -15
- data/lib/anthropic/models/bash_code_execution_tool_result_error_object.rb +21 -0
- data/lib/anthropic/models/beta/beta_advisor_tool_result_block.rb +4 -4
- data/lib/anthropic/models/beta/beta_advisor_tool_result_error.rb +2 -31
- data/lib/anthropic/models/beta/beta_advisor_tool_result_error_object.rb +41 -0
- data/lib/anthropic/models/beta/beta_bash_code_execution_tool_result_block.rb +4 -4
- data/lib/anthropic/models/beta/beta_bash_code_execution_tool_result_error.rb +4 -29
- data/lib/anthropic/models/beta/beta_bash_code_execution_tool_result_error_object.rb +39 -0
- data/lib/anthropic/models/beta/beta_bill_to.rb +20 -0
- data/lib/anthropic/models/beta/beta_billing_policy.rb +36 -0
- data/lib/anthropic/models/beta/beta_code_execution_tool_result_block.rb +2 -2
- data/lib/anthropic/models/beta/beta_code_execution_tool_result_block_content.rb +2 -2
- data/lib/anthropic/models/beta/beta_code_execution_tool_result_error.rb +3 -15
- data/lib/anthropic/models/beta/beta_code_execution_tool_result_error_object.rb +25 -0
- data/lib/anthropic/models/beta/beta_content_block.rb +1 -1
- data/lib/anthropic/models/beta/beta_content_block_param.rb +1 -1
- data/lib/anthropic/models/beta/beta_dream.rb +3 -3
- data/lib/anthropic/models/beta/beta_dream_error.rb +2 -27
- data/lib/anthropic/models/beta/beta_dream_error_object.rb +37 -0
- data/lib/anthropic/models/beta/beta_dreaming_error.rb +2 -90
- data/lib/anthropic/models/beta/beta_dreaming_error_object.rb +100 -0
- data/lib/anthropic/models/beta/beta_managed_agents_agent_archived_deployment_paused_reason_error.rb +4 -11
- data/lib/anthropic/models/beta/beta_managed_agents_agent_archived_deployment_paused_reason_error_object.rb +22 -0
- data/lib/anthropic/models/beta/beta_managed_agents_agent_archived_run_error.rb +4 -19
- data/lib/anthropic/models/beta/beta_managed_agents_agent_archived_run_error_object.rb +29 -0
- data/lib/anthropic/models/beta/beta_managed_agents_agent_toolset_default_config.rb +1 -1
- data/lib/anthropic/models/beta/beta_managed_agents_agent_toolset_default_config_params.rb +1 -1
- data/lib/anthropic/models/beta/beta_managed_agents_auto_policy.rb +3 -1
- data/lib/anthropic/models/beta/beta_managed_agents_bash_tool_config.rb +1 -1
- data/lib/anthropic/models/beta/beta_managed_agents_bash_tool_config_params.rb +1 -1
- data/lib/anthropic/models/beta/beta_managed_agents_deployment_paused_reason.rb +1 -1
- data/lib/anthropic/models/beta/beta_managed_agents_deployment_paused_reason_error.rb +4 -130
- data/lib/anthropic/models/beta/beta_managed_agents_deployment_paused_reason_error_object.rb +143 -0
- data/lib/anthropic/models/beta/beta_managed_agents_deployment_run.rb +41 -36
- data/lib/anthropic/models/beta/beta_managed_agents_edit_tool_config.rb +1 -1
- data/lib/anthropic/models/beta/beta_managed_agents_edit_tool_config_params.rb +1 -1
- data/lib/anthropic/models/beta/beta_managed_agents_environment_archived_deployment_paused_reason_error.rb +4 -11
- data/lib/anthropic/models/beta/beta_managed_agents_environment_archived_deployment_paused_reason_error_object.rb +22 -0
- data/lib/anthropic/models/beta/beta_managed_agents_environment_archived_run_error.rb +4 -19
- data/lib/anthropic/models/beta/beta_managed_agents_environment_archived_run_error_object.rb +30 -0
- data/lib/anthropic/models/beta/beta_managed_agents_environment_not_found_deployment_paused_reason_error.rb +4 -11
- data/lib/anthropic/models/beta/beta_managed_agents_environment_not_found_deployment_paused_reason_error_object.rb +22 -0
- data/lib/anthropic/models/beta/beta_managed_agents_environment_not_found_run_error.rb +4 -19
- data/lib/anthropic/models/beta/beta_managed_agents_environment_not_found_run_error_object.rb +30 -0
- data/lib/anthropic/models/beta/beta_managed_agents_error_deployment_paused_reason.rb +3 -3
- data/lib/anthropic/models/beta/beta_managed_agents_file_not_found_deployment_paused_reason_error.rb +4 -11
- data/lib/anthropic/models/beta/beta_managed_agents_file_not_found_deployment_paused_reason_error_object.rb +22 -0
- data/lib/anthropic/models/beta/beta_managed_agents_file_not_found_run_error.rb +4 -19
- data/lib/anthropic/models/beta/beta_managed_agents_file_not_found_run_error_object.rb +29 -0
- data/lib/anthropic/models/beta/beta_managed_agents_glob_tool_config.rb +1 -1
- data/lib/anthropic/models/beta/beta_managed_agents_glob_tool_config_params.rb +1 -1
- data/lib/anthropic/models/beta/beta_managed_agents_grep_tool_config.rb +1 -1
- data/lib/anthropic/models/beta/beta_managed_agents_grep_tool_config_params.rb +1 -1
- data/lib/anthropic/models/beta/beta_managed_agents_mcp_egress_blocked_deployment_paused_reason_error.rb +4 -12
- data/lib/anthropic/models/beta/beta_managed_agents_mcp_egress_blocked_deployment_paused_reason_error_object.rb +23 -0
- data/lib/anthropic/models/beta/beta_managed_agents_mcp_egress_blocked_run_error.rb +4 -20
- data/lib/anthropic/models/beta/beta_managed_agents_mcp_egress_blocked_run_error_object.rb +30 -0
- data/lib/anthropic/models/beta/beta_managed_agents_mcp_tool_config.rb +1 -1
- data/lib/anthropic/models/beta/beta_managed_agents_mcp_tool_config_params.rb +1 -1
- data/lib/anthropic/models/beta/beta_managed_agents_mcp_toolset_default_config.rb +1 -1
- data/lib/anthropic/models/beta/beta_managed_agents_mcp_toolset_default_config_params.rb +1 -1
- data/lib/anthropic/models/beta/beta_managed_agents_memory_store_archived_deployment_paused_reason_error.rb +4 -11
- data/lib/anthropic/models/beta/beta_managed_agents_memory_store_archived_deployment_paused_reason_error_object.rb +22 -0
- data/lib/anthropic/models/beta/beta_managed_agents_memory_store_archived_run_error.rb +4 -19
- data/lib/anthropic/models/beta/beta_managed_agents_memory_store_archived_run_error_object.rb +30 -0
- data/lib/anthropic/models/beta/beta_managed_agents_multiagent_coordinator_params.rb +3 -2
- data/lib/anthropic/models/beta/beta_managed_agents_multiagent_params.rb +1 -1
- data/lib/anthropic/models/beta/beta_managed_agents_organization_disabled_deployment_paused_reason_error.rb +5 -11
- data/lib/anthropic/models/beta/beta_managed_agents_organization_disabled_deployment_paused_reason_error_object.rb +22 -0
- data/lib/anthropic/models/beta/beta_managed_agents_organization_disabled_run_error.rb +4 -19
- data/lib/anthropic/models/beta/beta_managed_agents_organization_disabled_run_error_object.rb +30 -0
- data/lib/anthropic/models/beta/beta_managed_agents_read_tool_config.rb +1 -1
- data/lib/anthropic/models/beta/beta_managed_agents_read_tool_config_params.rb +1 -1
- data/lib/anthropic/models/beta/beta_managed_agents_self_hosted_resources_unsupported_deployment_paused_reason_error.rb +5 -12
- data/lib/anthropic/models/beta/beta_managed_agents_self_hosted_resources_unsupported_deployment_paused_reason_error_object.rb +23 -0
- data/lib/anthropic/models/beta/beta_managed_agents_self_hosted_resources_unsupported_run_error.rb +4 -20
- data/lib/anthropic/models/beta/beta_managed_agents_self_hosted_resources_unsupported_run_error_object.rb +31 -0
- data/lib/anthropic/models/beta/beta_managed_agents_session_creation_rejected_run_error.rb +4 -19
- data/lib/anthropic/models/beta/beta_managed_agents_session_creation_rejected_run_error_object.rb +30 -0
- data/lib/anthropic/models/beta/beta_managed_agents_session_rate_limited_run_error.rb +4 -20
- data/lib/anthropic/models/beta/beta_managed_agents_session_rate_limited_run_error_object.rb +31 -0
- data/lib/anthropic/models/beta/beta_managed_agents_session_resource_not_found_deployment_paused_reason_error.rb +5 -11
- data/lib/anthropic/models/beta/beta_managed_agents_session_resource_not_found_deployment_paused_reason_error_object.rb +22 -0
- data/lib/anthropic/models/beta/beta_managed_agents_session_resource_not_found_run_error.rb +4 -19
- data/lib/anthropic/models/beta/beta_managed_agents_session_resource_not_found_run_error_object.rb +30 -0
- data/lib/anthropic/models/beta/beta_managed_agents_skill_not_found_deployment_paused_reason_error.rb +4 -11
- data/lib/anthropic/models/beta/beta_managed_agents_skill_not_found_deployment_paused_reason_error_object.rb +22 -0
- data/lib/anthropic/models/beta/beta_managed_agents_skill_not_found_run_error.rb +4 -19
- data/lib/anthropic/models/beta/beta_managed_agents_skill_not_found_run_error_object.rb +29 -0
- data/lib/anthropic/models/beta/beta_managed_agents_unknown_deployment_paused_reason_error.rb +4 -12
- data/lib/anthropic/models/beta/beta_managed_agents_unknown_deployment_paused_reason_error_object.rb +23 -0
- data/lib/anthropic/models/beta/beta_managed_agents_unknown_run_error.rb +3 -20
- data/lib/anthropic/models/beta/beta_managed_agents_unknown_run_error_object.rb +30 -0
- data/lib/anthropic/models/beta/beta_managed_agents_vault_archived_deployment_paused_reason_error.rb +4 -11
- data/lib/anthropic/models/beta/beta_managed_agents_vault_archived_deployment_paused_reason_error_object.rb +22 -0
- data/lib/anthropic/models/beta/beta_managed_agents_vault_archived_run_error.rb +4 -19
- data/lib/anthropic/models/beta/beta_managed_agents_vault_archived_run_error_object.rb +29 -0
- data/lib/anthropic/models/beta/beta_managed_agents_vault_not_found_deployment_paused_reason_error.rb +4 -11
- data/lib/anthropic/models/beta/beta_managed_agents_vault_not_found_deployment_paused_reason_error_object.rb +22 -0
- data/lib/anthropic/models/beta/beta_managed_agents_vault_not_found_run_error.rb +4 -19
- data/lib/anthropic/models/beta/beta_managed_agents_vault_not_found_run_error_object.rb +29 -0
- data/lib/anthropic/models/beta/beta_managed_agents_web_fetch_tool_config.rb +1 -1
- data/lib/anthropic/models/beta/beta_managed_agents_web_fetch_tool_config_params.rb +1 -1
- data/lib/anthropic/models/beta/beta_managed_agents_web_search_tool_config.rb +1 -1
- data/lib/anthropic/models/beta/beta_managed_agents_web_search_tool_config_params.rb +1 -1
- data/lib/anthropic/models/beta/beta_managed_agents_workspace_archived_deployment_paused_reason_error.rb +4 -11
- data/lib/anthropic/models/beta/beta_managed_agents_workspace_archived_deployment_paused_reason_error_object.rb +22 -0
- data/lib/anthropic/models/beta/beta_managed_agents_workspace_archived_run_error.rb +4 -19
- data/lib/anthropic/models/beta/beta_managed_agents_workspace_archived_run_error_object.rb +29 -0
- data/lib/anthropic/models/beta/beta_managed_agents_write_tool_config.rb +1 -1
- data/lib/anthropic/models/beta/beta_managed_agents_write_tool_config_params.rb +1 -1
- data/lib/anthropic/models/beta/beta_raw_content_block_start_event.rb +1 -1
- data/lib/anthropic/models/beta/beta_target_store_held_error.rb +2 -26
- data/lib/anthropic/models/beta/beta_target_store_held_error_object.rb +36 -0
- data/lib/anthropic/models/beta/beta_text_editor_code_execution_tool_result_block.rb +4 -4
- data/lib/anthropic/models/beta/beta_text_editor_code_execution_tool_result_error.rb +4 -35
- data/lib/anthropic/models/beta/beta_text_editor_code_execution_tool_result_error_object.rb +46 -0
- data/lib/anthropic/models/beta/beta_tool_search_tool_result_block.rb +4 -4
- data/lib/anthropic/models/beta/beta_tool_search_tool_result_error.rb +3 -34
- data/lib/anthropic/models/beta/beta_tool_search_tool_result_error_object.rb +44 -0
- data/lib/anthropic/models/beta/beta_web_search_tool_request_error.rb +3 -15
- data/lib/anthropic/models/beta/beta_web_search_tool_request_error_object.rb +25 -0
- data/lib/anthropic/models/beta/beta_web_search_tool_result_block.rb +2 -2
- data/lib/anthropic/models/beta/beta_web_search_tool_result_block_content.rb +2 -2
- data/lib/anthropic/models/beta/beta_web_search_tool_result_block_param.rb +2 -2
- data/lib/anthropic/models/beta/beta_web_search_tool_result_block_param_content.rb +2 -2
- data/lib/anthropic/models/beta/beta_web_search_tool_result_error.rb +3 -15
- data/lib/anthropic/models/beta/beta_web_search_tool_result_error_object.rb +25 -0
- data/lib/anthropic/models/beta/beta_webhook_event.rb +2 -2
- data/lib/anthropic/models/beta/beta_webhook_event_data.rb +12 -2
- data/lib/anthropic/models/beta/beta_webhook_external_key_failed_event_data.rb +34 -0
- data/lib/anthropic/models/beta/beta_webhook_external_key_recovered_event_data.rb +34 -0
- data/lib/anthropic/models/beta/memory_stores/beta_managed_agents_conflict_error.rb +4 -15
- data/lib/anthropic/models/beta/memory_stores/beta_managed_agents_conflict_error_object.rb +25 -0
- data/lib/anthropic/models/beta/memory_stores/beta_managed_agents_error.rb +2 -114
- data/lib/anthropic/models/beta/memory_stores/beta_managed_agents_error_object.rb +124 -0
- data/lib/anthropic/models/beta/memory_stores/beta_managed_agents_memory_path_conflict_error.rb +4 -52
- data/lib/anthropic/models/beta/memory_stores/beta_managed_agents_memory_path_conflict_error_object.rb +62 -0
- data/lib/anthropic/models/beta/memory_stores/beta_managed_agents_memory_precondition_failed_error.rb +4 -26
- data/lib/anthropic/models/beta/memory_stores/beta_managed_agents_memory_precondition_failed_error_object.rb +36 -0
- data/lib/anthropic/models/beta/message_count_tokens_params.rb +12 -1
- data/lib/anthropic/models/beta/message_create_params.rb +15 -1
- data/lib/anthropic/models/beta/messages/batch_create_params.rb +15 -1
- data/lib/anthropic/models/beta/organization/beta_aws_external_key_config.rb +1 -2
- data/lib/anthropic/models/beta/organization/beta_bundle_attachment_not_supported_error.rb +24 -0
- data/lib/anthropic/models/beta/organization/beta_bundle_attachment_not_supported_error_details.rb +22 -0
- data/lib/anthropic/models/beta/organization/beta_bundle_on_call_error.rb +24 -0
- data/lib/anthropic/models/beta/organization/beta_bundle_on_call_error_details.rb +22 -0
- data/lib/anthropic/models/beta/organization/beta_external_key.rb +2 -2
- data/lib/anthropic/models/beta/organization/beta_new_organization_webhook_endpoint.rb +2 -0
- data/lib/anthropic/models/beta/organization/beta_organization_webhook_endpoint.rb +2 -0
- data/lib/anthropic/models/beta/organization/beta_plugin_content_scan.rb +11 -2
- data/lib/anthropic/models/beta/organization/beta_plugin_marketplace_validation_plugin_error.rb +4 -26
- data/lib/anthropic/models/beta/organization/beta_plugin_marketplace_validation_plugin_error_object.rb +36 -0
- data/lib/anthropic/models/beta/organization/beta_plugin_marketplace_validation_report.rb +3 -3
- data/lib/anthropic/models/beta/organization/beta_rbac_role.rb +14 -5
- data/lib/anthropic/models/beta/organization/beta_rbac_role_source.rb +52 -0
- data/lib/anthropic/models/beta/organization/beta_rbac_role_source_built_in.rb +25 -0
- data/lib/anthropic/models/beta/organization/beta_rbac_role_source_custom.rb +20 -0
- data/lib/anthropic/models/beta/organization/beta_workspace.rb +7 -6
- data/lib/anthropic/models/beta/organization/claude_tag/beta_claude_tag_bundle.rb +15 -2
- data/lib/anthropic/models/beta/organization/claude_tag/bundle_update_params.rb +50 -0
- data/lib/anthropic/models/beta/organization/external_key_create_params.rb +3 -2
- data/lib/anthropic/models/beta/organization/plugin_list_params.rb +2 -1
- data/lib/anthropic/models/beta/organization/plugin_marketplace_list_params.rb +2 -1
- data/lib/anthropic/models/beta/organization/plugin_marketplace_retrieve_params.rb +2 -1
- data/lib/anthropic/models/beta/organization/plugin_retrieve_params.rb +2 -1
- data/lib/anthropic/models/beta/organization/plugins/installation_setting_list_params.rb +2 -1
- data/lib/anthropic/models/beta/organization/plugins/share_list_params.rb +2 -1
- data/lib/anthropic/models/beta/organization/plugins/version_download_params.rb +2 -1
- data/lib/anthropic/models/beta/organization/plugins/version_list_params.rb +2 -1
- data/lib/anthropic/models/beta/organization/plugins/version_retrieve_params.rb +2 -1
- data/lib/anthropic/models/beta/organization/webhook_create_params.rb +2 -0
- data/lib/anthropic/models/beta/organization/webhook_update_params.rb +2 -0
- data/lib/anthropic/models/beta/organization/workspace_create_params.rb +7 -6
- data/lib/anthropic/models/beta/organization/workspace_update_params.rb +9 -7
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_agent_auto_evaluated_permission.rb +1 -1
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_agent_auto_evaluated_permission_deny.rb +7 -4
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_billing_error.rb +3 -84
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_billing_error_object.rb +94 -0
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_compaction_limit_reached_error.rb +4 -85
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_compaction_limit_reached_error_object.rb +95 -0
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_credential_host_unreachable_error.rb +4 -99
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_credential_host_unreachable_error_object.rb +109 -0
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_max_workflow_runs_workflow_run_error.rb +4 -25
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_max_workflow_runs_workflow_run_error_object.rb +35 -0
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_mcp_authentication_failed_error.rb +4 -90
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_mcp_authentication_failed_error_object.rb +100 -0
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_mcp_connection_failed_error.rb +4 -90
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_mcp_connection_failed_error_object.rb +100 -0
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_model_overloaded_error.rb +4 -83
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_model_overloaded_error_object.rb +93 -0
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_model_rate_limited_error.rb +4 -82
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_model_rate_limited_error_object.rb +92 -0
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_model_request_failed_error.rb +4 -82
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_model_request_failed_error_object.rb +92 -0
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_program_workflow_run_error.rb +4 -24
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_program_workflow_run_error_object.rb +34 -0
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_repository_authentication_error.rb +4 -98
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_repository_authentication_error_object.rb +108 -0
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_repository_checkout_error.rb +4 -97
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_repository_checkout_error_object.rb +107 -0
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_repository_clone_error.rb +4 -97
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_repository_clone_error_object.rb +107 -0
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_repository_forbidden_error.rb +4 -97
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_repository_forbidden_error_object.rb +107 -0
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_repository_not_found_error.rb +4 -97
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_repository_not_found_error_object.rb +107 -0
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_session_error_event.rb +36 -34
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_session_event.rb +2 -2
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_stream_session_events.rb +2 -2
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_stream_session_thread_events.rb +2 -2
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_thread_limit_workflow_run_error.rb +4 -24
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_thread_limit_workflow_run_error_object.rb +34 -0
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_timeout_workflow_run_error.rb +4 -24
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_timeout_workflow_run_error_object.rb +34 -0
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_tool_use_limit_reached_error.rb +4 -86
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_tool_use_limit_reached_error_object.rb +96 -0
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_unknown_error.rb +3 -84
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_unknown_error_object.rb +94 -0
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_unknown_workflow_run_error.rb +4 -24
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_unknown_workflow_run_error_object.rb +34 -0
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_workflow_run_error.rb +4 -73
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_workflow_run_error_event.rb +3 -3
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_workflow_run_error_object.rb +83 -0
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_workflow_run_result.rb +5 -5
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_workflow_run_result_error.rb +4 -19
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_workflow_run_result_error_object.rb +29 -0
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_workflow_run_status_ended_event.rb +2 -2
- data/lib/anthropic/models/beta_api_error.rb +2 -22
- data/lib/anthropic/models/beta_api_error_object.rb +28 -0
- data/lib/anthropic/models/beta_authentication_error.rb +2 -22
- data/lib/anthropic/models/beta_authentication_error_object.rb +28 -0
- data/lib/anthropic/models/beta_billing_error.rb +2 -22
- data/lib/anthropic/models/beta_billing_error_object.rb +28 -0
- data/lib/anthropic/models/beta_error.rb +2 -82
- data/lib/anthropic/models/beta_error_object.rb +88 -0
- data/lib/anthropic/models/beta_error_response.rb +3 -3
- data/lib/anthropic/models/beta_gateway_timeout_error.rb +2 -22
- data/lib/anthropic/models/beta_gateway_timeout_error_object.rb +28 -0
- data/lib/anthropic/models/beta_invalid_request_error.rb +2 -22
- data/lib/anthropic/models/beta_invalid_request_error_object.rb +28 -0
- data/lib/anthropic/models/beta_not_found_error.rb +2 -22
- data/lib/anthropic/models/beta_not_found_error_object.rb +28 -0
- data/lib/anthropic/models/beta_overloaded_error.rb +2 -22
- data/lib/anthropic/models/beta_overloaded_error_object.rb +28 -0
- data/lib/anthropic/models/beta_permission_error.rb +2 -22
- data/lib/anthropic/models/beta_permission_error_object.rb +28 -0
- data/lib/anthropic/models/beta_rate_limit_error.rb +2 -22
- data/lib/anthropic/models/beta_rate_limit_error_object.rb +28 -0
- data/lib/anthropic/models/billing_error.rb +2 -22
- data/lib/anthropic/models/billing_error_object.rb +28 -0
- data/lib/anthropic/models/code_execution_tool_result_block.rb +2 -2
- data/lib/anthropic/models/code_execution_tool_result_block_content.rb +2 -2
- data/lib/anthropic/models/code_execution_tool_result_error.rb +3 -15
- data/lib/anthropic/models/code_execution_tool_result_error_object.rb +21 -0
- data/lib/anthropic/models/content_block.rb +1 -1
- data/lib/anthropic/models/content_block_param.rb +1 -1
- data/lib/anthropic/models/contract_spend_limit_reached_error.rb +19 -0
- data/lib/anthropic/models/contract_spend_limit_reached_error_details.rb +17 -0
- data/lib/anthropic/models/error_details.rb +67 -3
- data/lib/anthropic/models/error_object.rb +18 -18
- data/lib/anthropic/models/error_response.rb +2 -2
- data/lib/anthropic/models/gateway_timeout_error.rb +2 -22
- data/lib/anthropic/models/gateway_timeout_error_object.rb +28 -0
- data/lib/anthropic/models/invalid_request_error.rb +2 -22
- data/lib/anthropic/models/invalid_request_error_object.rb +28 -0
- data/lib/anthropic/models/linked_organization_billing_unavailable_error.rb +21 -0
- data/lib/anthropic/models/linked_organization_billing_unavailable_error_details.rb +19 -0
- data/lib/anthropic/models/linked_organization_spend_limit_reached_error.rb +21 -0
- data/lib/anthropic/models/linked_organization_spend_limit_reached_error_details.rb +19 -0
- data/lib/anthropic/models/not_found_error.rb +2 -22
- data/lib/anthropic/models/not_found_error_object.rb +28 -0
- data/lib/anthropic/models/organization/aws_external_key_config.rb +1 -2
- data/lib/anthropic/models/organization/external_key.rb +2 -2
- data/lib/anthropic/models/organization/external_key_create_params.rb +3 -2
- data/lib/anthropic/models/organization/key_profile_mismatch_error.rb +3 -3
- data/lib/anthropic/models/organization/key_profile_mismatch_error_details.rb +3 -3
- data/lib/anthropic/models/organization/rbac_role.rb +14 -5
- data/lib/anthropic/models/organization/rbac_role_source.rb +50 -0
- data/lib/anthropic/models/organization/rbac_role_source_built_in.rb +22 -0
- data/lib/anthropic/models/organization/rbac_role_source_custom.rb +18 -0
- data/lib/anthropic/models/organization/workspace.rb +7 -6
- data/lib/anthropic/models/organization/workspace_create_params.rb +7 -6
- data/lib/anthropic/models/organization/workspace_update_params.rb +9 -7
- data/lib/anthropic/models/overloaded_error.rb +2 -22
- data/lib/anthropic/models/overloaded_error_object.rb +28 -0
- data/lib/anthropic/models/parent_organization_required_error.rb +20 -0
- data/lib/anthropic/models/parent_organization_required_error_details.rb +18 -0
- data/lib/anthropic/models/permission_error.rb +2 -22
- data/lib/anthropic/models/permission_error_object.rb +28 -0
- data/lib/anthropic/models/rate_limit_error.rb +2 -22
- data/lib/anthropic/models/rate_limit_error_object.rb +28 -0
- data/lib/anthropic/models/raw_content_block_start_event.rb +1 -1
- data/lib/anthropic/models/rbac_role_not_found_error.rb +19 -0
- data/lib/anthropic/models/rbac_role_not_found_error_details.rb +17 -0
- data/lib/anthropic/models/text_editor_code_execution_tool_result_block.rb +4 -4
- data/lib/anthropic/models/text_editor_code_execution_tool_result_error.rb +3 -21
- data/lib/anthropic/models/text_editor_code_execution_tool_result_error_object.rb +27 -0
- data/lib/anthropic/models/tool_search_tool_result_block.rb +4 -4
- data/lib/anthropic/models/tool_search_tool_result_error.rb +2 -21
- data/lib/anthropic/models/tool_search_tool_result_error_object.rb +27 -0
- data/lib/anthropic/models/user_profile_billing_not_authorized_error.rb +21 -0
- data/lib/anthropic/models/user_profile_billing_not_authorized_error_details.rb +19 -0
- data/lib/anthropic/models/user_profile_not_billable_error.rb +20 -0
- data/lib/anthropic/models/user_profile_not_billable_error_details.rb +18 -0
- data/lib/anthropic/models/user_profile_required_error.rb +20 -0
- data/lib/anthropic/models/user_profile_required_error_details.rb +18 -0
- data/lib/anthropic/models/web_search_tool_request_error.rb +2 -15
- data/lib/anthropic/models/web_search_tool_request_error_object.rb +21 -0
- data/lib/anthropic/models/web_search_tool_result_block.rb +2 -2
- data/lib/anthropic/models/web_search_tool_result_block_content.rb +2 -2
- data/lib/anthropic/models/web_search_tool_result_block_param.rb +2 -2
- data/lib/anthropic/models/web_search_tool_result_block_param_content.rb +2 -2
- data/lib/anthropic/models/web_search_tool_result_error.rb +2 -15
- data/lib/anthropic/models/web_search_tool_result_error_object.rb +21 -0
- data/lib/anthropic/models.rb +84 -0
- data/lib/anthropic/resources/beta/environments/work.rb +21 -20
- data/lib/anthropic/resources/beta/messages/batches.rb +6 -6
- data/lib/anthropic/resources/beta/messages.rb +65 -5
- data/lib/anthropic/resources/beta/organization/claude_tag/bundles.rb +51 -0
- data/lib/anthropic/resources/beta/organization/plugins.rb +6 -2
- data/lib/anthropic/resources/beta/organization/rbac_roles/permissions.rb +4 -0
- data/lib/anthropic/resources/beta/organization/rbac_roles.rb +7 -0
- data/lib/anthropic/resources/messages.rb +48 -0
- data/lib/anthropic/resources/organization/rbac_roles/permissions.rb +4 -0
- data/lib/anthropic/resources/organization/rbac_roles.rb +7 -0
- data/lib/anthropic/version.rb +1 -1
- data/lib/anthropic.rb +123 -0
- data/rbi/anthropic/errors.rbi +4 -0
- data/rbi/anthropic/helpers/bedrock/client.rbi +6 -2
- data/rbi/anthropic/helpers/bedrock/event_stream.rbi +12 -3
- data/rbi/anthropic/helpers/bedrock/mantle_client.rbi +3 -1
- data/rbi/anthropic/helpers/google_cloud/client.rbi +3 -1
- data/rbi/anthropic/helpers/refusal_fallback.rbi +12 -4
- data/rbi/anthropic/helpers/vertex/client.rbi +6 -2
- data/rbi/anthropic/internal/tracing.rbi +2 -0
- data/rbi/anthropic/internal/type/union.rbi +5 -0
- data/rbi/anthropic/internal/util.rbi +2 -2
- data/rbi/anthropic/models/anthropic_beta.rbi +46 -41
- data/rbi/anthropic/models/authentication_error.rbi +1 -29
- data/rbi/anthropic/models/authentication_error_object.rbi +38 -0
- data/rbi/anthropic/models/bash_code_execution_tool_result_block.rbi +2 -2
- data/rbi/anthropic/models/bash_code_execution_tool_result_error.rbi +2 -38
- data/rbi/anthropic/models/bash_code_execution_tool_result_error_object.rbi +44 -0
- data/rbi/anthropic/models/beta/beta_advisor_tool_result_block.rbi +2 -2
- data/rbi/anthropic/models/beta/beta_advisor_tool_result_error.rbi +2 -100
- data/rbi/anthropic/models/beta/beta_advisor_tool_result_error_object.rbi +110 -0
- data/rbi/anthropic/models/beta/beta_bash_code_execution_tool_result_block.rbi +2 -2
- data/rbi/anthropic/models/beta/beta_bash_code_execution_tool_result_error.rbi +2 -90
- data/rbi/anthropic/models/beta/beta_bash_code_execution_tool_result_error_object.rbi +101 -0
- data/rbi/anthropic/models/beta/beta_bill_to.rbi +28 -0
- data/rbi/anthropic/models/beta/beta_billing_policy.rbi +59 -0
- data/rbi/anthropic/models/beta/beta_code_execution_tool_result_block.rbi +1 -1
- data/rbi/anthropic/models/beta/beta_code_execution_tool_result_block_content.rbi +1 -1
- data/rbi/anthropic/models/beta/beta_code_execution_tool_result_error.rbi +2 -41
- data/rbi/anthropic/models/beta/beta_code_execution_tool_result_error_object.rbi +52 -0
- data/rbi/anthropic/models/beta/beta_content_block.rbi +6 -6
- data/rbi/anthropic/models/beta/beta_content_block_param.rbi +1 -1
- data/rbi/anthropic/models/beta/beta_dream.rbi +6 -4
- data/rbi/anthropic/models/beta/beta_dream_error.rbi +1 -36
- data/rbi/anthropic/models/beta/beta_dream_error_object.rbi +49 -0
- data/rbi/anthropic/models/beta/beta_dreaming_error.rbi +1 -112
- data/rbi/anthropic/models/beta/beta_dreaming_error_object.rbi +124 -0
- data/rbi/anthropic/models/beta/beta_managed_agents_agent_archived_deployment_paused_reason_error.rbi +2 -21
- data/rbi/anthropic/models/beta/beta_managed_agents_agent_archived_deployment_paused_reason_error_object.rbi +32 -0
- data/rbi/anthropic/models/beta/beta_managed_agents_agent_archived_run_error.rbi +2 -29
- data/rbi/anthropic/models/beta/beta_managed_agents_agent_archived_run_error_object.rbi +40 -0
- data/rbi/anthropic/models/beta/beta_managed_agents_auto_policy.rbi +3 -1
- data/rbi/anthropic/models/beta/beta_managed_agents_deployment_paused_reason.rbi +14 -14
- data/rbi/anthropic/models/beta/beta_managed_agents_deployment_paused_reason_error.rbi +2 -141
- data/rbi/anthropic/models/beta/beta_managed_agents_deployment_paused_reason_error_object.rbi +152 -0
- data/rbi/anthropic/models/beta/beta_managed_agents_deployment_run.rbi +32 -32
- data/rbi/anthropic/models/beta/beta_managed_agents_environment_archived_deployment_paused_reason_error.rbi +2 -21
- data/rbi/anthropic/models/beta/beta_managed_agents_environment_archived_deployment_paused_reason_error_object.rbi +32 -0
- data/rbi/anthropic/models/beta/beta_managed_agents_environment_archived_run_error.rbi +2 -29
- data/rbi/anthropic/models/beta/beta_managed_agents_environment_archived_run_error_object.rbi +40 -0
- data/rbi/anthropic/models/beta/beta_managed_agents_environment_not_found_deployment_paused_reason_error.rbi +2 -21
- data/rbi/anthropic/models/beta/beta_managed_agents_environment_not_found_deployment_paused_reason_error_object.rbi +32 -0
- data/rbi/anthropic/models/beta/beta_managed_agents_environment_not_found_run_error.rbi +2 -29
- data/rbi/anthropic/models/beta/beta_managed_agents_environment_not_found_run_error_object.rbi +40 -0
- data/rbi/anthropic/models/beta/beta_managed_agents_error_deployment_paused_reason.rbi +16 -16
- data/rbi/anthropic/models/beta/beta_managed_agents_file_not_found_deployment_paused_reason_error.rbi +2 -21
- data/rbi/anthropic/models/beta/beta_managed_agents_file_not_found_deployment_paused_reason_error_object.rbi +32 -0
- data/rbi/anthropic/models/beta/beta_managed_agents_file_not_found_run_error.rbi +2 -29
- data/rbi/anthropic/models/beta/beta_managed_agents_file_not_found_run_error_object.rbi +40 -0
- data/rbi/anthropic/models/beta/beta_managed_agents_mcp_egress_blocked_deployment_paused_reason_error.rbi +2 -22
- data/rbi/anthropic/models/beta/beta_managed_agents_mcp_egress_blocked_deployment_paused_reason_error_object.rbi +33 -0
- data/rbi/anthropic/models/beta/beta_managed_agents_mcp_egress_blocked_run_error.rbi +2 -30
- data/rbi/anthropic/models/beta/beta_managed_agents_mcp_egress_blocked_run_error_object.rbi +41 -0
- data/rbi/anthropic/models/beta/beta_managed_agents_memory_store_archived_deployment_paused_reason_error.rbi +2 -21
- data/rbi/anthropic/models/beta/beta_managed_agents_memory_store_archived_deployment_paused_reason_error_object.rbi +32 -0
- data/rbi/anthropic/models/beta/beta_managed_agents_memory_store_archived_run_error.rbi +2 -29
- data/rbi/anthropic/models/beta/beta_managed_agents_memory_store_archived_run_error_object.rbi +40 -0
- data/rbi/anthropic/models/beta/beta_managed_agents_multiagent_coordinator_params.rbi +3 -2
- data/rbi/anthropic/models/beta/beta_managed_agents_organization_disabled_deployment_paused_reason_error.rbi +2 -21
- data/rbi/anthropic/models/beta/beta_managed_agents_organization_disabled_deployment_paused_reason_error_object.rbi +32 -0
- data/rbi/anthropic/models/beta/beta_managed_agents_organization_disabled_run_error.rbi +2 -29
- data/rbi/anthropic/models/beta/beta_managed_agents_organization_disabled_run_error_object.rbi +40 -0
- data/rbi/anthropic/models/beta/beta_managed_agents_self_hosted_resources_unsupported_deployment_paused_reason_error.rbi +2 -22
- data/rbi/anthropic/models/beta/beta_managed_agents_self_hosted_resources_unsupported_deployment_paused_reason_error_object.rbi +33 -0
- data/rbi/anthropic/models/beta/beta_managed_agents_self_hosted_resources_unsupported_run_error.rbi +2 -30
- data/rbi/anthropic/models/beta/beta_managed_agents_self_hosted_resources_unsupported_run_error_object.rbi +41 -0
- data/rbi/anthropic/models/beta/beta_managed_agents_session_creation_rejected_run_error.rbi +2 -29
- data/rbi/anthropic/models/beta/beta_managed_agents_session_creation_rejected_run_error_object.rbi +40 -0
- data/rbi/anthropic/models/beta/beta_managed_agents_session_rate_limited_run_error.rbi +2 -30
- data/rbi/anthropic/models/beta/beta_managed_agents_session_rate_limited_run_error_object.rbi +41 -0
- data/rbi/anthropic/models/beta/beta_managed_agents_session_resource_not_found_deployment_paused_reason_error.rbi +2 -21
- data/rbi/anthropic/models/beta/beta_managed_agents_session_resource_not_found_deployment_paused_reason_error_object.rbi +32 -0
- data/rbi/anthropic/models/beta/beta_managed_agents_session_resource_not_found_run_error.rbi +2 -29
- data/rbi/anthropic/models/beta/beta_managed_agents_session_resource_not_found_run_error_object.rbi +40 -0
- data/rbi/anthropic/models/beta/beta_managed_agents_skill_not_found_deployment_paused_reason_error.rbi +2 -21
- data/rbi/anthropic/models/beta/beta_managed_agents_skill_not_found_deployment_paused_reason_error_object.rbi +32 -0
- data/rbi/anthropic/models/beta/beta_managed_agents_skill_not_found_run_error.rbi +2 -29
- data/rbi/anthropic/models/beta/beta_managed_agents_skill_not_found_run_error_object.rbi +40 -0
- data/rbi/anthropic/models/beta/beta_managed_agents_unknown_deployment_paused_reason_error.rbi +2 -22
- data/rbi/anthropic/models/beta/beta_managed_agents_unknown_deployment_paused_reason_error_object.rbi +33 -0
- data/rbi/anthropic/models/beta/beta_managed_agents_unknown_run_error.rbi +2 -30
- data/rbi/anthropic/models/beta/beta_managed_agents_unknown_run_error_object.rbi +41 -0
- data/rbi/anthropic/models/beta/beta_managed_agents_vault_archived_deployment_paused_reason_error.rbi +2 -21
- data/rbi/anthropic/models/beta/beta_managed_agents_vault_archived_deployment_paused_reason_error_object.rbi +32 -0
- data/rbi/anthropic/models/beta/beta_managed_agents_vault_archived_run_error.rbi +2 -29
- data/rbi/anthropic/models/beta/beta_managed_agents_vault_archived_run_error_object.rbi +40 -0
- data/rbi/anthropic/models/beta/beta_managed_agents_vault_not_found_deployment_paused_reason_error.rbi +2 -21
- data/rbi/anthropic/models/beta/beta_managed_agents_vault_not_found_deployment_paused_reason_error_object.rbi +32 -0
- data/rbi/anthropic/models/beta/beta_managed_agents_vault_not_found_run_error.rbi +2 -29
- data/rbi/anthropic/models/beta/beta_managed_agents_vault_not_found_run_error_object.rbi +40 -0
- data/rbi/anthropic/models/beta/beta_managed_agents_workspace_archived_deployment_paused_reason_error.rbi +2 -21
- data/rbi/anthropic/models/beta/beta_managed_agents_workspace_archived_deployment_paused_reason_error_object.rbi +32 -0
- data/rbi/anthropic/models/beta/beta_managed_agents_workspace_archived_run_error.rbi +2 -29
- data/rbi/anthropic/models/beta/beta_managed_agents_workspace_archived_run_error_object.rbi +40 -0
- data/rbi/anthropic/models/beta/beta_raw_content_block_start_event.rbi +6 -6
- data/rbi/anthropic/models/beta/beta_target_store_held_error.rbi +2 -36
- data/rbi/anthropic/models/beta/beta_target_store_held_error_object.rbi +46 -0
- data/rbi/anthropic/models/beta/beta_text_editor_code_execution_tool_result_block.rbi +2 -2
- data/rbi/anthropic/models/beta/beta_text_editor_code_execution_tool_result_error.rbi +2 -99
- data/rbi/anthropic/models/beta/beta_text_editor_code_execution_tool_result_error_object.rbi +110 -0
- data/rbi/anthropic/models/beta/beta_tool_search_tool_result_block.rbi +2 -2
- data/rbi/anthropic/models/beta/beta_tool_search_tool_result_error.rbi +2 -94
- data/rbi/anthropic/models/beta/beta_tool_search_tool_result_error_object.rbi +105 -0
- data/rbi/anthropic/models/beta/beta_web_search_tool_request_error.rbi +2 -39
- data/rbi/anthropic/models/beta/beta_web_search_tool_request_error_object.rbi +50 -0
- data/rbi/anthropic/models/beta/beta_web_search_tool_result_block.rbi +1 -1
- data/rbi/anthropic/models/beta/beta_web_search_tool_result_block_content.rbi +1 -1
- data/rbi/anthropic/models/beta/beta_web_search_tool_result_block_param.rbi +3 -3
- data/rbi/anthropic/models/beta/beta_web_search_tool_result_block_param_content.rbi +1 -1
- data/rbi/anthropic/models/beta/beta_web_search_tool_result_error.rbi +2 -41
- data/rbi/anthropic/models/beta/beta_web_search_tool_result_error_object.rbi +52 -0
- data/rbi/anthropic/models/beta/beta_webhook_event.rbi +3 -1
- data/rbi/anthropic/models/beta/beta_webhook_event_data.rbi +13 -1
- data/rbi/anthropic/models/beta/beta_webhook_external_key_failed_event_data.rbi +51 -0
- data/rbi/anthropic/models/beta/beta_webhook_external_key_recovered_event_data.rbi +51 -0
- data/rbi/anthropic/models/beta/memory_stores/beta_managed_agents_conflict_error.rbi +2 -28
- data/rbi/anthropic/models/beta/memory_stores/beta_managed_agents_conflict_error_object.rbi +38 -0
- data/rbi/anthropic/models/beta/memory_stores/beta_managed_agents_error.rbi +2 -144
- data/rbi/anthropic/models/beta/memory_stores/beta_managed_agents_error_object.rbi +154 -0
- data/rbi/anthropic/models/beta/memory_stores/beta_managed_agents_memory_path_conflict_error.rbi +2 -82
- data/rbi/anthropic/models/beta/memory_stores/beta_managed_agents_memory_path_conflict_error_object.rbi +92 -0
- data/rbi/anthropic/models/beta/memory_stores/beta_managed_agents_memory_precondition_failed_error.rbi +2 -38
- data/rbi/anthropic/models/beta/memory_stores/beta_managed_agents_memory_precondition_failed_error_object.rbi +48 -0
- data/rbi/anthropic/models/beta/message_count_tokens_params.rbi +23 -0
- data/rbi/anthropic/models/beta/message_create_params.rbi +29 -0
- data/rbi/anthropic/models/beta/messages/batch_create_params.rbi +30 -0
- data/rbi/anthropic/models/beta/organization/beta_aws_external_key_config.rbi +2 -4
- data/rbi/anthropic/models/beta/organization/beta_bundle_attachment_not_supported_error.rbi +25 -0
- data/rbi/anthropic/models/beta/organization/beta_bundle_attachment_not_supported_error_details.rbi +32 -0
- data/rbi/anthropic/models/beta/organization/beta_bundle_on_call_error.rbi +23 -0
- data/rbi/anthropic/models/beta/organization/beta_bundle_on_call_error_details.rbi +32 -0
- data/rbi/anthropic/models/beta/organization/beta_external_key.rbi +5 -6
- data/rbi/anthropic/models/beta/organization/beta_new_organization_webhook_endpoint.rbi +10 -0
- data/rbi/anthropic/models/beta/organization/beta_organization_webhook_endpoint.rbi +10 -0
- data/rbi/anthropic/models/beta/organization/beta_plugin_content_scan.rbi +22 -4
- data/rbi/anthropic/models/beta/organization/beta_plugin_marketplace_validation_plugin_error.rbi +2 -44
- data/rbi/anthropic/models/beta/organization/beta_plugin_marketplace_validation_plugin_error_object.rbi +54 -0
- data/rbi/anthropic/models/beta/organization/beta_plugin_marketplace_validation_report.rbi +3 -3
- data/rbi/anthropic/models/beta/organization/beta_rbac_role.rbi +23 -6
- data/rbi/anthropic/models/beta/organization/beta_rbac_role_source.rbi +78 -0
- data/rbi/anthropic/models/beta/organization/beta_rbac_role_source_built_in.rbi +36 -0
- data/rbi/anthropic/models/beta/organization/beta_rbac_role_source_custom.rbi +34 -0
- data/rbi/anthropic/models/beta/organization/beta_workspace.rbi +14 -12
- data/rbi/anthropic/models/beta/organization/claude_tag/beta_claude_tag_bundle.rbi +11 -1
- data/rbi/anthropic/models/beta/organization/claude_tag/bundle_update_params.rbi +88 -0
- data/rbi/anthropic/models/beta/organization/external_key_create_params.rbi +7 -6
- data/rbi/anthropic/models/beta/organization/external_key_update_params.rbi +1 -2
- data/rbi/anthropic/models/beta/organization/plugin_list_params.rbi +4 -2
- data/rbi/anthropic/models/beta/organization/plugin_marketplace_list_params.rbi +4 -2
- data/rbi/anthropic/models/beta/organization/plugin_marketplace_retrieve_params.rbi +4 -2
- data/rbi/anthropic/models/beta/organization/plugin_retrieve_params.rbi +4 -2
- data/rbi/anthropic/models/beta/organization/plugins/installation_setting_list_params.rbi +4 -2
- data/rbi/anthropic/models/beta/organization/plugins/share_list_params.rbi +4 -2
- data/rbi/anthropic/models/beta/organization/plugins/version_download_params.rbi +4 -2
- data/rbi/anthropic/models/beta/organization/plugins/version_list_params.rbi +4 -2
- data/rbi/anthropic/models/beta/organization/plugins/version_retrieve_params.rbi +4 -2
- data/rbi/anthropic/models/beta/organization/webhook_create_params.rbi +10 -0
- data/rbi/anthropic/models/beta/organization/webhook_update_params.rbi +10 -0
- data/rbi/anthropic/models/beta/organization/workspace_create_params.rbi +14 -12
- data/rbi/anthropic/models/beta/organization/workspace_update_params.rbi +18 -14
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_agent_auto_evaluated_permission_deny.rbi +10 -6
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_billing_error.rbi +2 -137
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_billing_error_object.rbi +147 -0
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_compaction_limit_reached_error.rbi +2 -138
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_compaction_limit_reached_error_object.rbi +148 -0
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_credential_host_unreachable_error.rbi +2 -152
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_credential_host_unreachable_error_object.rbi +162 -0
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_max_workflow_runs_workflow_run_error.rbi +2 -34
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_max_workflow_runs_workflow_run_error_object.rbi +44 -0
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_mcp_authentication_failed_error.rbi +2 -143
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_mcp_authentication_failed_error_object.rbi +153 -0
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_mcp_connection_failed_error.rbi +2 -143
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_mcp_connection_failed_error_object.rbi +153 -0
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_model_overloaded_error.rbi +2 -136
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_model_overloaded_error_object.rbi +146 -0
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_model_rate_limited_error.rbi +2 -135
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_model_rate_limited_error_object.rbi +145 -0
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_model_request_failed_error.rbi +2 -135
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_model_request_failed_error_object.rbi +145 -0
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_program_workflow_run_error.rbi +2 -33
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_program_workflow_run_error_object.rbi +43 -0
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_repository_authentication_error.rbi +2 -149
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_repository_authentication_error_object.rbi +159 -0
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_repository_checkout_error.rbi +2 -148
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_repository_checkout_error_object.rbi +158 -0
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_repository_clone_error.rbi +2 -148
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_repository_clone_error_object.rbi +158 -0
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_repository_forbidden_error.rbi +2 -148
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_repository_forbidden_error_object.rbi +158 -0
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_repository_not_found_error.rbi +2 -148
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_repository_not_found_error_object.rbi +158 -0
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_session_error_event.rbi +30 -30
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_session_event.rbi +21 -21
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_stream_session_events.rbi +21 -21
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_stream_session_thread_events.rbi +21 -21
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_thread_limit_workflow_run_error.rbi +2 -33
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_thread_limit_workflow_run_error_object.rbi +43 -0
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_timeout_workflow_run_error.rbi +2 -33
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_timeout_workflow_run_error_object.rbi +43 -0
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_tool_use_limit_reached_error.rbi +2 -139
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_tool_use_limit_reached_error_object.rbi +149 -0
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_unknown_error.rbi +2 -137
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_unknown_error_object.rbi +147 -0
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_unknown_workflow_run_error.rbi +2 -33
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_unknown_workflow_run_error_object.rbi +43 -0
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_workflow_run_error.rbi +2 -95
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_workflow_run_error_event.rbi +7 -7
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_workflow_run_error_object.rbi +105 -0
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_workflow_run_result.rbi +6 -6
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_workflow_run_result_error.rbi +2 -53
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_workflow_run_result_error_object.rbi +63 -0
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_workflow_run_status_ended_event.rbi +1 -1
- data/rbi/anthropic/models/beta_api_error.rbi +1 -29
- data/rbi/anthropic/models/beta_api_error_object.rbi +35 -0
- data/rbi/anthropic/models/beta_authentication_error.rbi +1 -32
- data/rbi/anthropic/models/beta_authentication_error_object.rbi +38 -0
- data/rbi/anthropic/models/beta_billing_error.rbi +1 -29
- data/rbi/anthropic/models/beta_billing_error_object.rbi +35 -0
- data/rbi/anthropic/models/beta_error.rbi +1 -73
- data/rbi/anthropic/models/beta_error_object.rbi +97 -0
- data/rbi/anthropic/models/beta_error_response.rbi +11 -11
- data/rbi/anthropic/models/beta_gateway_timeout_error.rbi +1 -32
- data/rbi/anthropic/models/beta_gateway_timeout_error_object.rbi +38 -0
- data/rbi/anthropic/models/beta_invalid_request_error.rbi +1 -32
- data/rbi/anthropic/models/beta_invalid_request_error_object.rbi +38 -0
- data/rbi/anthropic/models/beta_not_found_error.rbi +1 -29
- data/rbi/anthropic/models/beta_not_found_error_object.rbi +38 -0
- data/rbi/anthropic/models/beta_overloaded_error.rbi +1 -29
- data/rbi/anthropic/models/beta_overloaded_error_object.rbi +38 -0
- data/rbi/anthropic/models/beta_permission_error.rbi +1 -29
- data/rbi/anthropic/models/beta_permission_error_object.rbi +38 -0
- data/rbi/anthropic/models/beta_rate_limit_error.rbi +1 -29
- data/rbi/anthropic/models/beta_rate_limit_error_object.rbi +38 -0
- data/rbi/anthropic/models/billing_error.rbi +1 -29
- data/rbi/anthropic/models/billing_error_object.rbi +35 -0
- data/rbi/anthropic/models/code_execution_tool_result_block.rbi +1 -1
- data/rbi/anthropic/models/code_execution_tool_result_block_content.rbi +1 -1
- data/rbi/anthropic/models/code_execution_tool_result_error.rbi +2 -36
- data/rbi/anthropic/models/code_execution_tool_result_error_object.rbi +42 -0
- data/rbi/anthropic/models/content_block.rbi +5 -5
- data/rbi/anthropic/models/content_block_param.rbi +1 -1
- data/rbi/anthropic/models/contract_spend_limit_reached_error.rbi +16 -0
- data/rbi/anthropic/models/contract_spend_limit_reached_error_details.rbi +27 -0
- data/rbi/anthropic/models/error_details.rbi +61 -1
- data/rbi/anthropic/models/error_object.rbi +8 -8
- data/rbi/anthropic/models/error_response.rbi +8 -8
- data/rbi/anthropic/models/gateway_timeout_error.rbi +1 -29
- data/rbi/anthropic/models/gateway_timeout_error_object.rbi +38 -0
- data/rbi/anthropic/models/invalid_request_error.rbi +1 -29
- data/rbi/anthropic/models/invalid_request_error_object.rbi +38 -0
- data/rbi/anthropic/models/linked_organization_billing_unavailable_error.rbi +20 -0
- data/rbi/anthropic/models/linked_organization_billing_unavailable_error_details.rbi +29 -0
- data/rbi/anthropic/models/linked_organization_spend_limit_reached_error.rbi +20 -0
- data/rbi/anthropic/models/linked_organization_spend_limit_reached_error_details.rbi +29 -0
- data/rbi/anthropic/models/not_found_error.rbi +1 -29
- data/rbi/anthropic/models/not_found_error_object.rbi +35 -0
- data/rbi/anthropic/models/organization/aws_external_key_config.rbi +2 -4
- data/rbi/anthropic/models/organization/external_key.rbi +5 -6
- data/rbi/anthropic/models/organization/external_key_create_params.rbi +7 -6
- data/rbi/anthropic/models/organization/external_key_update_params.rbi +1 -2
- data/rbi/anthropic/models/organization/key_profile_mismatch_error.rbi +3 -3
- data/rbi/anthropic/models/organization/key_profile_mismatch_error_details.rbi +3 -3
- data/rbi/anthropic/models/organization/rbac_role.rbi +20 -6
- data/rbi/anthropic/models/organization/rbac_role_source.rbi +68 -0
- data/rbi/anthropic/models/organization/rbac_role_source_built_in.rbi +34 -0
- data/rbi/anthropic/models/organization/rbac_role_source_custom.rbi +32 -0
- data/rbi/anthropic/models/organization/workspace.rbi +14 -12
- data/rbi/anthropic/models/organization/workspace_create_params.rbi +14 -12
- data/rbi/anthropic/models/organization/workspace_update_params.rbi +18 -14
- data/rbi/anthropic/models/overloaded_error.rbi +1 -29
- data/rbi/anthropic/models/overloaded_error_object.rbi +35 -0
- data/rbi/anthropic/models/parent_organization_required_error.rbi +17 -0
- data/rbi/anthropic/models/parent_organization_required_error_details.rbi +28 -0
- data/rbi/anthropic/models/permission_error.rbi +1 -29
- data/rbi/anthropic/models/permission_error_object.rbi +35 -0
- data/rbi/anthropic/models/rate_limit_error.rbi +1 -29
- data/rbi/anthropic/models/rate_limit_error_object.rbi +35 -0
- data/rbi/anthropic/models/raw_content_block_start_event.rbi +5 -5
- data/rbi/anthropic/models/rbac_role_not_found_error.rbi +16 -0
- data/rbi/anthropic/models/rbac_role_not_found_error_details.rbi +27 -0
- data/rbi/anthropic/models/text_editor_code_execution_tool_result_block.rbi +2 -2
- data/rbi/anthropic/models/text_editor_code_execution_tool_result_error.rbi +2 -50
- data/rbi/anthropic/models/text_editor_code_execution_tool_result_error_object.rbi +56 -0
- data/rbi/anthropic/models/tool_search_tool_result_block.rbi +2 -2
- data/rbi/anthropic/models/tool_search_tool_result_error.rbi +2 -44
- data/rbi/anthropic/models/tool_search_tool_result_error_object.rbi +50 -0
- data/rbi/anthropic/models/user_profile_billing_not_authorized_error.rbi +18 -0
- data/rbi/anthropic/models/user_profile_billing_not_authorized_error_details.rbi +29 -0
- data/rbi/anthropic/models/user_profile_not_billable_error.rbi +17 -0
- data/rbi/anthropic/models/user_profile_not_billable_error_details.rbi +28 -0
- data/rbi/anthropic/models/user_profile_required_error.rbi +17 -0
- data/rbi/anthropic/models/user_profile_required_error_details.rbi +28 -0
- data/rbi/anthropic/models/web_search_tool_request_error.rbi +2 -35
- data/rbi/anthropic/models/web_search_tool_request_error_object.rbi +41 -0
- data/rbi/anthropic/models/web_search_tool_result_block.rbi +1 -1
- data/rbi/anthropic/models/web_search_tool_result_block_content.rbi +1 -1
- data/rbi/anthropic/models/web_search_tool_result_block_param.rbi +3 -3
- data/rbi/anthropic/models/web_search_tool_result_block_param_content.rbi +1 -1
- data/rbi/anthropic/models/web_search_tool_result_error.rbi +1 -35
- data/rbi/anthropic/models/web_search_tool_result_error_object.rbi +41 -0
- data/rbi/anthropic/models.rbi +101 -0
- data/rbi/anthropic/resources/beta/environments/work.rbi +21 -20
- data/rbi/anthropic/resources/beta/messages.rbi +50 -0
- data/rbi/anthropic/resources/beta/organization/claude_tag/bundles.rbi +30 -0
- data/rbi/anthropic/resources/beta/organization/external_keys.rbi +3 -2
- data/rbi/anthropic/resources/beta/organization/plugin_marketplaces.rbi +4 -2
- data/rbi/anthropic/resources/beta/organization/plugins/installation_settings.rbi +2 -1
- data/rbi/anthropic/resources/beta/organization/plugins/shares.rbi +2 -1
- data/rbi/anthropic/resources/beta/organization/plugins/versions.rbi +6 -3
- data/rbi/anthropic/resources/beta/organization/plugins.rbi +10 -4
- data/rbi/anthropic/resources/beta/organization/workspaces.rbi +17 -13
- data/rbi/anthropic/resources/organization/external_keys.rbi +3 -2
- data/rbi/anthropic/resources/organization/workspaces.rbi +16 -13
- data/rbi/lib/anthropic/helpers/stainless_helper_header.rbi +6 -1
- data/sig/anthropic/errors.rbs +4 -0
- data/sig/anthropic/helpers/sessions/event_accumulator.rbs +6 -2
- data/sig/anthropic/internal/tracing.rbs +1 -0
- data/sig/anthropic/internal/type/union.rbs +4 -0
- data/sig/anthropic/internal/util.rbs +1 -1
- data/sig/anthropic/models/anthropic_beta.rbs +23 -21
- data/sig/anthropic/models/authentication_error.rbs +1 -11
- data/sig/anthropic/models/authentication_error_object.rbs +16 -0
- data/sig/anthropic/models/bash_code_execution_tool_result_block.rbs +1 -1
- data/sig/anthropic/models/bash_code_execution_tool_result_error.rbs +1 -21
- data/sig/anthropic/models/bash_code_execution_tool_result_error_object.rbs +25 -0
- data/sig/anthropic/models/beta/beta_advisor_tool_result_block.rbs +1 -1
- data/sig/anthropic/models/beta/beta_advisor_tool_result_error.rbs +1 -44
- data/sig/anthropic/models/beta/beta_advisor_tool_result_error_object.rbs +52 -0
- data/sig/anthropic/models/beta/beta_bash_code_execution_tool_result_block.rbs +1 -1
- data/sig/anthropic/models/beta/beta_bash_code_execution_tool_result_error.rbs +1 -40
- data/sig/anthropic/models/beta/beta_bash_code_execution_tool_result_error_object.rbs +48 -0
- data/sig/anthropic/models/beta/beta_bill_to.rbs +18 -0
- data/sig/anthropic/models/beta/beta_billing_policy.rbs +33 -0
- data/sig/anthropic/models/beta/beta_code_execution_tool_result_block_content.rbs +1 -1
- data/sig/anthropic/models/beta/beta_code_execution_tool_result_error.rbs +1 -21
- data/sig/anthropic/models/beta/beta_code_execution_tool_result_error_object.rbs +29 -0
- data/sig/anthropic/models/beta/beta_dream.rbs +4 -4
- data/sig/anthropic/models/beta/beta_dream_error.rbs +1 -11
- data/sig/anthropic/models/beta/beta_dream_error_object.rbs +19 -0
- data/sig/anthropic/models/beta/beta_dreaming_error.rbs +1 -92
- data/sig/anthropic/models/beta/beta_dreaming_error_object.rbs +101 -0
- data/sig/anthropic/models/beta/beta_managed_agents_agent_archived_deployment_paused_reason_error.rbs +1 -10
- data/sig/anthropic/models/beta/beta_managed_agents_agent_archived_deployment_paused_reason_error_object.rbs +18 -0
- data/sig/anthropic/models/beta/beta_managed_agents_agent_archived_run_error.rbs +1 -12
- data/sig/anthropic/models/beta/beta_managed_agents_agent_archived_run_error_object.rbs +20 -0
- data/sig/anthropic/models/beta/beta_managed_agents_deployment_paused_reason.rbs +2 -2
- data/sig/anthropic/models/beta/beta_managed_agents_deployment_paused_reason_error.rbs +1 -108
- data/sig/anthropic/models/beta/beta_managed_agents_deployment_paused_reason_error_object.rbs +116 -0
- data/sig/anthropic/models/beta/beta_managed_agents_deployment_run.rbs +32 -32
- data/sig/anthropic/models/beta/beta_managed_agents_environment_archived_deployment_paused_reason_error.rbs +1 -10
- data/sig/anthropic/models/beta/beta_managed_agents_environment_archived_deployment_paused_reason_error_object.rbs +18 -0
- data/sig/anthropic/models/beta/beta_managed_agents_environment_archived_run_error.rbs +1 -15
- data/sig/anthropic/models/beta/beta_managed_agents_environment_archived_run_error_object.rbs +23 -0
- data/sig/anthropic/models/beta/beta_managed_agents_environment_not_found_deployment_paused_reason_error.rbs +1 -10
- data/sig/anthropic/models/beta/beta_managed_agents_environment_not_found_deployment_paused_reason_error_object.rbs +18 -0
- data/sig/anthropic/models/beta/beta_managed_agents_environment_not_found_run_error.rbs +1 -15
- data/sig/anthropic/models/beta/beta_managed_agents_environment_not_found_run_error_object.rbs +23 -0
- data/sig/anthropic/models/beta/beta_managed_agents_error_deployment_paused_reason.rbs +4 -4
- data/sig/anthropic/models/beta/beta_managed_agents_file_not_found_deployment_paused_reason_error.rbs +1 -10
- data/sig/anthropic/models/beta/beta_managed_agents_file_not_found_deployment_paused_reason_error_object.rbs +18 -0
- data/sig/anthropic/models/beta/beta_managed_agents_file_not_found_run_error.rbs +1 -12
- data/sig/anthropic/models/beta/beta_managed_agents_file_not_found_run_error_object.rbs +20 -0
- data/sig/anthropic/models/beta/beta_managed_agents_mcp_egress_blocked_deployment_paused_reason_error.rbs +1 -10
- data/sig/anthropic/models/beta/beta_managed_agents_mcp_egress_blocked_deployment_paused_reason_error_object.rbs +18 -0
- data/sig/anthropic/models/beta/beta_managed_agents_mcp_egress_blocked_run_error.rbs +1 -15
- data/sig/anthropic/models/beta/beta_managed_agents_mcp_egress_blocked_run_error_object.rbs +23 -0
- data/sig/anthropic/models/beta/beta_managed_agents_memory_store_archived_deployment_paused_reason_error.rbs +1 -10
- data/sig/anthropic/models/beta/beta_managed_agents_memory_store_archived_deployment_paused_reason_error_object.rbs +18 -0
- data/sig/anthropic/models/beta/beta_managed_agents_memory_store_archived_run_error.rbs +1 -15
- data/sig/anthropic/models/beta/beta_managed_agents_memory_store_archived_run_error_object.rbs +23 -0
- data/sig/anthropic/models/beta/beta_managed_agents_organization_disabled_deployment_paused_reason_error.rbs +1 -10
- data/sig/anthropic/models/beta/beta_managed_agents_organization_disabled_deployment_paused_reason_error_object.rbs +18 -0
- data/sig/anthropic/models/beta/beta_managed_agents_organization_disabled_run_error.rbs +1 -15
- data/sig/anthropic/models/beta/beta_managed_agents_organization_disabled_run_error_object.rbs +23 -0
- data/sig/anthropic/models/beta/beta_managed_agents_self_hosted_resources_unsupported_deployment_paused_reason_error.rbs +1 -12
- data/sig/anthropic/models/beta/beta_managed_agents_self_hosted_resources_unsupported_deployment_paused_reason_error_object.rbs +20 -0
- data/sig/anthropic/models/beta/beta_managed_agents_self_hosted_resources_unsupported_run_error.rbs +1 -18
- data/sig/anthropic/models/beta/beta_managed_agents_self_hosted_resources_unsupported_run_error_object.rbs +26 -0
- data/sig/anthropic/models/beta/beta_managed_agents_session_creation_rejected_run_error.rbs +1 -18
- data/sig/anthropic/models/beta/beta_managed_agents_session_creation_rejected_run_error_object.rbs +26 -0
- data/sig/anthropic/models/beta/beta_managed_agents_session_rate_limited_run_error.rbs +1 -15
- data/sig/anthropic/models/beta/beta_managed_agents_session_rate_limited_run_error_object.rbs +23 -0
- data/sig/anthropic/models/beta/beta_managed_agents_session_resource_not_found_deployment_paused_reason_error.rbs +1 -10
- data/sig/anthropic/models/beta/beta_managed_agents_session_resource_not_found_deployment_paused_reason_error_object.rbs +18 -0
- data/sig/anthropic/models/beta/beta_managed_agents_session_resource_not_found_run_error.rbs +1 -18
- data/sig/anthropic/models/beta/beta_managed_agents_session_resource_not_found_run_error_object.rbs +26 -0
- data/sig/anthropic/models/beta/beta_managed_agents_skill_not_found_deployment_paused_reason_error.rbs +1 -10
- data/sig/anthropic/models/beta/beta_managed_agents_skill_not_found_deployment_paused_reason_error_object.rbs +18 -0
- data/sig/anthropic/models/beta/beta_managed_agents_skill_not_found_run_error.rbs +1 -12
- data/sig/anthropic/models/beta/beta_managed_agents_skill_not_found_run_error_object.rbs +20 -0
- data/sig/anthropic/models/beta/beta_managed_agents_unknown_deployment_paused_reason_error.rbs +1 -10
- data/sig/anthropic/models/beta/beta_managed_agents_unknown_deployment_paused_reason_error_object.rbs +18 -0
- data/sig/anthropic/models/beta/beta_managed_agents_unknown_run_error.rbs +1 -12
- data/sig/anthropic/models/beta/beta_managed_agents_unknown_run_error_object.rbs +20 -0
- data/sig/anthropic/models/beta/beta_managed_agents_vault_archived_deployment_paused_reason_error.rbs +1 -10
- data/sig/anthropic/models/beta/beta_managed_agents_vault_archived_deployment_paused_reason_error_object.rbs +18 -0
- data/sig/anthropic/models/beta/beta_managed_agents_vault_archived_run_error.rbs +1 -12
- data/sig/anthropic/models/beta/beta_managed_agents_vault_archived_run_error_object.rbs +20 -0
- data/sig/anthropic/models/beta/beta_managed_agents_vault_not_found_deployment_paused_reason_error.rbs +1 -10
- data/sig/anthropic/models/beta/beta_managed_agents_vault_not_found_deployment_paused_reason_error_object.rbs +18 -0
- data/sig/anthropic/models/beta/beta_managed_agents_vault_not_found_run_error.rbs +1 -12
- data/sig/anthropic/models/beta/beta_managed_agents_vault_not_found_run_error_object.rbs +20 -0
- data/sig/anthropic/models/beta/beta_managed_agents_workspace_archived_deployment_paused_reason_error.rbs +1 -10
- data/sig/anthropic/models/beta/beta_managed_agents_workspace_archived_deployment_paused_reason_error_object.rbs +18 -0
- data/sig/anthropic/models/beta/beta_managed_agents_workspace_archived_run_error.rbs +1 -15
- data/sig/anthropic/models/beta/beta_managed_agents_workspace_archived_run_error_object.rbs +23 -0
- data/sig/anthropic/models/beta/beta_target_store_held_error.rbs +1 -14
- data/sig/anthropic/models/beta/beta_target_store_held_error_object.rbs +22 -0
- data/sig/anthropic/models/beta/beta_text_editor_code_execution_tool_result_block.rbs +1 -1
- data/sig/anthropic/models/beta/beta_text_editor_code_execution_tool_result_error.rbs +1 -45
- data/sig/anthropic/models/beta/beta_text_editor_code_execution_tool_result_error_object.rbs +53 -0
- data/sig/anthropic/models/beta/beta_tool_search_tool_result_block.rbs +1 -1
- data/sig/anthropic/models/beta/beta_tool_search_tool_result_error.rbs +1 -43
- data/sig/anthropic/models/beta/beta_tool_search_tool_result_error_object.rbs +51 -0
- data/sig/anthropic/models/beta/beta_web_search_tool_request_error.rbs +1 -21
- data/sig/anthropic/models/beta/beta_web_search_tool_request_error_object.rbs +29 -0
- data/sig/anthropic/models/beta/beta_web_search_tool_result_block_content.rbs +1 -1
- data/sig/anthropic/models/beta/beta_web_search_tool_result_block_param_content.rbs +1 -1
- data/sig/anthropic/models/beta/beta_web_search_tool_result_error.rbs +1 -21
- data/sig/anthropic/models/beta/beta_web_search_tool_result_error_object.rbs +29 -0
- data/sig/anthropic/models/beta/beta_webhook_event_data.rbs +16 -0
- data/sig/anthropic/models/beta/beta_webhook_external_key_failed_event_data.rbs +30 -0
- data/sig/anthropic/models/beta/beta_webhook_external_key_recovered_event_data.rbs +30 -0
- data/sig/anthropic/models/beta/memory_stores/beta_managed_agents_conflict_error.rbs +1 -14
- data/sig/anthropic/models/beta/memory_stores/beta_managed_agents_conflict_error_object.rbs +22 -0
- data/sig/anthropic/models/beta/memory_stores/beta_managed_agents_error.rbs +1 -112
- data/sig/anthropic/models/beta/memory_stores/beta_managed_agents_error_object.rbs +120 -0
- data/sig/anthropic/models/beta/memory_stores/beta_managed_agents_memory_path_conflict_error.rbs +1 -37
- data/sig/anthropic/models/beta/memory_stores/beta_managed_agents_memory_path_conflict_error_object.rbs +45 -0
- data/sig/anthropic/models/beta/memory_stores/beta_managed_agents_memory_precondition_failed_error.rbs +1 -20
- data/sig/anthropic/models/beta/memory_stores/beta_managed_agents_memory_precondition_failed_error_object.rbs +28 -0
- data/sig/anthropic/models/beta/message_count_tokens_params.rbs +5 -0
- data/sig/anthropic/models/beta/message_create_params.rbs +5 -0
- data/sig/anthropic/models/beta/messages/batch_create_params.rbs +5 -0
- data/sig/anthropic/models/beta/organization/beta_bundle_attachment_not_supported_error.rbs +13 -0
- data/sig/anthropic/models/beta/organization/beta_bundle_attachment_not_supported_error_details.rbs +20 -0
- data/sig/anthropic/models/beta/organization/beta_bundle_on_call_error.rbs +13 -0
- data/sig/anthropic/models/beta/organization/beta_bundle_on_call_error_details.rbs +17 -0
- data/sig/anthropic/models/beta/organization/beta_new_organization_webhook_endpoint.rbs +5 -1
- data/sig/anthropic/models/beta/organization/beta_organization_webhook_endpoint.rbs +5 -1
- data/sig/anthropic/models/beta/organization/beta_plugin_marketplace_validation_plugin_error.rbs +1 -18
- data/sig/anthropic/models/beta/organization/beta_plugin_marketplace_validation_plugin_error_object.rbs +26 -0
- data/sig/anthropic/models/beta/organization/beta_plugin_marketplace_validation_report.rbs +4 -4
- data/sig/anthropic/models/beta/organization/beta_rbac_role.rbs +5 -0
- data/sig/anthropic/models/beta/organization/beta_rbac_role_source.rbs +40 -0
- data/sig/anthropic/models/beta/organization/beta_rbac_role_source_built_in.rbs +17 -0
- data/sig/anthropic/models/beta/organization/beta_rbac_role_source_custom.rbs +17 -0
- data/sig/anthropic/models/beta/organization/claude_tag/beta_claude_tag_bundle.rbs +5 -0
- data/sig/anthropic/models/beta/organization/claude_tag/bundle_update_params.rbs +46 -0
- data/sig/anthropic/models/beta/organization/webhook_create_params.rbs +5 -1
- data/sig/anthropic/models/beta/organization/webhook_update_params.rbs +5 -1
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_billing_error.rbs +1 -64
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_billing_error_object.rbs +72 -0
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_compaction_limit_reached_error.rbs +1 -64
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_compaction_limit_reached_error_object.rbs +72 -0
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_credential_host_unreachable_error.rbs +1 -74
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_credential_host_unreachable_error_object.rbs +82 -0
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_max_workflow_runs_workflow_run_error.rbs +1 -15
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_max_workflow_runs_workflow_run_error_object.rbs +23 -0
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_mcp_authentication_failed_error.rbs +1 -69
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_mcp_authentication_failed_error_object.rbs +77 -0
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_mcp_connection_failed_error.rbs +1 -69
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_mcp_connection_failed_error_object.rbs +77 -0
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_model_overloaded_error.rbs +1 -64
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_model_overloaded_error_object.rbs +72 -0
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_model_rate_limited_error.rbs +1 -64
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_model_rate_limited_error_object.rbs +72 -0
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_model_request_failed_error.rbs +1 -64
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_model_request_failed_error_object.rbs +72 -0
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_program_workflow_run_error.rbs +1 -12
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_program_workflow_run_error_object.rbs +20 -0
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_repository_authentication_error.rbs +1 -69
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_repository_authentication_error_object.rbs +77 -0
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_repository_checkout_error.rbs +1 -69
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_repository_checkout_error_object.rbs +77 -0
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_repository_clone_error.rbs +1 -69
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_repository_clone_error_object.rbs +77 -0
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_repository_forbidden_error.rbs +1 -69
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_repository_forbidden_error_object.rbs +77 -0
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_repository_not_found_error.rbs +1 -69
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_repository_not_found_error_object.rbs +77 -0
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_session_error_event.rbs +60 -60
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_session_event.rbs +2 -2
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_stream_session_events.rbs +2 -2
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_stream_session_thread_events.rbs +2 -2
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_thread_limit_workflow_run_error.rbs +1 -12
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_thread_limit_workflow_run_error_object.rbs +20 -0
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_timeout_workflow_run_error.rbs +1 -12
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_timeout_workflow_run_error_object.rbs +20 -0
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_tool_use_limit_reached_error.rbs +1 -64
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_tool_use_limit_reached_error_object.rbs +72 -0
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_unknown_error.rbs +1 -64
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_unknown_error_object.rbs +72 -0
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_unknown_workflow_run_error.rbs +1 -12
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_unknown_workflow_run_error_object.rbs +20 -0
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_workflow_run_error.rbs +1 -58
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_workflow_run_error_event.rbs +4 -4
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_workflow_run_error_object.rbs +66 -0
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_workflow_run_result.rbs +4 -4
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_workflow_run_result_error.rbs +1 -21
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_workflow_run_result_error_object.rbs +29 -0
- data/sig/anthropic/models/beta_api_error.rbs +1 -11
- data/sig/anthropic/models/beta_api_error_object.rbs +15 -0
- data/sig/anthropic/models/beta_authentication_error.rbs +1 -12
- data/sig/anthropic/models/beta_authentication_error_object.rbs +16 -0
- data/sig/anthropic/models/beta_billing_error.rbs +1 -11
- data/sig/anthropic/models/beta_billing_error_object.rbs +15 -0
- data/sig/anthropic/models/beta_error.rbs +1 -85
- data/sig/anthropic/models/beta_error_object.rbs +89 -0
- data/sig/anthropic/models/beta_error_response.rbs +4 -4
- data/sig/anthropic/models/beta_gateway_timeout_error.rbs +1 -11
- data/sig/anthropic/models/beta_gateway_timeout_error_object.rbs +16 -0
- data/sig/anthropic/models/beta_invalid_request_error.rbs +1 -12
- data/sig/anthropic/models/beta_invalid_request_error_object.rbs +16 -0
- data/sig/anthropic/models/beta_not_found_error.rbs +1 -11
- data/sig/anthropic/models/beta_not_found_error_object.rbs +16 -0
- data/sig/anthropic/models/beta_overloaded_error.rbs +1 -11
- data/sig/anthropic/models/beta_overloaded_error_object.rbs +16 -0
- data/sig/anthropic/models/beta_permission_error.rbs +1 -11
- data/sig/anthropic/models/beta_permission_error_object.rbs +16 -0
- data/sig/anthropic/models/beta_rate_limit_error.rbs +1 -11
- data/sig/anthropic/models/beta_rate_limit_error_object.rbs +16 -0
- data/sig/anthropic/models/billing_error.rbs +1 -11
- data/sig/anthropic/models/billing_error_object.rbs +15 -0
- data/sig/anthropic/models/code_execution_tool_result_block_content.rbs +1 -1
- data/sig/anthropic/models/code_execution_tool_result_error.rbs +1 -21
- data/sig/anthropic/models/code_execution_tool_result_error_object.rbs +25 -0
- data/sig/anthropic/models/contract_spend_limit_reached_error.rbs +9 -0
- data/sig/anthropic/models/contract_spend_limit_reached_error_details.rbs +14 -0
- data/sig/anthropic/models/error_details.rbs +66 -0
- data/sig/anthropic/models/error_object.rbs +16 -16
- data/sig/anthropic/models/gateway_timeout_error.rbs +1 -11
- data/sig/anthropic/models/gateway_timeout_error_object.rbs +16 -0
- data/sig/anthropic/models/invalid_request_error.rbs +1 -12
- data/sig/anthropic/models/invalid_request_error_object.rbs +16 -0
- data/sig/anthropic/models/linked_organization_billing_unavailable_error.rbs +9 -0
- data/sig/anthropic/models/linked_organization_billing_unavailable_error_details.rbs +16 -0
- data/sig/anthropic/models/linked_organization_spend_limit_reached_error.rbs +9 -0
- data/sig/anthropic/models/linked_organization_spend_limit_reached_error_details.rbs +16 -0
- data/sig/anthropic/models/not_found_error.rbs +1 -11
- data/sig/anthropic/models/not_found_error_object.rbs +15 -0
- data/sig/anthropic/models/organization/rbac_role.rbs +5 -0
- data/sig/anthropic/models/organization/rbac_role_source.rbs +38 -0
- data/sig/anthropic/models/organization/rbac_role_source_built_in.rbs +15 -0
- data/sig/anthropic/models/organization/rbac_role_source_custom.rbs +15 -0
- data/sig/anthropic/models/overloaded_error.rbs +1 -11
- data/sig/anthropic/models/overloaded_error_object.rbs +15 -0
- data/sig/anthropic/models/parent_organization_required_error.rbs +9 -0
- data/sig/anthropic/models/parent_organization_required_error_details.rbs +14 -0
- data/sig/anthropic/models/permission_error.rbs +1 -11
- data/sig/anthropic/models/permission_error_object.rbs +15 -0
- data/sig/anthropic/models/rate_limit_error.rbs +1 -11
- data/sig/anthropic/models/rate_limit_error_object.rbs +15 -0
- data/sig/anthropic/models/rbac_role_not_found_error.rbs +9 -0
- data/sig/anthropic/models/rbac_role_not_found_error_details.rbs +14 -0
- data/sig/anthropic/models/text_editor_code_execution_tool_result_block.rbs +1 -1
- data/sig/anthropic/models/text_editor_code_execution_tool_result_error.rbs +1 -26
- data/sig/anthropic/models/text_editor_code_execution_tool_result_error_object.rbs +30 -0
- data/sig/anthropic/models/tool_search_tool_result_block.rbs +1 -1
- data/sig/anthropic/models/tool_search_tool_result_error.rbs +1 -26
- data/sig/anthropic/models/tool_search_tool_result_error_object.rbs +30 -0
- data/sig/anthropic/models/user_profile_billing_not_authorized_error.rbs +9 -0
- data/sig/anthropic/models/user_profile_billing_not_authorized_error_details.rbs +16 -0
- data/sig/anthropic/models/user_profile_not_billable_error.rbs +9 -0
- data/sig/anthropic/models/user_profile_not_billable_error_details.rbs +14 -0
- data/sig/anthropic/models/user_profile_required_error.rbs +9 -0
- data/sig/anthropic/models/user_profile_required_error_details.rbs +14 -0
- data/sig/anthropic/models/web_search_tool_request_error.rbs +1 -21
- data/sig/anthropic/models/web_search_tool_request_error_object.rbs +25 -0
- data/sig/anthropic/models/web_search_tool_result_block_content.rbs +1 -1
- data/sig/anthropic/models/web_search_tool_result_block_param_content.rbs +1 -1
- data/sig/anthropic/models/web_search_tool_result_error.rbs +1 -21
- data/sig/anthropic/models/web_search_tool_result_error_object.rbs +25 -0
- data/sig/anthropic/models.rbs +80 -0
- data/sig/anthropic/resources/beta/messages.rbs +5 -0
- data/sig/anthropic/resources/beta/organization/claude_tag/bundles.rbs +7 -0
- metadata +371 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c95b436e737195df72142c842d05ed099068cd446fa0043cc407cb6cf5451deb
|
|
4
|
+
data.tar.gz: dd5f8d0bd460c4dc19208454a06e751bacffc2d10c7a93806564926e5bfce304
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 07c30931b22e14a6e041a2c8cabfc28962efe35d70ab9d0a4e1d5bb18f4184237b30378fe0f34ccd47dfd385cf7ca95b8c8d0d0162086251ffb9165f6306df6e
|
|
7
|
+
data.tar.gz: 675521144c16c141961c6b06405e8d5542eed2a0db0ef6a2013aea25ccf21f48e8222efa3fcc0dfa55cafcb0cd7cbdbefc0f95fa04d995192206165f74c6c7a6
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,77 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.10.0](https://github.com/anthropics/anthropic-sdk-ruby/compare/v2.9.0...v2.10.0) (2026-11-17)
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* **api:** add beta support for the billing_policy request parameter
|
|
8
|
+
* **api:** add contract_spend_limit_reached error code to messages
|
|
9
|
+
* **api:** add error codes for linked billing refusals
|
|
10
|
+
* **api:** add the user_profile_billing_not_authorized error code
|
|
11
|
+
* **api:** add webhook events for external key failure and recovery
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* **bedrock:** refresh temporary AWS credentials
|
|
17
|
+
* **client:** encode spaces in query strings as %20
|
|
18
|
+
|
|
19
|
+
The AWS SigV4 signature of a request now matches its query string when a parameter contains a space.
|
|
20
|
+
|
|
21
|
+
* **client:** send API property names from hashes in unions without a discriminator
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Chores
|
|
25
|
+
|
|
26
|
+
* **api:** rename error data models, deprecating the old names
|
|
27
|
+
* **docs:** clarify which AWS KMS keys a workspace can use on Claude Platform on AWS
|
|
28
|
+
* **docs:** clarify which credential work get, update and list accept
|
|
29
|
+
* **docs:** clarify which uploads a plugin pin holds back
|
|
30
|
+
* **docs:** note that a plugin scan's reason also covers errored scans
|
|
31
|
+
|
|
32
|
+
`content_scan.reason` on an errored scan now says why there is no verdict. It is not a security finding, so code that treats any `reason` as a concern should also check `status`.
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
### Documentation
|
|
36
|
+
|
|
37
|
+
* **client:** list the errors that messages.stream can raise
|
|
38
|
+
|
|
39
|
+
## [2.9.0](https://github.com/anthropics/anthropic-sdk-ruby/compare/v2.8.0...v2.9.0) (2026-11-16)
|
|
40
|
+
|
|
41
|
+
### Features
|
|
42
|
+
|
|
43
|
+
* **api:** add source and error codes to the RBAC Role read endpoints
|
|
44
|
+
* **api:** add Update Bundle, which sets a Claude Tag Bundle's instructions, and return instructions on Bundle
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
### Bug Fixes
|
|
48
|
+
|
|
49
|
+
* **client:** keep a streamed request body from breaking the next request
|
|
50
|
+
* **client:** read a response as JSON Lines only for JSON Lines types
|
|
51
|
+
* **client:** send an Enumerator request body in full on every attempt
|
|
52
|
+
* **client:** send multipart uploads with non-ASCII text, and stop corrupting AWS uploads on older Rubies
|
|
53
|
+
* **client:** upload a Tempfile's contents, not "#<File:0x...>"
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
### Chores
|
|
57
|
+
|
|
58
|
+
* **api:** deprecate old beta header values
|
|
59
|
+
|
|
60
|
+
The API still accepts these values, but a later release removes them from the SDKs. Delete `prompt-caching-2024-07-31`, `pdfs-2024-09-25`, `token-counting-2024-11-01`, `token-efficient-tools-2025-02-19`, `extended-cache-ttl-2025-04-11`, `cache-diagnosis-2026-04-07` and `ce-user-management-2026-07-13` from your requests. `files-api-2025-04-14` and `skills-2025-10-02` select the beta response shapes, so follow the Files API and Skills migration guides before you delete them.
|
|
61
|
+
|
|
62
|
+
In C#, the `AnthropicBeta` enum's members have new numbers, so code compiled against an earlier SDK version sends a different beta value, with no error, until you rebuild it.
|
|
63
|
+
|
|
64
|
+
* **api:** stop sending an old beta header on batch requests
|
|
65
|
+
|
|
66
|
+
`beta.messages.batches` no longer sends `message-batches-2024-09-24`, which the API doesn't need. If your client sets a default `anthropic-beta` header, these requests now send it, where in some SDKs the old value replaced it. The API still accepts the old value. If you set it yourself, delete it: a later release removes it from the SDKs.
|
|
67
|
+
|
|
68
|
+
* **docs:** add an example value for the workspace name
|
|
69
|
+
* **docs:** clarify when the auto permission policy denies a tool call
|
|
70
|
+
* **docs:** clarify which workspaces an external key can be attached to
|
|
71
|
+
* **docs:** recommend multiagent_20261001 over the coordinator type
|
|
72
|
+
* **docs:** say when organization_id is required on plugin reads
|
|
73
|
+
* **internal:** format hand-written code with scripts/format
|
|
74
|
+
|
|
3
75
|
## [2.8.0](https://github.com/anthropics/anthropic-sdk-ruby/compare/v2.7.0...v2.8.0) (2026-11-10)
|
|
4
76
|
|
|
5
77
|
### Features
|
data/README.md
CHANGED
|
@@ -9,6 +9,7 @@ module Anthropic
|
|
|
9
9
|
{
|
|
10
10
|
[400, nil] => Anthropic::Errors::BadRequestError,
|
|
11
11
|
[401, nil] => Anthropic::Errors::AuthenticationError,
|
|
12
|
+
[402, nil] => Anthropic::Errors::PaymentRequiredError,
|
|
12
13
|
[403, nil] => Anthropic::Errors::PermissionDeniedError,
|
|
13
14
|
[404, nil] => Anthropic::Errors::NotFoundError,
|
|
14
15
|
[408, nil] => Anthropic::Errors::RequestTimeoutError,
|
|
@@ -25,6 +26,8 @@ module Anthropic
|
|
|
25
26
|
[529, nil] => Anthropic::Errors::OverloadedError,
|
|
26
27
|
[400, "already_member"] => Anthropic::Models::Organization::AlreadyMemberError,
|
|
27
28
|
[400, "available_tools_limit_exceeded"] => Anthropic::Models::AvailableToolsLimitExceededError,
|
|
29
|
+
[400, "bundle_attachment_not_supported"] => Anthropic::Models::Beta::Organization::BetaBundleAttachmentNotSupportedError,
|
|
30
|
+
[400, "bundle_on_call"] => Anthropic::Models::Beta::Organization::BetaBundleOnCallError,
|
|
28
31
|
[400, "cannot_invite_emails_with_unverified_domains"] => Anthropic::Models::Organization::CannotInviteEmailsWithUnverifiedDomainsError,
|
|
29
32
|
[400, "cannot_remove_last_member"] => Anthropic::Models::Organization::CannotRemoveLastMemberError,
|
|
30
33
|
[400, "cannot_sign_out_primary_owner"] => Anthropic::Models::Beta::Organization::BetaCannotSignOutPrimaryOwnerError,
|
|
@@ -56,6 +59,7 @@ module Anthropic
|
|
|
56
59
|
[400, "organization_not_enrolled_in_beta"] => Anthropic::Models::BetaOrganizationNotEnrolledInBetaError,
|
|
57
60
|
[400, "organization_on_hold"] => Anthropic::Models::OrganizationOnHoldError,
|
|
58
61
|
[400, "organization_type_not_supported"] => Anthropic::Models::OrganizationTypeNotSupportedError,
|
|
62
|
+
[400, "parent_organization_required"] => Anthropic::Models::ParentOrganizationRequiredError,
|
|
59
63
|
[400, "rbac_group_grants_owner_access"] => Anthropic::Models::Organization::RBACGroupGrantsOwnerAccessError,
|
|
60
64
|
[400, "rbac_group_owner_access_unconfirmed"] => Anthropic::Models::Organization::RBACGroupOwnerAccessUnconfirmedError,
|
|
61
65
|
[400, "request_body_encoding_invalid"] => Anthropic::Models::RequestBodyEncodingInvalidError,
|
|
@@ -71,9 +75,12 @@ module Anthropic
|
|
|
71
75
|
[400, "tool_reference_unresolved"] => Anthropic::Models::ToolReferenceUnresolvedError,
|
|
72
76
|
[400, "unsupported_charset"] => Anthropic::Models::BetaUnsupportedCharsetError,
|
|
73
77
|
[400, "user_profile_not_found"] => Anthropic::Models::UserProfileNotFoundError,
|
|
78
|
+
[400, "user_profile_required"] => Anthropic::Models::UserProfileRequiredError,
|
|
74
79
|
[400, "workspace_api_key_limit_exceeded"] => Anthropic::Models::Organization::WorkspaceAPIKeyLimitExceededError,
|
|
75
80
|
[400, "workspace_member_limit_exceeded"] => Anthropic::Models::Organization::WorkspaceMemberLimitExceededError,
|
|
76
81
|
[400, "workspace_policy_violation"] => Anthropic::Models::Organization::WorkspacePolicyViolationError,
|
|
82
|
+
[402, "linked_organization_billing_unavailable"] => Anthropic::Models::LinkedOrganizationBillingUnavailableError,
|
|
83
|
+
[402, "linked_organization_spend_limit_reached"] => Anthropic::Models::LinkedOrganizationSpendLimitReachedError,
|
|
77
84
|
[403, "api_key_scope_missing"] => Anthropic::Models::Beta::Organization::BetaAPIKeyScopeMissingError,
|
|
78
85
|
[403, "cannot_sign_out_managed_member"] => Anthropic::Models::Beta::Organization::BetaCannotSignOutManagedMemberError,
|
|
79
86
|
[403, "cannot_sign_out_membership_admin"] => Anthropic::Models::Beta::Organization::BetaCannotSignOutMembershipAdminError,
|
|
@@ -86,8 +93,11 @@ module Anthropic
|
|
|
86
93
|
[403, "organization_level_scoped_api_key_required"] => Anthropic::Models::Beta::Organization::BetaOrganizationLevelScopedAPIKeyRequiredError,
|
|
87
94
|
[403, "sandbox_egress_restricted"] => Anthropic::Models::SandboxEgressRestrictedError,
|
|
88
95
|
[403, "spend_limits_admin_api_writes_not_enabled"] => Anthropic::Models::Beta::Organization::BetaSpendLimitsAdminAPIWritesNotEnabledError,
|
|
96
|
+
[403, "user_profile_billing_not_authorized"] => Anthropic::Models::UserProfileBillingNotAuthorizedError,
|
|
97
|
+
[403, "user_profile_not_billable"] => Anthropic::Models::UserProfileNotBillableError,
|
|
89
98
|
[404, "environment_not_found"] => Anthropic::Models::Beta::BetaEnvironmentNotFoundError,
|
|
90
99
|
[404, "file_expired"] => Anthropic::Models::FileExpiredError,
|
|
100
|
+
[404, "rbac_role_not_found"] => Anthropic::Models::RBACRoleNotFoundError,
|
|
91
101
|
[404, "slack_channel_set_up_environment_not_found"] => Anthropic::Models::Beta::Organization::BetaSlackChannelSetUpEnvironmentNotFoundError,
|
|
92
102
|
[404, "thread_not_found"] => Anthropic::Models::ThreadNotFoundError,
|
|
93
103
|
[409, "concurrent_membership_change"] => Anthropic::Models::ConcurrentMembershipChangeError,
|
|
@@ -99,6 +109,7 @@ module Anthropic
|
|
|
99
109
|
[409, "slack_channel_set_up_settings_conflict"] => Anthropic::Models::Beta::Organization::BetaSlackChannelSetUpSettingsConflictError,
|
|
100
110
|
[412, "heartbeat_precondition_failed"] => Anthropic::Models::Beta::Environments::BetaHeartbeatPreconditionFailedError,
|
|
101
111
|
[413, "request_body_too_large_after_decoding"] => Anthropic::Models::RequestBodyTooLargeAfterDecodingError,
|
|
112
|
+
[429, "contract_spend_limit_reached"] => Anthropic::Models::ContractSpendLimitReachedError,
|
|
102
113
|
[429, "enforced_spend_limit_reached"] => Anthropic::Models::EnforcedSpendLimitReachedError,
|
|
103
114
|
[429, "ramp_limit_exceeded"] => Anthropic::Models::RampLimitExceededError,
|
|
104
115
|
[503, "cmek_context_unavailable"] => Anthropic::Models::CMEKContextUnavailableError,
|
data/lib/anthropic/errors.rb
CHANGED
|
@@ -248,6 +248,10 @@ module Anthropic
|
|
|
248
248
|
HTTP_STATUS = 401
|
|
249
249
|
end
|
|
250
250
|
|
|
251
|
+
class PaymentRequiredError < Anthropic::Errors::APIStatusError
|
|
252
|
+
HTTP_STATUS = 402
|
|
253
|
+
end
|
|
254
|
+
|
|
251
255
|
class PermissionDeniedError < Anthropic::Errors::APIStatusError
|
|
252
256
|
HTTP_STATUS = 403
|
|
253
257
|
end
|
|
@@ -15,8 +15,8 @@ module Anthropic
|
|
|
15
15
|
# @return [String]
|
|
16
16
|
attr_reader :aws_region
|
|
17
17
|
|
|
18
|
-
# @return [Aws::Credentials]
|
|
19
|
-
|
|
18
|
+
# @return [Aws::Credentials, nil]
|
|
19
|
+
def aws_credentials = @signer&.credentials_provider&.credentials
|
|
20
20
|
|
|
21
21
|
# @return [String, nil]
|
|
22
22
|
def api_key = @auth_token
|
|
@@ -105,7 +105,7 @@ module Anthropic
|
|
|
105
105
|
raise RuntimeError.new(message)
|
|
106
106
|
end
|
|
107
107
|
|
|
108
|
-
@aws_region,
|
|
108
|
+
@aws_region, credentials_provider = resolve_region_and_credentials(
|
|
109
109
|
aws_region: aws_region,
|
|
110
110
|
aws_secret_key: aws_secret_key,
|
|
111
111
|
aws_access_key: aws_access_key,
|
|
@@ -116,7 +116,7 @@ module Anthropic
|
|
|
116
116
|
@signer = Aws::Sigv4::Signer.new(
|
|
117
117
|
service: "bedrock",
|
|
118
118
|
region: @aws_region,
|
|
119
|
-
|
|
119
|
+
credentials_provider: credentials_provider
|
|
120
120
|
)
|
|
121
121
|
else
|
|
122
122
|
@aws_region = aws_region || env_lookup("AWS_REGION", "AWS_DEFAULT_REGION")
|
|
@@ -280,7 +280,7 @@ module Anthropic
|
|
|
280
280
|
#
|
|
281
281
|
# @param aws_profile [String, nil]
|
|
282
282
|
#
|
|
283
|
-
# @return [Array<String, Aws::
|
|
283
|
+
# @return [Array<String, Aws::CredentialProvider>]
|
|
284
284
|
#
|
|
285
285
|
private def resolve_region_and_credentials(
|
|
286
286
|
aws_region:,
|
|
@@ -298,7 +298,7 @@ module Anthropic
|
|
|
298
298
|
(client_options[:region] = aws_region) unless aws_region.nil?
|
|
299
299
|
|
|
300
300
|
bedrock_client = Aws::BedrockRuntime::Client.new(client_options)
|
|
301
|
-
[bedrock_client.config.region, bedrock_client.config.credentials
|
|
301
|
+
[bedrock_client.config.region, bedrock_client.config.credentials]
|
|
302
302
|
end
|
|
303
303
|
|
|
304
304
|
# @private
|
|
@@ -11,7 +11,9 @@ module Anthropic
|
|
|
11
11
|
THREADS_BETA = Anthropic::Models::AnthropicBeta::MESSAGE_THREADS_2026_08_12.to_s
|
|
12
12
|
NOT_FOUND_ERROR_CODE = "thread_not_found"
|
|
13
13
|
# A `continue` rejected with one of these is sent again as a `create`.
|
|
14
|
-
REPLAY_ERROR_CODES = Set[NOT_FOUND_ERROR_CODE,
|
|
14
|
+
REPLAY_ERROR_CODES = Set[NOT_FOUND_ERROR_CODE,
|
|
15
|
+
"thread_already_continued",
|
|
16
|
+
"thread_continue_in_flight"].freeze
|
|
15
17
|
UNSUPPORTED_REQUEST_ERROR_CODE = "thread_unsupported_request"
|
|
16
18
|
UNSUPPORTED_REQUEST_BEHAVIORS = Set[:error, :continue_unthreaded].freeze
|
|
17
19
|
|
|
@@ -455,7 +457,16 @@ module Anthropic
|
|
|
455
457
|
value.except(:cache_control, "cache_control").to_h do |key, nested|
|
|
456
458
|
next [key, nested] unless %w[content source tool definition tool_references].include?(key.to_s)
|
|
457
459
|
|
|
458
|
-
[
|
|
460
|
+
[
|
|
461
|
+
key,
|
|
462
|
+
if nested.is_a?(Array)
|
|
463
|
+
nested.map do
|
|
464
|
+
without_cache_control(_1)
|
|
465
|
+
end
|
|
466
|
+
else
|
|
467
|
+
without_cache_control(nested)
|
|
468
|
+
end
|
|
469
|
+
]
|
|
459
470
|
end
|
|
460
471
|
end
|
|
461
472
|
|
|
@@ -463,11 +474,20 @@ module Anthropic
|
|
|
463
474
|
# as the API would receive it, and the classes that its tool inputs and output parse into
|
|
464
475
|
def wire_request(fields)
|
|
465
476
|
wire, = Anthropic::Models::Beta::MessageCreateParams.dump_request(fields)
|
|
466
|
-
tools, models = Anthropic::Helpers::Messages.distill_input_schema_models!(
|
|
477
|
+
tools, models = Anthropic::Helpers::Messages.distill_input_schema_models!(
|
|
478
|
+
wire,
|
|
479
|
+
strict: nil,
|
|
480
|
+
is_beta: true
|
|
481
|
+
)
|
|
467
482
|
[wire, tools, models]
|
|
468
483
|
end
|
|
469
484
|
|
|
470
|
-
def create_only_fields(wire)
|
|
485
|
+
def create_only_fields(wire)
|
|
486
|
+
{
|
|
487
|
+
system_: wire[:system],
|
|
488
|
+
tools: wire[:tools]
|
|
489
|
+
}.transform_values(&:to_json)
|
|
490
|
+
end
|
|
471
491
|
|
|
472
492
|
def refuse_change!(created_with)
|
|
473
493
|
return if !@anchor.is_a?(Continue) || created_with == @anchor.created_with
|
|
@@ -495,14 +515,18 @@ module Anthropic
|
|
|
495
515
|
in Anthropic::Models::Beta::BetaToolUseBlock[type: :tool_use] if (tool = request.tools[block.name])
|
|
496
516
|
Anthropic::Internal::Type::Converter.coerce(tool, block.input)
|
|
497
517
|
in Anthropic::Models::Beta::BetaTextBlock if (model = request.models.first&.last)
|
|
498
|
-
Anthropic::Internal::Type::Converter.coerce(
|
|
518
|
+
Anthropic::Internal::Type::Converter.coerce(
|
|
519
|
+
model,
|
|
520
|
+
JSON.parse(block.text, symbolize_names: true)
|
|
521
|
+
)
|
|
499
522
|
else
|
|
500
523
|
next
|
|
501
524
|
end
|
|
502
525
|
rescue StandardError => e
|
|
503
526
|
{error: e.message}
|
|
504
527
|
end
|
|
505
|
-
reply.content[index] =
|
|
528
|
+
reply.content[index] =
|
|
529
|
+
Anthropic::Internal::Type::Converter.coerce(block.class, {**block.to_h, parsed:})
|
|
506
530
|
end
|
|
507
531
|
end
|
|
508
532
|
|
|
@@ -272,7 +272,11 @@ module Anthropic
|
|
|
272
272
|
raise
|
|
273
273
|
ensure
|
|
274
274
|
if tool_runner_span
|
|
275
|
-
Anthropic::Helpers::Tracing.end_tool_runner_span(
|
|
275
|
+
Anthropic::Helpers::Tracing.end_tool_runner_span(
|
|
276
|
+
tool_runner_span,
|
|
277
|
+
returned: returned,
|
|
278
|
+
error: error
|
|
279
|
+
)
|
|
276
280
|
end
|
|
277
281
|
@tool_runner_otel_context, @app_otel_context, @stopped_by_app = outer
|
|
278
282
|
end
|
|
@@ -349,7 +353,12 @@ module Anthropic
|
|
|
349
353
|
begin
|
|
350
354
|
# `parsed` was read against `params[:tools]`, which an added tool is not in.
|
|
351
355
|
input = tool_use.parsed
|
|
352
|
-
|
|
356
|
+
if @tool_overrides.key?(tool_use.name)
|
|
357
|
+
input = Anthropic::Internal::Type::Converter.coerce(
|
|
358
|
+
tool,
|
|
359
|
+
tool_use.input
|
|
360
|
+
)
|
|
361
|
+
end
|
|
353
362
|
run = proc { tool.call(input) }
|
|
354
363
|
raw = tool_use_span ? OpenTelemetry::Trace.with_span(tool_use_span, &run) : run.call
|
|
355
364
|
is_error = false
|
|
@@ -360,7 +369,12 @@ module Anthropic
|
|
|
360
369
|
if tool_use_span
|
|
361
370
|
# `is_error` is unset when the run was interrupted, and then so is the span's status.
|
|
362
371
|
result = {content: tool_result_content(raw), is_error:} unless is_error.nil?
|
|
363
|
-
Anthropic::Helpers::Tracing.end_tool_use_span(
|
|
372
|
+
Anthropic::Helpers::Tracing.end_tool_use_span(
|
|
373
|
+
@client,
|
|
374
|
+
tool_use_span,
|
|
375
|
+
tool_use.input,
|
|
376
|
+
result
|
|
377
|
+
)
|
|
364
378
|
end
|
|
365
379
|
end
|
|
366
380
|
else
|
|
@@ -597,7 +611,10 @@ module Anthropic
|
|
|
597
611
|
# A compaction response replaces the history, `tool_removal` blocks included, so what the
|
|
598
612
|
# history took away is taken out of the overrides first.
|
|
599
613
|
private def keep_removals_from_history
|
|
600
|
-
runnable = [
|
|
614
|
+
runnable = [
|
|
615
|
+
*params[:tools].to_a.grep(Anthropic::Helpers::Tools::BaseTool),
|
|
616
|
+
*@tool_overrides.values.compact
|
|
617
|
+
]
|
|
601
618
|
names = runnable.map { Anthropic::Helpers::Messages.tool_api_name(_1) }
|
|
602
619
|
(names - available_tool_names(runnable).to_a).each { @tool_overrides.store(_1, nil) }
|
|
603
620
|
end
|
|
@@ -26,7 +26,14 @@ module Anthropic
|
|
|
26
26
|
# @param content_limit [Integer] the most bytes the `content` attributes hold
|
|
27
27
|
#
|
|
28
28
|
# @return [Array(Enumerator, Anthropic::Helpers::Tracing::StreamedMessage)]
|
|
29
|
-
def follow_streamed_message(
|
|
29
|
+
def follow_streamed_message(
|
|
30
|
+
span,
|
|
31
|
+
events,
|
|
32
|
+
params:,
|
|
33
|
+
start_time:,
|
|
34
|
+
content:,
|
|
35
|
+
content_limit: CONTENT_LIMIT
|
|
36
|
+
)
|
|
30
37
|
tracker = StreamedMessage.new(
|
|
31
38
|
span,
|
|
32
39
|
params: params,
|
|
@@ -366,6 +366,7 @@ module Anthropic
|
|
|
366
366
|
"anthropic.organization.claude_tag.slack_workspaces.update"
|
|
367
367
|
ORGANIZATION_CLAUDE_TAG_SLACK_WORKSPACES_LIST = "anthropic.organization.claude_tag.slack_workspaces.list"
|
|
368
368
|
ORGANIZATION_CLAUDE_TAG_BUNDLES_RETRIEVE = "anthropic.organization.claude_tag.bundles.retrieve"
|
|
369
|
+
ORGANIZATION_CLAUDE_TAG_BUNDLES_UPDATE = "anthropic.organization.claude_tag.bundles.update"
|
|
369
370
|
ORGANIZATION_CLAUDE_TAG_BUNDLES_LIST = "anthropic.organization.claude_tag.bundles.list"
|
|
370
371
|
ORGANIZATION_CLAUDE_TAG_BUNDLES_TARGETS_CREATE =
|
|
371
372
|
"anthropic.organization.claude_tag.bundles.targets.create"
|
|
@@ -92,6 +92,17 @@ module Anthropic
|
|
|
92
92
|
in Anthropic::FilePart if value.content.is_a?(IO)
|
|
93
93
|
state[:can_retry] = false
|
|
94
94
|
value
|
|
95
|
+
in Anthropic::FilePart if IO.try_convert(value.content)
|
|
96
|
+
dump(
|
|
97
|
+
Anthropic::FilePart.new(
|
|
98
|
+
value.content.to_io,
|
|
99
|
+
filename: value.filename,
|
|
100
|
+
content_type: value.content_type
|
|
101
|
+
),
|
|
102
|
+
state: state
|
|
103
|
+
)
|
|
104
|
+
in -> { IO.try_convert(_1) }
|
|
105
|
+
dump(value.to_io, state: state)
|
|
95
106
|
else
|
|
96
107
|
value
|
|
97
108
|
end
|
|
@@ -112,6 +112,28 @@ module Anthropic
|
|
|
112
112
|
end
|
|
113
113
|
end
|
|
114
114
|
|
|
115
|
+
# @api private
|
|
116
|
+
#
|
|
117
|
+
# @param value [Object]
|
|
118
|
+
#
|
|
119
|
+
# @return [Anthropic::Internal::Type::Converter, Class, nil]
|
|
120
|
+
private def resolve_untagged_variant(value)
|
|
121
|
+
variants.find do |target|
|
|
122
|
+
case [target, value]
|
|
123
|
+
in [Anthropic::Internal::Type::ArrayOf, Array]
|
|
124
|
+
true
|
|
125
|
+
in [Class, Hash] if target <= Anthropic::Internal::Type::BaseModel
|
|
126
|
+
consts = target.known_fields.reject { _2.fetch(:const) == Anthropic::Internal::OMIT }
|
|
127
|
+
consts.any? && consts.all? do |name, field|
|
|
128
|
+
val = value.fetch(name) { value[name.to_s] }
|
|
129
|
+
(val.is_a?(String) ? val.to_sym : val) == field.fetch(:const)
|
|
130
|
+
end
|
|
131
|
+
else
|
|
132
|
+
false
|
|
133
|
+
end
|
|
134
|
+
end
|
|
135
|
+
end
|
|
136
|
+
|
|
115
137
|
# rubocop:disable Style/HashEachMethods
|
|
116
138
|
# rubocop:disable Style/CaseEquality
|
|
117
139
|
|
|
@@ -226,6 +248,10 @@ module Anthropic
|
|
|
226
248
|
return Anthropic::Internal::Type::Converter.dump(target, value, state: state) if target === value
|
|
227
249
|
end
|
|
228
250
|
|
|
251
|
+
if (target = resolve_untagged_variant(value))
|
|
252
|
+
return Anthropic::Internal::Type::Converter.dump(target, value, state: state)
|
|
253
|
+
end
|
|
254
|
+
|
|
229
255
|
super
|
|
230
256
|
end
|
|
231
257
|
|
|
@@ -338,7 +338,9 @@ module Anthropic
|
|
|
338
338
|
#
|
|
339
339
|
# @return [String, nil]
|
|
340
340
|
def encode_query(query)
|
|
341
|
-
query.to_h.empty?
|
|
341
|
+
return if query.to_h.empty?
|
|
342
|
+
|
|
343
|
+
URI.encode_www_form(query).gsub(/[+*]|%7E/, {"+" => "%20", "*" => "%2A", "%7E" => "~"})
|
|
342
344
|
end
|
|
343
345
|
end
|
|
344
346
|
|
|
@@ -473,18 +475,23 @@ module Anthropic
|
|
|
473
475
|
#
|
|
474
476
|
# @param max_len [Integer, nil]
|
|
475
477
|
#
|
|
476
|
-
# @return [String]
|
|
478
|
+
# @return [String, nil]
|
|
477
479
|
private def read_enum(max_len)
|
|
478
480
|
case max_len
|
|
479
481
|
in nil
|
|
480
|
-
@stream.
|
|
482
|
+
loop { @buf << @stream.next }
|
|
483
|
+
@stream = nil
|
|
484
|
+
@buf.slice!(0..)
|
|
481
485
|
in Integer
|
|
482
486
|
@buf << @stream.next while @buf.length < max_len
|
|
483
|
-
@buf.slice!(
|
|
487
|
+
@buf.slice!(0, max_len)
|
|
484
488
|
end
|
|
485
489
|
rescue StopIteration
|
|
486
490
|
@stream = nil
|
|
487
|
-
|
|
491
|
+
# Return nil, not "", once the body is used up, as `IO#read(length)` does: Net::HTTP sends each read as a
|
|
492
|
+
# chunk, and an empty chunk ends the body, so "" would end it twice and break the next request on the
|
|
493
|
+
# connection.
|
|
494
|
+
@buf.slice!(0..) unless @buf.empty?
|
|
488
495
|
end
|
|
489
496
|
|
|
490
497
|
# @api private
|
|
@@ -496,15 +503,19 @@ module Anthropic
|
|
|
496
503
|
def read(max_len = nil, out_string = nil)
|
|
497
504
|
case @stream
|
|
498
505
|
in nil
|
|
506
|
+
out_string&.clear
|
|
499
507
|
nil
|
|
500
508
|
in IO | StringIO
|
|
501
509
|
@stream.read(max_len, out_string)
|
|
502
510
|
in Enumerator
|
|
503
511
|
read = read_enum(max_len)
|
|
504
|
-
case out_string
|
|
505
|
-
in String
|
|
512
|
+
case [out_string, read]
|
|
513
|
+
in [String, String]
|
|
506
514
|
out_string.replace(read)
|
|
507
|
-
in nil
|
|
515
|
+
in [String, nil]
|
|
516
|
+
out_string.clear
|
|
517
|
+
nil
|
|
518
|
+
in [nil, _]
|
|
508
519
|
read
|
|
509
520
|
end
|
|
510
521
|
end
|
|
@@ -525,6 +536,10 @@ module Anthropic
|
|
|
525
536
|
in Pathname
|
|
526
537
|
@closing = true
|
|
527
538
|
src.open(binmode: true)
|
|
539
|
+
in Enumerator
|
|
540
|
+
# Each retry or redirect reads the same body through a new adapter. Calling `next` on `src` itself would
|
|
541
|
+
# resume where the previous adapter stopped; `to_enum` starts from the beginning.
|
|
542
|
+
src.to_enum
|
|
528
543
|
else
|
|
529
544
|
src
|
|
530
545
|
end
|
|
@@ -540,8 +555,10 @@ module Anthropic
|
|
|
540
555
|
# @return [Enumerable<String>]
|
|
541
556
|
def writable_enum(&blk)
|
|
542
557
|
Enumerator.new do |y|
|
|
558
|
+
y.define_singleton_method(:<<) { super(_1.b) }
|
|
543
559
|
y.define_singleton_method(:write) do
|
|
544
|
-
|
|
560
|
+
# `IO.copy_stream` reuses its buffer. With Ruby bug #21131, a `dup` or `b` of it changes on the next read.
|
|
561
|
+
self << (String.new(capacity: _1.bytesize) << _1)
|
|
545
562
|
_1.bytesize
|
|
546
563
|
end
|
|
547
564
|
|
|
@@ -553,7 +570,7 @@ module Anthropic
|
|
|
553
570
|
# @type [Regexp]
|
|
554
571
|
JSON_CONTENT = %r{^application/(?:[a-zA-Z0-9.-]+\+)?json(?!l)}
|
|
555
572
|
# @type [Regexp]
|
|
556
|
-
JSONL_CONTENT = %r{^application/(
|
|
573
|
+
JSONL_CONTENT = %r{^application/(?:x-(?:n|l)djson|(?:x-)?jsonl)}
|
|
557
574
|
|
|
558
575
|
class << self
|
|
559
576
|
# @api private
|
|
@@ -685,6 +702,9 @@ module Anthropic
|
|
|
685
702
|
# RFC 1521 Section 7.2.1 says we should have 70 char maximum for boundary length
|
|
686
703
|
boundary = SecureRandom.urlsafe_base64(30)
|
|
687
704
|
|
|
705
|
+
# Each read of `strio` runs this block from the start, so a retry or redirect sends the whole body. A read
|
|
706
|
+
# stopped partway skips the `ensure` below; `ReadIOAdapter#close` then starts a new read and stops it at the
|
|
707
|
+
# first chunk, and that read's `ensure` closes every file left in `closing`.
|
|
688
708
|
closing = []
|
|
689
709
|
strio = writable_enum do |y|
|
|
690
710
|
case body
|
|
@@ -703,10 +723,24 @@ module Anthropic
|
|
|
703
723
|
write_multipart_chunk(y, boundary: boundary, key: nil, val: body, closing: closing)
|
|
704
724
|
end
|
|
705
725
|
y << "--#{boundary}--\r\n"
|
|
726
|
+
ensure
|
|
727
|
+
closing.each(&:call)
|
|
728
|
+
closing.clear
|
|
729
|
+
end
|
|
730
|
+
|
|
731
|
+
# An IO can be read only once, so a second read of `strio` would send the other parts with an empty file part.
|
|
732
|
+
# `fused_enum` yields nothing instead. Resource methods turn retries off for a body holding an IO; a retry
|
|
733
|
+
# through `client.request`, or a 307 or 308 redirect, can still send it without the file's contents.
|
|
734
|
+
parts = if body.is_a?(Hash)
|
|
735
|
+
body.values.flat_map { _1.is_a?(Array) ? _1 : [_1] }
|
|
736
|
+
else
|
|
737
|
+
[body]
|
|
738
|
+
end
|
|
739
|
+
if parts.any? { _1.is_a?(IO) || (_1.is_a?(Anthropic::FilePart) && _1.content.is_a?(IO)) }
|
|
740
|
+
return [boundary, fused_enum(strio) { closing.each(&:call) }]
|
|
706
741
|
end
|
|
707
742
|
|
|
708
|
-
|
|
709
|
-
[boundary, fused_io]
|
|
743
|
+
[boundary, strio]
|
|
710
744
|
# rubocop:enable Style/CaseEquality
|
|
711
745
|
end
|
|
712
746
|
|