anthropic 1.78.0 → 1.79.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 +35 -0
- data/LICENSE +8 -0
- data/README.md +42 -1
- data/lib/anthropic/client.rb +32 -0
- data/lib/anthropic/helpers/aws/client.rb +12 -2
- data/lib/anthropic/helpers/aws_auth.rb +8 -1
- data/lib/anthropic/helpers/bedrock/client.rb +19 -2
- data/lib/anthropic/helpers/bedrock/mantle_client.rb +19 -2
- data/lib/anthropic/helpers/google_cloud/client.rb +12 -2
- data/lib/anthropic/helpers/streaming/message_stream.rb +20 -43
- data/lib/anthropic/helpers/tools/runner.rb +104 -11
- data/lib/anthropic/helpers/tracing/attributes.rb +34 -0
- data/lib/anthropic/helpers/tracing/config.rb +16 -0
- data/lib/anthropic/helpers/tracing/content.rb +346 -0
- data/lib/anthropic/helpers/tracing/recorders.rb +131 -0
- data/lib/anthropic/helpers/tracing/response.rb +29 -0
- data/lib/anthropic/helpers/tracing/streamed_message.rb +189 -0
- data/lib/anthropic/helpers/tracing/tool_spans.rb +138 -0
- data/lib/anthropic/helpers/tracing.rb +13 -0
- data/lib/anthropic/helpers/vertex/client.rb +19 -2
- data/lib/anthropic/internal/tracing.rb +1118 -0
- data/lib/anthropic/internal/transport/base_client.rb +174 -10
- data/lib/anthropic/internal/transport/pooled_net_requester.rb +6 -0
- data/lib/anthropic/models/anthropic_beta.rb +3 -0
- data/lib/anthropic/models/beta/agent_create_params.rb +17 -6
- data/lib/anthropic/models/beta/agent_update_params.rb +17 -6
- data/lib/anthropic/models/beta/beta_dream_input.rb +2 -2
- data/lib/anthropic/models/beta/beta_fallbacks_param.rb +6 -2
- data/lib/anthropic/models/beta/beta_managed_agents_agent.rb +15 -6
- data/lib/anthropic/models/beta/beta_managed_agents_agent_tool_config_params.rb +8 -8
- data/lib/anthropic/models/beta/beta_managed_agents_agent_toolset_default_config.rb +2 -2
- data/lib/anthropic/models/beta/beta_managed_agents_agent_toolset_default_config_params.rb +2 -2
- data/lib/anthropic/models/beta/beta_managed_agents_agent_with_overrides_params.rb +6 -6
- data/lib/anthropic/models/beta/beta_managed_agents_aws_role_execution_identity.rb +29 -0
- data/lib/anthropic/models/beta/beta_managed_agents_aws_role_execution_identity_params.rb +34 -0
- data/lib/anthropic/models/beta/beta_managed_agents_bash_tool_config.rb +2 -2
- data/lib/anthropic/models/beta/beta_managed_agents_bash_tool_config_params.rb +2 -2
- data/lib/anthropic/models/beta/beta_managed_agents_deployment_initial_event.rb +3 -3
- data/lib/anthropic/models/beta/beta_managed_agents_deployment_initial_event_params.rb +3 -3
- data/lib/anthropic/models/beta/beta_managed_agents_deployment_paused_reason.rb +2 -2
- data/lib/anthropic/models/beta/beta_managed_agents_deployment_paused_reason_error.rb +38 -14
- data/lib/anthropic/models/beta/beta_managed_agents_deployment_run.rb +16 -16
- data/lib/anthropic/models/beta/beta_managed_agents_deployment_user_define_outcome_event.rb +2 -2
- data/lib/anthropic/models/beta/beta_managed_agents_deployment_user_message_event.rb +4 -4
- data/lib/anthropic/models/beta/beta_managed_agents_edit_tool_config.rb +2 -2
- data/lib/anthropic/models/beta/beta_managed_agents_edit_tool_config_params.rb +2 -2
- data/lib/anthropic/models/beta/beta_managed_agents_execution_identity.rb +57 -0
- data/lib/anthropic/models/beta/beta_managed_agents_execution_identity_params.rb +62 -0
- data/lib/anthropic/models/beta/beta_managed_agents_github_repository_resource_config.rb +2 -2
- data/lib/anthropic/models/beta/beta_managed_agents_github_repository_resource_params.rb +2 -2
- data/lib/anthropic/models/beta/beta_managed_agents_glob_tool_config.rb +2 -2
- data/lib/anthropic/models/beta/beta_managed_agents_glob_tool_config_params.rb +2 -2
- data/lib/anthropic/models/beta/beta_managed_agents_grep_tool_config.rb +2 -2
- data/lib/anthropic/models/beta/beta_managed_agents_grep_tool_config_params.rb +2 -2
- data/lib/anthropic/models/beta/beta_managed_agents_mcp_tool_config.rb +2 -2
- data/lib/anthropic/models/beta/beta_managed_agents_mcp_tool_config_params.rb +2 -2
- data/lib/anthropic/models/beta/beta_managed_agents_mcp_toolset_default_config.rb +2 -2
- data/lib/anthropic/models/beta/beta_managed_agents_mcp_toolset_default_config_params.rb +2 -2
- data/lib/anthropic/models/beta/beta_managed_agents_model.rb +0 -2
- data/lib/anthropic/models/beta/beta_managed_agents_model_config.rb +5 -5
- data/lib/anthropic/models/beta/beta_managed_agents_multiagent.rb +1 -1
- data/lib/anthropic/models/beta/beta_managed_agents_multiagent_coordinator.rb +2 -2
- data/lib/anthropic/models/beta/beta_managed_agents_multiagent_params.rb +1 -1
- data/lib/anthropic/models/beta/beta_managed_agents_read_tool_config.rb +2 -2
- data/lib/anthropic/models/beta/beta_managed_agents_read_tool_config_params.rb +2 -2
- data/lib/anthropic/models/beta/beta_managed_agents_service_account_execution_identity.rb +21 -0
- data/lib/anthropic/models/beta/beta_managed_agents_service_account_execution_identity_params.rb +23 -0
- data/lib/anthropic/models/beta/beta_managed_agents_session_agent.rb +16 -6
- data/lib/anthropic/models/beta/beta_managed_agents_session_agent_update.rb +3 -3
- data/lib/anthropic/models/beta/beta_managed_agents_session_multiagent.rb +1 -1
- data/lib/anthropic/models/beta/beta_managed_agents_session_multiagent_coordinator.rb +8 -2
- data/lib/anthropic/models/beta/beta_managed_agents_session_resource_config.rb +3 -3
- data/lib/anthropic/models/beta/beta_managed_agents_session_thread_agent.rb +19 -6
- data/lib/anthropic/models/beta/beta_managed_agents_skill_params.rb +2 -2
- data/lib/anthropic/models/beta/beta_managed_agents_start_event_preview.rb +2 -2
- data/lib/anthropic/models/beta/beta_managed_agents_trigger_context.rb +2 -2
- data/lib/anthropic/models/beta/beta_managed_agents_user_tool_result_event.rb +4 -4
- data/lib/anthropic/models/beta/beta_managed_agents_web_fetch_tool_config.rb +2 -2
- data/lib/anthropic/models/beta/beta_managed_agents_web_fetch_tool_config_params.rb +2 -2
- data/lib/anthropic/models/beta/beta_managed_agents_web_search_tool_config.rb +2 -2
- data/lib/anthropic/models/beta/beta_managed_agents_web_search_tool_config_params.rb +2 -2
- data/lib/anthropic/models/beta/beta_managed_agents_write_tool_config.rb +2 -2
- data/lib/anthropic/models/beta/beta_managed_agents_write_tool_config_params.rb +2 -2
- data/lib/anthropic/models/beta/beta_message_delta_usage.rb +0 -1
- data/lib/anthropic/models/beta/beta_output_behavior.rb +2 -2
- data/lib/anthropic/models/beta/beta_thinking_config_adaptive.rb +6 -4
- data/lib/anthropic/models/beta/beta_thinking_config_enabled.rb +6 -4
- data/lib/anthropic/models/beta/beta_thinking_config_param.rb +8 -7
- data/lib/anthropic/models/beta/beta_usage.rb +0 -1
- data/lib/anthropic/models/beta/deployment_create_params.rb +3 -3
- data/lib/anthropic/models/beta/deployment_update_params.rb +3 -3
- data/lib/anthropic/models/beta/memory_stores/beta_managed_agents_actor.rb +3 -3
- data/lib/anthropic/models/beta/memory_stores/beta_managed_agents_error.rb +6 -3
- data/lib/anthropic/models/beta/memory_stores/beta_managed_agents_memory_list_item.rb +2 -2
- data/lib/anthropic/models/beta/message_count_tokens_params.rb +15 -10
- data/lib/anthropic/models/beta/message_create_params.rb +21 -12
- data/lib/anthropic/models/beta/messages/batch_create_params.rb +21 -12
- data/lib/anthropic/models/beta/organization/beta_analytics_cost_bucketed_result.rb +3 -3
- data/lib/anthropic/models/beta/organization/beta_analytics_cost_users_item.rb +3 -3
- data/lib/anthropic/models/beta/organization/beta_analytics_usage_bucketed_result.rb +3 -3
- data/lib/anthropic/models/beta/organization/beta_analytics_usage_users_item.rb +3 -3
- data/lib/anthropic/models/beta/organization/beta_deleted_telemetry_destination.rb +30 -0
- data/lib/anthropic/models/beta/organization/beta_spend_limit.rb +2 -2
- data/lib/anthropic/models/beta/organization/beta_telemetry_destination.rb +118 -0
- data/lib/anthropic/models/beta/organization/beta_telemetry_destination_content_mode.rb +29 -0
- data/lib/anthropic/models/beta/organization/beta_telemetry_destination_delivery_health.rb +69 -0
- data/lib/anthropic/models/beta/organization/beta_telemetry_destination_disabled_reason.rb +73 -0
- data/lib/anthropic/models/beta/organization/beta_telemetry_destination_disabled_reason_caller.rb +21 -0
- data/lib/anthropic/models/beta/organization/beta_telemetry_destination_disabled_reason_invalid_address.rb +29 -0
- data/lib/anthropic/models/beta/organization/beta_telemetry_destination_disabled_reason_redirect.rb +23 -0
- data/lib/anthropic/models/beta/organization/beta_telemetry_destination_disabled_reason_sustained_failure.rb +25 -0
- data/lib/anthropic/models/beta/organization/beta_telemetry_destination_state.rb +71 -0
- data/lib/anthropic/models/beta/organization/beta_telemetry_destination_state_disabled.rb +36 -0
- data/lib/anthropic/models/beta/organization/beta_telemetry_destination_state_disabled_params.rb +24 -0
- data/lib/anthropic/models/beta/organization/beta_telemetry_destination_state_enabled.rb +21 -0
- data/lib/anthropic/models/beta/organization/beta_telemetry_destination_state_enabled_params.rb +23 -0
- data/lib/anthropic/models/beta/organization/beta_telemetry_destination_state_params.rb +61 -0
- data/lib/anthropic/models/beta/organization/beta_telemetry_destination_test_failure.rb +37 -0
- data/lib/anthropic/models/beta/organization/beta_telemetry_destination_test_response.rb +35 -0
- data/lib/anthropic/models/beta/organization/beta_telemetry_destination_test_result.rb +61 -0
- data/lib/anthropic/models/beta/organization/beta_telemetry_destination_test_success.rb +21 -0
- data/lib/anthropic/models/beta/organization/beta_telemetry_destination_traces.rb +61 -0
- data/lib/anthropic/models/beta/organization/beta_telemetry_destination_traces_params.rb +71 -0
- data/lib/anthropic/models/beta/organization/beta_telemetry_destination_workspaces.rb +69 -0
- data/lib/anthropic/models/beta/organization/beta_telemetry_destination_workspaces_all.rb +23 -0
- data/lib/anthropic/models/beta/organization/beta_telemetry_destination_workspaces_all_params.rb +23 -0
- data/lib/anthropic/models/beta/organization/beta_telemetry_destination_workspaces_exclude.rb +22 -0
- data/lib/anthropic/models/beta/organization/beta_telemetry_destination_workspaces_exclude_params.rb +49 -0
- data/lib/anthropic/models/beta/organization/beta_telemetry_destination_workspaces_include.rb +21 -0
- data/lib/anthropic/models/beta/organization/beta_telemetry_destination_workspaces_include_params.rb +49 -0
- data/lib/anthropic/models/beta/organization/beta_telemetry_destination_workspaces_params.rb +70 -0
- data/lib/anthropic/models/beta/organization/invite_create_params.rb +4 -2
- data/lib/anthropic/models/beta/organization/spend_limit_list_params.rb +2 -5
- data/lib/anthropic/models/beta/organization/telemetry_destination_create_params.rb +93 -0
- data/lib/anthropic/models/beta/organization/telemetry_destination_delete_params.rb +34 -0
- data/lib/anthropic/models/beta/organization/telemetry_destination_list_params.rb +62 -0
- data/lib/anthropic/models/beta/organization/telemetry_destination_retrieve_params.rb +34 -0
- data/lib/anthropic/models/beta/organization/telemetry_destination_test_params.rb +34 -0
- data/lib/anthropic/models/beta/organization/telemetry_destination_update_params.rb +120 -0
- data/lib/anthropic/models/beta/organization/telemetry_destinations/beta_deleted_telemetry_destination_workspace.rb +40 -0
- data/lib/anthropic/models/beta/organization/telemetry_destinations/beta_telemetry_destination_workspace.rb +52 -0
- data/lib/anthropic/models/beta/organization/telemetry_destinations/workspace_add_params.rb +44 -0
- data/lib/anthropic/models/beta/organization/telemetry_destinations/workspace_list_params.rb +57 -0
- data/lib/anthropic/models/beta/organization/telemetry_destinations/workspace_remove_params.rb +44 -0
- data/lib/anthropic/models/beta/organization/user_update_params.rb +4 -2
- data/lib/anthropic/models/beta/session_create_params.rb +5 -5
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_agent_custom_tool_use_event.rb +3 -1
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_agent_mcp_tool_result_event.rb +4 -4
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_agent_message_event.rb +2 -2
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_agent_thread_message_received_event.rb +4 -4
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_agent_thread_message_sent_event.rb +4 -4
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_agent_tool_result_event.rb +4 -4
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_billing_error.rb +3 -3
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_credential_host_unreachable_error.rb +3 -3
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_document_block.rb +4 -4
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_event_params.rb +14 -8
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_github_repository_resource.rb +2 -2
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_image_block.rb +3 -3
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_inline_agent.rb +14 -6
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_mcp_authentication_failed_error.rb +3 -3
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_mcp_connection_failed_error.rb +3 -3
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_model_overloaded_error.rb +3 -3
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_model_rate_limited_error.rb +3 -3
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_model_request_failed_error.rb +3 -3
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_repository_authentication_error.rb +3 -3
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_repository_checkout_error.rb +3 -3
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_repository_clone_error.rb +3 -3
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_repository_forbidden_error.rb +3 -3
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_repository_not_found_error.rb +3 -3
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_send_session_events.rb +8 -8
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_session_error_event.rb +14 -8
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_session_event.rb +64 -37
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_session_resource.rb +3 -3
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_session_status_idle_event.rb +4 -4
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_session_thread.rb +8 -2
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_session_thread_status_idle_event.rb +4 -4
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_stream_session_events.rb +66 -39
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_stream_session_thread_events.rb +66 -39
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_unknown_error.rb +3 -3
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_user_custom_tool_result_event.rb +7 -7
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_user_custom_tool_result_event_params.rb +7 -7
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_user_define_outcome_event.rb +2 -2
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_user_define_outcome_event_params.rb +2 -2
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_user_message_event.rb +4 -4
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_user_message_event_params.rb +4 -4
- data/lib/anthropic/models/beta/sessions/beta_managed_agents_user_tool_result_event_params.rb +4 -4
- data/lib/anthropic/models/beta/sessions/resource_retrieve_response.rb +3 -3
- data/lib/anthropic/models/beta/sessions/resource_update_response.rb +3 -3
- data/lib/anthropic/models/beta/vaults/beta_managed_agents_credential.rb +6 -3
- data/lib/anthropic/models/beta/vaults/beta_managed_agents_credential_networking_params.rb +7 -2
- data/lib/anthropic/models/beta/vaults/beta_managed_agents_environment_variable_auth_response.rb +7 -2
- data/lib/anthropic/models/beta/vaults/beta_managed_agents_mcp_oauth_refresh_params.rb +3 -3
- data/lib/anthropic/models/beta/vaults/beta_managed_agents_mcp_oauth_refresh_response.rb +12 -3
- data/lib/anthropic/models/beta/vaults/beta_managed_agents_mcp_oauth_refresh_update_params.rb +8 -2
- data/lib/anthropic/models/beta/vaults/credential_create_params.rb +6 -3
- data/lib/anthropic/models/beta/vaults/credential_update_params.rb +6 -3
- data/lib/anthropic/models/message_count_tokens_params.rb +15 -10
- data/lib/anthropic/models/message_create_params.rb +15 -10
- data/lib/anthropic/models/messages/batch_create_params.rb +15 -10
- data/lib/anthropic/models/model.rb +0 -2
- data/lib/anthropic/models/organization/invite_create_params.rb +4 -2
- data/lib/anthropic/models/organization/user_update_params.rb +4 -2
- data/lib/anthropic/models/thinking_config_adaptive.rb +6 -4
- data/lib/anthropic/models/thinking_config_enabled.rb +6 -4
- data/lib/anthropic/models/thinking_config_param.rb +8 -7
- data/lib/anthropic/request_options.rb +7 -0
- data/lib/anthropic/resources/beta/agents/versions.rb +4 -0
- data/lib/anthropic/resources/beta/agents.rb +22 -2
- data/lib/anthropic/resources/beta/deployment_runs.rb +16 -0
- data/lib/anthropic/resources/beta/deployments.rb +24 -0
- data/lib/anthropic/resources/beta/dreams.rb +15 -0
- data/lib/anthropic/resources/beta/environments/work.rb +42 -0
- data/lib/anthropic/resources/beta/environments.rb +18 -0
- data/lib/anthropic/resources/beta/files.rb +15 -0
- data/lib/anthropic/resources/beta/memory_stores/memories.rb +31 -0
- data/lib/anthropic/resources/beta/memory_stores/memory_versions.rb +28 -0
- data/lib/anthropic/resources/beta/memory_stores.rb +18 -0
- data/lib/anthropic/resources/beta/messages/batches.rb +19 -1
- data/lib/anthropic/resources/beta/messages.rb +12 -4
- data/lib/anthropic/resources/beta/models.rb +6 -0
- data/lib/anthropic/resources/beta/organization/analytics/apps/chat/projects.rb +3 -0
- data/lib/anthropic/resources/beta/organization/analytics/artifacts.rb +3 -0
- data/lib/anthropic/resources/beta/organization/analytics/connectors.rb +4 -0
- data/lib/anthropic/resources/beta/organization/analytics/cost_report.rb +20 -0
- data/lib/anthropic/resources/beta/organization/analytics/plugins.rb +4 -0
- data/lib/anthropic/resources/beta/organization/analytics/skills.rb +4 -0
- data/lib/anthropic/resources/beta/organization/analytics/summaries.rb +3 -0
- data/lib/anthropic/resources/beta/organization/analytics/usage_report.rb +20 -0
- data/lib/anthropic/resources/beta/organization/analytics/user_cost_report.rb +23 -0
- data/lib/anthropic/resources/beta/organization/analytics/user_usage_report.rb +23 -0
- data/lib/anthropic/resources/beta/organization/analytics/users.rb +4 -0
- data/lib/anthropic/resources/beta/organization/api_keys.rb +9 -0
- data/lib/anthropic/resources/beta/organization/compliance_settings.rb +4 -0
- data/lib/anthropic/resources/beta/organization/external_keys.rb +18 -0
- data/lib/anthropic/resources/beta/organization/federation/issuers.rb +15 -0
- data/lib/anthropic/resources/beta/organization/federation/rules/workspaces.rb +14 -0
- data/lib/anthropic/resources/beta/organization/federation/rules.rb +15 -0
- data/lib/anthropic/resources/beta/organization/invites.rb +12 -0
- data/lib/anthropic/resources/beta/organization/plugin_marketplaces.rb +14 -0
- data/lib/anthropic/resources/beta/organization/plugins/installation_settings.rb +16 -0
- data/lib/anthropic/resources/beta/organization/plugins/shares.rb +4 -0
- data/lib/anthropic/resources/beta/organization/plugins/versions.rb +22 -0
- data/lib/anthropic/resources/beta/organization/plugins.rb +27 -0
- data/lib/anthropic/resources/beta/organization/rate_limits.rb +3 -0
- data/lib/anthropic/resources/beta/organization/rbac_groups/members.rb +14 -0
- data/lib/anthropic/resources/beta/organization/rbac_groups.rb +15 -0
- data/lib/anthropic/resources/beta/organization/rbac_roles/permissions.rb +4 -0
- data/lib/anthropic/resources/beta/organization/rbac_roles.rb +6 -0
- data/lib/anthropic/resources/beta/organization/service_accounts/workspaces.rb +14 -0
- data/lib/anthropic/resources/beta/organization/service_accounts.rb +15 -0
- data/lib/anthropic/resources/beta/organization/spend_limits/effective.rb +5 -2
- data/lib/anthropic/resources/beta/organization/spend_limits/increase_requests.rb +12 -0
- data/lib/anthropic/resources/beta/organization/spend_limits.rb +17 -7
- data/lib/anthropic/resources/beta/organization/telemetry_destinations/workspaces.rb +173 -0
- data/lib/anthropic/resources/beta/organization/telemetry_destinations.rb +274 -0
- data/lib/anthropic/resources/beta/organization/users.rb +12 -0
- data/lib/anthropic/resources/beta/organization/workspaces/members.rb +26 -0
- data/lib/anthropic/resources/beta/organization/workspaces/rate_limits.rb +4 -0
- data/lib/anthropic/resources/beta/organization/workspaces/service_accounts.rb +26 -0
- data/lib/anthropic/resources/beta/organization/workspaces.rb +15 -0
- data/lib/anthropic/resources/beta/organization.rb +7 -0
- data/lib/anthropic/resources/beta/sessions/events.rb +21 -1
- data/lib/anthropic/resources/beta/sessions/resources.rb +26 -0
- data/lib/anthropic/resources/beta/sessions/threads/events.rb +15 -1
- data/lib/anthropic/resources/beta/sessions/threads.rb +16 -0
- data/lib/anthropic/resources/beta/sessions.rb +32 -0
- data/lib/anthropic/resources/beta/skills/versions.rb +17 -0
- data/lib/anthropic/resources/beta/skills.rb +12 -0
- data/lib/anthropic/resources/beta/tunnels/certificates.rb +20 -0
- data/lib/anthropic/resources/beta/tunnels.rb +18 -0
- data/lib/anthropic/resources/beta/user_profiles.rb +15 -0
- data/lib/anthropic/resources/beta/vaults/credentials.rb +38 -0
- data/lib/anthropic/resources/beta/vaults.rb +18 -0
- data/lib/anthropic/resources/completions.rb +5 -1
- data/lib/anthropic/resources/files.rb +15 -0
- data/lib/anthropic/resources/messages/batches.rb +19 -1
- data/lib/anthropic/resources/messages.rb +12 -4
- data/lib/anthropic/resources/models.rb +6 -0
- data/lib/anthropic/resources/organization/api_keys.rb +9 -0
- data/lib/anthropic/resources/organization/compliance_settings.rb +4 -0
- data/lib/anthropic/resources/organization/external_keys.rb +18 -0
- data/lib/anthropic/resources/organization/federation/issuers.rb +15 -0
- data/lib/anthropic/resources/organization/federation/rules/workspaces.rb +14 -0
- data/lib/anthropic/resources/organization/federation/rules.rb +15 -0
- data/lib/anthropic/resources/organization/invites.rb +12 -0
- data/lib/anthropic/resources/organization/rate_limits.rb +3 -0
- data/lib/anthropic/resources/organization/service_accounts/workspaces.rb +14 -0
- data/lib/anthropic/resources/organization/service_accounts.rb +15 -0
- data/lib/anthropic/resources/organization/users.rb +12 -0
- data/lib/anthropic/resources/organization/workspaces/members.rb +26 -0
- data/lib/anthropic/resources/organization/workspaces/rate_limits.rb +4 -0
- data/lib/anthropic/resources/organization/workspaces/service_accounts.rb +26 -0
- data/lib/anthropic/resources/organization/workspaces.rb +15 -0
- data/lib/anthropic/resources/organization.rb +2 -0
- data/lib/anthropic/resources/skills/versions.rb +14 -0
- data/lib/anthropic/resources/skills.rb +12 -0
- data/lib/anthropic/version.rb +1 -1
- data/lib/anthropic.rb +58 -0
- data/rbi/anthropic/client.rbi +28 -0
- data/rbi/anthropic/helpers/aws/client.rbi +6 -2
- data/rbi/anthropic/helpers/bedrock/client.rbi +6 -2
- data/rbi/anthropic/helpers/bedrock/mantle_client.rbi +6 -2
- data/rbi/anthropic/helpers/google_cloud/client.rbi +6 -2
- data/rbi/anthropic/helpers/streaming/message_stream.rbi +4 -1
- data/rbi/anthropic/helpers/vertex/client.rbi +6 -2
- data/rbi/anthropic/internal/tracing.rbi +847 -0
- data/rbi/anthropic/internal/transport/base_client.rbi +93 -5
- data/rbi/anthropic/internal/type/base_stream.rbi +2 -0
- data/rbi/anthropic/models/anthropic_beta.rbi +5 -0
- data/rbi/anthropic/models/beta/agent_create_params.rbi +34 -3
- data/rbi/anthropic/models/beta/agent_update_params.rbi +34 -3
- data/rbi/anthropic/models/beta/beta_fallback_param.rbi +3 -2
- data/rbi/anthropic/models/beta/beta_fallbacks_param.rbi +6 -2
- data/rbi/anthropic/models/beta/beta_managed_agents_agent.rbi +17 -0
- data/rbi/anthropic/models/beta/beta_managed_agents_agent_with_overrides_params.rbi +3 -3
- data/rbi/anthropic/models/beta/beta_managed_agents_aws_role_execution_identity.rbi +40 -0
- data/rbi/anthropic/models/beta/beta_managed_agents_aws_role_execution_identity_params.rbi +42 -0
- data/rbi/anthropic/models/beta/beta_managed_agents_execution_identity.rbi +85 -0
- data/rbi/anthropic/models/beta/beta_managed_agents_execution_identity_params.rbi +87 -0
- data/rbi/anthropic/models/beta/beta_managed_agents_model.rbi +0 -2
- data/rbi/anthropic/models/beta/beta_managed_agents_service_account_execution_identity.rbi +32 -0
- data/rbi/anthropic/models/beta/beta_managed_agents_service_account_execution_identity_params.rbi +33 -0
- data/rbi/anthropic/models/beta/beta_managed_agents_session_agent.rbi +19 -0
- data/rbi/anthropic/models/beta/beta_managed_agents_session_multiagent_coordinator.rbi +9 -0
- data/rbi/anthropic/models/beta/beta_managed_agents_session_thread_agent.rbi +19 -0
- data/rbi/anthropic/models/beta/beta_message_delta_usage.rbi +0 -2
- data/rbi/anthropic/models/beta/beta_thinking_config_adaptive.rbi +9 -6
- data/rbi/anthropic/models/beta/beta_thinking_config_enabled.rbi +9 -6
- data/rbi/anthropic/models/beta/beta_thinking_config_param.rbi +11 -9
- data/rbi/anthropic/models/beta/beta_usage.rbi +0 -2
- data/rbi/anthropic/models/beta/message_count_tokens_params.rbi +28 -18
- data/rbi/anthropic/models/beta/message_create_params.rbi +40 -22
- data/rbi/anthropic/models/beta/messages/batch_create_params.rbi +40 -22
- data/rbi/anthropic/models/beta/organization/beta_analytics_cost_bucketed_result.rbi +6 -6
- data/rbi/anthropic/models/beta/organization/beta_analytics_cost_users_item.rbi +6 -6
- data/rbi/anthropic/models/beta/organization/beta_analytics_usage_bucketed_result.rbi +6 -6
- data/rbi/anthropic/models/beta/organization/beta_analytics_usage_users_item.rbi +6 -6
- data/rbi/anthropic/models/beta/organization/beta_deleted_telemetry_destination.rbi +39 -0
- data/rbi/anthropic/models/beta/organization/beta_spend_limit.rbi +4 -4
- data/rbi/anthropic/models/beta/organization/beta_telemetry_destination.rbi +191 -0
- data/rbi/anthropic/models/beta/organization/beta_telemetry_destination_content_mode.rbi +53 -0
- data/rbi/anthropic/models/beta/organization/beta_telemetry_destination_delivery_health.rbi +106 -0
- data/rbi/anthropic/models/beta/organization/beta_telemetry_destination_disabled_reason.rbi +95 -0
- data/rbi/anthropic/models/beta/organization/beta_telemetry_destination_disabled_reason_caller.rbi +31 -0
- data/rbi/anthropic/models/beta/organization/beta_telemetry_destination_disabled_reason_invalid_address.rbi +39 -0
- data/rbi/anthropic/models/beta/organization/beta_telemetry_destination_disabled_reason_redirect.rbi +33 -0
- data/rbi/anthropic/models/beta/organization/beta_telemetry_destination_disabled_reason_sustained_failure.rbi +35 -0
- data/rbi/anthropic/models/beta/organization/beta_telemetry_destination_state.rbi +99 -0
- data/rbi/anthropic/models/beta/organization/beta_telemetry_destination_state_disabled.rbi +66 -0
- data/rbi/anthropic/models/beta/organization/beta_telemetry_destination_state_disabled_params.rbi +34 -0
- data/rbi/anthropic/models/beta/organization/beta_telemetry_destination_state_enabled.rbi +31 -0
- data/rbi/anthropic/models/beta/organization/beta_telemetry_destination_state_enabled_params.rbi +33 -0
- data/rbi/anthropic/models/beta/organization/beta_telemetry_destination_state_params.rbi +81 -0
- data/rbi/anthropic/models/beta/organization/beta_telemetry_destination_test_failure.rbi +47 -0
- data/rbi/anthropic/models/beta/organization/beta_telemetry_destination_test_response.rbi +62 -0
- data/rbi/anthropic/models/beta/organization/beta_telemetry_destination_test_result.rbi +88 -0
- data/rbi/anthropic/models/beta/organization/beta_telemetry_destination_test_success.rbi +31 -0
- data/rbi/anthropic/models/beta/organization/beta_telemetry_destination_traces.rbi +97 -0
- data/rbi/anthropic/models/beta/organization/beta_telemetry_destination_traces_params.rbi +120 -0
- data/rbi/anthropic/models/beta/organization/beta_telemetry_destination_workspaces.rbi +93 -0
- data/rbi/anthropic/models/beta/organization/beta_telemetry_destination_workspaces_all.rbi +33 -0
- data/rbi/anthropic/models/beta/organization/beta_telemetry_destination_workspaces_all_params.rbi +33 -0
- data/rbi/anthropic/models/beta/organization/beta_telemetry_destination_workspaces_exclude.rbi +32 -0
- data/rbi/anthropic/models/beta/organization/beta_telemetry_destination_workspaces_exclude_params.rbi +80 -0
- data/rbi/anthropic/models/beta/organization/beta_telemetry_destination_workspaces_include.rbi +31 -0
- data/rbi/anthropic/models/beta/organization/beta_telemetry_destination_workspaces_include_params.rbi +80 -0
- data/rbi/anthropic/models/beta/organization/beta_telemetry_destination_workspaces_params.rbi +107 -0
- data/rbi/anthropic/models/beta/organization/invite_create_params.rbi +6 -3
- data/rbi/anthropic/models/beta/organization/spend_limit_list_params.rbi +2 -8
- data/rbi/anthropic/models/beta/organization/telemetry_destination_create_params.rbi +186 -0
- data/rbi/anthropic/models/beta/organization/telemetry_destination_delete_params.rbi +73 -0
- data/rbi/anthropic/models/beta/organization/telemetry_destination_list_params.rbi +114 -0
- data/rbi/anthropic/models/beta/organization/telemetry_destination_retrieve_params.rbi +73 -0
- data/rbi/anthropic/models/beta/organization/telemetry_destination_test_params.rbi +73 -0
- data/rbi/anthropic/models/beta/organization/telemetry_destination_update_params.rbi +264 -0
- data/rbi/anthropic/models/beta/organization/telemetry_destinations/beta_deleted_telemetry_destination_workspace.rbi +61 -0
- data/rbi/anthropic/models/beta/organization/telemetry_destinations/beta_telemetry_destination_workspace.rbi +73 -0
- data/rbi/anthropic/models/beta/organization/telemetry_destinations/workspace_add_params.rbi +84 -0
- data/rbi/anthropic/models/beta/organization/telemetry_destinations/workspace_list_params.rbi +100 -0
- data/rbi/anthropic/models/beta/organization/telemetry_destinations/workspace_remove_params.rbi +84 -0
- data/rbi/anthropic/models/beta/organization/user_update_params.rbi +6 -3
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_agent_custom_tool_use_event.rbi +3 -1
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_event_params.rbi +2 -2
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_inline_agent.rbi +17 -0
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_send_session_events.rbi +2 -2
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_session_event.rbi +2 -2
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_session_thread.rbi +9 -0
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_stream_session_events.rbi +2 -2
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_stream_session_thread_events.rbi +2 -2
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_user_custom_tool_result_event.rbi +4 -4
- data/rbi/anthropic/models/beta/sessions/beta_managed_agents_user_custom_tool_result_event_params.rbi +4 -4
- data/rbi/anthropic/models/message_count_tokens_params.rbi +28 -18
- data/rbi/anthropic/models/message_create_params.rbi +28 -18
- data/rbi/anthropic/models/messages/batch_create_params.rbi +28 -18
- data/rbi/anthropic/models/model.rbi +0 -2
- data/rbi/anthropic/models/organization/invite_create_params.rbi +6 -3
- data/rbi/anthropic/models/organization/user_update_params.rbi +6 -3
- data/rbi/anthropic/models/thinking_config_adaptive.rbi +9 -6
- data/rbi/anthropic/models/thinking_config_enabled.rbi +9 -6
- data/rbi/anthropic/models/thinking_config_param.rbi +11 -9
- data/rbi/anthropic/request_options.rbi +5 -0
- data/rbi/anthropic/resources/beta/agents.rbi +22 -2
- data/rbi/anthropic/resources/beta/messages/batches.rbi +2 -1
- data/rbi/anthropic/resources/beta/messages.rbi +56 -32
- data/rbi/anthropic/resources/beta/organization/invites.rbi +2 -1
- data/rbi/anthropic/resources/beta/organization/spend_limits/effective.rbi +2 -2
- data/rbi/anthropic/resources/beta/organization/spend_limits.rbi +5 -10
- data/rbi/anthropic/resources/beta/organization/telemetry_destinations/workspaces.rbi +124 -0
- data/rbi/anthropic/resources/beta/organization/telemetry_destinations.rbi +300 -0
- data/rbi/anthropic/resources/beta/organization/users.rbi +2 -1
- data/rbi/anthropic/resources/beta/organization.rbi +7 -0
- data/rbi/anthropic/resources/beta/sessions/events.rbi +2 -1
- data/rbi/anthropic/resources/beta/sessions/threads/events.rbi +2 -1
- data/rbi/anthropic/resources/completions.rbi +6 -1
- data/rbi/anthropic/resources/messages/batches.rbi +2 -1
- data/rbi/anthropic/resources/messages.rbi +44 -28
- data/rbi/anthropic/resources/organization/invites.rbi +2 -1
- data/rbi/anthropic/resources/organization/users.rbi +2 -1
- data/sig/anthropic/client.rbs +1 -0
- data/sig/anthropic/helpers/bedrock/client.rbs +2 -1
- data/sig/anthropic/helpers/google_cloud/client.rbs +2 -1
- data/sig/anthropic/helpers/streaming/message_stream.rbs +2 -2
- data/sig/anthropic/helpers/vertex/client.rbs +2 -1
- data/sig/anthropic/internal/tracing.rbs +477 -0
- data/sig/anthropic/internal/transport/base_client.rbs +37 -2
- data/sig/anthropic/internal/type/base_stream.rbs +1 -1
- 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_aws_role_execution_identity.rbs +20 -0
- data/sig/anthropic/models/beta/beta_managed_agents_aws_role_execution_identity_params.rbs +20 -0
- data/sig/anthropic/models/beta/beta_managed_agents_execution_identity.rbs +42 -0
- data/sig/anthropic/models/beta/beta_managed_agents_execution_identity_params.rbs +42 -0
- data/sig/anthropic/models/beta/beta_managed_agents_model.rbs +0 -2
- data/sig/anthropic/models/beta/beta_managed_agents_service_account_execution_identity.rbs +18 -0
- data/sig/anthropic/models/beta/beta_managed_agents_service_account_execution_identity_params.rbs +18 -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 +2 -0
- data/sig/anthropic/models/beta/beta_managed_agents_session_thread_agent.rbs +5 -0
- data/sig/anthropic/models/beta/organization/beta_deleted_telemetry_destination.rbs +23 -0
- data/sig/anthropic/models/beta/organization/beta_telemetry_destination.rbs +74 -0
- data/sig/anthropic/models/beta/organization/beta_telemetry_destination_content_mode.rbs +23 -0
- data/sig/anthropic/models/beta/organization/beta_telemetry_destination_delivery_health.rbs +30 -0
- data/sig/anthropic/models/beta/organization/beta_telemetry_destination_disabled_reason.rbs +51 -0
- data/sig/anthropic/models/beta/organization/beta_telemetry_destination_disabled_reason_caller.rbs +18 -0
- data/sig/anthropic/models/beta/organization/beta_telemetry_destination_disabled_reason_invalid_address.rbs +18 -0
- data/sig/anthropic/models/beta/organization/beta_telemetry_destination_disabled_reason_redirect.rbs +18 -0
- data/sig/anthropic/models/beta/organization/beta_telemetry_destination_disabled_reason_sustained_failure.rbs +18 -0
- data/sig/anthropic/models/beta/organization/beta_telemetry_destination_state.rbs +42 -0
- data/sig/anthropic/models/beta/organization/beta_telemetry_destination_state_disabled.rbs +29 -0
- data/sig/anthropic/models/beta/organization/beta_telemetry_destination_state_disabled_params.rbs +18 -0
- data/sig/anthropic/models/beta/organization/beta_telemetry_destination_state_enabled.rbs +17 -0
- data/sig/anthropic/models/beta/organization/beta_telemetry_destination_state_enabled_params.rbs +18 -0
- data/sig/anthropic/models/beta/organization/beta_telemetry_destination_state_params.rbs +40 -0
- data/sig/anthropic/models/beta/organization/beta_telemetry_destination_test_failure.rbs +20 -0
- data/sig/anthropic/models/beta/organization/beta_telemetry_destination_test_response.rbs +29 -0
- data/sig/anthropic/models/beta/organization/beta_telemetry_destination_test_result.rbs +42 -0
- data/sig/anthropic/models/beta/organization/beta_telemetry_destination_test_success.rbs +17 -0
- data/sig/anthropic/models/beta/organization/beta_telemetry_destination_traces.rbs +39 -0
- data/sig/anthropic/models/beta/organization/beta_telemetry_destination_traces_params.rbs +41 -0
- data/sig/anthropic/models/beta/organization/beta_telemetry_destination_workspaces.rbs +45 -0
- data/sig/anthropic/models/beta/organization/beta_telemetry_destination_workspaces_all.rbs +17 -0
- data/sig/anthropic/models/beta/organization/beta_telemetry_destination_workspaces_all_params.rbs +17 -0
- data/sig/anthropic/models/beta/organization/beta_telemetry_destination_workspaces_exclude.rbs +17 -0
- data/sig/anthropic/models/beta/organization/beta_telemetry_destination_workspaces_exclude_params.rbs +25 -0
- data/sig/anthropic/models/beta/organization/beta_telemetry_destination_workspaces_include.rbs +17 -0
- data/sig/anthropic/models/beta/organization/beta_telemetry_destination_workspaces_include_params.rbs +25 -0
- data/sig/anthropic/models/beta/organization/beta_telemetry_destination_workspaces_params.rbs +48 -0
- data/sig/anthropic/models/beta/organization/telemetry_destination_create_params.rbs +65 -0
- data/sig/anthropic/models/beta/organization/telemetry_destination_delete_params.rbs +39 -0
- data/sig/anthropic/models/beta/organization/telemetry_destination_list_params.rbs +55 -0
- data/sig/anthropic/models/beta/organization/telemetry_destination_retrieve_params.rbs +39 -0
- data/sig/anthropic/models/beta/organization/telemetry_destination_test_params.rbs +39 -0
- data/sig/anthropic/models/beta/organization/telemetry_destination_update_params.rbs +79 -0
- data/sig/anthropic/models/beta/organization/telemetry_destinations/beta_deleted_telemetry_destination_workspace.rbs +36 -0
- data/sig/anthropic/models/beta/organization/telemetry_destinations/beta_telemetry_destination_workspace.rbs +41 -0
- data/sig/anthropic/models/beta/organization/telemetry_destinations/workspace_add_params.rbs +46 -0
- data/sig/anthropic/models/beta/organization/telemetry_destinations/workspace_list_params.rbs +55 -0
- data/sig/anthropic/models/beta/organization/telemetry_destinations/workspace_remove_params.rbs +46 -0
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_inline_agent.rbs +5 -0
- data/sig/anthropic/models/beta/sessions/beta_managed_agents_session_thread.rbs +3 -0
- data/sig/anthropic/models/model.rbs +0 -2
- data/sig/anthropic/request_options.rbs +3 -0
- data/sig/anthropic/resources/beta/agents.rbs +2 -0
- data/sig/anthropic/resources/beta/messages/batches.rbs +1 -1
- data/sig/anthropic/resources/beta/messages.rbs +1 -1
- data/sig/anthropic/resources/beta/organization/telemetry_destinations/workspaces.rbs +35 -0
- data/sig/anthropic/resources/beta/organization/telemetry_destinations.rbs +61 -0
- data/sig/anthropic/resources/beta/organization.rbs +2 -0
- data/sig/anthropic/resources/beta/sessions/events.rbs +1 -1
- data/sig/anthropic/resources/beta/sessions/threads/events.rbs +1 -1
- data/sig/anthropic/resources/completions.rbs +1 -1
- data/sig/anthropic/resources/messages/batches.rbs +1 -1
- data/sig/anthropic/resources/messages.rbs +1 -1
- metadata +178 -2
|
@@ -0,0 +1,847 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Internal
|
|
5
|
+
# @api private
|
|
6
|
+
#
|
|
7
|
+
# What a streaming method returns when its API call has a recording span. Reading
|
|
8
|
+
# or closing it reads or closes the SDK's own stream, and ends the span.
|
|
9
|
+
class TracedStream
|
|
10
|
+
Message = type_member(:in) { { fixed: T.anything } }
|
|
11
|
+
Elem = type_member(:out)
|
|
12
|
+
|
|
13
|
+
include Anthropic::Internal::Type::BaseStream
|
|
14
|
+
|
|
15
|
+
# What a recorder that follows this stream has read of it.
|
|
16
|
+
sig { returns(T.nilable(T.anything)) }
|
|
17
|
+
attr_reader :streamed_message
|
|
18
|
+
|
|
19
|
+
# @api private
|
|
20
|
+
sig do
|
|
21
|
+
params(
|
|
22
|
+
stream: Anthropic::Internal::Type::BaseStream[T.noreturn, Elem],
|
|
23
|
+
iterator: T::Enumerable[Elem],
|
|
24
|
+
streamed_message: T.nilable(T.anything)
|
|
25
|
+
).void
|
|
26
|
+
end
|
|
27
|
+
def initialize(
|
|
28
|
+
# the SDK's own stream
|
|
29
|
+
stream,
|
|
30
|
+
# reads `stream`, and ends the span
|
|
31
|
+
iterator,
|
|
32
|
+
streamed_message
|
|
33
|
+
)
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# @api private
|
|
38
|
+
#
|
|
39
|
+
# One `CLIENT` span per API call: every retry of an SDK method's request, and
|
|
40
|
+
# reading the stream it returns. The SDK emits no span per HTTP attempt.
|
|
41
|
+
module Tracing
|
|
42
|
+
INSTRUMENTATION_SCOPE = "com.anthropic.sdk.ruby"
|
|
43
|
+
|
|
44
|
+
ERROR_TYPE = "error.type"
|
|
45
|
+
HTTP_REQUEST_METHOD = "http.request.method"
|
|
46
|
+
HTTP_REQUEST_RESEND_COUNT = "http.request.resend_count"
|
|
47
|
+
HTTP_RESPONSE_STATUS_CODE = "http.response.status_code"
|
|
48
|
+
HTTP_ROUTE = "http.route"
|
|
49
|
+
SERVER_ADDRESS = "server.address"
|
|
50
|
+
SERVER_PORT = "server.port"
|
|
51
|
+
URL_FULL = "url.full"
|
|
52
|
+
URL_PATH = "url.path"
|
|
53
|
+
URL_QUERY = "url.query"
|
|
54
|
+
URL_SCHEME = "url.scheme"
|
|
55
|
+
|
|
56
|
+
GEN_AI_PROVIDER_NAME = "gen_ai.provider.name"
|
|
57
|
+
ANTHROPIC_REQUEST_ID = "anthropic.request.id"
|
|
58
|
+
ANTHROPIC_ORGANIZATION_ID = "anthropic.organization.id"
|
|
59
|
+
ANTHROPIC_WORKSPACE_ID = "anthropic.workspace.id"
|
|
60
|
+
GEN_AI_OPERATION_NAME = "gen_ai.operation.name"
|
|
61
|
+
GEN_AI_REQUEST_MODEL = "gen_ai.request.model"
|
|
62
|
+
GEN_AI_REQUEST_MAX_TOKENS = "gen_ai.request.max_tokens"
|
|
63
|
+
GEN_AI_REQUEST_TEMPERATURE = "gen_ai.request.temperature"
|
|
64
|
+
GEN_AI_REQUEST_TOP_P = "gen_ai.request.top_p"
|
|
65
|
+
GEN_AI_REQUEST_TOP_K = "gen_ai.request.top_k"
|
|
66
|
+
GEN_AI_REQUEST_REASONING_LEVEL = "gen_ai.request.reasoning.level"
|
|
67
|
+
ANTHROPIC_REQUEST_SERVICE_TIER = "anthropic.request.service_tier"
|
|
68
|
+
ANTHROPIC_THINKING_TYPE = "anthropic.thinking.type"
|
|
69
|
+
ANTHROPIC_THINKING_BUDGET_TOKENS = "anthropic.thinking.budget_tokens"
|
|
70
|
+
ANTHROPIC_BETA = "anthropic.beta"
|
|
71
|
+
GEN_AI_REQUEST_STREAM = "gen_ai.request.stream"
|
|
72
|
+
GEN_AI_RESPONSE_ID = "gen_ai.response.id"
|
|
73
|
+
GEN_AI_RESPONSE_MODEL = "gen_ai.response.model"
|
|
74
|
+
GEN_AI_USAGE_CACHE_WRITE_INPUT_TOKENS =
|
|
75
|
+
"gen_ai.usage.cache_write.input_tokens"
|
|
76
|
+
GEN_AI_USAGE_CACHE_READ_INPUT_TOKENS =
|
|
77
|
+
"gen_ai.usage.cache_read.input_tokens"
|
|
78
|
+
ANTHROPIC_USAGE_CACHE_CREATION_EPHEMERAL_5M_INPUT_TOKENS =
|
|
79
|
+
"anthropic.usage.cache_creation.ephemeral_5m_input_tokens"
|
|
80
|
+
ANTHROPIC_USAGE_CACHE_CREATION_EPHEMERAL_1H_INPUT_TOKENS =
|
|
81
|
+
"anthropic.usage.cache_creation.ephemeral_1h_input_tokens"
|
|
82
|
+
ANTHROPIC_RESPONSE_SERVICE_TIER = "anthropic.response.service_tier"
|
|
83
|
+
GEN_AI_USAGE_OUTPUT_TOKENS = "gen_ai.usage.output_tokens"
|
|
84
|
+
GEN_AI_USAGE_REASONING_OUTPUT_TOKENS =
|
|
85
|
+
"gen_ai.usage.reasoning.output_tokens"
|
|
86
|
+
ANTHROPIC_MESSAGE_STOP_REASON = "anthropic.message.stop_reason"
|
|
87
|
+
ANTHROPIC_MESSAGE_COUNT_TOKENS_INPUT_TOKENS =
|
|
88
|
+
"anthropic.message.count_tokens.input_tokens"
|
|
89
|
+
ANTHROPIC_SESSION_ENVIRONMENT_ID = "anthropic.session.environment.id"
|
|
90
|
+
GEN_AI_AGENT_NAME = "gen_ai.agent.name"
|
|
91
|
+
|
|
92
|
+
# @api private
|
|
93
|
+
#
|
|
94
|
+
# The span name of each SDK method. Code that names a span through these fails to
|
|
95
|
+
# load once no method has the name.
|
|
96
|
+
module SpanName
|
|
97
|
+
COMPLETIONS_CREATE = "anthropic.completions.create"
|
|
98
|
+
MESSAGES_CREATE = "anthropic.messages.create"
|
|
99
|
+
MESSAGES_COUNT_TOKENS = "anthropic.messages.count_tokens"
|
|
100
|
+
MESSAGES_BATCHES_CREATE = "anthropic.messages.batches.create"
|
|
101
|
+
MESSAGES_BATCHES_RETRIEVE = "anthropic.messages.batches.retrieve"
|
|
102
|
+
MESSAGES_BATCHES_LIST = "anthropic.messages.batches.list"
|
|
103
|
+
MESSAGES_BATCHES_DELETE = "anthropic.messages.batches.delete"
|
|
104
|
+
MESSAGES_BATCHES_CANCEL = "anthropic.messages.batches.cancel"
|
|
105
|
+
MESSAGES_BATCHES_RESULTS = "anthropic.messages.batches.results"
|
|
106
|
+
MODELS_RETRIEVE = "anthropic.models.retrieve"
|
|
107
|
+
MODELS_LIST = "anthropic.models.list"
|
|
108
|
+
FILES_LIST = "anthropic.files.list"
|
|
109
|
+
FILES_DELETE = "anthropic.files.delete"
|
|
110
|
+
FILES_DOWNLOAD = "anthropic.files.download"
|
|
111
|
+
FILES_RETRIEVE_METADATA = "anthropic.files.retrieve_metadata"
|
|
112
|
+
FILES_UPLOAD = "anthropic.files.upload"
|
|
113
|
+
SKILLS_CREATE = "anthropic.skills.create"
|
|
114
|
+
SKILLS_RETRIEVE = "anthropic.skills.retrieve"
|
|
115
|
+
SKILLS_LIST = "anthropic.skills.list"
|
|
116
|
+
SKILLS_DELETE = "anthropic.skills.delete"
|
|
117
|
+
SKILLS_VERSIONS_CREATE = "anthropic.skills.versions.create"
|
|
118
|
+
SKILLS_VERSIONS_RETRIEVE = "anthropic.skills.versions.retrieve"
|
|
119
|
+
SKILLS_VERSIONS_LIST = "anthropic.skills.versions.list"
|
|
120
|
+
SKILLS_VERSIONS_DELETE = "anthropic.skills.versions.delete"
|
|
121
|
+
ORGANIZATION_RETRIEVE = "anthropic.organization.retrieve"
|
|
122
|
+
ORGANIZATION_API_KEYS_RETRIEVE =
|
|
123
|
+
"anthropic.organization.api_keys.retrieve"
|
|
124
|
+
ORGANIZATION_API_KEYS_UPDATE = "anthropic.organization.api_keys.update"
|
|
125
|
+
ORGANIZATION_API_KEYS_LIST = "anthropic.organization.api_keys.list"
|
|
126
|
+
ORGANIZATION_EXTERNAL_KEYS_CREATE =
|
|
127
|
+
"anthropic.organization.external_keys.create"
|
|
128
|
+
ORGANIZATION_EXTERNAL_KEYS_RETRIEVE =
|
|
129
|
+
"anthropic.organization.external_keys.retrieve"
|
|
130
|
+
ORGANIZATION_EXTERNAL_KEYS_UPDATE =
|
|
131
|
+
"anthropic.organization.external_keys.update"
|
|
132
|
+
ORGANIZATION_EXTERNAL_KEYS_LIST =
|
|
133
|
+
"anthropic.organization.external_keys.list"
|
|
134
|
+
ORGANIZATION_EXTERNAL_KEYS_DELETE =
|
|
135
|
+
"anthropic.organization.external_keys.delete"
|
|
136
|
+
ORGANIZATION_EXTERNAL_KEYS_VALIDATE =
|
|
137
|
+
"anthropic.organization.external_keys.validate"
|
|
138
|
+
ORGANIZATION_FEDERATION_ISSUERS_CREATE =
|
|
139
|
+
"anthropic.organization.federation.issuers.create"
|
|
140
|
+
ORGANIZATION_FEDERATION_ISSUERS_RETRIEVE =
|
|
141
|
+
"anthropic.organization.federation.issuers.retrieve"
|
|
142
|
+
ORGANIZATION_FEDERATION_ISSUERS_UPDATE =
|
|
143
|
+
"anthropic.organization.federation.issuers.update"
|
|
144
|
+
ORGANIZATION_FEDERATION_ISSUERS_LIST =
|
|
145
|
+
"anthropic.organization.federation.issuers.list"
|
|
146
|
+
ORGANIZATION_FEDERATION_ISSUERS_ARCHIVE =
|
|
147
|
+
"anthropic.organization.federation.issuers.archive"
|
|
148
|
+
ORGANIZATION_FEDERATION_RULES_CREATE =
|
|
149
|
+
"anthropic.organization.federation.rules.create"
|
|
150
|
+
ORGANIZATION_FEDERATION_RULES_RETRIEVE =
|
|
151
|
+
"anthropic.organization.federation.rules.retrieve"
|
|
152
|
+
ORGANIZATION_FEDERATION_RULES_UPDATE =
|
|
153
|
+
"anthropic.organization.federation.rules.update"
|
|
154
|
+
ORGANIZATION_FEDERATION_RULES_LIST =
|
|
155
|
+
"anthropic.organization.federation.rules.list"
|
|
156
|
+
ORGANIZATION_FEDERATION_RULES_ARCHIVE =
|
|
157
|
+
"anthropic.organization.federation.rules.archive"
|
|
158
|
+
ORGANIZATION_FEDERATION_RULES_WORKSPACES_LIST =
|
|
159
|
+
"anthropic.organization.federation.rules.workspaces.list"
|
|
160
|
+
ORGANIZATION_FEDERATION_RULES_WORKSPACES_ADD =
|
|
161
|
+
"anthropic.organization.federation.rules.workspaces.add"
|
|
162
|
+
ORGANIZATION_FEDERATION_RULES_WORKSPACES_REMOVE =
|
|
163
|
+
"anthropic.organization.federation.rules.workspaces.remove"
|
|
164
|
+
ORGANIZATION_INVITES_CREATE = "anthropic.organization.invites.create"
|
|
165
|
+
ORGANIZATION_INVITES_RETRIEVE =
|
|
166
|
+
"anthropic.organization.invites.retrieve"
|
|
167
|
+
ORGANIZATION_INVITES_LIST = "anthropic.organization.invites.list"
|
|
168
|
+
ORGANIZATION_INVITES_DELETE = "anthropic.organization.invites.delete"
|
|
169
|
+
ORGANIZATION_SERVICE_ACCOUNTS_CREATE =
|
|
170
|
+
"anthropic.organization.service_accounts.create"
|
|
171
|
+
ORGANIZATION_SERVICE_ACCOUNTS_RETRIEVE =
|
|
172
|
+
"anthropic.organization.service_accounts.retrieve"
|
|
173
|
+
ORGANIZATION_SERVICE_ACCOUNTS_UPDATE =
|
|
174
|
+
"anthropic.organization.service_accounts.update"
|
|
175
|
+
ORGANIZATION_SERVICE_ACCOUNTS_LIST =
|
|
176
|
+
"anthropic.organization.service_accounts.list"
|
|
177
|
+
ORGANIZATION_SERVICE_ACCOUNTS_ARCHIVE =
|
|
178
|
+
"anthropic.organization.service_accounts.archive"
|
|
179
|
+
ORGANIZATION_SERVICE_ACCOUNTS_WORKSPACES_LIST =
|
|
180
|
+
"anthropic.organization.service_accounts.workspaces.list"
|
|
181
|
+
ORGANIZATION_SERVICE_ACCOUNTS_WORKSPACES_ADD =
|
|
182
|
+
"anthropic.organization.service_accounts.workspaces.add"
|
|
183
|
+
ORGANIZATION_SERVICE_ACCOUNTS_WORKSPACES_REMOVE =
|
|
184
|
+
"anthropic.organization.service_accounts.workspaces.remove"
|
|
185
|
+
ORGANIZATION_USERS_RETRIEVE = "anthropic.organization.users.retrieve"
|
|
186
|
+
ORGANIZATION_USERS_UPDATE = "anthropic.organization.users.update"
|
|
187
|
+
ORGANIZATION_USERS_LIST = "anthropic.organization.users.list"
|
|
188
|
+
ORGANIZATION_USERS_REMOVE = "anthropic.organization.users.remove"
|
|
189
|
+
ORGANIZATION_WORKSPACES_CREATE =
|
|
190
|
+
"anthropic.organization.workspaces.create"
|
|
191
|
+
ORGANIZATION_WORKSPACES_RETRIEVE =
|
|
192
|
+
"anthropic.organization.workspaces.retrieve"
|
|
193
|
+
ORGANIZATION_WORKSPACES_UPDATE =
|
|
194
|
+
"anthropic.organization.workspaces.update"
|
|
195
|
+
ORGANIZATION_WORKSPACES_LIST = "anthropic.organization.workspaces.list"
|
|
196
|
+
ORGANIZATION_WORKSPACES_ARCHIVE =
|
|
197
|
+
"anthropic.organization.workspaces.archive"
|
|
198
|
+
ORGANIZATION_WORKSPACES_RATE_LIMITS_LIST =
|
|
199
|
+
"anthropic.organization.workspaces.rate_limits.list"
|
|
200
|
+
ORGANIZATION_WORKSPACES_MEMBERS_RETRIEVE =
|
|
201
|
+
"anthropic.organization.workspaces.members.retrieve"
|
|
202
|
+
ORGANIZATION_WORKSPACES_MEMBERS_UPDATE =
|
|
203
|
+
"anthropic.organization.workspaces.members.update"
|
|
204
|
+
ORGANIZATION_WORKSPACES_MEMBERS_LIST =
|
|
205
|
+
"anthropic.organization.workspaces.members.list"
|
|
206
|
+
ORGANIZATION_WORKSPACES_MEMBERS_ADD =
|
|
207
|
+
"anthropic.organization.workspaces.members.add"
|
|
208
|
+
ORGANIZATION_WORKSPACES_MEMBERS_REMOVE =
|
|
209
|
+
"anthropic.organization.workspaces.members.remove"
|
|
210
|
+
ORGANIZATION_WORKSPACES_SERVICE_ACCOUNTS_RETRIEVE =
|
|
211
|
+
"anthropic.organization.workspaces.service_accounts.retrieve"
|
|
212
|
+
ORGANIZATION_WORKSPACES_SERVICE_ACCOUNTS_UPDATE =
|
|
213
|
+
"anthropic.organization.workspaces.service_accounts.update"
|
|
214
|
+
ORGANIZATION_WORKSPACES_SERVICE_ACCOUNTS_LIST =
|
|
215
|
+
"anthropic.organization.workspaces.service_accounts.list"
|
|
216
|
+
ORGANIZATION_WORKSPACES_SERVICE_ACCOUNTS_ADD =
|
|
217
|
+
"anthropic.organization.workspaces.service_accounts.add"
|
|
218
|
+
ORGANIZATION_WORKSPACES_SERVICE_ACCOUNTS_REMOVE =
|
|
219
|
+
"anthropic.organization.workspaces.service_accounts.remove"
|
|
220
|
+
ORGANIZATION_RATE_LIMITS_LIST =
|
|
221
|
+
"anthropic.organization.rate_limits.list"
|
|
222
|
+
ORGANIZATION_COMPLIANCE_SETTINGS_RETRIEVE =
|
|
223
|
+
"anthropic.organization.compliance_settings.retrieve"
|
|
224
|
+
ORGANIZATION_COMPLIANCE_SETTINGS_UPDATE =
|
|
225
|
+
"anthropic.organization.compliance_settings.update"
|
|
226
|
+
AGENTS_CREATE = "anthropic.agents.create"
|
|
227
|
+
AGENTS_RETRIEVE = "anthropic.agents.retrieve"
|
|
228
|
+
AGENTS_UPDATE = "anthropic.agents.update"
|
|
229
|
+
AGENTS_LIST = "anthropic.agents.list"
|
|
230
|
+
AGENTS_ARCHIVE = "anthropic.agents.archive"
|
|
231
|
+
AGENTS_VERSIONS_LIST = "anthropic.agents.versions.list"
|
|
232
|
+
ENVIRONMENTS_CREATE = "anthropic.environments.create"
|
|
233
|
+
ENVIRONMENTS_RETRIEVE = "anthropic.environments.retrieve"
|
|
234
|
+
ENVIRONMENTS_UPDATE = "anthropic.environments.update"
|
|
235
|
+
ENVIRONMENTS_LIST = "anthropic.environments.list"
|
|
236
|
+
ENVIRONMENTS_DELETE = "anthropic.environments.delete"
|
|
237
|
+
ENVIRONMENTS_ARCHIVE = "anthropic.environments.archive"
|
|
238
|
+
ENVIRONMENTS_WORK_RETRIEVE = "anthropic.environments.work.retrieve"
|
|
239
|
+
ENVIRONMENTS_WORK_UPDATE = "anthropic.environments.work.update"
|
|
240
|
+
ENVIRONMENTS_WORK_LIST = "anthropic.environments.work.list"
|
|
241
|
+
ENVIRONMENTS_WORK_ACK = "anthropic.environments.work.ack"
|
|
242
|
+
ENVIRONMENTS_WORK_HEARTBEAT = "anthropic.environments.work.heartbeat"
|
|
243
|
+
ENVIRONMENTS_WORK_POLL = "anthropic.environments.work.poll"
|
|
244
|
+
ENVIRONMENTS_WORK_STATS = "anthropic.environments.work.stats"
|
|
245
|
+
ENVIRONMENTS_WORK_STOP = "anthropic.environments.work.stop"
|
|
246
|
+
SESSIONS_CREATE = "anthropic.sessions.create"
|
|
247
|
+
SESSIONS_RETRIEVE = "anthropic.sessions.retrieve"
|
|
248
|
+
SESSIONS_UPDATE = "anthropic.sessions.update"
|
|
249
|
+
SESSIONS_LIST = "anthropic.sessions.list"
|
|
250
|
+
SESSIONS_DELETE = "anthropic.sessions.delete"
|
|
251
|
+
SESSIONS_ARCHIVE = "anthropic.sessions.archive"
|
|
252
|
+
SESSIONS_EVENTS_LIST = "anthropic.sessions.events.list"
|
|
253
|
+
SESSIONS_EVENTS_SEND = "anthropic.sessions.events.send"
|
|
254
|
+
SESSIONS_EVENTS_STREAM = "anthropic.sessions.events.stream"
|
|
255
|
+
SESSIONS_RESOURCES_RETRIEVE = "anthropic.sessions.resources.retrieve"
|
|
256
|
+
SESSIONS_RESOURCES_UPDATE = "anthropic.sessions.resources.update"
|
|
257
|
+
SESSIONS_RESOURCES_LIST = "anthropic.sessions.resources.list"
|
|
258
|
+
SESSIONS_RESOURCES_DELETE = "anthropic.sessions.resources.delete"
|
|
259
|
+
SESSIONS_RESOURCES_ADD = "anthropic.sessions.resources.add"
|
|
260
|
+
SESSIONS_THREADS_RETRIEVE = "anthropic.sessions.threads.retrieve"
|
|
261
|
+
SESSIONS_THREADS_LIST = "anthropic.sessions.threads.list"
|
|
262
|
+
SESSIONS_THREADS_ARCHIVE = "anthropic.sessions.threads.archive"
|
|
263
|
+
SESSIONS_THREADS_EVENTS_LIST = "anthropic.sessions.threads.events.list"
|
|
264
|
+
SESSIONS_THREADS_EVENTS_STREAM =
|
|
265
|
+
"anthropic.sessions.threads.events.stream"
|
|
266
|
+
DEPLOYMENTS_CREATE = "anthropic.deployments.create"
|
|
267
|
+
DEPLOYMENTS_RETRIEVE = "anthropic.deployments.retrieve"
|
|
268
|
+
DEPLOYMENTS_UPDATE = "anthropic.deployments.update"
|
|
269
|
+
DEPLOYMENTS_LIST = "anthropic.deployments.list"
|
|
270
|
+
DEPLOYMENTS_ARCHIVE = "anthropic.deployments.archive"
|
|
271
|
+
DEPLOYMENTS_PAUSE = "anthropic.deployments.pause"
|
|
272
|
+
DEPLOYMENTS_RUN = "anthropic.deployments.run"
|
|
273
|
+
DEPLOYMENTS_UNPAUSE = "anthropic.deployments.unpause"
|
|
274
|
+
DEPLOYMENT_RUNS_RETRIEVE = "anthropic.deployment_runs.retrieve"
|
|
275
|
+
DEPLOYMENT_RUNS_LIST = "anthropic.deployment_runs.list"
|
|
276
|
+
VAULTS_CREATE = "anthropic.vaults.create"
|
|
277
|
+
VAULTS_RETRIEVE = "anthropic.vaults.retrieve"
|
|
278
|
+
VAULTS_UPDATE = "anthropic.vaults.update"
|
|
279
|
+
VAULTS_LIST = "anthropic.vaults.list"
|
|
280
|
+
VAULTS_DELETE = "anthropic.vaults.delete"
|
|
281
|
+
VAULTS_ARCHIVE = "anthropic.vaults.archive"
|
|
282
|
+
VAULTS_CREDENTIALS_CREATE = "anthropic.vaults.credentials.create"
|
|
283
|
+
VAULTS_CREDENTIALS_RETRIEVE = "anthropic.vaults.credentials.retrieve"
|
|
284
|
+
VAULTS_CREDENTIALS_UPDATE = "anthropic.vaults.credentials.update"
|
|
285
|
+
VAULTS_CREDENTIALS_LIST = "anthropic.vaults.credentials.list"
|
|
286
|
+
VAULTS_CREDENTIALS_DELETE = "anthropic.vaults.credentials.delete"
|
|
287
|
+
VAULTS_CREDENTIALS_ARCHIVE = "anthropic.vaults.credentials.archive"
|
|
288
|
+
VAULTS_CREDENTIALS_MCP_OAUTH_VALIDATE =
|
|
289
|
+
"anthropic.vaults.credentials.mcp_oauth_validate"
|
|
290
|
+
MEMORY_STORES_CREATE = "anthropic.memory_stores.create"
|
|
291
|
+
MEMORY_STORES_RETRIEVE = "anthropic.memory_stores.retrieve"
|
|
292
|
+
MEMORY_STORES_UPDATE = "anthropic.memory_stores.update"
|
|
293
|
+
MEMORY_STORES_LIST = "anthropic.memory_stores.list"
|
|
294
|
+
MEMORY_STORES_DELETE = "anthropic.memory_stores.delete"
|
|
295
|
+
MEMORY_STORES_ARCHIVE = "anthropic.memory_stores.archive"
|
|
296
|
+
MEMORY_STORES_MEMORIES_CREATE =
|
|
297
|
+
"anthropic.memory_stores.memories.create"
|
|
298
|
+
MEMORY_STORES_MEMORIES_RETRIEVE =
|
|
299
|
+
"anthropic.memory_stores.memories.retrieve"
|
|
300
|
+
MEMORY_STORES_MEMORIES_UPDATE =
|
|
301
|
+
"anthropic.memory_stores.memories.update"
|
|
302
|
+
MEMORY_STORES_MEMORIES_LIST = "anthropic.memory_stores.memories.list"
|
|
303
|
+
MEMORY_STORES_MEMORIES_DELETE =
|
|
304
|
+
"anthropic.memory_stores.memories.delete"
|
|
305
|
+
MEMORY_STORES_MEMORY_VERSIONS_RETRIEVE =
|
|
306
|
+
"anthropic.memory_stores.memory_versions.retrieve"
|
|
307
|
+
MEMORY_STORES_MEMORY_VERSIONS_LIST =
|
|
308
|
+
"anthropic.memory_stores.memory_versions.list"
|
|
309
|
+
MEMORY_STORES_MEMORY_VERSIONS_REDACT =
|
|
310
|
+
"anthropic.memory_stores.memory_versions.redact"
|
|
311
|
+
SKILLS_VERSIONS_DOWNLOAD = "anthropic.skills.versions.download"
|
|
312
|
+
USER_PROFILES_CREATE = "anthropic.user_profiles.create"
|
|
313
|
+
USER_PROFILES_RETRIEVE = "anthropic.user_profiles.retrieve"
|
|
314
|
+
USER_PROFILES_UPDATE = "anthropic.user_profiles.update"
|
|
315
|
+
USER_PROFILES_LIST = "anthropic.user_profiles.list"
|
|
316
|
+
USER_PROFILES_CREATE_ENROLLMENT_URL =
|
|
317
|
+
"anthropic.user_profiles.create_enrollment_url"
|
|
318
|
+
DREAMS_CREATE = "anthropic.dreams.create"
|
|
319
|
+
DREAMS_RETRIEVE = "anthropic.dreams.retrieve"
|
|
320
|
+
DREAMS_LIST = "anthropic.dreams.list"
|
|
321
|
+
DREAMS_ARCHIVE = "anthropic.dreams.archive"
|
|
322
|
+
DREAMS_CANCEL = "anthropic.dreams.cancel"
|
|
323
|
+
TUNNELS_CREATE = "anthropic.tunnels.create"
|
|
324
|
+
TUNNELS_RETRIEVE = "anthropic.tunnels.retrieve"
|
|
325
|
+
TUNNELS_LIST = "anthropic.tunnels.list"
|
|
326
|
+
TUNNELS_ARCHIVE = "anthropic.tunnels.archive"
|
|
327
|
+
TUNNELS_REVEAL_TOKEN = "anthropic.tunnels.reveal_token"
|
|
328
|
+
TUNNELS_ROTATE_TOKEN = "anthropic.tunnels.rotate_token"
|
|
329
|
+
TUNNELS_CERTIFICATES_CREATE = "anthropic.tunnels.certificates.create"
|
|
330
|
+
TUNNELS_CERTIFICATES_RETRIEVE =
|
|
331
|
+
"anthropic.tunnels.certificates.retrieve"
|
|
332
|
+
TUNNELS_CERTIFICATES_LIST = "anthropic.tunnels.certificates.list"
|
|
333
|
+
TUNNELS_CERTIFICATES_ARCHIVE = "anthropic.tunnels.certificates.archive"
|
|
334
|
+
ORGANIZATION_ANALYTICS_SUMMARIES_LIST =
|
|
335
|
+
"anthropic.organization.analytics.summaries.list"
|
|
336
|
+
ORGANIZATION_ANALYTICS_USERS_LIST =
|
|
337
|
+
"anthropic.organization.analytics.users.list"
|
|
338
|
+
ORGANIZATION_ANALYTICS_APPS_CHAT_PROJECTS_LIST =
|
|
339
|
+
"anthropic.organization.analytics.apps.chat.projects.list"
|
|
340
|
+
ORGANIZATION_ANALYTICS_CONNECTORS_LIST =
|
|
341
|
+
"anthropic.organization.analytics.connectors.list"
|
|
342
|
+
ORGANIZATION_ANALYTICS_PLUGINS_LIST =
|
|
343
|
+
"anthropic.organization.analytics.plugins.list"
|
|
344
|
+
ORGANIZATION_ANALYTICS_SKILLS_LIST =
|
|
345
|
+
"anthropic.organization.analytics.skills.list"
|
|
346
|
+
ORGANIZATION_ANALYTICS_ARTIFACTS_LIST =
|
|
347
|
+
"anthropic.organization.analytics.artifacts.list"
|
|
348
|
+
ORGANIZATION_ANALYTICS_USAGE_REPORT_LIST =
|
|
349
|
+
"anthropic.organization.analytics.usage_report.list"
|
|
350
|
+
ORGANIZATION_ANALYTICS_USER_USAGE_REPORT_LIST =
|
|
351
|
+
"anthropic.organization.analytics.user_usage_report.list"
|
|
352
|
+
ORGANIZATION_ANALYTICS_COST_REPORT_LIST =
|
|
353
|
+
"anthropic.organization.analytics.cost_report.list"
|
|
354
|
+
ORGANIZATION_ANALYTICS_USER_COST_REPORT_LIST =
|
|
355
|
+
"anthropic.organization.analytics.user_cost_report.list"
|
|
356
|
+
ORGANIZATION_SPEND_LIMITS_RETRIEVE =
|
|
357
|
+
"anthropic.organization.spend_limits.retrieve"
|
|
358
|
+
ORGANIZATION_SPEND_LIMITS_LIST =
|
|
359
|
+
"anthropic.organization.spend_limits.list"
|
|
360
|
+
ORGANIZATION_SPEND_LIMITS_DELETE =
|
|
361
|
+
"anthropic.organization.spend_limits.delete"
|
|
362
|
+
ORGANIZATION_SPEND_LIMITS_SET =
|
|
363
|
+
"anthropic.organization.spend_limits.set"
|
|
364
|
+
ORGANIZATION_SPEND_LIMITS_EFFECTIVE_LIST =
|
|
365
|
+
"anthropic.organization.spend_limits.effective.list"
|
|
366
|
+
ORGANIZATION_SPEND_LIMITS_INCREASE_REQUESTS_RETRIEVE =
|
|
367
|
+
"anthropic.organization.spend_limits.increase_requests.retrieve"
|
|
368
|
+
ORGANIZATION_SPEND_LIMITS_INCREASE_REQUESTS_LIST =
|
|
369
|
+
"anthropic.organization.spend_limits.increase_requests.list"
|
|
370
|
+
ORGANIZATION_SPEND_LIMITS_INCREASE_REQUESTS_APPROVE =
|
|
371
|
+
"anthropic.organization.spend_limits.increase_requests.approve"
|
|
372
|
+
ORGANIZATION_SPEND_LIMITS_INCREASE_REQUESTS_DENY =
|
|
373
|
+
"anthropic.organization.spend_limits.increase_requests.deny"
|
|
374
|
+
ORGANIZATION_RBAC_GROUPS_CREATE =
|
|
375
|
+
"anthropic.organization.rbac_groups.create"
|
|
376
|
+
ORGANIZATION_RBAC_GROUPS_RETRIEVE =
|
|
377
|
+
"anthropic.organization.rbac_groups.retrieve"
|
|
378
|
+
ORGANIZATION_RBAC_GROUPS_UPDATE =
|
|
379
|
+
"anthropic.organization.rbac_groups.update"
|
|
380
|
+
ORGANIZATION_RBAC_GROUPS_LIST =
|
|
381
|
+
"anthropic.organization.rbac_groups.list"
|
|
382
|
+
ORGANIZATION_RBAC_GROUPS_DELETE =
|
|
383
|
+
"anthropic.organization.rbac_groups.delete"
|
|
384
|
+
ORGANIZATION_RBAC_GROUPS_MEMBERS_LIST =
|
|
385
|
+
"anthropic.organization.rbac_groups.members.list"
|
|
386
|
+
ORGANIZATION_RBAC_GROUPS_MEMBERS_ADD =
|
|
387
|
+
"anthropic.organization.rbac_groups.members.add"
|
|
388
|
+
ORGANIZATION_RBAC_GROUPS_MEMBERS_REMOVE =
|
|
389
|
+
"anthropic.organization.rbac_groups.members.remove"
|
|
390
|
+
ORGANIZATION_RBAC_ROLES_RETRIEVE =
|
|
391
|
+
"anthropic.organization.rbac_roles.retrieve"
|
|
392
|
+
ORGANIZATION_RBAC_ROLES_LIST = "anthropic.organization.rbac_roles.list"
|
|
393
|
+
ORGANIZATION_RBAC_ROLES_PERMISSIONS_LIST =
|
|
394
|
+
"anthropic.organization.rbac_roles.permissions.list"
|
|
395
|
+
ORGANIZATION_PLUGINS_CREATE = "anthropic.organization.plugins.create"
|
|
396
|
+
ORGANIZATION_PLUGINS_RETRIEVE =
|
|
397
|
+
"anthropic.organization.plugins.retrieve"
|
|
398
|
+
ORGANIZATION_PLUGINS_UPDATE = "anthropic.organization.plugins.update"
|
|
399
|
+
ORGANIZATION_PLUGINS_LIST = "anthropic.organization.plugins.list"
|
|
400
|
+
ORGANIZATION_PLUGINS_DELETE = "anthropic.organization.plugins.delete"
|
|
401
|
+
ORGANIZATION_PLUGINS_VERSIONS_CREATE =
|
|
402
|
+
"anthropic.organization.plugins.versions.create"
|
|
403
|
+
ORGANIZATION_PLUGINS_VERSIONS_RETRIEVE =
|
|
404
|
+
"anthropic.organization.plugins.versions.retrieve"
|
|
405
|
+
ORGANIZATION_PLUGINS_VERSIONS_LIST =
|
|
406
|
+
"anthropic.organization.plugins.versions.list"
|
|
407
|
+
ORGANIZATION_PLUGINS_VERSIONS_DOWNLOAD =
|
|
408
|
+
"anthropic.organization.plugins.versions.download"
|
|
409
|
+
ORGANIZATION_PLUGINS_INSTALLATION_SETTINGS_LIST =
|
|
410
|
+
"anthropic.organization.plugins.installation_settings.list"
|
|
411
|
+
ORGANIZATION_PLUGINS_INSTALLATION_SETTINGS_REMOVE =
|
|
412
|
+
"anthropic.organization.plugins.installation_settings.remove"
|
|
413
|
+
ORGANIZATION_PLUGINS_INSTALLATION_SETTINGS_SET =
|
|
414
|
+
"anthropic.organization.plugins.installation_settings.set"
|
|
415
|
+
ORGANIZATION_PLUGINS_SHARES_LIST =
|
|
416
|
+
"anthropic.organization.plugins.shares.list"
|
|
417
|
+
ORGANIZATION_PLUGIN_MARKETPLACES_RETRIEVE =
|
|
418
|
+
"anthropic.organization.plugin_marketplaces.retrieve"
|
|
419
|
+
ORGANIZATION_PLUGIN_MARKETPLACES_UPDATE =
|
|
420
|
+
"anthropic.organization.plugin_marketplaces.update"
|
|
421
|
+
ORGANIZATION_PLUGIN_MARKETPLACES_LIST =
|
|
422
|
+
"anthropic.organization.plugin_marketplaces.list"
|
|
423
|
+
ORGANIZATION_PLUGIN_MARKETPLACES_VALIDATE_ARCHIVE =
|
|
424
|
+
"anthropic.organization.plugin_marketplaces.validate_archive"
|
|
425
|
+
ORGANIZATION_PLUGIN_MARKETPLACES_VALIDATE_REPOSITORY =
|
|
426
|
+
"anthropic.organization.plugin_marketplaces.validate_repository"
|
|
427
|
+
ORGANIZATION_TELEMETRY_DESTINATIONS_CREATE =
|
|
428
|
+
"anthropic.organization.telemetry_destinations.create"
|
|
429
|
+
ORGANIZATION_TELEMETRY_DESTINATIONS_RETRIEVE =
|
|
430
|
+
"anthropic.organization.telemetry_destinations.retrieve"
|
|
431
|
+
ORGANIZATION_TELEMETRY_DESTINATIONS_UPDATE =
|
|
432
|
+
"anthropic.organization.telemetry_destinations.update"
|
|
433
|
+
ORGANIZATION_TELEMETRY_DESTINATIONS_LIST =
|
|
434
|
+
"anthropic.organization.telemetry_destinations.list"
|
|
435
|
+
ORGANIZATION_TELEMETRY_DESTINATIONS_DELETE =
|
|
436
|
+
"anthropic.organization.telemetry_destinations.delete"
|
|
437
|
+
ORGANIZATION_TELEMETRY_DESTINATIONS_TEST =
|
|
438
|
+
"anthropic.organization.telemetry_destinations.test"
|
|
439
|
+
ORGANIZATION_TELEMETRY_DESTINATIONS_WORKSPACES_LIST =
|
|
440
|
+
"anthropic.organization.telemetry_destinations.workspaces.list"
|
|
441
|
+
ORGANIZATION_TELEMETRY_DESTINATIONS_WORKSPACES_ADD =
|
|
442
|
+
"anthropic.organization.telemetry_destinations.workspaces.add"
|
|
443
|
+
ORGANIZATION_TELEMETRY_DESTINATIONS_WORKSPACES_REMOVE =
|
|
444
|
+
"anthropic.organization.telemetry_destinations.workspaces.remove"
|
|
445
|
+
end
|
|
446
|
+
|
|
447
|
+
CLIENT_ATTRIBUTES = T.let(T.unsafe(nil), T::Hash[String, String])
|
|
448
|
+
|
|
449
|
+
# Each attribute with the response header it comes from.
|
|
450
|
+
RESPONSE_HEADER_ATTRIBUTES = T.let(T.unsafe(nil), T::Hash[String, String])
|
|
451
|
+
|
|
452
|
+
CLIENT_OPTION_KEYS = T.let(T.unsafe(nil), T::Array[Symbol])
|
|
453
|
+
|
|
454
|
+
TRACES_KEYS = T.let(T.unsafe(nil), T::Array[Symbol])
|
|
455
|
+
|
|
456
|
+
CONTENT_MODES = T.let(T.unsafe(nil), T::Array[Symbol])
|
|
457
|
+
|
|
458
|
+
# The most bytes the `content` attributes of one span hold when
|
|
459
|
+
# `max_content_bytes` sets no other bound.
|
|
460
|
+
DEFAULT_MAX_CONTENT_BYTES = T.let(T.unsafe(nil), Integer)
|
|
461
|
+
|
|
462
|
+
REQUEST_OPTION_KEYS = T.let(T.unsafe(nil), T::Array[Symbol])
|
|
463
|
+
|
|
464
|
+
# Query parameters whose value is content on every endpoint that defines them.
|
|
465
|
+
CONTENT_QUERY_PARAMETERS = T.let(T.unsafe(nil), T::Array[String])
|
|
466
|
+
|
|
467
|
+
# By span name. `:request` and `:response` map an attribute to `[path, type]` in
|
|
468
|
+
# that body, `:request_headers` to `[header, type]`.
|
|
469
|
+
SPAN_ATTRIBUTES =
|
|
470
|
+
T.let(T.unsafe(nil), T::Hash[String, T::Hash[Symbol, T.anything]])
|
|
471
|
+
|
|
472
|
+
class << self
|
|
473
|
+
# The settings of a client's spans, frozen: its `open_telemetry` option with
|
|
474
|
+
# Symbol keys, where `:traces` is a Hash that has every one of {TRACES_KEYS}.
|
|
475
|
+
# `true` and `false` are `{traces: <it>}`, and a `:traces` of `true` or `false` is
|
|
476
|
+
# `{enabled: <it>}`. `nil`, for a client that is given no option, is what the
|
|
477
|
+
# environment says, and the environment is read here and nowhere else. Any other
|
|
478
|
+
# option is complete: what it leaves unset has the default, and no variable is
|
|
479
|
+
# read.
|
|
480
|
+
sig do
|
|
481
|
+
params(
|
|
482
|
+
option:
|
|
483
|
+
T.nilable(
|
|
484
|
+
T.any(T::Hash[T.any(Symbol, String), T.anything], T::Boolean)
|
|
485
|
+
)
|
|
486
|
+
).returns(T::Hash[Symbol, T.anything])
|
|
487
|
+
end
|
|
488
|
+
def client_option(option)
|
|
489
|
+
end
|
|
490
|
+
|
|
491
|
+
# The `open_telemetry` request option with Symbol keys.
|
|
492
|
+
sig do
|
|
493
|
+
params(
|
|
494
|
+
option: T.nilable(T::Hash[T.any(Symbol, String), T.anything])
|
|
495
|
+
).returns(T::Hash[Symbol, T.anything])
|
|
496
|
+
end
|
|
497
|
+
def request_option(option)
|
|
498
|
+
end
|
|
499
|
+
|
|
500
|
+
# The tracer for a client, or `nil` when its spans are disabled.
|
|
501
|
+
sig do
|
|
502
|
+
params(option: T::Hash[Symbol, T.anything], scope: String).returns(
|
|
503
|
+
T.nilable(T.anything)
|
|
504
|
+
)
|
|
505
|
+
end
|
|
506
|
+
def tracer(
|
|
507
|
+
# from {client_option}
|
|
508
|
+
option,
|
|
509
|
+
scope = INSTRUMENTATION_SCOPE
|
|
510
|
+
)
|
|
511
|
+
end
|
|
512
|
+
|
|
513
|
+
# Whether a client's spans have the `content` attributes.
|
|
514
|
+
sig { params(option: T::Hash[Symbol, T.anything]).returns(T::Boolean) }
|
|
515
|
+
def content?(
|
|
516
|
+
# from {client_option}
|
|
517
|
+
option
|
|
518
|
+
)
|
|
519
|
+
end
|
|
520
|
+
|
|
521
|
+
# The most bytes the `content` attributes of one of a client's spans hold.
|
|
522
|
+
sig { params(option: T::Hash[Symbol, T.anything]).returns(Integer) }
|
|
523
|
+
def max_content_bytes(
|
|
524
|
+
# from {client_option}
|
|
525
|
+
option
|
|
526
|
+
)
|
|
527
|
+
end
|
|
528
|
+
|
|
529
|
+
# Whether a client's requests carry the trace context of their span.
|
|
530
|
+
sig { params(option: T::Hash[Symbol, T.anything]).returns(T::Boolean) }
|
|
531
|
+
def propagation?(
|
|
532
|
+
# from {client_option}
|
|
533
|
+
option
|
|
534
|
+
)
|
|
535
|
+
end
|
|
536
|
+
|
|
537
|
+
# Returns `nil` when `req` has no `span_name`, or when the span neither records
|
|
538
|
+
# nor propagates a trace context: with `propagation` off, a span whose context is
|
|
539
|
+
# valid is kept, for the application's HTTP instrumentation to propagate. A span
|
|
540
|
+
# that cannot start is `nil` too, and the call goes on without one.
|
|
541
|
+
sig do
|
|
542
|
+
params(
|
|
543
|
+
tracer: T.anything,
|
|
544
|
+
req: T::Hash[Symbol, T.anything],
|
|
545
|
+
propagation: T::Boolean
|
|
546
|
+
).returns(T.nilable(T.anything))
|
|
547
|
+
end
|
|
548
|
+
def start_api_call_span(
|
|
549
|
+
tracer,
|
|
550
|
+
# the request, as the SDK method gave it to `BaseClient#request`
|
|
551
|
+
req,
|
|
552
|
+
# whether the client's requests carry the trace context
|
|
553
|
+
propagation:
|
|
554
|
+
)
|
|
555
|
+
end
|
|
556
|
+
|
|
557
|
+
# `span_name` is `nil` for every API call. The span starts with what
|
|
558
|
+
# `recorder.start_attributes(client, req)` returns, without its `nil` values, and
|
|
559
|
+
# `recorder.record(span, result)` runs right before the span ends, or before a
|
|
560
|
+
# streamed body takes the span with it. An error that either raises is logged, and
|
|
561
|
+
# does not fail the API call.
|
|
562
|
+
sig { params(span_name: T.nilable(String), recorder: T.anything).void }
|
|
563
|
+
def register_recorder(
|
|
564
|
+
# one of {SpanName}
|
|
565
|
+
span_name,
|
|
566
|
+
recorder
|
|
567
|
+
)
|
|
568
|
+
end
|
|
569
|
+
|
|
570
|
+
# A sampler reads only the attributes a span starts with, so everything known
|
|
571
|
+
# before the first attempt is here.
|
|
572
|
+
sig do
|
|
573
|
+
params(
|
|
574
|
+
client: Anthropic::Internal::Transport::BaseClient,
|
|
575
|
+
req: T::Hash[Symbol, T.anything]
|
|
576
|
+
).returns(T::Hash[String, T.anything])
|
|
577
|
+
end
|
|
578
|
+
def api_call_span_attributes(
|
|
579
|
+
client,
|
|
580
|
+
# the request, as the SDK method gave it to `BaseClient#request`
|
|
581
|
+
req
|
|
582
|
+
)
|
|
583
|
+
end
|
|
584
|
+
|
|
585
|
+
# The first send sets the URL attributes ({url_attributes}). Every later one, a
|
|
586
|
+
# retry or a followed redirect, counts toward `http.request.resend_count`.
|
|
587
|
+
sig do
|
|
588
|
+
params(
|
|
589
|
+
span: T.anything,
|
|
590
|
+
client: Anthropic::Internal::Transport::BaseClient,
|
|
591
|
+
request: T::Hash[Symbol, T.anything],
|
|
592
|
+
url: URI::Generic
|
|
593
|
+
).void
|
|
594
|
+
end
|
|
595
|
+
def record_send(
|
|
596
|
+
span,
|
|
597
|
+
client,
|
|
598
|
+
# the request, as `BaseClient#send_request` has it
|
|
599
|
+
request,
|
|
600
|
+
url
|
|
601
|
+
)
|
|
602
|
+
end
|
|
603
|
+
|
|
604
|
+
# A field that `response` lacks, or whose type is not the attribute's, sets
|
|
605
|
+
# nothing.
|
|
606
|
+
sig do
|
|
607
|
+
params(
|
|
608
|
+
span: T.anything,
|
|
609
|
+
span_name: T.nilable(String),
|
|
610
|
+
response:
|
|
611
|
+
T.any(
|
|
612
|
+
Anthropic::Internal::Type::BaseModel,
|
|
613
|
+
T::Hash[Symbol, T.anything]
|
|
614
|
+
)
|
|
615
|
+
).void
|
|
616
|
+
end
|
|
617
|
+
def set_response_attributes(span, span_name, response)
|
|
618
|
+
end
|
|
619
|
+
|
|
620
|
+
# The trace context of `span` as request headers, with lowercase names: none when
|
|
621
|
+
# the propagator fails.
|
|
622
|
+
sig { params(span: T.anything).returns(T::Hash[String, String]) }
|
|
623
|
+
def inject(span)
|
|
624
|
+
end
|
|
625
|
+
|
|
626
|
+
# The lowercase names of the headers that carry a trace context. A propagator may
|
|
627
|
+
# write headers that it does not list, so those {inject} writes for `span` count
|
|
628
|
+
# too. A propagator that fails to list its headers counts as listing the standard
|
|
629
|
+
# ones.
|
|
630
|
+
sig { params(span: T.nilable(T.anything)).returns(T::Array[String]) }
|
|
631
|
+
def trace_header_names(span)
|
|
632
|
+
end
|
|
633
|
+
|
|
634
|
+
# The status is `ERROR` for `result[:error]`, `OK` for `result[:data]`, and unset
|
|
635
|
+
# when the call has neither because the application stopped it, such as with
|
|
636
|
+
# `Interrupt`.
|
|
637
|
+
sig do
|
|
638
|
+
params(span: T.anything, result: T::Hash[Symbol, T.anything]).void
|
|
639
|
+
end
|
|
640
|
+
def end_api_call_span(
|
|
641
|
+
span,
|
|
642
|
+
# the result of the API call, as far as the call got
|
|
643
|
+
result
|
|
644
|
+
)
|
|
645
|
+
end
|
|
646
|
+
|
|
647
|
+
# Returns the stream that the application gets in place of `stream`: it ends
|
|
648
|
+
# `span` when the read ends ({iterate_and_end_span}). `result` is as for
|
|
649
|
+
# {end_api_call_span}.
|
|
650
|
+
sig do
|
|
651
|
+
params(
|
|
652
|
+
span: T.anything,
|
|
653
|
+
stream:
|
|
654
|
+
Anthropic::Internal::Type::BaseStream[T.noreturn, T.anything],
|
|
655
|
+
result: T::Hash[Symbol, T.anything]
|
|
656
|
+
).returns(
|
|
657
|
+
Anthropic::Internal::Type::BaseStream[T.noreturn, T.anything]
|
|
658
|
+
)
|
|
659
|
+
end
|
|
660
|
+
def end_api_call_span_when_stream_ends(span, stream, result)
|
|
661
|
+
end
|
|
662
|
+
|
|
663
|
+
# Anything but a `StandardError`, such as `Interrupt`, is the application stopping
|
|
664
|
+
# the operation, which leaves the status unset.
|
|
665
|
+
sig { params(span: T.anything, error: Exception).void }
|
|
666
|
+
def set_error_status(span, error)
|
|
667
|
+
end
|
|
668
|
+
|
|
669
|
+
# @api private
|
|
670
|
+
#
|
|
671
|
+
# `option` with Symbol keys. Raises unless it is a Hash whose keys are all in
|
|
672
|
+
# `keys`.
|
|
673
|
+
sig do
|
|
674
|
+
params(
|
|
675
|
+
option: T.anything,
|
|
676
|
+
keys: T::Array[Symbol],
|
|
677
|
+
name: String,
|
|
678
|
+
expected: String
|
|
679
|
+
).returns(T::Hash[Symbol, T.anything])
|
|
680
|
+
end
|
|
681
|
+
private def option_hash(option, keys, name, expected)
|
|
682
|
+
end
|
|
683
|
+
|
|
684
|
+
# @api private
|
|
685
|
+
#
|
|
686
|
+
# The option can hold a tracer provider or content, so an error message shows a
|
|
687
|
+
# value only when it is a plain one, and its class otherwise.
|
|
688
|
+
sig { params(value: T.anything).returns(String) }
|
|
689
|
+
private def plain(value)
|
|
690
|
+
end
|
|
691
|
+
|
|
692
|
+
# @api private
|
|
693
|
+
#
|
|
694
|
+
# The `open_telemetry` option that the environment variables stand for. Only
|
|
695
|
+
# `false`, in any case, turns the spans or the propagation off.
|
|
696
|
+
sig { returns(T::Hash[Symbol, T.anything]) }
|
|
697
|
+
private def environment_option
|
|
698
|
+
end
|
|
699
|
+
|
|
700
|
+
# @api private
|
|
701
|
+
#
|
|
702
|
+
# Anything but `content`, in any case, is `:metadata_only`.
|
|
703
|
+
sig { returns(Symbol) }
|
|
704
|
+
private def environment_content_mode
|
|
705
|
+
end
|
|
706
|
+
|
|
707
|
+
# @api private
|
|
708
|
+
#
|
|
709
|
+
# `nil` unless the variable is a whole number of 1 or more, in decimal digits.
|
|
710
|
+
sig { returns(T.nilable(Integer)) }
|
|
711
|
+
private def environment_max_content_bytes
|
|
712
|
+
end
|
|
713
|
+
|
|
714
|
+
# @api private
|
|
715
|
+
sig do
|
|
716
|
+
params(span: T.anything, result: T::Hash[Symbol, T.anything]).void
|
|
717
|
+
end
|
|
718
|
+
private def set_response_status_code(span, result)
|
|
719
|
+
end
|
|
720
|
+
|
|
721
|
+
# @api private
|
|
722
|
+
#
|
|
723
|
+
# `span_created_id` names the attribute for the created object's `id`, or, as
|
|
724
|
+
# `{"<attribute>" => :user_id}`, for another of its fields.
|
|
725
|
+
sig do
|
|
726
|
+
params(span: T.anything, result: T::Hash[Symbol, T.anything]).void
|
|
727
|
+
end
|
|
728
|
+
private def set_created_id(span, result)
|
|
729
|
+
end
|
|
730
|
+
|
|
731
|
+
# @api private
|
|
732
|
+
sig do
|
|
733
|
+
params(span: T.anything, result: T::Hash[Symbol, T.anything]).void
|
|
734
|
+
end
|
|
735
|
+
private def set_response_header_attributes(span, result)
|
|
736
|
+
end
|
|
737
|
+
|
|
738
|
+
# @api private
|
|
739
|
+
sig do
|
|
740
|
+
params(span: T.anything, result: T::Hash[Symbol, T.anything]).void
|
|
741
|
+
end
|
|
742
|
+
private def record_result(span, result)
|
|
743
|
+
end
|
|
744
|
+
|
|
745
|
+
# @api private
|
|
746
|
+
sig do
|
|
747
|
+
params(span_name: T.nilable(String)).returns(T::Array[T.anything])
|
|
748
|
+
end
|
|
749
|
+
private def recorders(span_name)
|
|
750
|
+
end
|
|
751
|
+
|
|
752
|
+
# @api private
|
|
753
|
+
#
|
|
754
|
+
# A failure to trace must not fail the API call, so an error raised in the block,
|
|
755
|
+
# such as one from a span processor of the application, is logged, and the value
|
|
756
|
+
# is then `nil`.
|
|
757
|
+
sig do
|
|
758
|
+
params(
|
|
759
|
+
span_name: T.nilable(String),
|
|
760
|
+
blk: T.proc.returns(T.anything)
|
|
761
|
+
).returns(T.anything)
|
|
762
|
+
end
|
|
763
|
+
private def recording(span_name, &blk)
|
|
764
|
+
end
|
|
765
|
+
|
|
766
|
+
# @api private
|
|
767
|
+
#
|
|
768
|
+
# `url.query` and `url.full` keep only the pairs whose name the endpoint defines
|
|
769
|
+
# (`query_names`, or one of them followed by `[]`), so none that the application
|
|
770
|
+
# added. Both are left out when a kept pair is content
|
|
771
|
+
# ({CONTENT_QUERY_PARAMETERS}, `content_names`) and the client's spans have none.
|
|
772
|
+
sig do
|
|
773
|
+
params(
|
|
774
|
+
client: Anthropic::Internal::Transport::BaseClient,
|
|
775
|
+
url: URI::Generic,
|
|
776
|
+
query_names: T::Array[String],
|
|
777
|
+
content_names: T::Array[String]
|
|
778
|
+
).returns(T::Hash[String, String])
|
|
779
|
+
end
|
|
780
|
+
private def url_attributes(client, url, query_names, content_names)
|
|
781
|
+
end
|
|
782
|
+
|
|
783
|
+
# @api private
|
|
784
|
+
sig do
|
|
785
|
+
params(
|
|
786
|
+
client: Anthropic::Internal::Transport::BaseClient,
|
|
787
|
+
req: T::Hash[Symbol, T.anything]
|
|
788
|
+
).returns(T::Hash[String, T.anything])
|
|
789
|
+
end
|
|
790
|
+
private def request_attributes(client, req)
|
|
791
|
+
end
|
|
792
|
+
|
|
793
|
+
# @api private
|
|
794
|
+
sig do
|
|
795
|
+
params(data: T.anything, path: T::Array[Symbol]).returns(T.anything)
|
|
796
|
+
end
|
|
797
|
+
private def dig(data, path)
|
|
798
|
+
end
|
|
799
|
+
|
|
800
|
+
# @api private
|
|
801
|
+
#
|
|
802
|
+
# `nil` for a value of another type than `type`, so that a response this SDK
|
|
803
|
+
# version does not know sets no attribute rather than a wrong one.
|
|
804
|
+
sig do
|
|
805
|
+
params(
|
|
806
|
+
value: T.anything,
|
|
807
|
+
type: T.any(Symbol, T::Array[Symbol])
|
|
808
|
+
).returns(T.anything)
|
|
809
|
+
end
|
|
810
|
+
private def attribute_value(value, type)
|
|
811
|
+
end
|
|
812
|
+
|
|
813
|
+
# @api private
|
|
814
|
+
sig do
|
|
815
|
+
params(
|
|
816
|
+
value: T.nilable(String),
|
|
817
|
+
type: T.any(Symbol, T::Array[Symbol])
|
|
818
|
+
).returns(T.anything)
|
|
819
|
+
end
|
|
820
|
+
private def header_value(value, type)
|
|
821
|
+
end
|
|
822
|
+
|
|
823
|
+
# @api private
|
|
824
|
+
#
|
|
825
|
+
# The first iteration ends `span` exactly once, however the read ends: `OK` when
|
|
826
|
+
# exhausted, `ERROR` when it fails, unset when the application closes it early.
|
|
827
|
+
# Server-sent events have no end that this code knows, so the server ending them
|
|
828
|
+
# (`events`) sets no status: whoever knows their end event does. A later iteration
|
|
829
|
+
# reads `source` as is, without touching the span.
|
|
830
|
+
sig do
|
|
831
|
+
params(
|
|
832
|
+
source: T::Enumerator[T.anything],
|
|
833
|
+
span: T.anything,
|
|
834
|
+
events: T::Boolean
|
|
835
|
+
).returns(T::Enumerator[T.anything])
|
|
836
|
+
end
|
|
837
|
+
private def iterate_and_end_span(source, span, events)
|
|
838
|
+
end
|
|
839
|
+
|
|
840
|
+
# @api private
|
|
841
|
+
sig { params(error: StandardError).returns(String) }
|
|
842
|
+
private def error_type(error)
|
|
843
|
+
end
|
|
844
|
+
end
|
|
845
|
+
end
|
|
846
|
+
end
|
|
847
|
+
end
|