anthropic 1.37.0 → 1.39.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 +22 -0
- data/README.md +1 -1
- data/lib/anthropic/client.rb +7 -0
- data/lib/anthropic/credentials/config_provider.rb +5 -0
- data/lib/anthropic/credentials/constants.rb +3 -0
- data/lib/anthropic/credentials/in_memory_config.rb +1 -0
- data/lib/anthropic/credentials/workload_identity.rb +29 -1
- data/lib/anthropic/credentials.rb +4 -0
- data/lib/anthropic/helpers/aws_auth.rb +51 -2
- data/lib/anthropic/internal/stream.rb +1 -1
- data/lib/anthropic/internal/util.rb +1 -1
- data/lib/anthropic/models/anthropic_beta.rb +3 -0
- data/lib/anthropic/models/beta/agent_create_params.rb +10 -1
- data/lib/anthropic/models/beta/agent_update_params.rb +10 -1
- data/lib/anthropic/models/beta/beta_citation_content_block_location.rb +24 -3
- data/lib/anthropic/models/beta/beta_citation_content_block_location_param.rb +24 -3
- data/lib/anthropic/models/beta/beta_citation_search_result_location.rb +31 -4
- data/lib/anthropic/models/beta/beta_citation_search_result_location_param.rb +32 -4
- data/lib/anthropic/models/beta/beta_managed_agents_agent.rb +9 -1
- data/lib/anthropic/models/beta/beta_managed_agents_agent_reference.rb +43 -0
- data/lib/anthropic/models/beta/beta_managed_agents_multiagent.rb +44 -0
- data/lib/anthropic/models/beta/beta_managed_agents_multiagent_coordinator.rb +45 -0
- data/lib/anthropic/models/beta/beta_managed_agents_multiagent_coordinator_params.rb +50 -0
- data/lib/anthropic/models/beta/beta_managed_agents_multiagent_params.rb +49 -0
- data/lib/anthropic/models/beta/beta_managed_agents_multiagent_roster_entry_params.rb +26 -0
- data/lib/anthropic/models/beta/beta_managed_agents_multiagent_self_params.rb +32 -0
- data/lib/anthropic/models/beta/beta_managed_agents_outcome_evaluation_resource.rb +87 -0
- data/lib/anthropic/models/beta/beta_managed_agents_session.rb +11 -1
- data/lib/anthropic/models/beta/beta_managed_agents_session_agent.rb +17 -1
- data/lib/anthropic/models/beta/beta_managed_agents_session_multiagent_coordinator.rb +41 -0
- data/lib/anthropic/models/beta/beta_user_profile.rb +36 -1
- data/lib/anthropic/models/beta/beta_webhook_event.rb +43 -0
- data/lib/anthropic/models/beta/beta_webhook_event_data.rb +65 -0
- data/lib/anthropic/models/beta/beta_webhook_session_archived_event_data.rb +41 -0
- data/lib/anthropic/models/beta/beta_webhook_session_created_event_data.rb +41 -0
- data/lib/anthropic/models/beta/beta_webhook_session_deleted_event_data.rb +41 -0
- data/lib/anthropic/models/beta/beta_webhook_session_idled_event_data.rb +41 -0
- data/lib/anthropic/models/beta/beta_webhook_session_outcome_evaluation_ended_event_data.rb +42 -0
- data/lib/anthropic/models/beta/beta_webhook_session_pending_event_data.rb +41 -0
- data/lib/anthropic/models/beta/beta_webhook_session_requires_action_event_data.rb +41 -0
- data/lib/anthropic/models/beta/beta_webhook_session_running_event_data.rb +41 -0
- data/lib/anthropic/models/beta/beta_webhook_session_status_idled_event_data.rb +41 -0
- data/lib/anthropic/models/beta/beta_webhook_session_status_rescheduled_event_data.rb +41 -0
- data/lib/anthropic/models/beta/beta_webhook_session_status_run_started_event_data.rb +41 -0
- data/lib/anthropic/models/beta/beta_webhook_session_status_terminated_event_data.rb +41 -0
- data/lib/anthropic/models/beta/beta_webhook_session_thread_created_event_data.rb +41 -0
- data/lib/anthropic/models/beta/beta_webhook_session_thread_idled_event_data.rb +41 -0
- data/lib/anthropic/models/beta/beta_webhook_session_thread_terminated_event_data.rb +41 -0
- data/lib/anthropic/models/beta/beta_webhook_vault_archived_event_data.rb +41 -0
- data/lib/anthropic/models/beta/beta_webhook_vault_created_event_data.rb +41 -0
- data/lib/anthropic/models/beta/beta_webhook_vault_credential_archived_event_data.rb +49 -0
- data/lib/anthropic/models/beta/beta_webhook_vault_credential_created_event_data.rb +49 -0
- data/lib/anthropic/models/beta/beta_webhook_vault_credential_deleted_event_data.rb +49 -0
- data/lib/anthropic/models/beta/beta_webhook_vault_credential_refresh_failed_event_data.rb +49 -0
- data/lib/anthropic/models/beta/beta_webhook_vault_deleted_event_data.rb +41 -0
- data/lib/anthropic/models/beta/session_list_params.rb +24 -1
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_agent_custom_tool_use_event.rb +15 -1
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_agent_mcp_tool_use_event.rb +16 -1
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_agent_thread_message_received_event.rb +98 -0
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_agent_thread_message_sent_event.rb +97 -0
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_agent_tool_use_event.rb +16 -1
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_event_params.rb +5 -1
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_file_rubric.rb +39 -0
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_file_rubric_params.rb +39 -0
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_send_session_events.rb +6 -3
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_session_event.rb +44 -1
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_session_thread.rb +119 -0
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_session_thread_agent.rb +133 -0
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_session_thread_created_event.rb +64 -0
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_session_thread_stats.rb +45 -0
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_session_thread_status.rb +22 -0
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_session_thread_status_idle_event.rb +95 -0
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_session_thread_status_rescheduled_event.rb +66 -0
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_session_thread_status_running_event.rb +65 -0
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_session_thread_status_terminated_event.rb +65 -0
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_session_thread_usage.rb +46 -0
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_span_outcome_evaluation_end_event.rb +111 -0
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_span_outcome_evaluation_ongoing_event.rb +72 -0
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_span_outcome_evaluation_start_event.rb +69 -0
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_stream_session_events.rb +44 -1
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_stream_session_thread_events.rb +132 -0
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_text_rubric.rb +39 -0
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_text_rubric_params.rb +44 -0
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_user_custom_tool_result_event.rb +10 -1
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_user_define_outcome_event.rb +103 -0
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_user_define_outcome_event_params.rb +76 -0
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_user_interrupt_event.rb +15 -1
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_user_interrupt_event_params.rb +15 -1
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_user_tool_confirmation_event.rb +11 -1
- data/lib/anthropic/models/beta/sessions/event_list_params.rb +42 -1
- data/lib/anthropic/models/beta/sessions/event_send_params.rb +2 -2
- data/lib/anthropic/models/beta/sessions/thread_archive_params.rb +40 -0
- data/lib/anthropic/models/beta/sessions/thread_list_params.rb +49 -0
- data/lib/anthropic/models/beta/sessions/thread_retrieve_params.rb +40 -0
- data/lib/anthropic/models/beta/sessions/threads/event_list_params.rb +58 -0
- data/lib/anthropic/models/beta/sessions/threads/event_stream_params.rb +42 -0
- data/lib/anthropic/models/beta/unwrap_webhook_event.rb +41 -0
- data/lib/anthropic/models/beta/user_profile_create_params.rb +35 -1
- data/lib/anthropic/models/beta/user_profile_update_params.rb +38 -1
- data/lib/anthropic/models/beta/vaults/beta_managed_agents_credential_validation.rb +88 -0
- data/lib/anthropic/models/beta/vaults/beta_managed_agents_credential_validation_status.rb +21 -0
- data/lib/anthropic/models/beta/vaults/beta_managed_agents_mcp_probe.rb +34 -0
- data/lib/anthropic/models/beta/vaults/beta_managed_agents_refresh_http_response.rb +46 -0
- data/lib/anthropic/models/beta/vaults/beta_managed_agents_refresh_object.rb +49 -0
- data/lib/anthropic/models/beta/vaults/credential_mcp_oauth_validate_params.rb +40 -0
- data/lib/anthropic/models/beta/webhook_unwrap_params.rb +16 -0
- data/lib/anthropic/models/citation_content_block_location.rb +24 -3
- data/lib/anthropic/models/citation_content_block_location_param.rb +23 -3
- data/lib/anthropic/models/citation_search_result_location_param.rb +31 -4
- data/lib/anthropic/models/citations_search_result_location.rb +31 -4
- data/lib/anthropic/resources/beta/agents.rb +6 -2
- data/lib/anthropic/resources/beta/sessions/events.rb +31 -6
- data/lib/anthropic/resources/beta/sessions/threads/events.rb +95 -0
- data/lib/anthropic/resources/beta/sessions/threads.rb +117 -0
- data/lib/anthropic/resources/beta/sessions.rb +9 -2
- data/lib/anthropic/resources/beta/user_profiles.rb +10 -2
- data/lib/anthropic/resources/beta/vaults/credentials.rb +30 -0
- data/lib/anthropic/resources/beta/webhooks.rb +34 -0
- data/lib/anthropic/resources/beta.rb +4 -0
- data/lib/anthropic/version.rb +1 -1
- data/lib/anthropic.rb +72 -0
- data/rbi/anthropic/client.rbi +6 -0
- data/rbi/anthropic/credentials.rbi +3 -0
- data/rbi/anthropic/helpers/aws/client.rbi +2 -3
- data/rbi/anthropic/models/anthropic_beta.rbi +5 -0
- data/rbi/anthropic/models/beta/agent_create_params.rbi +26 -0
- data/rbi/anthropic/models/beta/agent_update_params.rbi +26 -0
- data/rbi/anthropic/models/beta/beta_citation_content_block_location.rbi +24 -0
- data/rbi/anthropic/models/beta/beta_citation_content_block_location_param.rbi +24 -0
- data/rbi/anthropic/models/beta/beta_citation_search_result_location.rbi +36 -0
- data/rbi/anthropic/models/beta/beta_citation_search_result_location_param.rbi +36 -0
- data/rbi/anthropic/models/beta/beta_managed_agents_agent.rbi +18 -0
- data/rbi/anthropic/models/beta/beta_managed_agents_agent_reference.rbi +86 -0
- data/rbi/anthropic/models/beta/beta_managed_agents_multiagent.rbi +90 -0
- data/rbi/anthropic/models/beta/beta_managed_agents_multiagent_coordinator.rbi +95 -0
- data/rbi/anthropic/models/beta/beta_managed_agents_multiagent_coordinator_params.rbi +122 -0
- data/rbi/anthropic/models/beta/beta_managed_agents_multiagent_params.rbi +121 -0
- data/rbi/anthropic/models/beta/beta_managed_agents_multiagent_roster_entry_params.rbi +35 -0
- data/rbi/anthropic/models/beta/beta_managed_agents_multiagent_self_params.rbi +78 -0
- data/rbi/anthropic/models/beta/beta_managed_agents_outcome_evaluation_resource.rbi +135 -0
- data/rbi/anthropic/models/beta/beta_managed_agents_session.rbi +22 -0
- data/rbi/anthropic/models/beta/beta_managed_agents_session_agent.rbi +32 -0
- data/rbi/anthropic/models/beta/beta_managed_agents_session_multiagent_coordinator.rbi +100 -0
- data/rbi/anthropic/models/beta/beta_user_profile.rbi +68 -3
- data/rbi/anthropic/models/beta/beta_webhook_event.rbi +141 -0
- data/rbi/anthropic/models/beta/beta_webhook_event_data.rbi +49 -0
- data/rbi/anthropic/models/beta/beta_webhook_session_archived_event_data.rbi +63 -0
- data/rbi/anthropic/models/beta/beta_webhook_session_created_event_data.rbi +63 -0
- data/rbi/anthropic/models/beta/beta_webhook_session_deleted_event_data.rbi +63 -0
- data/rbi/anthropic/models/beta/beta_webhook_session_idled_event_data.rbi +62 -0
- data/rbi/anthropic/models/beta/beta_webhook_session_outcome_evaluation_ended_event_data.rbi +63 -0
- data/rbi/anthropic/models/beta/beta_webhook_session_pending_event_data.rbi +63 -0
- data/rbi/anthropic/models/beta/beta_webhook_session_requires_action_event_data.rbi +63 -0
- data/rbi/anthropic/models/beta/beta_webhook_session_running_event_data.rbi +63 -0
- data/rbi/anthropic/models/beta/beta_webhook_session_status_idled_event_data.rbi +63 -0
- data/rbi/anthropic/models/beta/beta_webhook_session_status_rescheduled_event_data.rbi +63 -0
- data/rbi/anthropic/models/beta/beta_webhook_session_status_run_started_event_data.rbi +63 -0
- data/rbi/anthropic/models/beta/beta_webhook_session_status_terminated_event_data.rbi +63 -0
- data/rbi/anthropic/models/beta/beta_webhook_session_thread_created_event_data.rbi +63 -0
- data/rbi/anthropic/models/beta/beta_webhook_session_thread_idled_event_data.rbi +63 -0
- data/rbi/anthropic/models/beta/beta_webhook_session_thread_terminated_event_data.rbi +63 -0
- data/rbi/anthropic/models/beta/beta_webhook_vault_archived_event_data.rbi +62 -0
- data/rbi/anthropic/models/beta/beta_webhook_vault_created_event_data.rbi +62 -0
- data/rbi/anthropic/models/beta/beta_webhook_vault_credential_archived_event_data.rbi +71 -0
- data/rbi/anthropic/models/beta/beta_webhook_vault_credential_created_event_data.rbi +71 -0
- data/rbi/anthropic/models/beta/beta_webhook_vault_credential_deleted_event_data.rbi +71 -0
- data/rbi/anthropic/models/beta/beta_webhook_vault_credential_refresh_failed_event_data.rbi +71 -0
- data/rbi/anthropic/models/beta/beta_webhook_vault_deleted_event_data.rbi +62 -0
- data/rbi/anthropic/models/beta/session_list_params.rbi +66 -0
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_agent_custom_tool_use_event.rbi +15 -3
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_agent_mcp_tool_use_event.rbi +17 -3
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_agent_thread_message_received_event.rbi +161 -0
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_agent_thread_message_sent_event.rbi +161 -0
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_agent_tool_use_event.rbi +17 -3
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_event_params.rbi +2 -1
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_file_rubric.rbi +86 -0
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_file_rubric_params.rbi +86 -0
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_send_session_events.rbi +6 -3
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_session_event.rbi +12 -1
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_session_thread.rbi +227 -0
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_session_thread_agent.rbi +231 -0
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_session_thread_created_event.rbi +111 -0
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_session_thread_stats.rbi +76 -0
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_session_thread_status.rbi +54 -0
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_session_thread_status_idle_event.rbi +153 -0
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_session_thread_status_rescheduled_event.rbi +112 -0
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_session_thread_status_running_event.rbi +111 -0
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_session_thread_status_terminated_event.rbi +111 -0
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_session_thread_usage.rbi +92 -0
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_span_outcome_evaluation_end_event.rbi +173 -0
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_span_outcome_evaluation_ongoing_event.rbi +115 -0
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_span_outcome_evaluation_start_event.rbi +112 -0
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_stream_session_events.rbi +12 -1
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_stream_session_thread_events.rbi +61 -0
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_text_rubric.rbi +86 -0
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_text_rubric_params.rbi +88 -0
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_user_custom_tool_result_event.rbi +13 -3
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_user_define_outcome_event.rbi +161 -0
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_user_define_outcome_event_params.rbi +141 -0
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_user_interrupt_event.rbi +15 -3
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_user_interrupt_event_params.rbi +17 -3
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_user_tool_confirmation_event.rbi +15 -3
- data/rbi/anthropic/models/beta/sessions/event_list_params.rbi +57 -0
- data/rbi/anthropic/models/beta/sessions/event_send_params.rbi +6 -3
- data/rbi/anthropic/models/beta/sessions/thread_archive_params.rbi +77 -0
- data/rbi/anthropic/models/beta/sessions/thread_list_params.rbi +93 -0
- data/rbi/anthropic/models/beta/sessions/thread_retrieve_params.rbi +77 -0
- data/rbi/anthropic/models/beta/sessions/threads/event_list_params.rbi +102 -0
- data/rbi/anthropic/models/beta/sessions/threads/event_stream_params.rbi +80 -0
- data/rbi/anthropic/models/beta/unwrap_webhook_event.rbi +88 -0
- data/rbi/anthropic/models/beta/user_profile_create_params.rbi +82 -0
- data/rbi/anthropic/models/beta/user_profile_update_params.rbi +76 -0
- data/rbi/anthropic/models/beta/vaults/beta_managed_agents_credential_validation.rbi +178 -0
- data/rbi/anthropic/models/beta/vaults/beta_managed_agents_credential_validation_status.rbi +49 -0
- data/rbi/anthropic/models/beta/vaults/beta_managed_agents_mcp_probe.rbi +75 -0
- data/rbi/anthropic/models/beta/vaults/beta_managed_agents_refresh_http_response.rbi +69 -0
- data/rbi/anthropic/models/beta/vaults/beta_managed_agents_refresh_object.rbi +126 -0
- data/rbi/anthropic/models/beta/vaults/credential_mcp_oauth_validate_params.rbi +77 -0
- data/rbi/anthropic/models/beta/webhook_unwrap_params.rbi +32 -0
- data/rbi/anthropic/models/citation_content_block_location.rbi +24 -0
- data/rbi/anthropic/models/citation_content_block_location_param.rbi +24 -0
- data/rbi/anthropic/models/citation_search_result_location_param.rbi +36 -0
- data/rbi/anthropic/models/citations_search_result_location.rbi +36 -0
- data/rbi/anthropic/resources/beta/agents.rbi +16 -0
- data/rbi/anthropic/resources/beta/sessions/events.rbi +19 -1
- data/rbi/anthropic/resources/beta/sessions/threads/events.rbi +74 -0
- data/rbi/anthropic/resources/beta/sessions/threads.rbi +90 -0
- data/rbi/anthropic/resources/beta/sessions.rbi +8 -0
- data/rbi/anthropic/resources/beta/user_profiles.rbi +25 -0
- data/rbi/anthropic/resources/beta/vaults/credentials.rbi +23 -0
- data/rbi/anthropic/resources/beta/webhooks.rbi +31 -0
- data/rbi/anthropic/resources/beta.rbi +3 -0
- data/sig/anthropic/client.rbs +3 -0
- data/sig/anthropic/credentials.rbs +3 -0
- data/sig/anthropic/models/anthropic_beta.rbs +2 -0
- data/sig/anthropic/models/beta/agent_create_params.rbs +5 -0
- data/sig/anthropic/models/beta/agent_update_params.rbs +5 -0
- data/sig/anthropic/models/beta/beta_managed_agents_agent.rbs +5 -0
- data/sig/anthropic/models/beta/beta_managed_agents_agent_reference.rbs +44 -0
- data/sig/anthropic/models/beta/beta_managed_agents_multiagent.rbs +39 -0
- data/sig/anthropic/models/beta/beta_managed_agents_multiagent_coordinator.rbs +39 -0
- data/sig/anthropic/models/beta/beta_managed_agents_multiagent_coordinator_params.rbs +39 -0
- data/sig/anthropic/models/beta/beta_managed_agents_multiagent_params.rbs +39 -0
- data/sig/anthropic/models/beta/beta_managed_agents_multiagent_roster_entry_params.rbs +18 -0
- data/sig/anthropic/models/beta/beta_managed_agents_multiagent_self_params.rbs +34 -0
- data/sig/anthropic/models/beta/beta_managed_agents_outcome_evaluation_resource.rbs +64 -0
- data/sig/anthropic/models/beta/beta_managed_agents_session.rbs +5 -0
- data/sig/anthropic/models/beta/beta_managed_agents_session_agent.rbs +5 -0
- data/sig/anthropic/models/beta/beta_managed_agents_session_multiagent_coordinator.rbs +39 -0
- data/sig/anthropic/models/beta/beta_user_profile.rbs +25 -3
- data/sig/anthropic/models/beta/beta_webhook_event.rbs +39 -0
- data/sig/anthropic/models/beta/beta_webhook_event_data.rbs +37 -0
- data/sig/anthropic/models/beta/beta_webhook_session_archived_event_data.rbs +39 -0
- data/sig/anthropic/models/beta/beta_webhook_session_created_event_data.rbs +39 -0
- data/sig/anthropic/models/beta/beta_webhook_session_deleted_event_data.rbs +39 -0
- data/sig/anthropic/models/beta/beta_webhook_session_idled_event_data.rbs +39 -0
- data/sig/anthropic/models/beta/beta_webhook_session_outcome_evaluation_ended_event_data.rbs +39 -0
- data/sig/anthropic/models/beta/beta_webhook_session_pending_event_data.rbs +39 -0
- data/sig/anthropic/models/beta/beta_webhook_session_requires_action_event_data.rbs +39 -0
- data/sig/anthropic/models/beta/beta_webhook_session_running_event_data.rbs +39 -0
- data/sig/anthropic/models/beta/beta_webhook_session_status_idled_event_data.rbs +39 -0
- data/sig/anthropic/models/beta/beta_webhook_session_status_rescheduled_event_data.rbs +39 -0
- data/sig/anthropic/models/beta/beta_webhook_session_status_run_started_event_data.rbs +39 -0
- data/sig/anthropic/models/beta/beta_webhook_session_status_terminated_event_data.rbs +39 -0
- data/sig/anthropic/models/beta/beta_webhook_session_thread_created_event_data.rbs +39 -0
- data/sig/anthropic/models/beta/beta_webhook_session_thread_idled_event_data.rbs +39 -0
- data/sig/anthropic/models/beta/beta_webhook_session_thread_terminated_event_data.rbs +39 -0
- data/sig/anthropic/models/beta/beta_webhook_vault_archived_event_data.rbs +39 -0
- data/sig/anthropic/models/beta/beta_webhook_vault_created_event_data.rbs +39 -0
- data/sig/anthropic/models/beta/beta_webhook_vault_credential_archived_event_data.rbs +44 -0
- data/sig/anthropic/models/beta/beta_webhook_vault_credential_created_event_data.rbs +44 -0
- data/sig/anthropic/models/beta/beta_webhook_vault_credential_deleted_event_data.rbs +44 -0
- data/sig/anthropic/models/beta/beta_webhook_vault_credential_refresh_failed_event_data.rbs +44 -0
- data/sig/anthropic/models/beta/beta_webhook_vault_deleted_event_data.rbs +39 -0
- data/sig/anthropic/models/beta/session_list_params.rbs +22 -0
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_agent_custom_tool_use_event.rbs +8 -3
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_agent_mcp_tool_use_event.rbs +8 -3
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_agent_thread_message_received_event.rbs +70 -0
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_agent_thread_message_sent_event.rbs +70 -0
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_agent_tool_use_event.rbs +8 -3
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_event_params.rbs +1 -0
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_file_rubric.rbs +39 -0
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_file_rubric_params.rbs +39 -0
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_send_session_events.rbs +1 -0
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_session_event.rbs +11 -0
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_session_thread.rbs +84 -0
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_session_thread_agent.rbs +100 -0
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_session_thread_created_event.rbs +54 -0
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_session_thread_stats.rbs +40 -0
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_session_thread_status.rbs +21 -0
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_session_thread_status_idle_event.rbs +70 -0
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_session_thread_status_rescheduled_event.rbs +54 -0
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_session_thread_status_running_event.rbs +54 -0
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_session_thread_status_terminated_event.rbs +54 -0
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_session_thread_usage.rbs +49 -0
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_span_outcome_evaluation_end_event.rbs +74 -0
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_span_outcome_evaluation_ongoing_event.rbs +54 -0
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_span_outcome_evaluation_start_event.rbs +54 -0
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_stream_session_events.rbs +11 -0
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_stream_session_thread_events.rbs +46 -0
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_text_rubric.rbs +39 -0
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_text_rubric_params.rbs +39 -0
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_user_custom_tool_result_event.rbs +8 -3
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_user_define_outcome_event.rbs +74 -0
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_user_define_outcome_event_params.rbs +59 -0
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_user_interrupt_event.rbs +8 -3
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_user_interrupt_event_params.rbs +8 -3
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_user_tool_confirmation_event.rbs +8 -3
- data/sig/anthropic/models/beta/sessions/event_list_params.rbs +35 -0
- data/sig/anthropic/models/beta/sessions/thread_archive_params.rbs +44 -0
- data/sig/anthropic/models/beta/sessions/thread_list_params.rbs +53 -0
- data/sig/anthropic/models/beta/sessions/thread_retrieve_params.rbs +44 -0
- data/sig/anthropic/models/beta/sessions/threads/event_list_params.rbs +60 -0
- data/sig/anthropic/models/beta/sessions/threads/event_stream_params.rbs +46 -0
- data/sig/anthropic/models/beta/unwrap_webhook_event.rbs +37 -0
- data/sig/anthropic/models/beta/user_profile_create_params.rbs +26 -0
- data/sig/anthropic/models/beta/user_profile_update_params.rbs +22 -0
- data/sig/anthropic/models/beta/vaults/beta_managed_agents_credential_validation.rbs +69 -0
- data/sig/anthropic/models/beta/vaults/beta_managed_agents_credential_validation_status.rbs +20 -0
- data/sig/anthropic/models/beta/vaults/beta_managed_agents_mcp_probe.rbs +29 -0
- data/sig/anthropic/models/beta/vaults/beta_managed_agents_refresh_http_response.rbs +39 -0
- data/sig/anthropic/models/beta/vaults/beta_managed_agents_refresh_object.rbs +43 -0
- data/sig/anthropic/models/beta/vaults/credential_mcp_oauth_validate_params.rbs +44 -0
- data/sig/anthropic/models/beta/webhook_unwrap_params.rbs +17 -0
- data/sig/anthropic/resources/beta/agents.rbs +2 -0
- data/sig/anthropic/resources/beta/sessions/events.rbs +5 -0
- data/sig/anthropic/resources/beta/sessions/threads/events.rbs +29 -0
- data/sig/anthropic/resources/beta/sessions/threads.rbs +35 -0
- data/sig/anthropic/resources/beta/sessions.rbs +3 -0
- data/sig/anthropic/resources/beta/user_profiles.rbs +4 -0
- data/sig/anthropic/resources/beta/vaults/credentials.rbs +7 -0
- data/sig/anthropic/resources/beta/webhooks.rbs +15 -0
- data/sig/anthropic/resources/beta.rbs +2 -0
- metadata +229 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a28aebdd54d31366f32c1d4d6ef29255d82de76cee72340466a6d00a4c00ce93
|
|
4
|
+
data.tar.gz: 782a11bdf33bb17a714fae90128ed8a47bb2dc58f25a13764a963e80dead26b4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bea1ae610f8b0ecc832c480a05d2d774b1cf67def8112cd24c433d222fd848ef580abf96ade09eb17fed9b206d2f21648aaf9ec50ea03b0132c7a34fdd3d8479
|
|
7
|
+
data.tar.gz: 322ddef548b47012b960dcc23329b753e1a8b04328ad6eb0a40794c912e33829c4aaca97a6cab2c39a2672f5dcc4139e80dfab8fbf87bfccbe9cd3d8bf9d59ff
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.39.0 (2026-05-06)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v1.38.0...v1.39.0](https://github.com/anthropics/anthropic-sdk-ruby/compare/v1.38.0...v1.39.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** add support for Managed Agents multiagents and outcomes, webhooks, vault validation ([21230ec](https://github.com/anthropics/anthropic-sdk-ruby/commit/21230ecd2fd7dac66600f984c7e34383cf122d7a))
|
|
10
|
+
* **client:** add aws sso config resolution ([#887](https://github.com/anthropics/anthropic-sdk-ruby/issues/887)) ([4a0476a](https://github.com/anthropics/anthropic-sdk-ruby/commit/4a0476ada4e1549965971fce3272a7a9dee8faaa))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* **api:** Adjust webhook configuration ([e587f17](https://github.com/anthropics/anthropic-sdk-ruby/commit/e587f17eae68e656586f73a9a880e4f9ab8b94fe))
|
|
16
|
+
|
|
17
|
+
## 1.38.0 (2026-05-05)
|
|
18
|
+
|
|
19
|
+
Full Changelog: [v1.37.0...v1.38.0](https://github.com/anthropics/anthropic-sdk-ruby/compare/v1.37.0...v1.38.0)
|
|
20
|
+
|
|
21
|
+
### Features
|
|
22
|
+
|
|
23
|
+
* **client:** allow targeting a workspace for OIDC federation token exchange ([85f4668](https://github.com/anthropics/anthropic-sdk-ruby/commit/85f46687b798714bed259e6b78e07bc4df114046))
|
|
24
|
+
|
|
3
25
|
## 1.37.0 (2026-05-04)
|
|
4
26
|
|
|
5
27
|
Full Changelog: [v1.36.0...v1.37.0](https://github.com/anthropics/anthropic-sdk-ruby/compare/v1.36.0...v1.37.0)
|
data/README.md
CHANGED
data/lib/anthropic/client.rb
CHANGED
|
@@ -59,6 +59,9 @@ module Anthropic
|
|
|
59
59
|
# @return [String, nil]
|
|
60
60
|
attr_reader :auth_token
|
|
61
61
|
|
|
62
|
+
# @return [String, nil]
|
|
63
|
+
attr_reader :webhook_key
|
|
64
|
+
|
|
62
65
|
# @return [Object, nil]
|
|
63
66
|
attr_reader :credentials
|
|
64
67
|
|
|
@@ -159,6 +162,8 @@ module Anthropic
|
|
|
159
162
|
# with +credentials:+. For +user_oauth+, must also include
|
|
160
163
|
# +authentication.credentials_path+.
|
|
161
164
|
#
|
|
165
|
+
# @param webhook_key [String, nil] Defaults to `ENV["ANTHROPIC_WEBHOOK_SIGNING_KEY"]`
|
|
166
|
+
#
|
|
162
167
|
# @param base_url [String, nil] Override the default base URL for the API, e.g.,
|
|
163
168
|
# +"https://api.example.com/v2/"+. Defaults to +ENV["ANTHROPIC_BASE_URL"]+,
|
|
164
169
|
# then to the profile's +base_url+ if present, then to +https://api.anthropic.com+.
|
|
@@ -173,6 +178,7 @@ module Anthropic
|
|
|
173
178
|
def initialize(
|
|
174
179
|
api_key: nil,
|
|
175
180
|
auth_token: nil,
|
|
181
|
+
webhook_key: ENV["ANTHROPIC_WEBHOOK_SIGNING_KEY"],
|
|
176
182
|
credentials: nil,
|
|
177
183
|
config: nil,
|
|
178
184
|
base_url: nil,
|
|
@@ -251,6 +257,7 @@ module Anthropic
|
|
|
251
257
|
headers = parsed.merge(headers)
|
|
252
258
|
end
|
|
253
259
|
headers = headers.merge(credential_headers)
|
|
260
|
+
@webhook_key = webhook_key&.to_s
|
|
254
261
|
|
|
255
262
|
super(
|
|
256
263
|
base_url: base_url,
|
|
@@ -74,6 +74,9 @@ module Anthropic
|
|
|
74
74
|
headers = {}
|
|
75
75
|
|
|
76
76
|
auth_type = config[:authentication][:type]
|
|
77
|
+
# For federation profiles workspace_id is sent in the jwt-bearer
|
|
78
|
+
# exchange body, not as a request header (the minted token is already
|
|
79
|
+
# workspace-scoped, so the header would be ignored).
|
|
77
80
|
if auth_type != AUTH_TYPE_OIDC_FEDERATION
|
|
78
81
|
workspace_id = config[:workspace_id]
|
|
79
82
|
headers["anthropic-workspace-id"] = workspace_id.to_s if workspace_id
|
|
@@ -193,6 +196,7 @@ module Anthropic
|
|
|
193
196
|
federation_rule_id: federation_rule_id,
|
|
194
197
|
organization_id: organization_id,
|
|
195
198
|
service_account_id: auth[:service_account_id],
|
|
199
|
+
workspace_id: @config[:workspace_id],
|
|
196
200
|
scope: auth[:scope]
|
|
197
201
|
)
|
|
198
202
|
|
|
@@ -394,6 +398,7 @@ module Anthropic
|
|
|
394
398
|
def fill_missing_from_env(config, auth)
|
|
395
399
|
fill(config, :base_url, ENV_BASE_URL)
|
|
396
400
|
fill(config, :organization_id, ENV_ORGANIZATION_ID)
|
|
401
|
+
fill(config, :workspace_id, ENV_WORKSPACE_ID)
|
|
397
402
|
|
|
398
403
|
auth_type = auth[:type]
|
|
399
404
|
if auth_type == AUTH_TYPE_OIDC_FEDERATION
|
|
@@ -62,6 +62,9 @@ module Anthropic
|
|
|
62
62
|
# Environment variable for service account ID.
|
|
63
63
|
ENV_SERVICE_ACCOUNT_ID = "ANTHROPIC_SERVICE_ACCOUNT_ID"
|
|
64
64
|
|
|
65
|
+
# Environment variable for workspace ID.
|
|
66
|
+
ENV_WORKSPACE_ID = "ANTHROPIC_WORKSPACE_ID"
|
|
67
|
+
|
|
65
68
|
# Environment variable for OAuth scope.
|
|
66
69
|
ENV_SCOPE = "ANTHROPIC_SCOPE"
|
|
67
70
|
|
|
@@ -53,6 +53,16 @@ module Anthropic
|
|
|
53
53
|
# @param organization_id [String] the organization's raw UUID string
|
|
54
54
|
# @param service_account_id [String, nil] optional service account ID to
|
|
55
55
|
# impersonate
|
|
56
|
+
# @param workspace_id [String, nil] Optional +wrkspc_*+ tagged ID, or the
|
|
57
|
+
# literal +"default"+ to scope the token to the organization's default
|
|
58
|
+
# workspace. When omitted the server picks the rule's sole enabled
|
|
59
|
+
# workspace, else the org default if the rule covers it. Required when
|
|
60
|
+
# the rule enables more than one non-default workspace, or to target a
|
|
61
|
+
# specific workspace other than the one the server would pick. The
|
|
62
|
+
# minted token is workspace-scoped: per-request workspace selection
|
|
63
|
+
# (the +anthropic-workspace-id+ header) is not supported for federation
|
|
64
|
+
# tokens — switching workspaces requires a new token exchange with a
|
|
65
|
+
# different +workspace_id+.
|
|
56
66
|
# @param scope [String, nil] optional OAuth scope (informational only for
|
|
57
67
|
# federation; the server derives the effective scope from the federation rule)
|
|
58
68
|
def initialize(
|
|
@@ -60,12 +70,14 @@ module Anthropic
|
|
|
60
70
|
federation_rule_id:,
|
|
61
71
|
organization_id:,
|
|
62
72
|
service_account_id: nil,
|
|
73
|
+
workspace_id: nil,
|
|
63
74
|
scope: nil # rubocop:disable Lint/UnusedMethodArgument
|
|
64
75
|
)
|
|
65
76
|
@identity_token_provider = identity_token_provider
|
|
66
77
|
@federation_rule_id = federation_rule_id
|
|
67
78
|
@organization_id = organization_id
|
|
68
79
|
@service_account_id = service_account_id
|
|
80
|
+
@workspace_id = workspace_id
|
|
69
81
|
@bound_base_url = nil
|
|
70
82
|
end
|
|
71
83
|
|
|
@@ -128,6 +140,7 @@ module Anthropic
|
|
|
128
140
|
"organization_id" => @organization_id
|
|
129
141
|
}
|
|
130
142
|
body["service_account_id"] = @service_account_id if @service_account_id
|
|
143
|
+
body["workspace_id"] = @workspace_id if @workspace_id
|
|
131
144
|
|
|
132
145
|
request = Net::HTTP::Post.new(uri.path)
|
|
133
146
|
request["Content-Type"] = "application/json"
|
|
@@ -173,8 +186,23 @@ module Anthropic
|
|
|
173
186
|
response.body&.slice(0, 256)
|
|
174
187
|
end
|
|
175
188
|
|
|
189
|
+
message = "Token exchange failed (HTTP #{response.code}): #{body}"
|
|
190
|
+
# An ambiguous 401 is usually a federation-rule misconfiguration.
|
|
191
|
+
# Surface the fix in the error rather than making the user dig through docs.
|
|
192
|
+
if response.code.to_i == 401
|
|
193
|
+
hint_parts = ["Ensure your federation rule matches your identity token"]
|
|
194
|
+
if @workspace_id.nil?
|
|
195
|
+
hint_parts << "If your federation rule is scoped to multiple workspaces, set the " \
|
|
196
|
+
"ANTHROPIC_WORKSPACE_ID environment variable, the 'workspace_id' " \
|
|
197
|
+
"config key, or the workspace_id: keyword argument"
|
|
198
|
+
end
|
|
199
|
+
hint_parts << "View your authentication events in the Workload identity page of " \
|
|
200
|
+
"Claude Console for more details"
|
|
201
|
+
message += " #{hint_parts.join('. ')}."
|
|
202
|
+
end
|
|
203
|
+
|
|
176
204
|
raise WorkloadIdentityError.new(
|
|
177
|
-
|
|
205
|
+
message,
|
|
178
206
|
status_code: response.code.to_i,
|
|
179
207
|
body: body,
|
|
180
208
|
request_id: request_id
|
|
@@ -146,6 +146,10 @@ module Anthropic
|
|
|
146
146
|
federation_rule_id: federation_rule_id,
|
|
147
147
|
organization_id: organization_id,
|
|
148
148
|
service_account_id: ENV[ENV_SERVICE_ACCOUNT_ID],
|
|
149
|
+
# Coerce empty string to nil so a defaulted-but-empty CI variable doesn't
|
|
150
|
+
# put "workspace_id" => "" on the wire — matches the blank-skip in
|
|
151
|
+
# ConfigProvider#fill.
|
|
152
|
+
workspace_id: ENV[ENV_WORKSPACE_ID].then { _1 unless _1.to_s.empty? },
|
|
149
153
|
scope: ENV[ENV_SCOPE]
|
|
150
154
|
)
|
|
151
155
|
provider.bind_base_url(base_url)
|
|
@@ -173,7 +173,7 @@ module Anthropic
|
|
|
173
173
|
# @param aws_session_token [String, nil]
|
|
174
174
|
# @param aws_profile [String, nil]
|
|
175
175
|
#
|
|
176
|
-
# @return [Aws::Credentials, Aws::SharedCredentials, Aws::InstanceProfileCredentials]
|
|
176
|
+
# @return [Aws::Credentials, Aws::SharedCredentials, Aws::SSOCredentials, Aws::InstanceProfileCredentials]
|
|
177
177
|
private def resolve_credentials(
|
|
178
178
|
aws_access_key:,
|
|
179
179
|
aws_secret_access_key:,
|
|
@@ -185,7 +185,7 @@ module Anthropic
|
|
|
185
185
|
end
|
|
186
186
|
|
|
187
187
|
if aws_profile
|
|
188
|
-
return
|
|
188
|
+
return resolve_profile_credentials(aws_profile)
|
|
189
189
|
end
|
|
190
190
|
|
|
191
191
|
# Default credential chain: env vars → shared config file → instance profile
|
|
@@ -208,6 +208,55 @@ module Anthropic
|
|
|
208
208
|
Aws::InstanceProfileCredentials.new
|
|
209
209
|
end
|
|
210
210
|
|
|
211
|
+
# Resolve credentials for a named AWS profile. Tries the same resolution
|
|
212
|
+
# order as Aws::CredentialProviderChain for explicit profiles: SSO,
|
|
213
|
+
# assume-role (including web identity), credential_process, and static
|
|
214
|
+
# shared credentials.
|
|
215
|
+
#
|
|
216
|
+
# Uses Aws.shared_config which is @api private in aws-sdk-core, but is
|
|
217
|
+
# the only path to load SSO/assume-role/process credentials from a profile
|
|
218
|
+
# name without re-parsing ~/.aws/config. This is the same approach the
|
|
219
|
+
# SDK's own CredentialProviderChain uses and has been stable across v3.
|
|
220
|
+
#
|
|
221
|
+
# @param aws_profile [String]
|
|
222
|
+
# @return [Aws::CredentialProvider]
|
|
223
|
+
# @raise [ArgumentError] if the profile resolves no usable credentials
|
|
224
|
+
private def resolve_profile_credentials(aws_profile)
|
|
225
|
+
sc = Aws.shared_config
|
|
226
|
+
|
|
227
|
+
# Same order as Aws::CredentialProviderChain for explicit profiles.
|
|
228
|
+
# The config-file resolvers are gated on config_enabled? since they
|
|
229
|
+
# read ~/.aws/config; static shared credentials read ~/.aws/credentials
|
|
230
|
+
# and are always attempted as the final fallback.
|
|
231
|
+
resolvers = []
|
|
232
|
+
if sc.config_enabled?
|
|
233
|
+
resolvers += [
|
|
234
|
+
-> { sc.assume_role_web_identity_credentials_from_config(profile: aws_profile) },
|
|
235
|
+
-> { sc.sso_credentials_from_config(profile: aws_profile) },
|
|
236
|
+
-> { sc.assume_role_credentials_from_config(profile: aws_profile) },
|
|
237
|
+
-> {
|
|
238
|
+
process_provider = sc.credential_process(profile: aws_profile)
|
|
239
|
+
Aws::ProcessCredentials.new([process_provider]) if process_provider
|
|
240
|
+
}
|
|
241
|
+
]
|
|
242
|
+
end
|
|
243
|
+
resolvers << -> { Aws::SharedCredentials.new(profile_name: aws_profile) }
|
|
244
|
+
|
|
245
|
+
resolvers.each do |resolver|
|
|
246
|
+
creds = resolver.call
|
|
247
|
+
return creds if creds&.set?
|
|
248
|
+
rescue Aws::Errors::NoSuchProfileError
|
|
249
|
+
# fall through to next strategy
|
|
250
|
+
nil
|
|
251
|
+
end
|
|
252
|
+
|
|
253
|
+
raise ArgumentError.new(
|
|
254
|
+
"Could not resolve credentials for profile #{aws_profile.inspect}. " \
|
|
255
|
+
"If this is an SSO profile, " \
|
|
256
|
+
"run `aws sso login --profile #{aws_profile}` first."
|
|
257
|
+
)
|
|
258
|
+
end
|
|
259
|
+
|
|
211
260
|
# Returns the first non-empty value from the given env var names.
|
|
212
261
|
#
|
|
213
262
|
# @param names [Array<String, nil>]
|
|
@@ -26,7 +26,7 @@ module Anthropic
|
|
|
26
26
|
unwrapped = Anthropic::Internal::Util.dig(decoded, @unwrap)
|
|
27
27
|
y << Anthropic::Internal::Type::Converter.coerce(@model, unwrapped)
|
|
28
28
|
in {
|
|
29
|
-
event: "message_start" | "message_delta" | "message_stop" | "content_block_start" | "content_block_delta" | "content_block_stop" | "message" | "user.message" | "user.interrupt" | "user.tool_confirmation" | "user.custom_tool_result" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "agent.mcp_tool_use" | "agent.mcp_tool_result" | "agent.custom_tool_use" | "agent.thread_context_compacted" | "session.status_running" | "session.status_idle" | "session.status_rescheduled" | "session.status_terminated" | "session.error" | "session.deleted" | "span.model_request_start" | "span.model_request_end",
|
|
29
|
+
event: "message_start" | "message_delta" | "message_stop" | "content_block_start" | "content_block_delta" | "content_block_stop" | "message" | "user.message" | "user.interrupt" | "user.tool_confirmation" | "user.custom_tool_result" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "agent.mcp_tool_use" | "agent.mcp_tool_result" | "agent.custom_tool_use" | "agent.thread_context_compacted" | "session.status_running" | "session.status_idle" | "session.status_rescheduled" | "session.status_terminated" | "session.error" | "session.deleted" | "span.model_request_start" | "span.model_request_end" | "span.outcome_evaluation_start" | "span.outcome_evaluation_ongoing" | "span.outcome_evaluation_end" | "user.define_outcome" | "agent.thread_message_received" | "agent.thread_message_sent" | "agent.session_thread_message_received" | "agent.session_thread_message_sent" | "session.thread_created" | "session.thread_status_created" | "session.thread_status_running" | "session.thread_status_idle" | "session.thread_status_rescheduled" | "session.thread_status_terminated",
|
|
30
30
|
data: String => data
|
|
31
31
|
}
|
|
32
32
|
decoded = JSON.parse(data, symbolize_names: true)
|
|
@@ -529,7 +529,7 @@ module Anthropic
|
|
|
529
529
|
write_query_param_element!(collection, "#{key}[#{name}]", value)
|
|
530
530
|
end
|
|
531
531
|
in Array
|
|
532
|
-
collection[key] = element.map(&:to_s)
|
|
532
|
+
collection["#{key}[]"] = element.map(&:to_s)
|
|
533
533
|
else
|
|
534
534
|
collection[key] = element.to_s
|
|
535
535
|
end
|
|
@@ -53,6 +53,8 @@ module Anthropic
|
|
|
53
53
|
|
|
54
54
|
variant const: -> { Anthropic::Models::AnthropicBeta::ADVISOR_TOOL_2026_03_01 }
|
|
55
55
|
|
|
56
|
+
variant const: -> { Anthropic::Models::AnthropicBeta::MANAGED_AGENTS_2026_04_01 }
|
|
57
|
+
|
|
56
58
|
# @!method self.variants
|
|
57
59
|
# @return [Array(String, Symbol)]
|
|
58
60
|
|
|
@@ -85,6 +87,7 @@ module Anthropic
|
|
|
85
87
|
OUTPUT_300K_2026_03_24 = :"output-300k-2026-03-24"
|
|
86
88
|
USER_PROFILES_2026_03_24 = :"user-profiles-2026-03-24"
|
|
87
89
|
ADVISOR_TOOL_2026_03_01 = :"advisor-tool-2026-03-01"
|
|
90
|
+
MANAGED_AGENTS_2026_04_01 = :"managed-agents-2026-04-01"
|
|
88
91
|
|
|
89
92
|
# @!endgroup
|
|
90
93
|
end
|
|
@@ -44,6 +44,13 @@ module Anthropic
|
|
|
44
44
|
# @return [Hash{Symbol=>String}, nil]
|
|
45
45
|
optional :metadata, Anthropic::Internal::Type::HashOf[String]
|
|
46
46
|
|
|
47
|
+
# @!attribute multiagent
|
|
48
|
+
# A coordinator topology: the session's primary thread orchestrates work by
|
|
49
|
+
# spawning session threads, each running an agent drawn from the `agents` roster.
|
|
50
|
+
#
|
|
51
|
+
# @return [Anthropic::Models::Beta::BetaManagedAgentsMultiagentParams, nil]
|
|
52
|
+
optional :multiagent, -> { Anthropic::Beta::BetaManagedAgentsMultiagentParams }, nil?: true
|
|
53
|
+
|
|
47
54
|
# @!attribute skills
|
|
48
55
|
# Skills available to the agent. Maximum 20.
|
|
49
56
|
#
|
|
@@ -71,7 +78,7 @@ module Anthropic
|
|
|
71
78
|
# @return [Array<String, Symbol, Anthropic::Models::AnthropicBeta>, nil]
|
|
72
79
|
optional :betas, -> { Anthropic::Internal::Type::ArrayOf[union: Anthropic::AnthropicBeta] }
|
|
73
80
|
|
|
74
|
-
# @!method initialize(model:, name:, description: nil, mcp_servers: nil, metadata: nil, skills: nil, system_: nil, tools: nil, betas: nil, request_options: {})
|
|
81
|
+
# @!method initialize(model:, name:, description: nil, mcp_servers: nil, metadata: nil, multiagent: nil, skills: nil, system_: nil, tools: nil, betas: nil, request_options: {})
|
|
75
82
|
# Some parameter documentations has been truncated, see
|
|
76
83
|
# {Anthropic::Models::Beta::AgentCreateParams} for more details.
|
|
77
84
|
#
|
|
@@ -85,6 +92,8 @@ module Anthropic
|
|
|
85
92
|
#
|
|
86
93
|
# @param metadata [Hash{Symbol=>String}] Arbitrary key-value metadata. Maximum 16 pairs, keys up to 64 chars, values up t
|
|
87
94
|
#
|
|
95
|
+
# @param multiagent [Anthropic::Models::Beta::BetaManagedAgentsMultiagentParams, nil] A coordinator topology: the session's primary thread orchestrates work by spawni
|
|
96
|
+
#
|
|
88
97
|
# @param skills [Array<Anthropic::Models::Beta::BetaManagedAgentsAnthropicSkillParams, Anthropic::Models::Beta::BetaManagedAgentsCustomSkillParams>] Skills available to the agent. Maximum 20.
|
|
89
98
|
#
|
|
90
99
|
# @param system_ [String, nil] System prompt for the agent. Up to 100,000 characters.
|
|
@@ -56,6 +56,13 @@ module Anthropic
|
|
|
56
56
|
# @return [Symbol, String, Anthropic::Models::Beta::BetaManagedAgentsModel, Anthropic::Models::Beta::BetaManagedAgentsModelConfigParams, nil]
|
|
57
57
|
optional :model, union: -> { Anthropic::Beta::AgentUpdateParams::Model }
|
|
58
58
|
|
|
59
|
+
# @!attribute multiagent
|
|
60
|
+
# A coordinator topology: the session's primary thread orchestrates work by
|
|
61
|
+
# spawning session threads, each running an agent drawn from the `agents` roster.
|
|
62
|
+
#
|
|
63
|
+
# @return [Anthropic::Models::Beta::BetaManagedAgentsMultiagentParams, nil]
|
|
64
|
+
optional :multiagent, -> { Anthropic::Beta::BetaManagedAgentsMultiagentParams }, nil?: true
|
|
65
|
+
|
|
59
66
|
# @!attribute name
|
|
60
67
|
# Human-readable name. 1-256 characters. Omit to preserve. Cannot be cleared.
|
|
61
68
|
#
|
|
@@ -96,7 +103,7 @@ module Anthropic
|
|
|
96
103
|
# @return [Array<String, Symbol, Anthropic::Models::AnthropicBeta>, nil]
|
|
97
104
|
optional :betas, -> { Anthropic::Internal::Type::ArrayOf[union: Anthropic::AnthropicBeta] }
|
|
98
105
|
|
|
99
|
-
# @!method initialize(agent_id:, version:, description: nil, mcp_servers: nil, metadata: nil, model: nil, name: nil, skills: nil, system_: nil, tools: nil, betas: nil, request_options: {})
|
|
106
|
+
# @!method initialize(agent_id:, version:, description: nil, mcp_servers: nil, metadata: nil, model: nil, multiagent: nil, name: nil, skills: nil, system_: nil, tools: nil, betas: nil, request_options: {})
|
|
100
107
|
# Some parameter documentations has been truncated, see
|
|
101
108
|
# {Anthropic::Models::Beta::AgentUpdateParams} for more details.
|
|
102
109
|
#
|
|
@@ -112,6 +119,8 @@ module Anthropic
|
|
|
112
119
|
#
|
|
113
120
|
# @param model [Symbol, String, Anthropic::Models::Beta::BetaManagedAgentsModel, Anthropic::Models::Beta::BetaManagedAgentsModelConfigParams] Model identifier. Accepts the [model string](https://platform.claude.com/docs/en
|
|
114
121
|
#
|
|
122
|
+
# @param multiagent [Anthropic::Models::Beta::BetaManagedAgentsMultiagentParams, nil] A coordinator topology: the session's primary thread orchestrates work by spawni
|
|
123
|
+
#
|
|
115
124
|
# @param name [String] Human-readable name. 1-256 characters. Omit to preserve. Cannot be cleared.
|
|
116
125
|
#
|
|
117
126
|
# @param skills [Array<Anthropic::Models::Beta::BetaManagedAgentsAnthropicSkillParams, Anthropic::Models::Beta::BetaManagedAgentsCustomSkillParams>, nil] Skills. Full replacement. Omit to preserve; send empty array or null to clear. M
|
|
@@ -5,6 +5,12 @@ module Anthropic
|
|
|
5
5
|
module Beta
|
|
6
6
|
class BetaCitationContentBlockLocation < Anthropic::Internal::Type::BaseModel
|
|
7
7
|
# @!attribute cited_text
|
|
8
|
+
# The full text of the cited block range, concatenated.
|
|
9
|
+
#
|
|
10
|
+
# Always equals the contents of `content[start_block_index:end_block_index]`
|
|
11
|
+
# joined together. The text block is the minimal citable unit; this field is never
|
|
12
|
+
# a substring of a single block. Not counted toward output tokens, and not counted
|
|
13
|
+
# toward input tokens when sent back in subsequent turns.
|
|
8
14
|
#
|
|
9
15
|
# @return [String]
|
|
10
16
|
required :cited_text, String
|
|
@@ -20,6 +26,11 @@ module Anthropic
|
|
|
20
26
|
required :document_title, String, nil?: true
|
|
21
27
|
|
|
22
28
|
# @!attribute end_block_index
|
|
29
|
+
# Exclusive 0-based end index of the cited block range in the source's `content`
|
|
30
|
+
# array.
|
|
31
|
+
#
|
|
32
|
+
# Always greater than `start_block_index`; a single-block citation has
|
|
33
|
+
# `end_block_index = start_block_index + 1`.
|
|
23
34
|
#
|
|
24
35
|
# @return [Integer]
|
|
25
36
|
required :end_block_index, Integer
|
|
@@ -30,6 +41,7 @@ module Anthropic
|
|
|
30
41
|
required :file_id, String, nil?: true
|
|
31
42
|
|
|
32
43
|
# @!attribute start_block_index
|
|
44
|
+
# 0-based index of the first cited block in the source's `content` array.
|
|
33
45
|
#
|
|
34
46
|
# @return [Integer]
|
|
35
47
|
required :start_block_index, Integer
|
|
@@ -40,12 +52,21 @@ module Anthropic
|
|
|
40
52
|
required :type, const: :content_block_location
|
|
41
53
|
|
|
42
54
|
# @!method initialize(cited_text:, document_index:, document_title:, end_block_index:, file_id:, start_block_index:, type: :content_block_location)
|
|
43
|
-
#
|
|
55
|
+
# Some parameter documentations has been truncated, see
|
|
56
|
+
# {Anthropic::Models::Beta::BetaCitationContentBlockLocation} for more details.
|
|
57
|
+
#
|
|
58
|
+
# @param cited_text [String] The full text of the cited block range, concatenated.
|
|
59
|
+
#
|
|
44
60
|
# @param document_index [Integer]
|
|
61
|
+
#
|
|
45
62
|
# @param document_title [String, nil]
|
|
46
|
-
#
|
|
63
|
+
#
|
|
64
|
+
# @param end_block_index [Integer] Exclusive 0-based end index of the cited block range in the source's `content` a
|
|
65
|
+
#
|
|
47
66
|
# @param file_id [String, nil]
|
|
48
|
-
#
|
|
67
|
+
#
|
|
68
|
+
# @param start_block_index [Integer] 0-based index of the first cited block in the source's `content` array.
|
|
69
|
+
#
|
|
49
70
|
# @param type [Symbol, :content_block_location]
|
|
50
71
|
end
|
|
51
72
|
end
|
|
@@ -5,6 +5,12 @@ module Anthropic
|
|
|
5
5
|
module Beta
|
|
6
6
|
class BetaCitationContentBlockLocationParam < Anthropic::Internal::Type::BaseModel
|
|
7
7
|
# @!attribute cited_text
|
|
8
|
+
# The full text of the cited block range, concatenated.
|
|
9
|
+
#
|
|
10
|
+
# Always equals the contents of `content[start_block_index:end_block_index]`
|
|
11
|
+
# joined together. The text block is the minimal citable unit; this field is never
|
|
12
|
+
# a substring of a single block. Not counted toward output tokens, and not counted
|
|
13
|
+
# toward input tokens when sent back in subsequent turns.
|
|
8
14
|
#
|
|
9
15
|
# @return [String]
|
|
10
16
|
required :cited_text, String
|
|
@@ -20,11 +26,17 @@ module Anthropic
|
|
|
20
26
|
required :document_title, String, nil?: true
|
|
21
27
|
|
|
22
28
|
# @!attribute end_block_index
|
|
29
|
+
# Exclusive 0-based end index of the cited block range in the source's `content`
|
|
30
|
+
# array.
|
|
31
|
+
#
|
|
32
|
+
# Always greater than `start_block_index`; a single-block citation has
|
|
33
|
+
# `end_block_index = start_block_index + 1`.
|
|
23
34
|
#
|
|
24
35
|
# @return [Integer]
|
|
25
36
|
required :end_block_index, Integer
|
|
26
37
|
|
|
27
38
|
# @!attribute start_block_index
|
|
39
|
+
# 0-based index of the first cited block in the source's `content` array.
|
|
28
40
|
#
|
|
29
41
|
# @return [Integer]
|
|
30
42
|
required :start_block_index, Integer
|
|
@@ -35,11 +47,20 @@ module Anthropic
|
|
|
35
47
|
required :type, const: :content_block_location
|
|
36
48
|
|
|
37
49
|
# @!method initialize(cited_text:, document_index:, document_title:, end_block_index:, start_block_index:, type: :content_block_location)
|
|
38
|
-
#
|
|
50
|
+
# Some parameter documentations has been truncated, see
|
|
51
|
+
# {Anthropic::Models::Beta::BetaCitationContentBlockLocationParam} for more
|
|
52
|
+
# details.
|
|
53
|
+
#
|
|
54
|
+
# @param cited_text [String] The full text of the cited block range, concatenated.
|
|
55
|
+
#
|
|
39
56
|
# @param document_index [Integer]
|
|
57
|
+
#
|
|
40
58
|
# @param document_title [String, nil]
|
|
41
|
-
#
|
|
42
|
-
# @param
|
|
59
|
+
#
|
|
60
|
+
# @param end_block_index [Integer] Exclusive 0-based end index of the cited block range in the source's `content` a
|
|
61
|
+
#
|
|
62
|
+
# @param start_block_index [Integer] 0-based index of the first cited block in the source's `content` array.
|
|
63
|
+
#
|
|
43
64
|
# @param type [Symbol, :content_block_location]
|
|
44
65
|
end
|
|
45
66
|
end
|
|
@@ -5,16 +5,33 @@ module Anthropic
|
|
|
5
5
|
module Beta
|
|
6
6
|
class BetaCitationSearchResultLocation < Anthropic::Internal::Type::BaseModel
|
|
7
7
|
# @!attribute cited_text
|
|
8
|
+
# The full text of the cited block range, concatenated.
|
|
9
|
+
#
|
|
10
|
+
# Always equals the contents of `content[start_block_index:end_block_index]`
|
|
11
|
+
# joined together. The text block is the minimal citable unit; this field is never
|
|
12
|
+
# a substring of a single block. Not counted toward output tokens, and not counted
|
|
13
|
+
# toward input tokens when sent back in subsequent turns.
|
|
8
14
|
#
|
|
9
15
|
# @return [String]
|
|
10
16
|
required :cited_text, String
|
|
11
17
|
|
|
12
18
|
# @!attribute end_block_index
|
|
19
|
+
# Exclusive 0-based end index of the cited block range in the source's `content`
|
|
20
|
+
# array.
|
|
21
|
+
#
|
|
22
|
+
# Always greater than `start_block_index`; a single-block citation has
|
|
23
|
+
# `end_block_index = start_block_index + 1`.
|
|
13
24
|
#
|
|
14
25
|
# @return [Integer]
|
|
15
26
|
required :end_block_index, Integer
|
|
16
27
|
|
|
17
28
|
# @!attribute search_result_index
|
|
29
|
+
# 0-based index of the cited search result among all `search_result` content
|
|
30
|
+
# blocks in the request, in the order they appear across messages and tool
|
|
31
|
+
# results.
|
|
32
|
+
#
|
|
33
|
+
# Counted separately from `document_index`; server-side web search results are not
|
|
34
|
+
# included in this count.
|
|
18
35
|
#
|
|
19
36
|
# @return [Integer]
|
|
20
37
|
required :search_result_index, Integer
|
|
@@ -25,6 +42,7 @@ module Anthropic
|
|
|
25
42
|
required :source, String
|
|
26
43
|
|
|
27
44
|
# @!attribute start_block_index
|
|
45
|
+
# 0-based index of the first cited block in the source's `content` array.
|
|
28
46
|
#
|
|
29
47
|
# @return [Integer]
|
|
30
48
|
required :start_block_index, Integer
|
|
@@ -40,12 +58,21 @@ module Anthropic
|
|
|
40
58
|
required :type, const: :search_result_location
|
|
41
59
|
|
|
42
60
|
# @!method initialize(cited_text:, end_block_index:, search_result_index:, source:, start_block_index:, title:, type: :search_result_location)
|
|
43
|
-
#
|
|
44
|
-
#
|
|
45
|
-
#
|
|
61
|
+
# Some parameter documentations has been truncated, see
|
|
62
|
+
# {Anthropic::Models::Beta::BetaCitationSearchResultLocation} for more details.
|
|
63
|
+
#
|
|
64
|
+
# @param cited_text [String] The full text of the cited block range, concatenated.
|
|
65
|
+
#
|
|
66
|
+
# @param end_block_index [Integer] Exclusive 0-based end index of the cited block range in the source's `content` a
|
|
67
|
+
#
|
|
68
|
+
# @param search_result_index [Integer] 0-based index of the cited search result among all `search_result` content block
|
|
69
|
+
#
|
|
46
70
|
# @param source [String]
|
|
47
|
-
#
|
|
71
|
+
#
|
|
72
|
+
# @param start_block_index [Integer] 0-based index of the first cited block in the source's `content` array.
|
|
73
|
+
#
|
|
48
74
|
# @param title [String, nil]
|
|
75
|
+
#
|
|
49
76
|
# @param type [Symbol, :search_result_location]
|
|
50
77
|
end
|
|
51
78
|
end
|
|
@@ -5,16 +5,33 @@ module Anthropic
|
|
|
5
5
|
module Beta
|
|
6
6
|
class BetaCitationSearchResultLocationParam < Anthropic::Internal::Type::BaseModel
|
|
7
7
|
# @!attribute cited_text
|
|
8
|
+
# The full text of the cited block range, concatenated.
|
|
9
|
+
#
|
|
10
|
+
# Always equals the contents of `content[start_block_index:end_block_index]`
|
|
11
|
+
# joined together. The text block is the minimal citable unit; this field is never
|
|
12
|
+
# a substring of a single block. Not counted toward output tokens, and not counted
|
|
13
|
+
# toward input tokens when sent back in subsequent turns.
|
|
8
14
|
#
|
|
9
15
|
# @return [String]
|
|
10
16
|
required :cited_text, String
|
|
11
17
|
|
|
12
18
|
# @!attribute end_block_index
|
|
19
|
+
# Exclusive 0-based end index of the cited block range in the source's `content`
|
|
20
|
+
# array.
|
|
21
|
+
#
|
|
22
|
+
# Always greater than `start_block_index`; a single-block citation has
|
|
23
|
+
# `end_block_index = start_block_index + 1`.
|
|
13
24
|
#
|
|
14
25
|
# @return [Integer]
|
|
15
26
|
required :end_block_index, Integer
|
|
16
27
|
|
|
17
28
|
# @!attribute search_result_index
|
|
29
|
+
# 0-based index of the cited search result among all `search_result` content
|
|
30
|
+
# blocks in the request, in the order they appear across messages and tool
|
|
31
|
+
# results.
|
|
32
|
+
#
|
|
33
|
+
# Counted separately from `document_index`; server-side web search results are not
|
|
34
|
+
# included in this count.
|
|
18
35
|
#
|
|
19
36
|
# @return [Integer]
|
|
20
37
|
required :search_result_index, Integer
|
|
@@ -25,6 +42,7 @@ module Anthropic
|
|
|
25
42
|
required :source, String
|
|
26
43
|
|
|
27
44
|
# @!attribute start_block_index
|
|
45
|
+
# 0-based index of the first cited block in the source's `content` array.
|
|
28
46
|
#
|
|
29
47
|
# @return [Integer]
|
|
30
48
|
required :start_block_index, Integer
|
|
@@ -40,12 +58,22 @@ module Anthropic
|
|
|
40
58
|
required :type, const: :search_result_location
|
|
41
59
|
|
|
42
60
|
# @!method initialize(cited_text:, end_block_index:, search_result_index:, source:, start_block_index:, title:, type: :search_result_location)
|
|
43
|
-
#
|
|
44
|
-
#
|
|
45
|
-
#
|
|
61
|
+
# Some parameter documentations has been truncated, see
|
|
62
|
+
# {Anthropic::Models::Beta::BetaCitationSearchResultLocationParam} for more
|
|
63
|
+
# details.
|
|
64
|
+
#
|
|
65
|
+
# @param cited_text [String] The full text of the cited block range, concatenated.
|
|
66
|
+
#
|
|
67
|
+
# @param end_block_index [Integer] Exclusive 0-based end index of the cited block range in the source's `content` a
|
|
68
|
+
#
|
|
69
|
+
# @param search_result_index [Integer] 0-based index of the cited search result among all `search_result` content block
|
|
70
|
+
#
|
|
46
71
|
# @param source [String]
|
|
47
|
-
#
|
|
72
|
+
#
|
|
73
|
+
# @param start_block_index [Integer] 0-based index of the first cited block in the source's `content` array.
|
|
74
|
+
#
|
|
48
75
|
# @param title [String, nil]
|
|
76
|
+
#
|
|
49
77
|
# @param type [Symbol, :search_result_location]
|
|
50
78
|
end
|
|
51
79
|
end
|