anthropic 1.79.0 → 1.81.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 +54 -1
- data/README.md +1 -1
- data/lib/anthropic/client.rb +4 -0
- data/lib/anthropic/helpers/aws/client.rb +20 -3
- data/lib/anthropic/helpers/bedrock/client.rb +6 -0
- data/lib/anthropic/helpers/bedrock/mantle_client.rb +41 -2
- data/lib/anthropic/helpers/google_cloud/client.rb +113 -31
- data/lib/anthropic/helpers/refusal_fallback.rb +52 -21
- data/lib/anthropic/helpers/vertex/client.rb +7 -0
- data/lib/anthropic/internal/report_page_cursor.rb +98 -0
- data/lib/anthropic/internal/stream.rb +6 -13
- data/lib/anthropic/internal/tracing.rb +7 -4
- data/lib/anthropic/models/beta/agent_archive_params.rb +3 -2
- data/lib/anthropic/models/beta/agent_create_params.rb +3 -2
- data/lib/anthropic/models/beta/agent_list_params.rb +3 -2
- data/lib/anthropic/models/beta/agent_retrieve_params.rb +3 -2
- data/lib/anthropic/models/beta/agent_update_params.rb +3 -2
- data/lib/anthropic/models/beta/agents/version_list_params.rb +3 -2
- data/lib/anthropic/models/beta/beta_cache_miss_messages_changed.rb +8 -0
- data/lib/anthropic/models/beta/beta_cache_miss_model_changed.rb +7 -0
- data/lib/anthropic/models/beta/beta_cache_miss_previous_message_not_found.rb +9 -0
- data/lib/anthropic/models/beta/beta_cache_miss_reason.rb +22 -0
- data/lib/anthropic/models/beta/beta_cache_miss_system_changed.rb +7 -0
- data/lib/anthropic/models/beta/beta_cache_miss_tools_changed.rb +7 -0
- data/lib/anthropic/models/beta/beta_cache_miss_unavailable.rb +11 -0
- data/lib/anthropic/models/beta/beta_deleted_user_profile.rb +29 -0
- data/lib/anthropic/models/beta/beta_fallback_param.rb +74 -10
- data/lib/anthropic/models/beta/beta_managed_agents_deleted_vault.rb +2 -2
- data/lib/anthropic/models/beta/beta_managed_agents_memory_store.rb +28 -19
- data/lib/anthropic/models/beta/beta_managed_agents_vault.rb +2 -2
- data/lib/anthropic/models/beta/beta_thinking_types.rb +17 -2
- data/lib/anthropic/models/beta/beta_user_profile.rb +31 -28
- data/lib/anthropic/models/beta/beta_user_profile_enrollment_url.rb +1 -1
- data/lib/anthropic/models/beta/deployment_archive_params.rb +3 -2
- data/lib/anthropic/models/beta/deployment_create_params.rb +3 -2
- data/lib/anthropic/models/beta/deployment_list_params.rb +3 -2
- data/lib/anthropic/models/beta/deployment_pause_params.rb +3 -2
- data/lib/anthropic/models/beta/deployment_retrieve_params.rb +3 -2
- data/lib/anthropic/models/beta/deployment_run_list_params.rb +3 -2
- data/lib/anthropic/models/beta/deployment_run_params.rb +3 -2
- data/lib/anthropic/models/beta/deployment_run_retrieve_params.rb +3 -2
- data/lib/anthropic/models/beta/deployment_unpause_params.rb +3 -2
- data/lib/anthropic/models/beta/deployment_update_params.rb +3 -2
- data/lib/anthropic/models/beta/dream_archive_params.rb +3 -2
- data/lib/anthropic/models/beta/dream_cancel_params.rb +3 -2
- data/lib/anthropic/models/beta/dream_create_params.rb +3 -2
- data/lib/anthropic/models/beta/dream_list_params.rb +3 -2
- data/lib/anthropic/models/beta/dream_retrieve_params.rb +3 -2
- data/lib/anthropic/models/beta/memory_store_archive_params.rb +8 -6
- data/lib/anthropic/models/beta/memory_store_create_params.rb +23 -13
- data/lib/anthropic/models/beta/memory_store_delete_params.rb +8 -6
- data/lib/anthropic/models/beta/memory_store_list_params.rb +10 -11
- data/lib/anthropic/models/beta/memory_store_retrieve_params.rb +5 -5
- data/lib/anthropic/models/beta/memory_store_update_params.rb +22 -16
- data/lib/anthropic/models/beta/memory_stores/beta_managed_agents_content_sha256_precondition.rb +6 -6
- data/lib/anthropic/models/beta/memory_stores/beta_managed_agents_deleted_memory.rb +13 -6
- data/lib/anthropic/models/beta/memory_stores/beta_managed_agents_error.rb +1 -1
- data/lib/anthropic/models/beta/memory_stores/beta_managed_agents_memory.rb +38 -26
- data/lib/anthropic/models/beta/memory_stores/beta_managed_agents_memory_list_item.rb +17 -10
- data/lib/anthropic/models/beta/memory_stores/beta_managed_agents_memory_path_conflict_error.rb +3 -2
- data/lib/anthropic/models/beta/memory_stores/beta_managed_agents_memory_prefix.rb +7 -6
- data/lib/anthropic/models/beta/memory_stores/beta_managed_agents_memory_version.rb +40 -26
- data/lib/anthropic/models/beta/memory_stores/beta_managed_agents_memory_version_operation.rb +4 -2
- data/lib/anthropic/models/beta/memory_stores/beta_managed_agents_memory_view.rb +5 -5
- data/lib/anthropic/models/beta/memory_stores/memory_create_params.rb +21 -17
- data/lib/anthropic/models/beta/memory_stores/memory_delete_params.rb +3 -2
- data/lib/anthropic/models/beta/memory_stores/memory_list_params.rb +30 -21
- data/lib/anthropic/models/beta/memory_stores/memory_retrieve_params.rb +9 -8
- data/lib/anthropic/models/beta/memory_stores/memory_update_params.rb +22 -20
- data/lib/anthropic/models/beta/memory_stores/memory_version_list_params.rb +16 -12
- data/lib/anthropic/models/beta/memory_stores/memory_version_redact_params.rb +3 -2
- data/lib/anthropic/models/beta/memory_stores/memory_version_retrieve_params.rb +9 -8
- data/lib/anthropic/models/beta/message_count_tokens_params.rb +11 -1
- data/lib/anthropic/models/beta/message_create_params.rb +11 -1
- data/lib/anthropic/models/beta/messages/batch_create_params.rb +13 -3
- data/lib/anthropic/models/beta/organization/beta_organization_rate_limit.rb +2 -1
- data/lib/anthropic/models/beta/organization/beta_plugin.rb +34 -9
- data/lib/anthropic/models/beta/organization/beta_spend_limit.rb +14 -4
- data/lib/anthropic/models/beta/organization/beta_spend_limit_usage_tier_scope.rb +25 -0
- data/lib/anthropic/models/beta/organization/beta_spend_summary.rb +28 -8
- data/lib/anthropic/models/beta/organization/plugin_marketplace_validate_repository_params.rb +9 -4
- data/lib/anthropic/models/beta/organization/plugins/beta_plugin_version.rb +13 -7
- data/lib/anthropic/models/beta/organization/telemetry_destination_create_params.rb +3 -2
- data/lib/anthropic/models/beta/organization/telemetry_destination_delete_params.rb +7 -2
- data/lib/anthropic/models/beta/organization/telemetry_destination_list_params.rb +3 -2
- data/lib/anthropic/models/beta/organization/telemetry_destination_retrieve_params.rb +7 -2
- data/lib/anthropic/models/beta/organization/telemetry_destination_test_params.rb +7 -2
- data/lib/anthropic/models/beta/organization/telemetry_destination_update_params.rb +3 -2
- data/lib/anthropic/models/beta/organization/telemetry_destinations/workspace_add_params.rb +7 -2
- data/lib/anthropic/models/beta/organization/telemetry_destinations/workspace_list_params.rb +3 -2
- data/lib/anthropic/models/beta/organization/telemetry_destinations/workspace_remove_params.rb +7 -2
- data/lib/anthropic/models/beta/organization/workspaces/beta_workspace_rate_limit.rb +1 -1
- data/lib/anthropic/models/beta/organization/workspaces/beta_workspace_rate_limit_type.rb +29 -0
- data/lib/anthropic/models/beta/organization/workspaces/beta_workspace_rate_limit_update_value.rb +35 -0
- data/lib/anthropic/models/beta/organization/workspaces/rate_limit_update_params.rb +45 -0
- data/lib/anthropic/models/beta/session_archive_params.rb +3 -2
- data/lib/anthropic/models/beta/session_create_params.rb +3 -2
- data/lib/anthropic/models/beta/session_delete_params.rb +3 -2
- data/lib/anthropic/models/beta/session_list_params.rb +3 -2
- data/lib/anthropic/models/beta/session_retrieve_params.rb +3 -2
- data/lib/anthropic/models/beta/session_update_params.rb +3 -2
- data/lib/anthropic/models/beta/sessions/event_list_params.rb +3 -2
- data/lib/anthropic/models/beta/sessions/event_send_params.rb +3 -2
- data/lib/anthropic/models/beta/sessions/event_stream_params.rb +3 -2
- data/lib/anthropic/models/beta/sessions/resource_add_params.rb +3 -2
- data/lib/anthropic/models/beta/sessions/resource_delete_params.rb +3 -2
- data/lib/anthropic/models/beta/sessions/resource_list_params.rb +3 -2
- data/lib/anthropic/models/beta/sessions/resource_retrieve_params.rb +3 -2
- data/lib/anthropic/models/beta/sessions/resource_update_params.rb +3 -2
- data/lib/anthropic/models/beta/sessions/thread_archive_params.rb +3 -2
- data/lib/anthropic/models/beta/sessions/thread_list_params.rb +3 -2
- data/lib/anthropic/models/beta/sessions/thread_retrieve_params.rb +3 -2
- data/lib/anthropic/models/beta/sessions/threads/event_list_params.rb +3 -2
- data/lib/anthropic/models/beta/sessions/threads/event_stream_params.rb +3 -2
- data/lib/anthropic/models/beta/tunnel_archive_params.rb +3 -2
- data/lib/anthropic/models/beta/tunnel_create_params.rb +3 -2
- data/lib/anthropic/models/beta/tunnel_list_params.rb +3 -2
- data/lib/anthropic/models/beta/tunnel_retrieve_params.rb +3 -2
- data/lib/anthropic/models/beta/tunnel_reveal_token_params.rb +3 -2
- data/lib/anthropic/models/beta/tunnel_rotate_token_params.rb +3 -2
- data/lib/anthropic/models/beta/tunnels/certificate_archive_params.rb +3 -2
- data/lib/anthropic/models/beta/tunnels/certificate_create_params.rb +3 -2
- data/lib/anthropic/models/beta/tunnels/certificate_list_params.rb +3 -2
- data/lib/anthropic/models/beta/tunnels/certificate_retrieve_params.rb +3 -2
- data/lib/anthropic/models/beta/user_profile_create_params.rb +10 -8
- data/lib/anthropic/models/beta/user_profile_delete_params.rb +48 -0
- data/lib/anthropic/models/beta/user_profile_update_params.rb +9 -8
- data/lib/anthropic/models/beta/user_profiles/action_url_create_params.rb +58 -0
- data/lib/anthropic/models/beta/user_profiles/beta_user_profile_action_url.rb +44 -0
- data/lib/anthropic/models/beta/user_profiles/beta_user_profile_enroll_end_user_action.rb +21 -0
- data/lib/anthropic/models/beta/vault_archive_params.rb +3 -2
- data/lib/anthropic/models/beta/vault_create_params.rb +3 -2
- data/lib/anthropic/models/beta/vault_delete_params.rb +3 -2
- data/lib/anthropic/models/beta/vault_list_params.rb +9 -6
- data/lib/anthropic/models/beta/vault_retrieve_params.rb +3 -2
- data/lib/anthropic/models/beta/vault_update_params.rb +3 -2
- data/lib/anthropic/models/beta/vaults/beta_managed_agents_credential.rb +7 -3
- data/lib/anthropic/models/beta/vaults/beta_managed_agents_credential_networking_params.rb +1 -1
- data/lib/anthropic/models/beta/vaults/beta_managed_agents_credential_validation.rb +3 -2
- data/lib/anthropic/models/beta/vaults/beta_managed_agents_credential_validation_status.rb +2 -2
- data/lib/anthropic/models/beta/vaults/beta_managed_agents_deleted_credential.rb +2 -2
- data/lib/anthropic/models/beta/vaults/beta_managed_agents_environment_variable_auth_response.rb +1 -1
- data/lib/anthropic/models/beta/vaults/beta_managed_agents_environment_variable_create_params.rb +7 -2
- data/lib/anthropic/models/beta/vaults/beta_managed_agents_environment_variable_update_params.rb +4 -4
- data/lib/anthropic/models/beta/vaults/beta_managed_agents_injection_location_update_params.rb +8 -1
- data/lib/anthropic/models/beta/vaults/beta_managed_agents_limited_credential_networking_params.rb +7 -5
- data/lib/anthropic/models/beta/vaults/beta_managed_agents_limited_credential_networking_response.rb +6 -4
- data/lib/anthropic/models/beta/vaults/beta_managed_agents_mcp_oauth_auth_response.rb +7 -2
- data/lib/anthropic/models/beta/vaults/beta_managed_agents_mcp_oauth_create_params.rb +10 -4
- data/lib/anthropic/models/beta/vaults/beta_managed_agents_mcp_oauth_refresh_params.rb +15 -5
- data/lib/anthropic/models/beta/vaults/beta_managed_agents_mcp_oauth_refresh_response.rb +2 -2
- data/lib/anthropic/models/beta/vaults/beta_managed_agents_mcp_oauth_refresh_update_params.rb +14 -5
- data/lib/anthropic/models/beta/vaults/beta_managed_agents_mcp_oauth_update_params.rb +14 -4
- data/lib/anthropic/models/beta/vaults/beta_managed_agents_mcp_probe.rb +4 -3
- data/lib/anthropic/models/beta/vaults/beta_managed_agents_static_bearer_create_params.rb +7 -2
- data/lib/anthropic/models/beta/vaults/beta_managed_agents_static_bearer_update_params.rb +2 -2
- data/lib/anthropic/models/beta/vaults/beta_managed_agents_token_endpoint_auth_basic_param.rb +7 -2
- data/lib/anthropic/models/beta/vaults/beta_managed_agents_token_endpoint_auth_basic_update_param.rb +10 -2
- data/lib/anthropic/models/beta/vaults/beta_managed_agents_token_endpoint_auth_post_param.rb +2 -2
- data/lib/anthropic/models/beta/vaults/beta_managed_agents_token_endpoint_auth_post_update_param.rb +10 -2
- data/lib/anthropic/models/beta/vaults/credential_archive_params.rb +3 -2
- data/lib/anthropic/models/beta/vaults/credential_create_params.rb +11 -6
- data/lib/anthropic/models/beta/vaults/credential_delete_params.rb +3 -2
- data/lib/anthropic/models/beta/vaults/credential_list_params.rb +9 -6
- data/lib/anthropic/models/beta/vaults/credential_mcp_oauth_validate_params.rb +3 -2
- data/lib/anthropic/models/beta/vaults/credential_retrieve_params.rb +3 -2
- data/lib/anthropic/models/beta/vaults/credential_update_params.rb +17 -12
- data/lib/anthropic/models/cache_miss_messages_changed.rb +8 -0
- data/lib/anthropic/models/cache_miss_model_changed.rb +7 -0
- data/lib/anthropic/models/cache_miss_previous_message_not_found.rb +9 -0
- data/lib/anthropic/models/cache_miss_reason.rb +22 -0
- data/lib/anthropic/models/cache_miss_system_changed.rb +7 -0
- data/lib/anthropic/models/cache_miss_tools_changed.rb +7 -0
- data/lib/anthropic/models/cache_miss_unavailable.rb +11 -0
- data/lib/anthropic/models/deleted_user_profile.rb +25 -0
- data/lib/anthropic/models/message_count_tokens_params.rb +33 -2
- data/lib/anthropic/models/message_create_params.rb +33 -2
- data/lib/anthropic/models/messages/batch_create_params.rb +41 -4
- data/lib/anthropic/models/organization/organization_rate_limit.rb +2 -1
- data/lib/anthropic/models/organization/workspaces/rate_limit_update_params.rb +43 -0
- data/lib/anthropic/models/organization/workspaces/workspace_rate_limit.rb +1 -1
- data/lib/anthropic/models/organization/workspaces/workspace_rate_limit_type.rb +29 -0
- data/lib/anthropic/models/organization/workspaces/workspace_rate_limit_update_value.rb +35 -0
- data/lib/anthropic/models/thinking_types.rb +17 -2
- data/lib/anthropic/models/usage.rb +22 -1
- data/lib/anthropic/models/user_profile.rb +108 -0
- data/lib/anthropic/models/user_profile_access_type.rb +23 -0
- data/lib/anthropic/models/user_profile_create_params.rb +74 -0
- data/lib/anthropic/models/user_profile_cyber_program.rb +52 -0
- data/lib/anthropic/models/user_profile_cyber_requirements.rb +35 -0
- data/lib/anthropic/models/user_profile_cyber_tier.rb +38 -0
- data/lib/anthropic/models/user_profile_delete_params.rb +38 -0
- data/lib/anthropic/models/user_profile_efs_feature.rb +38 -0
- data/lib/anthropic/models/user_profile_efs_program.rb +40 -0
- data/lib/anthropic/models/user_profile_external_user_account_status.rb +27 -0
- data/lib/anthropic/models/user_profile_external_user_details.rb +78 -0
- data/lib/anthropic/models/user_profile_external_user_details_params.rb +79 -0
- data/lib/anthropic/models/user_profile_external_user_entity_type.rb +19 -0
- data/lib/anthropic/models/user_profile_list_order.rb +19 -0
- data/lib/anthropic/models/user_profile_list_order_by.rb +20 -0
- data/lib/anthropic/models/user_profile_list_params.rb +67 -0
- data/lib/anthropic/models/user_profile_program_status.rb +23 -0
- data/lib/anthropic/models/user_profile_programs.rb +41 -0
- data/lib/anthropic/models/user_profile_retrieve_params.rb +38 -0
- data/lib/anthropic/models/user_profile_update_params.rb +78 -0
- data/lib/anthropic/models/user_profiles/action_url_create_params.rb +48 -0
- data/lib/anthropic/models/user_profiles/user_profile_action_url.rb +43 -0
- data/lib/anthropic/models/user_profiles/user_profile_enroll_end_user_action.rb +21 -0
- data/lib/anthropic/models.rb +44 -0
- data/lib/anthropic/resources/beta/agents/versions.rb +1 -1
- data/lib/anthropic/resources/beta/agents.rb +5 -5
- data/lib/anthropic/resources/beta/deployment_runs.rb +2 -2
- data/lib/anthropic/resources/beta/deployments.rb +8 -8
- data/lib/anthropic/resources/beta/dreams.rb +5 -5
- data/lib/anthropic/resources/beta/memory_stores/memories.rb +22 -22
- data/lib/anthropic/resources/beta/memory_stores/memory_versions.rb +9 -9
- data/lib/anthropic/resources/beta/memory_stores.rb +25 -25
- data/lib/anthropic/resources/beta/messages.rb +63 -111
- data/lib/anthropic/resources/beta/organization/analytics/cost_report.rb +2 -2
- data/lib/anthropic/resources/beta/organization/analytics/usage_report.rb +2 -2
- data/lib/anthropic/resources/beta/organization/analytics/user_cost_report.rb +2 -2
- data/lib/anthropic/resources/beta/organization/analytics/user_usage_report.rb +2 -2
- data/lib/anthropic/resources/beta/organization/spend_limits.rb +3 -2
- data/lib/anthropic/resources/beta/organization/telemetry_destinations/workspaces.rb +11 -3
- data/lib/anthropic/resources/beta/organization/telemetry_destinations.rb +18 -6
- data/lib/anthropic/resources/beta/organization/workspaces/rate_limits.rb +53 -0
- data/lib/anthropic/resources/beta/sessions/events.rb +3 -3
- data/lib/anthropic/resources/beta/sessions/resources.rb +5 -5
- data/lib/anthropic/resources/beta/sessions/threads/events.rb +2 -2
- data/lib/anthropic/resources/beta/sessions/threads.rb +3 -3
- data/lib/anthropic/resources/beta/sessions.rb +6 -6
- data/lib/anthropic/resources/beta/tunnels/certificates.rb +4 -4
- data/lib/anthropic/resources/beta/tunnels.rb +6 -6
- data/lib/anthropic/resources/beta/user_profiles/action_urls.rb +54 -0
- data/lib/anthropic/resources/beta/user_profiles.rb +36 -0
- data/lib/anthropic/resources/beta/vaults/credentials.rb +16 -16
- data/lib/anthropic/resources/beta/vaults.rb +13 -13
- data/lib/anthropic/resources/messages.rb +64 -90
- data/lib/anthropic/resources/organization/workspaces/rate_limits.rb +49 -0
- data/lib/anthropic/resources/user_profiles/action_urls.rb +50 -0
- data/lib/anthropic/resources/user_profiles.rb +196 -0
- data/lib/anthropic/version.rb +1 -1
- data/lib/anthropic.rb +40 -0
- data/rbi/anthropic/client.rbi +3 -0
- data/rbi/anthropic/helpers/aws/client.rbi +13 -0
- data/rbi/anthropic/helpers/bedrock/client.rbi +4 -0
- data/rbi/anthropic/helpers/bedrock/mantle_client.rbi +9 -0
- data/rbi/anthropic/helpers/google_cloud/client.rbi +19 -2
- data/rbi/anthropic/helpers/vertex/client.rbi +4 -0
- data/rbi/anthropic/internal/report_page_cursor.rbi +28 -0
- data/rbi/anthropic/internal/tracing.rbi +9 -4
- data/rbi/anthropic/models/beta/agent_archive_params.rbi +4 -2
- data/rbi/anthropic/models/beta/agent_create_params.rbi +4 -2
- data/rbi/anthropic/models/beta/agent_list_params.rbi +4 -2
- data/rbi/anthropic/models/beta/agent_retrieve_params.rbi +4 -2
- data/rbi/anthropic/models/beta/agent_update_params.rbi +4 -2
- data/rbi/anthropic/models/beta/agents/version_list_params.rbi +4 -2
- data/rbi/anthropic/models/beta/beta_cache_miss_messages_changed.rbi +7 -0
- data/rbi/anthropic/models/beta/beta_cache_miss_model_changed.rbi +6 -0
- data/rbi/anthropic/models/beta/beta_cache_miss_previous_message_not_found.rbi +8 -0
- data/rbi/anthropic/models/beta/beta_cache_miss_system_changed.rbi +6 -0
- data/rbi/anthropic/models/beta/beta_cache_miss_tools_changed.rbi +6 -0
- data/rbi/anthropic/models/beta/beta_cache_miss_unavailable.rbi +10 -0
- data/rbi/anthropic/models/beta/beta_deleted_user_profile.rbi +40 -0
- data/rbi/anthropic/models/beta/beta_fallback_param.rbi +116 -9
- data/rbi/anthropic/models/beta/beta_managed_agents_deleted_vault.rbi +2 -2
- data/rbi/anthropic/models/beta/beta_managed_agents_memory_store.rbi +44 -26
- data/rbi/anthropic/models/beta/beta_managed_agents_vault.rbi +2 -2
- data/rbi/anthropic/models/beta/beta_thinking_types.rbi +31 -2
- data/rbi/anthropic/models/beta/beta_user_profile.rbi +50 -43
- data/rbi/anthropic/models/beta/beta_user_profile_enrollment_url.rbi +1 -1
- data/rbi/anthropic/models/beta/deployment_archive_params.rbi +4 -2
- data/rbi/anthropic/models/beta/deployment_create_params.rbi +4 -2
- data/rbi/anthropic/models/beta/deployment_list_params.rbi +4 -2
- data/rbi/anthropic/models/beta/deployment_pause_params.rbi +4 -2
- data/rbi/anthropic/models/beta/deployment_retrieve_params.rbi +4 -2
- data/rbi/anthropic/models/beta/deployment_run_list_params.rbi +4 -2
- data/rbi/anthropic/models/beta/deployment_run_params.rbi +4 -2
- data/rbi/anthropic/models/beta/deployment_run_retrieve_params.rbi +4 -2
- data/rbi/anthropic/models/beta/deployment_unpause_params.rbi +4 -2
- data/rbi/anthropic/models/beta/deployment_update_params.rbi +4 -2
- data/rbi/anthropic/models/beta/dream_archive_params.rbi +4 -2
- data/rbi/anthropic/models/beta/dream_cancel_params.rbi +4 -2
- data/rbi/anthropic/models/beta/dream_create_params.rbi +4 -2
- data/rbi/anthropic/models/beta/dream_list_params.rbi +4 -2
- data/rbi/anthropic/models/beta/dream_retrieve_params.rbi +4 -2
- data/rbi/anthropic/models/beta/memory_store_archive_params.rbi +12 -8
- data/rbi/anthropic/models/beta/memory_store_create_params.rbi +38 -18
- data/rbi/anthropic/models/beta/memory_store_delete_params.rbi +12 -8
- data/rbi/anthropic/models/beta/memory_store_list_params.rbi +12 -14
- data/rbi/anthropic/models/beta/memory_store_retrieve_params.rbi +6 -6
- data/rbi/anthropic/models/beta/memory_store_update_params.rbi +34 -22
- data/rbi/anthropic/models/beta/memory_stores/beta_managed_agents_content_sha256_precondition.rbi +6 -6
- data/rbi/anthropic/models/beta/memory_stores/beta_managed_agents_deleted_memory.rbi +13 -6
- data/rbi/anthropic/models/beta/memory_stores/beta_managed_agents_memory.rbi +54 -36
- data/rbi/anthropic/models/beta/memory_stores/beta_managed_agents_memory_list_item.rbi +25 -18
- data/rbi/anthropic/models/beta/memory_stores/beta_managed_agents_memory_path_conflict_error.rbi +3 -2
- data/rbi/anthropic/models/beta/memory_stores/beta_managed_agents_memory_prefix.rbi +7 -6
- data/rbi/anthropic/models/beta/memory_stores/beta_managed_agents_memory_version.rbi +60 -38
- data/rbi/anthropic/models/beta/memory_stores/beta_managed_agents_memory_version_operation.rbi +4 -2
- data/rbi/anthropic/models/beta/memory_stores/beta_managed_agents_memory_view.rbi +5 -5
- data/rbi/anthropic/models/beta/memory_stores/memory_create_params.rbi +34 -26
- data/rbi/anthropic/models/beta/memory_stores/memory_delete_params.rbi +4 -2
- data/rbi/anthropic/models/beta/memory_stores/memory_list_params.rbi +48 -30
- data/rbi/anthropic/models/beta/memory_stores/memory_retrieve_params.rbi +14 -12
- data/rbi/anthropic/models/beta/memory_stores/memory_update_params.rbi +36 -32
- data/rbi/anthropic/models/beta/memory_stores/memory_version_list_params.rbi +26 -18
- data/rbi/anthropic/models/beta/memory_stores/memory_version_redact_params.rbi +4 -2
- data/rbi/anthropic/models/beta/memory_stores/memory_version_retrieve_params.rbi +14 -12
- data/rbi/anthropic/models/beta/message_count_tokens_params.rbi +17 -2
- data/rbi/anthropic/models/beta/message_create_params.rbi +17 -2
- data/rbi/anthropic/models/beta/messages/batch_create_params.rbi +21 -6
- data/rbi/anthropic/models/beta/organization/beta_organization_rate_limit.rbi +4 -2
- data/rbi/anthropic/models/beta/organization/beta_plugin.rbi +49 -11
- data/rbi/anthropic/models/beta/organization/beta_spend_limit.rbi +9 -2
- data/rbi/anthropic/models/beta/organization/beta_spend_limit_usage_tier_scope.rbi +38 -0
- data/rbi/anthropic/models/beta/organization/beta_spend_summary.rbi +18 -4
- data/rbi/anthropic/models/beta/organization/plugin_marketplace_validate_repository_params.rbi +18 -8
- data/rbi/anthropic/models/beta/organization/plugins/beta_plugin_version.rbi +20 -8
- data/rbi/anthropic/models/beta/organization/telemetry_destination_create_params.rbi +4 -2
- data/rbi/anthropic/models/beta/organization/telemetry_destination_delete_params.rbi +4 -2
- data/rbi/anthropic/models/beta/organization/telemetry_destination_list_params.rbi +4 -2
- data/rbi/anthropic/models/beta/organization/telemetry_destination_retrieve_params.rbi +4 -2
- data/rbi/anthropic/models/beta/organization/telemetry_destination_test_params.rbi +4 -2
- data/rbi/anthropic/models/beta/organization/telemetry_destination_update_params.rbi +4 -2
- data/rbi/anthropic/models/beta/organization/telemetry_destinations/workspace_add_params.rbi +4 -2
- data/rbi/anthropic/models/beta/organization/telemetry_destinations/workspace_list_params.rbi +4 -2
- data/rbi/anthropic/models/beta/organization/telemetry_destinations/workspace_remove_params.rbi +4 -2
- data/rbi/anthropic/models/beta/organization/workspaces/beta_workspace_rate_limit_type.rbi +81 -0
- data/rbi/anthropic/models/beta/organization/workspaces/beta_workspace_rate_limit_update_value.rbi +62 -0
- data/rbi/anthropic/models/beta/organization/workspaces/rate_limit_update_params.rbi +80 -0
- data/rbi/anthropic/models/beta/session_archive_params.rbi +4 -2
- data/rbi/anthropic/models/beta/session_create_params.rbi +4 -2
- data/rbi/anthropic/models/beta/session_delete_params.rbi +4 -2
- data/rbi/anthropic/models/beta/session_list_params.rbi +4 -2
- data/rbi/anthropic/models/beta/session_retrieve_params.rbi +4 -2
- data/rbi/anthropic/models/beta/session_update_params.rbi +4 -2
- data/rbi/anthropic/models/beta/sessions/event_list_params.rbi +4 -2
- data/rbi/anthropic/models/beta/sessions/event_send_params.rbi +4 -2
- data/rbi/anthropic/models/beta/sessions/event_stream_params.rbi +4 -2
- data/rbi/anthropic/models/beta/sessions/resource_add_params.rbi +4 -2
- data/rbi/anthropic/models/beta/sessions/resource_delete_params.rbi +4 -2
- data/rbi/anthropic/models/beta/sessions/resource_list_params.rbi +4 -2
- data/rbi/anthropic/models/beta/sessions/resource_retrieve_params.rbi +4 -2
- data/rbi/anthropic/models/beta/sessions/resource_update_params.rbi +4 -2
- data/rbi/anthropic/models/beta/sessions/thread_archive_params.rbi +4 -2
- data/rbi/anthropic/models/beta/sessions/thread_list_params.rbi +4 -2
- data/rbi/anthropic/models/beta/sessions/thread_retrieve_params.rbi +4 -2
- data/rbi/anthropic/models/beta/sessions/threads/event_list_params.rbi +4 -2
- data/rbi/anthropic/models/beta/sessions/threads/event_stream_params.rbi +4 -2
- data/rbi/anthropic/models/beta/tunnel_archive_params.rbi +4 -2
- data/rbi/anthropic/models/beta/tunnel_create_params.rbi +4 -2
- data/rbi/anthropic/models/beta/tunnel_list_params.rbi +4 -2
- data/rbi/anthropic/models/beta/tunnel_retrieve_params.rbi +4 -2
- data/rbi/anthropic/models/beta/tunnel_reveal_token_params.rbi +4 -2
- data/rbi/anthropic/models/beta/tunnel_rotate_token_params.rbi +4 -2
- data/rbi/anthropic/models/beta/tunnels/certificate_archive_params.rbi +4 -2
- data/rbi/anthropic/models/beta/tunnels/certificate_create_params.rbi +4 -2
- data/rbi/anthropic/models/beta/tunnels/certificate_list_params.rbi +4 -2
- data/rbi/anthropic/models/beta/tunnels/certificate_retrieve_params.rbi +4 -2
- data/rbi/anthropic/models/beta/user_profile_create_params.rbi +20 -16
- data/rbi/anthropic/models/beta/user_profile_delete_params.rbi +91 -0
- data/rbi/anthropic/models/beta/user_profile_update_params.rbi +18 -16
- data/rbi/anthropic/models/beta/user_profiles/action_url_create_params.rbi +116 -0
- data/rbi/anthropic/models/beta/user_profiles/beta_user_profile_action_url.rbi +55 -0
- data/rbi/anthropic/models/beta/user_profiles/beta_user_profile_enroll_end_user_action.rbi +31 -0
- data/rbi/anthropic/models/beta/vault_archive_params.rbi +4 -2
- data/rbi/anthropic/models/beta/vault_create_params.rbi +4 -2
- data/rbi/anthropic/models/beta/vault_delete_params.rbi +4 -2
- data/rbi/anthropic/models/beta/vault_list_params.rbi +12 -6
- data/rbi/anthropic/models/beta/vault_retrieve_params.rbi +4 -2
- data/rbi/anthropic/models/beta/vault_update_params.rbi +4 -2
- data/rbi/anthropic/models/beta/vaults/beta_managed_agents_credential.rbi +4 -3
- data/rbi/anthropic/models/beta/vaults/beta_managed_agents_credential_networking_params.rbi +6 -4
- data/rbi/anthropic/models/beta/vaults/beta_managed_agents_credential_validation.rbi +4 -2
- data/rbi/anthropic/models/beta/vaults/beta_managed_agents_credential_validation_status.rbi +2 -2
- data/rbi/anthropic/models/beta/vaults/beta_managed_agents_deleted_credential.rbi +2 -2
- data/rbi/anthropic/models/beta/vaults/beta_managed_agents_environment_variable_auth_response.rbi +5 -3
- data/rbi/anthropic/models/beta/vaults/beta_managed_agents_environment_variable_create_params.rbi +4 -2
- data/rbi/anthropic/models/beta/vaults/beta_managed_agents_environment_variable_update_params.rbi +4 -4
- data/rbi/anthropic/models/beta/vaults/beta_managed_agents_injection_location_update_params.rbi +8 -1
- data/rbi/anthropic/models/beta/vaults/beta_managed_agents_limited_credential_networking_params.rbi +12 -8
- data/rbi/anthropic/models/beta/vaults/beta_managed_agents_limited_credential_networking_response.rbi +10 -6
- data/rbi/anthropic/models/beta/vaults/beta_managed_agents_mcp_oauth_auth_response.rbi +4 -2
- data/rbi/anthropic/models/beta/vaults/beta_managed_agents_mcp_oauth_create_params.rbi +8 -4
- data/rbi/anthropic/models/beta/vaults/beta_managed_agents_mcp_oauth_refresh_params.rbi +10 -5
- data/rbi/anthropic/models/beta/vaults/beta_managed_agents_mcp_oauth_refresh_response.rbi +2 -2
- data/rbi/anthropic/models/beta/vaults/beta_managed_agents_mcp_oauth_refresh_update_params.rbi +11 -5
- data/rbi/anthropic/models/beta/vaults/beta_managed_agents_mcp_oauth_update_params.rbi +16 -4
- data/rbi/anthropic/models/beta/vaults/beta_managed_agents_mcp_probe.rbi +6 -4
- data/rbi/anthropic/models/beta/vaults/beta_managed_agents_static_bearer_create_params.rbi +4 -2
- data/rbi/anthropic/models/beta/vaults/beta_managed_agents_static_bearer_update_params.rbi +2 -2
- data/rbi/anthropic/models/beta/vaults/beta_managed_agents_token_endpoint_auth_basic_param.rbi +4 -2
- data/rbi/anthropic/models/beta/vaults/beta_managed_agents_token_endpoint_auth_basic_update_param.rbi +10 -2
- data/rbi/anthropic/models/beta/vaults/beta_managed_agents_token_endpoint_auth_post_param.rbi +2 -2
- data/rbi/anthropic/models/beta/vaults/beta_managed_agents_token_endpoint_auth_post_update_param.rbi +10 -2
- data/rbi/anthropic/models/beta/vaults/credential_archive_params.rbi +4 -2
- data/rbi/anthropic/models/beta/vaults/credential_create_params.rbi +12 -6
- data/rbi/anthropic/models/beta/vaults/credential_delete_params.rbi +4 -2
- data/rbi/anthropic/models/beta/vaults/credential_list_params.rbi +12 -6
- data/rbi/anthropic/models/beta/vaults/credential_mcp_oauth_validate_params.rbi +4 -2
- data/rbi/anthropic/models/beta/vaults/credential_retrieve_params.rbi +4 -2
- data/rbi/anthropic/models/beta/vaults/credential_update_params.rbi +21 -13
- data/rbi/anthropic/models/cache_miss_messages_changed.rbi +7 -0
- data/rbi/anthropic/models/cache_miss_model_changed.rbi +6 -0
- data/rbi/anthropic/models/cache_miss_previous_message_not_found.rbi +8 -0
- data/rbi/anthropic/models/cache_miss_system_changed.rbi +6 -0
- data/rbi/anthropic/models/cache_miss_tools_changed.rbi +6 -0
- data/rbi/anthropic/models/cache_miss_unavailable.rbi +10 -0
- data/rbi/anthropic/models/deleted_user_profile.rbi +33 -0
- data/rbi/anthropic/models/message_count_tokens_params.rbi +59 -2
- data/rbi/anthropic/models/message_create_params.rbi +51 -2
- data/rbi/anthropic/models/messages/batch_create_params.rbi +79 -6
- data/rbi/anthropic/models/organization/organization_rate_limit.rbi +4 -2
- data/rbi/anthropic/models/organization/workspaces/rate_limit_update_params.rbi +78 -0
- data/rbi/anthropic/models/organization/workspaces/workspace_rate_limit_type.rbi +81 -0
- data/rbi/anthropic/models/organization/workspaces/workspace_rate_limit_update_value.rbi +62 -0
- data/rbi/anthropic/models/thinking_types.rbi +27 -2
- data/rbi/anthropic/models/usage.rbi +29 -3
- data/rbi/anthropic/models/user_profile.rbi +152 -0
- data/rbi/anthropic/models/user_profile_access_type.rbi +34 -0
- data/rbi/anthropic/models/user_profile_create_params.rbi +135 -0
- data/rbi/anthropic/models/user_profile_cyber_program.rbi +95 -0
- data/rbi/anthropic/models/user_profile_cyber_requirements.rbi +52 -0
- data/rbi/anthropic/models/user_profile_cyber_tier.rbi +69 -0
- data/rbi/anthropic/models/user_profile_delete_params.rbi +67 -0
- data/rbi/anthropic/models/user_profile_efs_feature.rbi +69 -0
- data/rbi/anthropic/models/user_profile_efs_program.rbi +66 -0
- data/rbi/anthropic/models/user_profile_external_user_account_status.rbi +52 -0
- data/rbi/anthropic/models/user_profile_external_user_details.rbi +125 -0
- data/rbi/anthropic/models/user_profile_external_user_details_params.rbi +131 -0
- data/rbi/anthropic/models/user_profile_external_user_entity_type.rbi +46 -0
- data/rbi/anthropic/models/user_profile_list_order.rbi +28 -0
- data/rbi/anthropic/models/user_profile_list_order_by.rbi +30 -0
- data/rbi/anthropic/models/user_profile_list_params.rbi +110 -0
- data/rbi/anthropic/models/user_profile_program_status.rbi +34 -0
- data/rbi/anthropic/models/user_profile_programs.rbi +77 -0
- data/rbi/anthropic/models/user_profile_retrieve_params.rbi +67 -0
- data/rbi/anthropic/models/user_profile_update_params.rbi +130 -0
- data/rbi/anthropic/models/user_profiles/action_url_create_params.rbi +86 -0
- data/rbi/anthropic/models/user_profiles/user_profile_action_url.rbi +55 -0
- data/rbi/anthropic/models/user_profiles/user_profile_enroll_end_user_action.rbi +32 -0
- data/rbi/anthropic/models.rbi +48 -0
- data/rbi/anthropic/resources/beta/agents/versions.rbi +2 -1
- data/rbi/anthropic/resources/beta/agents.rbi +10 -5
- data/rbi/anthropic/resources/beta/deployment_runs.rbi +4 -2
- data/rbi/anthropic/resources/beta/deployments.rbi +16 -8
- data/rbi/anthropic/resources/beta/dreams.rbi +10 -5
- data/rbi/anthropic/resources/beta/memory_stores/memories.rbi +75 -56
- data/rbi/anthropic/resources/beta/memory_stores/memory_versions.rbi +25 -19
- data/rbi/anthropic/resources/beta/memory_stores.rbi +65 -44
- data/rbi/anthropic/resources/beta/messages/batches.rbi +3 -4
- data/rbi/anthropic/resources/beta/messages.rbi +207 -198
- data/rbi/anthropic/resources/beta/organization/analytics/cost_report.rbi +1 -1
- data/rbi/anthropic/resources/beta/organization/analytics/usage_report.rbi +1 -1
- data/rbi/anthropic/resources/beta/organization/analytics/user_cost_report.rbi +1 -1
- data/rbi/anthropic/resources/beta/organization/analytics/user_usage_report.rbi +1 -1
- data/rbi/anthropic/resources/beta/organization/plugin_marketplaces.rbi +9 -4
- data/rbi/anthropic/resources/beta/organization/spend_limits.rbi +3 -2
- data/rbi/anthropic/resources/beta/organization/telemetry_destinations/workspaces.rbi +6 -3
- data/rbi/anthropic/resources/beta/organization/telemetry_destinations.rbi +12 -6
- data/rbi/anthropic/resources/beta/organization/workspaces/rate_limits.rbi +35 -0
- data/rbi/anthropic/resources/beta/sessions/events.rbi +6 -3
- data/rbi/anthropic/resources/beta/sessions/resources.rbi +10 -5
- data/rbi/anthropic/resources/beta/sessions/threads/events.rbi +4 -2
- data/rbi/anthropic/resources/beta/sessions/threads.rbi +6 -3
- data/rbi/anthropic/resources/beta/sessions.rbi +12 -6
- data/rbi/anthropic/resources/beta/tunnels/certificates.rbi +8 -4
- data/rbi/anthropic/resources/beta/tunnels.rbi +12 -6
- data/rbi/anthropic/resources/beta/user_profiles/action_urls.rbi +46 -0
- data/rbi/anthropic/resources/beta/user_profiles.rbi +46 -15
- data/rbi/anthropic/resources/beta/vaults/credentials.rbi +27 -18
- data/rbi/anthropic/resources/beta/vaults.rbi +22 -13
- data/rbi/anthropic/resources/messages/batches.rbi +3 -4
- data/rbi/anthropic/resources/messages.rbi +151 -129
- data/rbi/anthropic/resources/organization/workspaces/rate_limits.rbi +33 -0
- data/rbi/anthropic/resources/user_profiles/action_urls.rbi +40 -0
- data/rbi/anthropic/resources/user_profiles.rbi +184 -0
- data/sig/anthropic/client.rbs +2 -0
- data/sig/anthropic/helpers/bedrock/client.rbs +2 -0
- data/sig/anthropic/helpers/google_cloud/client.rbs +10 -1
- data/sig/anthropic/helpers/vertex/client.rbs +2 -0
- data/sig/anthropic/internal/report_page_cursor.rbs +17 -0
- data/sig/anthropic/internal/tracing.rbs +7 -4
- data/sig/anthropic/models/beta/beta_deleted_user_profile.rbs +20 -0
- data/sig/anthropic/models/beta/beta_thinking_types.rbs +5 -0
- data/sig/anthropic/models/beta/beta_user_profile.rbs +8 -8
- data/sig/anthropic/models/beta/organization/beta_spend_limit.rbs +6 -0
- data/sig/anthropic/models/beta/organization/beta_spend_limit_usage_tier_scope.rbs +17 -0
- data/sig/anthropic/models/beta/organization/beta_spend_summary.rbs +12 -0
- data/sig/anthropic/models/beta/organization/workspaces/beta_workspace_rate_limit_type.rbs +36 -0
- data/sig/anthropic/models/beta/organization/workspaces/beta_workspace_rate_limit_update_value.rbs +31 -0
- data/sig/anthropic/models/beta/organization/workspaces/rate_limit_update_params.rbs +42 -0
- data/sig/anthropic/models/beta/user_profile_delete_params.rbs +44 -0
- data/sig/anthropic/models/beta/user_profiles/action_url_create_params.rbs +51 -0
- data/sig/anthropic/models/beta/user_profiles/beta_user_profile_action_url.rbs +30 -0
- data/sig/anthropic/models/beta/user_profiles/beta_user_profile_enroll_end_user_action.rbs +18 -0
- data/sig/anthropic/models/beta/vaults/beta_managed_agents_credential_validation_status.rbs +2 -2
- data/sig/anthropic/models/deleted_user_profile.rbs +15 -0
- data/sig/anthropic/models/message_count_tokens_params.rbs +16 -0
- data/sig/anthropic/models/message_create_params.rbs +16 -0
- data/sig/anthropic/models/messages/batch_create_params.rbs +16 -0
- data/sig/anthropic/models/organization/workspaces/rate_limit_update_params.rbs +40 -0
- data/sig/anthropic/models/organization/workspaces/workspace_rate_limit_type.rbs +36 -0
- data/sig/anthropic/models/organization/workspaces/workspace_rate_limit_update_value.rbs +31 -0
- data/sig/anthropic/models/thinking_types.rbs +5 -0
- data/sig/anthropic/models/usage.rbs +19 -3
- data/sig/anthropic/models/user_profile.rbs +60 -0
- data/sig/anthropic/models/user_profile_access_type.rbs +17 -0
- data/sig/anthropic/models/user_profile_create_params.rbs +58 -0
- data/sig/anthropic/models/user_profile_cyber_program.rbs +30 -0
- data/sig/anthropic/models/user_profile_cyber_requirements.rbs +16 -0
- data/sig/anthropic/models/user_profile_cyber_tier.rbs +29 -0
- data/sig/anthropic/models/user_profile_delete_params.rbs +30 -0
- data/sig/anthropic/models/user_profile_efs_feature.rbs +29 -0
- data/sig/anthropic/models/user_profile_efs_program.rbs +25 -0
- data/sig/anthropic/models/user_profile_external_user_account_status.rbs +21 -0
- data/sig/anthropic/models/user_profile_external_user_details.rbs +50 -0
- data/sig/anthropic/models/user_profile_external_user_details_params.rbs +52 -0
- data/sig/anthropic/models/user_profile_external_user_entity_type.rbs +17 -0
- data/sig/anthropic/models/user_profile_list_order.rbs +17 -0
- data/sig/anthropic/models/user_profile_list_order_by.rbs +17 -0
- data/sig/anthropic/models/user_profile_list_params.rbs +60 -0
- data/sig/anthropic/models/user_profile_program_status.rbs +20 -0
- data/sig/anthropic/models/user_profile_programs.rbs +25 -0
- data/sig/anthropic/models/user_profile_retrieve_params.rbs +30 -0
- data/sig/anthropic/models/user_profile_update_params.rbs +59 -0
- data/sig/anthropic/models/user_profiles/action_url_create_params.rbs +40 -0
- data/sig/anthropic/models/user_profiles/user_profile_action_url.rbs +30 -0
- data/sig/anthropic/models/user_profiles/user_profile_enroll_end_user_action.rbs +17 -0
- data/sig/anthropic/models.rbs +44 -0
- data/sig/anthropic/resources/beta/messages.rbs +24 -24
- data/sig/anthropic/resources/beta/organization/analytics/cost_report.rbs +1 -1
- data/sig/anthropic/resources/beta/organization/analytics/usage_report.rbs +1 -1
- data/sig/anthropic/resources/beta/organization/analytics/user_cost_report.rbs +1 -1
- data/sig/anthropic/resources/beta/organization/analytics/user_usage_report.rbs +1 -1
- data/sig/anthropic/resources/beta/organization/workspaces/rate_limits.rbs +7 -0
- data/sig/anthropic/resources/beta/user_profiles/action_urls.rbs +19 -0
- data/sig/anthropic/resources/beta/user_profiles.rbs +9 -0
- data/sig/anthropic/resources/messages.rbs +22 -18
- data/sig/anthropic/resources/organization/workspaces/rate_limits.rbs +7 -0
- data/sig/anthropic/resources/user_profiles/action_urls.rbs +16 -0
- data/sig/anthropic/resources/user_profiles.rbs +49 -0
- metadata +122 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 154fbf0eeb1ef7997d8bc33f44e588fbe3fb3327aed6be57fba6d6459703d580
|
|
4
|
+
data.tar.gz: 974d03138f614db3ecc816de5c3d25e4862951faf84b0679ee8058758a89789e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e8701990520600baf05a9a240c836ba0245272b08a4df77a52d13da4d6c29cfaf4c884671ec3d2e8cec60a067ab5a859feff5630dbe1d3b796372bf691402408
|
|
7
|
+
data.tar.gz: bdad1379435404bc3ad2ab1534024c9a7baaa3bfbce296080e51fec7a31c9f1a95650f86c3e42ff94eb9b1dcd30c3f412bca8718148cbbd50b05b33c05624392
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,56 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.81.0](https://github.com/anthropics/anthropic-sdk-ruby/compare/v1.80.0...v1.81.0) (2026-10-20)
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* **api:** add data_refreshed_at and has_more to analytics report pages
|
|
8
|
+
* **api:** add workspace rate-limit updates to the Admin API
|
|
9
|
+
* **api:** make User Profiles generally available
|
|
10
|
+
* **client:** yield server-sent events with unrecognized event names
|
|
11
|
+
* **google-cloud:** use the v1 endpoints and add the organization endpoint
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* **client:** `messages.stream` and `beta.messages.stream` now take the same parameters as `stream_raw`; their Sorbet and RBS signatures take one params hash
|
|
17
|
+
* **types:** type the keyword parameters of messages.stream and beta.messages.stream
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Chores
|
|
21
|
+
|
|
22
|
+
* **ci:** publish gems from a fixed Ubuntu 24.04 runner
|
|
23
|
+
* **ci:** set up Ruby 3.2 with a newer setup-ruby in the build and dependency version jobs
|
|
24
|
+
* **ci:** skip the changelog check on draft pull requests
|
|
25
|
+
* **docs:** add credential expiry descriptions to the Managed Agents API reference
|
|
26
|
+
* **docs:** add Messages API request descriptions
|
|
27
|
+
* **docs:** correct plugin manifest_version and reach descriptions
|
|
28
|
+
* **docs:** improve Managed Agents memory store descriptions
|
|
29
|
+
* **docs:** improve Managed Agents vault and credential descriptions
|
|
30
|
+
* **tests:** cover per-request timeouts and later union variants
|
|
31
|
+
* **tests:** make the tracing tests independent of test order
|
|
32
|
+
* **tests:** send events that the stream yields in the tracing test
|
|
33
|
+
|
|
34
|
+
## [1.80.0](https://github.com/anthropics/anthropic-sdk-ruby/compare/v1.79.0...v1.80.0) (2026-10-15)
|
|
35
|
+
|
|
36
|
+
### Features
|
|
37
|
+
|
|
38
|
+
* **api:** add between_tools to thinking types in model capabilities
|
|
39
|
+
* **api:** add the speed parameter and usage.speed to Messages
|
|
40
|
+
* **api:** return a Console organization's usage-tier spend cap as a read-only spend limit
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
### Chores
|
|
44
|
+
|
|
45
|
+
* **ci:** speed up breaking change detection
|
|
46
|
+
* **docs:** describe headers on Managed Agents and telemetry endpoints
|
|
47
|
+
* **tests:** cover trace context propagation and failing telemetry
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
### Documentation
|
|
51
|
+
|
|
52
|
+
* **api:** note that some models need a beta header to use speed
|
|
53
|
+
|
|
3
54
|
## [1.79.0](https://github.com/anthropics/anthropic-sdk-ruby/compare/v1.78.0...v1.79.0) (2026-10-14)
|
|
4
55
|
|
|
5
56
|
### Features
|
|
@@ -8,7 +59,9 @@
|
|
|
8
59
|
* **api:** add organization_type_not_supported error to spend limit lists
|
|
9
60
|
* **api:** add telemetry destination test endpoint
|
|
10
61
|
* **api:** add telemetry destinations to the Admin API
|
|
11
|
-
* **client:** add
|
|
62
|
+
* **client:** add native support for OpenTelemetry tracing
|
|
63
|
+
|
|
64
|
+
If your app registers a global tracer provider, the SDK will create spans with it after upgrading, and they'll be exported with the rest of your traces. Requests will also get trace context headers from the global propagator. To disable, pass `open_telemetry: false` to the client or set `ANTHROPIC_OPEN_TELEMETRY=false`. Learn more in the [documentation](https://platform.claude.com/docs/en/manage-claude/opentelemetry/sdk).
|
|
12
65
|
|
|
13
66
|
|
|
14
67
|
### Bug Fixes
|
data/README.md
CHANGED
data/lib/anthropic/client.rb
CHANGED
|
@@ -82,6 +82,9 @@ module Anthropic
|
|
|
82
82
|
# @return [Anthropic::Resources::Skills]
|
|
83
83
|
attr_reader :skills
|
|
84
84
|
|
|
85
|
+
# @return [Anthropic::Resources::UserProfiles]
|
|
86
|
+
attr_reader :user_profiles
|
|
87
|
+
|
|
85
88
|
# @return [Anthropic::Resources::Organization]
|
|
86
89
|
attr_reader :organization
|
|
87
90
|
|
|
@@ -342,6 +345,7 @@ module Anthropic
|
|
|
342
345
|
@models = Anthropic::Resources::Models.new(client: self)
|
|
343
346
|
@files = Anthropic::Resources::Files.new(client: self)
|
|
344
347
|
@skills = Anthropic::Resources::Skills.new(client: self)
|
|
348
|
+
@user_profiles = Anthropic::Resources::UserProfiles.new(client: self)
|
|
345
349
|
@organization = Anthropic::Resources::Organization.new(client: self)
|
|
346
350
|
@beta = Anthropic::Resources::Beta.new(client: self)
|
|
347
351
|
end
|
|
@@ -91,9 +91,9 @@ module Anthropic
|
|
|
91
91
|
|
|
92
92
|
# In API-key mode the gateway key rides the base client's `api_key`
|
|
93
93
|
# slot; {#resolve_default_credentials?} keeps first-party credential
|
|
94
|
-
# auto-discovery out of the picture when it is absent.
|
|
95
|
-
#
|
|
96
|
-
#
|
|
94
|
+
# auto-discovery out of the picture when it is absent. Every resource
|
|
95
|
+
# the parent wires up stays available; {#build_request} rejects the
|
|
96
|
+
# one route the gateway does not serve.
|
|
97
97
|
super(
|
|
98
98
|
api_key: effective_api_key,
|
|
99
99
|
base_url: resolved_base_url,
|
|
@@ -105,6 +105,23 @@ module Anthropic
|
|
|
105
105
|
)
|
|
106
106
|
end
|
|
107
107
|
|
|
108
|
+
# @api private
|
|
109
|
+
#
|
|
110
|
+
# Fails fast on user profile action URLs, which the gateway does not serve.
|
|
111
|
+
#
|
|
112
|
+
# @param req [Hash{Symbol=>Object}]
|
|
113
|
+
# @param opts [Hash{Symbol=>Object}]
|
|
114
|
+
# @return [Hash{Symbol=>Object}]
|
|
115
|
+
private def build_request(req, opts)
|
|
116
|
+
# Id-parameterized routes pass `path` as an Array whose first element
|
|
117
|
+
# is the format string (e.g. `["v1/user_profiles/%1$s/action_urls", id]`).
|
|
118
|
+
if Array(req[:path]).first.to_s.match?(%r{\Av1/user_profiles/[^/]+/action_urls})
|
|
119
|
+
raise NotImplementedError.new("User profile action URLs are not supported on the AWS gateway.")
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
super
|
|
123
|
+
end
|
|
124
|
+
|
|
108
125
|
# @api private
|
|
109
126
|
#
|
|
110
127
|
# @return [String]
|
|
@@ -169,6 +169,10 @@ module Anthropic
|
|
|
169
169
|
raise NotImplementedError, "Skills are not supported on Bedrock."
|
|
170
170
|
end
|
|
171
171
|
|
|
172
|
+
def user_profiles
|
|
173
|
+
raise NotImplementedError, "User profiles are not supported on Bedrock."
|
|
174
|
+
end
|
|
175
|
+
|
|
172
176
|
# @api private
|
|
173
177
|
#
|
|
174
178
|
# @param req [Hash{Symbol=>Object}] .
|
|
@@ -318,6 +322,8 @@ module Anthropic
|
|
|
318
322
|
message = "Please instead use https://docs.anthropic.com/en/api/claude-on-amazon-bedrock#list-available-models to list available models on Bedrock."
|
|
319
323
|
# rubocop:enable Layout/LineLength
|
|
320
324
|
raise NotImplementedError.new(message)
|
|
325
|
+
in %r{^v1/user_profiles}
|
|
326
|
+
raise NotImplementedError.new("User profiles are not supported on Bedrock.")
|
|
321
327
|
else
|
|
322
328
|
end
|
|
323
329
|
end
|
|
@@ -131,6 +131,13 @@ module Anthropic
|
|
|
131
131
|
"Skills are not supported on Bedrock Mantle. Only Messages (/v1/messages) is supported."
|
|
132
132
|
end
|
|
133
133
|
|
|
134
|
+
# User profiles are not supported on Bedrock Mantle. Only Messages (/v1/messages) is supported.
|
|
135
|
+
def user_profiles
|
|
136
|
+
raise NotImplementedError,
|
|
137
|
+
"User profiles are not supported on Bedrock Mantle. " \
|
|
138
|
+
"Only Messages (/v1/messages) is supported."
|
|
139
|
+
end
|
|
140
|
+
|
|
134
141
|
# @api private
|
|
135
142
|
#
|
|
136
143
|
# @return [Hash{String=>String}]
|
|
@@ -146,10 +153,36 @@ module Anthropic
|
|
|
146
153
|
# @api private
|
|
147
154
|
#
|
|
148
155
|
# @return [#call]
|
|
149
|
-
private def provider_middleware
|
|
156
|
+
private def provider_middleware
|
|
157
|
+
->(req, nxt) { aws_auth_provider(adapt_request(req), nxt) }
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
# @api private
|
|
161
|
+
#
|
|
162
|
+
# Mantle drops custom request headers, so Messages and token counting send the user profile ID
|
|
163
|
+
# in the body.
|
|
164
|
+
#
|
|
165
|
+
# @param req [Anthropic::APIRequest]
|
|
166
|
+
# @return [Anthropic::APIRequest]
|
|
167
|
+
private def adapt_request(req)
|
|
168
|
+
path = req.url.path.to_s
|
|
169
|
+
return req unless req.method == :post && path.end_with?("/v1/messages", "/v1/messages/count_tokens")
|
|
170
|
+
|
|
171
|
+
body = req.body
|
|
172
|
+
profile_headers, headers = req.headers.partition do |name, _|
|
|
173
|
+
name.to_s.casecmp?("anthropic-user-profile-id")
|
|
174
|
+
end
|
|
175
|
+
user_profile_id = profile_headers.last&.last
|
|
176
|
+
return req if user_profile_id.to_s.empty? || !body.is_a?(Hash)
|
|
177
|
+
|
|
178
|
+
unless body.keys.any? { _1.to_s == "user_profile_id" }
|
|
179
|
+
body = {**body, user_profile_id: user_profile_id}
|
|
180
|
+
end
|
|
181
|
+
req.with(headers: headers.to_h, body: body)
|
|
182
|
+
end
|
|
150
183
|
|
|
151
184
|
# Restricted Beta service that only exposes messages. Other beta resources
|
|
152
|
-
# (models, files, skills) are not supported on Bedrock Mantle.
|
|
185
|
+
# (models, files, skills, user profiles) are not supported on Bedrock Mantle.
|
|
153
186
|
class MantleBeta
|
|
154
187
|
# @return [Anthropic::Resources::Beta::Messages]
|
|
155
188
|
attr_reader :messages
|
|
@@ -173,6 +206,12 @@ module Anthropic
|
|
|
173
206
|
raise NotImplementedError,
|
|
174
207
|
"Beta skills are not supported on Bedrock Mantle. Only Messages (/v1/messages) is supported."
|
|
175
208
|
end
|
|
209
|
+
|
|
210
|
+
def user_profiles
|
|
211
|
+
raise NotImplementedError,
|
|
212
|
+
"Beta user profiles are not supported on Bedrock Mantle. " \
|
|
213
|
+
"Only Messages (/v1/messages) is supported."
|
|
214
|
+
end
|
|
176
215
|
end
|
|
177
216
|
end
|
|
178
217
|
end
|
|
@@ -10,17 +10,26 @@ module Anthropic
|
|
|
10
10
|
# `:rawPredict` publisher-model API (publisher model IDs, messages
|
|
11
11
|
# only). This client speaks the full first-party Anthropic API: requests
|
|
12
12
|
# pass through the gateway unchanged — standard `/v1/*` paths, standard
|
|
13
|
-
# model names
|
|
14
|
-
#
|
|
13
|
+
# model names. The deprecated text Completions endpoint is intentionally
|
|
14
|
+
# not exposed, and the gateway does not serve the User Profiles API.
|
|
15
15
|
class Client < Anthropic::Client
|
|
16
16
|
# OAuth2 scope required to call the gateway.
|
|
17
17
|
SCOPE = "https://www.googleapis.com/auth/cloud-platform"
|
|
18
18
|
|
|
19
|
+
LOCATION_URL_TEMPLATE =
|
|
20
|
+
"https://claude.googleapis.com/v1/projects/%<project>s/locations/%<location>s"
|
|
21
|
+
|
|
19
22
|
# Gateway base URL template; override via `base_url` or
|
|
20
23
|
# `ANTHROPIC_GOOGLE_CLOUD_BASE_URL`.
|
|
21
|
-
URL_TEMPLATE =
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
URL_TEMPLATE = "#{LOCATION_URL_TEMPLATE}/workspaces/%<workspace_id>s/invoke".freeze
|
|
25
|
+
|
|
26
|
+
# Gateway base URL template for organization-level routes, which are
|
|
27
|
+
# served from a base with no workspace in it.
|
|
28
|
+
ORGANIZATION_URL_TEMPLATE = "#{LOCATION_URL_TEMPLATE}/claudeOrganization/invoke".freeze
|
|
29
|
+
|
|
30
|
+
ORGANIZATION_PATH_PREFIX = "/v1/organizations/"
|
|
31
|
+
|
|
32
|
+
private_constant :LOCATION_URL_TEMPLATE, :ORGANIZATION_PATH_PREFIX
|
|
24
33
|
|
|
25
34
|
# @return [String, nil]
|
|
26
35
|
attr_reader :project
|
|
@@ -53,12 +62,14 @@ module Anthropic
|
|
|
53
62
|
# explicit `nil` falls back to the same defaults.
|
|
54
63
|
#
|
|
55
64
|
# @param workspace_id [String, nil] Defaults to
|
|
56
|
-
# `ENV["ANTHROPIC_GOOGLE_CLOUD_WORKSPACE_ID"]`. Required
|
|
57
|
-
#
|
|
65
|
+
# `ENV["ANTHROPIC_GOOGLE_CLOUD_WORKSPACE_ID"]`. Required when the base
|
|
66
|
+
# URL is derived, except for organization-level routes
|
|
67
|
+
# (`/v1/organizations/`), which need no workspace ID.
|
|
58
68
|
#
|
|
59
|
-
# @param base_url [String, nil] Override the gateway base URL
|
|
60
|
-
# `ENV["ANTHROPIC_GOOGLE_CLOUD_BASE_URL"]`, otherwise
|
|
61
|
-
# `project`, `location`, and `workspace_id` via
|
|
69
|
+
# @param base_url [String, nil] Override the gateway base URL for every
|
|
70
|
+
# route. Defaults to `ENV["ANTHROPIC_GOOGLE_CLOUD_BASE_URL"]`, otherwise
|
|
71
|
+
# derived from `project`, `location`, and `workspace_id` via
|
|
72
|
+
# {URL_TEMPLATE}.
|
|
62
73
|
#
|
|
63
74
|
# @param google_credentials [#apply, nil] A `googleauth`-compatible
|
|
64
75
|
# credentials object. Mutually exclusive with `skip_auth`.
|
|
@@ -67,10 +78,9 @@ module Anthropic
|
|
|
67
78
|
# token string. Takes precedence over `google_credentials`. Mutually
|
|
68
79
|
# exclusive with `skip_auth`.
|
|
69
80
|
#
|
|
70
|
-
# @param skip_auth [Boolean] When true, no token is attached
|
|
71
|
-
#
|
|
72
|
-
#
|
|
73
|
-
# exclusive with `token_provider` and `google_credentials`.
|
|
81
|
+
# @param skip_auth [Boolean] When true, no token is attached. For callers
|
|
82
|
+
# fronting with their own authenticated proxy. Mutually exclusive with
|
|
83
|
+
# `token_provider` and `google_credentials`.
|
|
74
84
|
#
|
|
75
85
|
# @param max_retries [Integer] Max number of retries to attempt after a
|
|
76
86
|
# failed retryable request.
|
|
@@ -132,23 +142,23 @@ module Anthropic
|
|
|
132
142
|
# so nil can't reach the derived URL (matches the other SDKs).
|
|
133
143
|
@location = location || ENV["ANTHROPIC_GOOGLE_CLOUD_LOCATION"] || "global"
|
|
134
144
|
|
|
135
|
-
if workspace_id.nil? && !skip_auth
|
|
136
|
-
raise ArgumentError.new(
|
|
137
|
-
"No workspace ID was given. Set the `workspace_id` argument or the " \
|
|
138
|
-
"`ANTHROPIC_GOOGLE_CLOUD_WORKSPACE_ID` environment variable."
|
|
139
|
-
)
|
|
140
|
-
end
|
|
141
145
|
@workspace_id = workspace_id
|
|
142
146
|
|
|
143
147
|
base_url = nil if base_url.to_s.empty?
|
|
144
|
-
base_url
|
|
148
|
+
unless base_url
|
|
149
|
+
@organization_base_url = URI.parse(derive_base_url(ORGANIZATION_URL_TEMPLATE))
|
|
150
|
+
# Without a workspace ID there is no workspace base to derive, so
|
|
151
|
+
# `base_url` is the organization base.
|
|
152
|
+
base_url = @workspace_id.nil? ? @organization_base_url.to_s : derive_base_url(URL_TEMPLATE)
|
|
153
|
+
end
|
|
145
154
|
|
|
146
155
|
# No first-party credential is ever passed up, and
|
|
147
156
|
# {#resolve_default_credentials?} keeps the parent from discovering
|
|
148
157
|
# one; `base_url` is always resolved by this point, so the parent's
|
|
149
158
|
# `ANTHROPIC_BASE_URL` fallback never applies. The parent wires up
|
|
150
|
-
# every resource; {#completions}
|
|
151
|
-
# not serve
|
|
159
|
+
# every resource; {#completions} and {#user_profiles} withhold the
|
|
160
|
+
# ones the gateway does not serve, and {#build_request} refuses the
|
|
161
|
+
# user profile routes however the resource is reached.
|
|
152
162
|
super(
|
|
153
163
|
base_url: base_url,
|
|
154
164
|
timeout: timeout,
|
|
@@ -176,6 +186,83 @@ module Anthropic
|
|
|
176
186
|
)
|
|
177
187
|
end
|
|
178
188
|
|
|
189
|
+
# User profiles are not supported on the Google Cloud gateway.
|
|
190
|
+
#
|
|
191
|
+
# @raise [NotImplementedError]
|
|
192
|
+
def user_profiles
|
|
193
|
+
raise NotImplementedError.new("User profiles are not supported on the Google Cloud gateway.")
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
# @api private
|
|
197
|
+
#
|
|
198
|
+
# @param req [Hash{Symbol=>Object}] .
|
|
199
|
+
#
|
|
200
|
+
# @option req [Symbol] :method
|
|
201
|
+
#
|
|
202
|
+
# @option req [String, Array<String>] :path
|
|
203
|
+
#
|
|
204
|
+
# @option req [Hash{String=>Array<String>, String, nil}, nil] :query
|
|
205
|
+
#
|
|
206
|
+
# @option req [Hash{String=>String, Integer, Array<String, Integer, nil>, nil}, nil] :headers
|
|
207
|
+
#
|
|
208
|
+
# @option req [Object, nil] :body
|
|
209
|
+
#
|
|
210
|
+
# @option req [Symbol, Integer, Array<Symbol, Integer>, Proc, nil] :unwrap
|
|
211
|
+
#
|
|
212
|
+
# @option req [Class<Anthropic::Internal::Type::BasePage>, nil] :page
|
|
213
|
+
#
|
|
214
|
+
# @option req [Class<Anthropic::Internal::Type::BaseStream>, nil] :stream
|
|
215
|
+
#
|
|
216
|
+
# @option req [Anthropic::Internal::Type::Converter, Class, nil] :model
|
|
217
|
+
#
|
|
218
|
+
# @param opts [Hash{Symbol=>Object}] .
|
|
219
|
+
#
|
|
220
|
+
# @option opts [String, nil] :idempotency_key
|
|
221
|
+
#
|
|
222
|
+
# @option opts [Hash{String=>Array<String>, String, nil}, nil] :extra_query
|
|
223
|
+
#
|
|
224
|
+
# @option opts [Hash{String=>String, nil}, nil] :extra_headers
|
|
225
|
+
#
|
|
226
|
+
# @option opts [Object, nil] :extra_body
|
|
227
|
+
#
|
|
228
|
+
# @option opts [Integer, nil] :max_retries
|
|
229
|
+
#
|
|
230
|
+
# @option opts [Float, nil] :timeout
|
|
231
|
+
#
|
|
232
|
+
# @raise [ArgumentError]
|
|
233
|
+
# @raise [NotImplementedError]
|
|
234
|
+
# @return [Hash{Symbol=>Object}]
|
|
235
|
+
private def build_request(req, opts)
|
|
236
|
+
# Id-parameterized routes pass `path` as an Array whose first element
|
|
237
|
+
# is the format string (e.g. `["v1/user_profiles/%1$s", id]`).
|
|
238
|
+
if Array(req[:path]).first.to_s.start_with?("v1/user_profiles")
|
|
239
|
+
raise NotImplementedError.new("User profiles are not supported on the Google Cloud gateway.")
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
request = super
|
|
243
|
+
return request if @organization_base_url.nil?
|
|
244
|
+
|
|
245
|
+
url = request.fetch(:url)
|
|
246
|
+
under_base_url =
|
|
247
|
+
url.path.start_with?("#{base_url.path}/") &&
|
|
248
|
+
Anthropic::Internal::Util.uri_origin(url) == Anthropic::Internal::Util.uri_origin(base_url)
|
|
249
|
+
return request unless under_base_url
|
|
250
|
+
|
|
251
|
+
path = url.path.delete_prefix(base_url.path)
|
|
252
|
+
if path.start_with?(ORGANIZATION_PATH_PREFIX)
|
|
253
|
+
url = url.dup
|
|
254
|
+
url.path = "#{@organization_base_url.path}#{path}"
|
|
255
|
+
{**request, url: url}
|
|
256
|
+
elsif @workspace_id.nil?
|
|
257
|
+
raise ArgumentError.new(
|
|
258
|
+
"No workspace ID was given. Set the `workspace_id` argument or the " \
|
|
259
|
+
"`ANTHROPIC_GOOGLE_CLOUD_WORKSPACE_ID` environment variable."
|
|
260
|
+
)
|
|
261
|
+
else
|
|
262
|
+
request
|
|
263
|
+
end
|
|
264
|
+
end
|
|
265
|
+
|
|
179
266
|
# @api private
|
|
180
267
|
#
|
|
181
268
|
# Hard guarantee that no first-party `X-Api-Key` / `Authorization`
|
|
@@ -230,9 +317,10 @@ module Anthropic
|
|
|
230
317
|
|
|
231
318
|
# @api private
|
|
232
319
|
#
|
|
320
|
+
# @param template [String]
|
|
233
321
|
# @return [String]
|
|
234
322
|
# @raise [ArgumentError]
|
|
235
|
-
private def derive_base_url
|
|
323
|
+
private def derive_base_url(template)
|
|
236
324
|
if @project.nil?
|
|
237
325
|
raise ArgumentError.new(
|
|
238
326
|
"No project found. Set the `project` argument, set the " \
|
|
@@ -240,13 +328,7 @@ module Anthropic
|
|
|
240
328
|
"application default credentials with a project."
|
|
241
329
|
)
|
|
242
330
|
end
|
|
243
|
-
|
|
244
|
-
raise ArgumentError.new(
|
|
245
|
-
"No workspace ID was given. Set the `workspace_id` argument or the " \
|
|
246
|
-
"`ANTHROPIC_GOOGLE_CLOUD_WORKSPACE_ID` environment variable."
|
|
247
|
-
)
|
|
248
|
-
end
|
|
249
|
-
format(URL_TEMPLATE, project: @project, location: @location, workspace_id: @workspace_id)
|
|
331
|
+
format(template, project: @project, location: @location, workspace_id: @workspace_id)
|
|
250
332
|
end
|
|
251
333
|
|
|
252
334
|
# @api private
|
|
@@ -38,10 +38,11 @@ module Anthropic
|
|
|
38
38
|
# — and the fallback's events are spliced onto the still-open stream, so the
|
|
39
39
|
# client sees one continuous message: a `fallback` content block at each
|
|
40
40
|
# model boundary, monotonic block indices, and per-hop `usage.iterations` on
|
|
41
|
-
# the final `message_delta`. Only `model`
|
|
42
|
-
# path
|
|
43
|
-
#
|
|
44
|
-
#
|
|
41
|
+
# the final `message_delta`. Only `model` and `speed` are honored from each
|
|
42
|
+
# entry on this path. The other per-entry overrides are ignored, because the
|
|
43
|
+
# credit token is tied to the refused request's body. A `speed` value replaces
|
|
44
|
+
# the request's, and `speed: nil` omits it. A `between_tools` thinking config
|
|
45
|
+
# is always sent as `disabled` on this path.
|
|
45
46
|
#
|
|
46
47
|
# Credit tokens are sent in the object form with `mode: :best_effort`, so a
|
|
47
48
|
# failing redemption never rejects the retry — it proceeds at normal price
|
|
@@ -49,6 +50,10 @@ module Anthropic
|
|
|
49
50
|
# beta this requires is sent by default on every request the middleware
|
|
50
51
|
# handles; the `betas:` option controls this.
|
|
51
52
|
#
|
|
53
|
+
# A `speed: "fast"` request that falls back to an entry with no `speed`, and
|
|
54
|
+
# is rejected with a 429 or 529, is retried once on that entry without
|
|
55
|
+
# `speed`. Set `speed: "fast"` on the entry to keep it fast-only.
|
|
56
|
+
#
|
|
52
57
|
# To keep later requests on the model that accepted, pass a
|
|
53
58
|
# {BetaFallbackState} via the `fallback_state` request option; requests
|
|
54
59
|
# sharing that state start directly at the pinned fallback.
|
|
@@ -72,7 +77,7 @@ module Anthropic
|
|
|
72
77
|
# …) patch the original request body for that hop — a value overrides
|
|
73
78
|
# the param, an explicit `nil` unsets it, an absent key keeps the
|
|
74
79
|
# original value (an absent `thinking:` sends `between_tools` as
|
|
75
|
-
# `disabled`).
|
|
80
|
+
# `disabled`). On the streaming path only `speed:` patches it.
|
|
76
81
|
# @param betas [Array<String>] betas added to the `anthropic-beta` header
|
|
77
82
|
# of every `/v1/messages` request this middleware handles. Defaults to
|
|
78
83
|
# `["fallback-credit-2026-07-01"]`; pass `[]` to send none.
|
|
@@ -129,24 +134,24 @@ module Anthropic
|
|
|
129
134
|
end
|
|
130
135
|
|
|
131
136
|
streaming = req.streaming?
|
|
137
|
+
entry = @fallbacks.fetch(start_index) unless start_index == -1
|
|
132
138
|
initial_body =
|
|
133
|
-
if
|
|
139
|
+
if entry.nil?
|
|
134
140
|
body
|
|
135
141
|
elsif streaming
|
|
136
|
-
# Only `model`
|
|
137
|
-
#
|
|
138
|
-
|
|
139
|
-
degrade_between_tools(body.merge(model: @fallbacks.fetch(start_index).fetch(:model)))
|
|
142
|
+
# Only `model` and `speed` are honored on the streaming path: the credit
|
|
143
|
+
# token is tied to the refused request's body.
|
|
144
|
+
degrade_between_tools(patch(body, entry.slice(:speed)).merge(model: entry.fetch(:model)))
|
|
140
145
|
else
|
|
141
|
-
apply_fallback(body,
|
|
146
|
+
apply_fallback(body, entry)
|
|
142
147
|
end
|
|
143
|
-
res = nxt.call(req.with(body: initial_body))
|
|
148
|
+
res = entry ? send_hop(req, nxt, entry, initial_body).first : nxt.call(req.with(body: initial_body))
|
|
144
149
|
return res unless res.status < 300
|
|
145
150
|
|
|
146
151
|
if streaming
|
|
147
152
|
first_hop = start_index + 1
|
|
148
153
|
return res unless first_hop < @fallbacks.length
|
|
149
|
-
return splice_fallback_stream(req, res, nxt,
|
|
154
|
+
return splice_fallback_stream(req, res, nxt, initial_body, first_hop, pin)
|
|
150
155
|
end
|
|
151
156
|
|
|
152
157
|
handle_non_streaming(req, res, nxt, body, start_index, pin)
|
|
@@ -276,6 +281,25 @@ module Anthropic
|
|
|
276
281
|
{token: token, mode: Anthropic::Models::Beta::BetaFallbackCreditTokenParam::Mode::BEST_EFFORT}
|
|
277
282
|
end
|
|
278
283
|
|
|
284
|
+
# Send a request built from `entry`. One that is fast only because the
|
|
285
|
+
# original request was, and is rejected with a 429 or 529, is resent once
|
|
286
|
+
# without `speed`, and that response stands in for the first.
|
|
287
|
+
#
|
|
288
|
+
# @param req [Anthropic::APIRequest]
|
|
289
|
+
# @param nxt [#call]
|
|
290
|
+
# @param entry [Hash{Symbol=>Object}]
|
|
291
|
+
# @param hop_body [Hash{Symbol=>Object}]
|
|
292
|
+
# @return [Array(Anthropic::APIResponse, Boolean)] the response, and whether
|
|
293
|
+
# it answers the resend.
|
|
294
|
+
def send_hop(req, nxt, entry, hop_body)
|
|
295
|
+
res = nxt.call(req.with(body: hop_body))
|
|
296
|
+
return [res, false] unless [429, 529].include?(res.status)
|
|
297
|
+
return [res, false] if entry.key?(:speed) || hop_body[:speed].to_s != "fast"
|
|
298
|
+
|
|
299
|
+
Anthropic::Internal::Util.close_fused!(res.body)
|
|
300
|
+
[nxt.call(req.with(body: hop_body.except(:speed))), true]
|
|
301
|
+
end
|
|
302
|
+
|
|
279
303
|
# --- non-streaming ------------------------------------------------------
|
|
280
304
|
|
|
281
305
|
# @param req [Anthropic::APIRequest]
|
|
@@ -303,7 +327,7 @@ module Anthropic
|
|
|
303
327
|
hop_body = hop_body.merge(fallback_credit_token: credit_token_param(token)) if token
|
|
304
328
|
|
|
305
329
|
begin
|
|
306
|
-
hop_res =
|
|
330
|
+
hop_res = send_hop(req, nxt, entry, hop_body).first
|
|
307
331
|
rescue StandardError
|
|
308
332
|
hop_res = nil
|
|
309
333
|
end
|
|
@@ -359,7 +383,7 @@ module Anthropic
|
|
|
359
383
|
# @param req [Anthropic::APIRequest]
|
|
360
384
|
# @param res [Anthropic::APIResponse]
|
|
361
385
|
# @param nxt [#call]
|
|
362
|
-
# @param body [Hash{Symbol=>Object}] the
|
|
386
|
+
# @param body [Hash{Symbol=>Object}] the body built for stream A
|
|
363
387
|
# @param first_hop [Integer]
|
|
364
388
|
# @param pin [Proc]
|
|
365
389
|
# @return [Anthropic::APIResponse]
|
|
@@ -399,10 +423,12 @@ module Anthropic
|
|
|
399
423
|
iterations = [iteration_usage("message", a[:model] || "", a.dig(:refused, :usage))]
|
|
400
424
|
|
|
401
425
|
(first_hop...@fallbacks.length).each do |hop|
|
|
402
|
-
|
|
426
|
+
entry = @fallbacks.fetch(hop)
|
|
427
|
+
model = entry.fetch(:model).to_s
|
|
403
428
|
has_next = hop + 1 < @fallbacks.length
|
|
404
429
|
|
|
405
|
-
|
|
430
|
+
hop_body = degrade_between_tools(patch(body, entry.slice(:speed)))
|
|
431
|
+
res_b, sent, failed = issue_hop(req, nxt, hop_body, entry, token, base, partial)
|
|
406
432
|
|
|
407
433
|
if failed
|
|
408
434
|
next if has_next
|
|
@@ -465,15 +491,19 @@ module Anthropic
|
|
|
465
491
|
end
|
|
466
492
|
end
|
|
467
493
|
|
|
468
|
-
# Issue one fallback hop with a single 400-on-prefill retry
|
|
494
|
+
# Issue one fallback hop with a single 400-on-prefill retry, which stays
|
|
495
|
+
# without `speed` once the hop has been resent without it.
|
|
469
496
|
#
|
|
470
497
|
# @return [Array(Anthropic::APIResponse, Array<Hash>, false), Array(nil, Array<Hash>, true)]
|
|
471
498
|
# the response, the continuation actually sent (`base + partial`, or
|
|
472
499
|
# `base` if the prefill was dropped on retry), and whether the hop failed.
|
|
473
|
-
def issue_hop(req, nxt, body,
|
|
500
|
+
def issue_hop(req, nxt, body, entry, token, base, partial)
|
|
474
501
|
continuation = base + partial
|
|
475
502
|
2.times do |attempt|
|
|
476
|
-
hop_body = body.merge(
|
|
503
|
+
hop_body = body.merge(
|
|
504
|
+
model: entry.fetch(:model).to_s,
|
|
505
|
+
fallback_credit_token: credit_token_param(token)
|
|
506
|
+
)
|
|
477
507
|
unless continuation.empty?
|
|
478
508
|
hop_body = hop_body.merge(
|
|
479
509
|
messages: body.fetch(:messages) + [{role: :assistant, content: continuation}]
|
|
@@ -481,10 +511,11 @@ module Anthropic
|
|
|
481
511
|
end
|
|
482
512
|
|
|
483
513
|
begin
|
|
484
|
-
res =
|
|
514
|
+
res, resent = send_hop(req, nxt, entry, hop_body)
|
|
485
515
|
rescue StandardError
|
|
486
516
|
return [nil, continuation, true]
|
|
487
517
|
end
|
|
518
|
+
body = body.except(:speed) if resent
|
|
488
519
|
return [res, continuation, false] if res.status < 300
|
|
489
520
|
|
|
490
521
|
if attempt.zero? && res.status == 400 && !partial.empty?
|
|
@@ -141,6 +141,10 @@ module Anthropic
|
|
|
141
141
|
raise NotImplementedError, "Skills are not supported on Vertex."
|
|
142
142
|
end
|
|
143
143
|
|
|
144
|
+
def user_profiles
|
|
145
|
+
raise NotImplementedError, "Managing user profiles is not supported on Vertex."
|
|
146
|
+
end
|
|
147
|
+
|
|
144
148
|
# @api private
|
|
145
149
|
#
|
|
146
150
|
# @param req [Hash{Symbol=>Object}] .
|
|
@@ -185,6 +189,9 @@ module Anthropic
|
|
|
185
189
|
if path.start_with?("v1/messages/batches")
|
|
186
190
|
raise NotImplementedError.new("The Batch API is not supported in the Vertex client yet")
|
|
187
191
|
end
|
|
192
|
+
if path.start_with?("v1/user_profiles")
|
|
193
|
+
raise NotImplementedError.new("Managing user profiles is not supported on Vertex.")
|
|
194
|
+
end
|
|
188
195
|
|
|
189
196
|
super
|
|
190
197
|
end
|