From fb2057e0b886f66282bfc36ad2543b949d9b829c Mon Sep 17 00:00:00 2001 From: Greg Holmes Date: Tue, 1 Dec 2026 12:45:49 +0000 Subject: [PATCH 1/6] chore: initialize SDK regeneration branch From 96667b75444759793b60d5244507b727a324f375 Mon Sep 17 00:00:00 2001 From: Greg Holmes Date: Tue, 1 Dec 2026 12:46:32 +0000 Subject: [PATCH 2/6] chore: unfreeze files pending regen --- .fernignore | 110 +- .gitignore.bak | 8 + src/deepgram/__init__.py.bak | 1420 +++++++++++++++++ src/deepgram/agent/__init__.py.bak | 528 ++++++ src/deepgram/agent/v1/__init__.py.bak | 530 ++++++ .../agent/v1/requests/__init__.py.bak | 279 ++++ .../requests/agent_v1conversation_text.py.bak | 39 + ...gent_v1inject_dynamic_agent_message.py.bak | 27 + .../agent/v1/requests/agent_v1settings.py.bak | 31 + .../v1/requests/agent_v1settings_agent.py.bak | 18 + .../agent_v1settings_agent_context.py.bak | 37 + src/deepgram/agent/v1/socket_client.py.bak | 447 ++++++ src/deepgram/agent/v1/types/__init__.py.bak | 305 ++++ .../v1/types/agent_v1conversation_text.py.bak | 50 + ...gent_v1inject_dynamic_agent_message.py.bak | 38 + .../agent/v1/types/agent_v1settings.py.bak | 42 + .../v1/types/agent_v1settings_agent.py.bak | 58 + .../agent_v1settings_agent_context.py.bak | 67 + ...tings_agent_context_listen_provider.py.bak | 77 + ...nt_v1settings_agent_listen_provider.py.bak | 77 + .../types/agent_v1update_listen_listen.py.bak | 61 + src/deepgram/core/api_error.py.bak | 25 + src/deepgram/core/client_wrapper.py.bak | 146 ++ src/deepgram/core/parse_error.py.bak | 38 + src/deepgram/core/query_encoder.py.bak | 65 + src/deepgram/listen/__init__.py.bak | 246 +++ .../listen_v1configure_failure.py.bak | 34 + src/deepgram/listen/v1/socket_client.py.bak | 262 +++ .../types/listen_v1configure_failure.py.bak | 45 + src/deepgram/listen/v2/__init__.py.bak | 118 ++ src/deepgram/listen/v2/socket_client.py.bak | 251 +++ src/deepgram/listen/v2/types/__init__.py.bak | 78 + .../types/listen_v2configure_failure.py.bak | 45 + .../types/listen_v2configure_success.py.bak | 60 + ...sten_v2configure_success_thresholds.py.bak | 30 + .../listen/v2/types/listen_v2connected.py.bak | 35 + .../v2/types/listen_v2fatal_error.py.bak | 40 + .../listen/v2/types/listen_v2turn_info.py.bak | 102 ++ .../listen_v2turn_info_words_item.py.bak | 38 + .../listen/v2/types/listen_v2warning.py.bak | 45 + src/deepgram/requests/__init__.py.bak | 618 +++++++ src/deepgram/requests/shared_intents.py.bak | 16 + src/deepgram/requests/shared_topics.py.bak | 16 + src/deepgram/speak/v1/socket_client.py.bak | 237 +++ .../speak/v2/requests/speak_v2warning.py.bak | 30 + src/deepgram/speak/v2/socket_client.py.bak | 269 ++++ .../speak/v2/types/speak_v2warning.py.bak | 41 + src/deepgram/types/__init__.py.bak | 883 ++++++++++ src/deepgram/types/deepgram.py.bak | 44 + .../types/deepgram_listen_provider_v2.py.bak | 86 + src/deepgram/types/shared_intents.py.bak | 62 + src/deepgram/types/shared_topics.py.bak | 62 + .../types/speak_settings_v1provider.py.bak | 117 ++ tests/wire/test_listen_v1_media.py.bak | 105 ++ .../wire/test_manage_v1_projects_keys.py.bak | 59 + .../test_manage_v1_projects_requests.py.bak | 66 + 56 files changed, 8608 insertions(+), 55 deletions(-) create mode 100644 .gitignore.bak create mode 100644 src/deepgram/__init__.py.bak create mode 100644 src/deepgram/agent/__init__.py.bak create mode 100644 src/deepgram/agent/v1/__init__.py.bak create mode 100644 src/deepgram/agent/v1/requests/__init__.py.bak create mode 100644 src/deepgram/agent/v1/requests/agent_v1conversation_text.py.bak create mode 100644 src/deepgram/agent/v1/requests/agent_v1inject_dynamic_agent_message.py.bak create mode 100644 src/deepgram/agent/v1/requests/agent_v1settings.py.bak create mode 100644 src/deepgram/agent/v1/requests/agent_v1settings_agent.py.bak create mode 100644 src/deepgram/agent/v1/requests/agent_v1settings_agent_context.py.bak create mode 100644 src/deepgram/agent/v1/socket_client.py.bak create mode 100644 src/deepgram/agent/v1/types/__init__.py.bak create mode 100644 src/deepgram/agent/v1/types/agent_v1conversation_text.py.bak create mode 100644 src/deepgram/agent/v1/types/agent_v1inject_dynamic_agent_message.py.bak create mode 100644 src/deepgram/agent/v1/types/agent_v1settings.py.bak create mode 100644 src/deepgram/agent/v1/types/agent_v1settings_agent.py.bak create mode 100644 src/deepgram/agent/v1/types/agent_v1settings_agent_context.py.bak create mode 100644 src/deepgram/agent/v1/types/agent_v1settings_agent_context_listen_provider.py.bak create mode 100644 src/deepgram/agent/v1/types/agent_v1settings_agent_listen_provider.py.bak create mode 100644 src/deepgram/agent/v1/types/agent_v1update_listen_listen.py.bak create mode 100644 src/deepgram/core/api_error.py.bak create mode 100644 src/deepgram/core/client_wrapper.py.bak create mode 100644 src/deepgram/core/parse_error.py.bak create mode 100644 src/deepgram/core/query_encoder.py.bak create mode 100644 src/deepgram/listen/__init__.py.bak create mode 100644 src/deepgram/listen/v1/requests/listen_v1configure_failure.py.bak create mode 100644 src/deepgram/listen/v1/socket_client.py.bak create mode 100644 src/deepgram/listen/v1/types/listen_v1configure_failure.py.bak create mode 100644 src/deepgram/listen/v2/__init__.py.bak create mode 100644 src/deepgram/listen/v2/socket_client.py.bak create mode 100644 src/deepgram/listen/v2/types/__init__.py.bak create mode 100644 src/deepgram/listen/v2/types/listen_v2configure_failure.py.bak create mode 100644 src/deepgram/listen/v2/types/listen_v2configure_success.py.bak create mode 100644 src/deepgram/listen/v2/types/listen_v2configure_success_thresholds.py.bak create mode 100644 src/deepgram/listen/v2/types/listen_v2connected.py.bak create mode 100644 src/deepgram/listen/v2/types/listen_v2fatal_error.py.bak create mode 100644 src/deepgram/listen/v2/types/listen_v2turn_info.py.bak create mode 100644 src/deepgram/listen/v2/types/listen_v2turn_info_words_item.py.bak create mode 100644 src/deepgram/listen/v2/types/listen_v2warning.py.bak create mode 100644 src/deepgram/requests/__init__.py.bak create mode 100644 src/deepgram/requests/shared_intents.py.bak create mode 100644 src/deepgram/requests/shared_topics.py.bak create mode 100644 src/deepgram/speak/v1/socket_client.py.bak create mode 100644 src/deepgram/speak/v2/requests/speak_v2warning.py.bak create mode 100644 src/deepgram/speak/v2/socket_client.py.bak create mode 100644 src/deepgram/speak/v2/types/speak_v2warning.py.bak create mode 100644 src/deepgram/types/__init__.py.bak create mode 100644 src/deepgram/types/deepgram.py.bak create mode 100644 src/deepgram/types/deepgram_listen_provider_v2.py.bak create mode 100644 src/deepgram/types/shared_intents.py.bak create mode 100644 src/deepgram/types/shared_topics.py.bak create mode 100644 src/deepgram/types/speak_settings_v1provider.py.bak create mode 100644 tests/wire/test_listen_v1_media.py.bak create mode 100644 tests/wire/test_manage_v1_projects_keys.py.bak create mode 100644 tests/wire/test_manage_v1_projects_requests.py.bak diff --git a/.fernignore b/.fernignore index a40f6845..db0ec517 100644 --- a/.fernignore +++ b/.fernignore @@ -45,18 +45,18 @@ src/deepgram/requests/shared_intents_results_intents_segments_item_intents_item. # and Params retain the deprecated ``results`` construction shape and normalize # it to generated ``segments`` while preserving the permanent wrappers above. # [temporarily frozen — remove in the next major after retiring ``results``] -src/deepgram/types/shared_topics.py -src/deepgram/types/shared_intents.py -src/deepgram/requests/shared_topics.py -src/deepgram/requests/shared_intents.py +src/deepgram/types/shared_topics.py.bak +src/deepgram/types/shared_intents.py.bak +src/deepgram/requests/shared_topics.py.bak +src/deepgram/requests/shared_intents.py.bak # Agent Think Live ConversationText gained a required wire field in 2026-10. # The runtime model defaults missing legacy response payloads to `default`, while # the request TypedDict accepts the pre-2026-10 shape for existing typed callers. # SDK-created runtime models still serialize the current wire-required field. # [temporarily frozen — remove after legacy server payloads are retired] -src/deepgram/agent/v1/types/agent_v1conversation_text.py -src/deepgram/agent/v1/requests/agent_v1conversation_text.py +src/deepgram/agent/v1/types/agent_v1conversation_text.py.bak +src/deepgram/agent/v1/requests/agent_v1conversation_text.py.bak # WebSocket socket clients: # - except Exception broad catch (supports custom transports, generator narrows to WebSocketException) @@ -71,17 +71,17 @@ src/deepgram/agent/v1/requests/agent_v1conversation_text.py # - listen response unions include bytes because their iterators and recv methods # already return binary frames # [temporarily frozen — manual patches listed above] -src/deepgram/agent/v1/socket_client.py -src/deepgram/listen/v1/socket_client.py -src/deepgram/listen/v2/socket_client.py -src/deepgram/speak/v1/socket_client.py -src/deepgram/speak/v2/socket_client.py +src/deepgram/agent/v1/socket_client.py.bak +src/deepgram/listen/v1/socket_client.py.bak +src/deepgram/listen/v2/socket_client.py.bak +src/deepgram/speak/v1/socket_client.py.bak +src/deepgram/speak/v2/socket_client.py.bak # Agent TTS provider expressivity must reject fractional values rather than # allowing Pydantic v1 to truncate them before the API sees the request. # [temporarily frozen — remove when Pydantic v1 support is dropped] -src/deepgram/types/speak_settings_v1provider.py -src/deepgram/types/deepgram.py +src/deepgram/types/speak_settings_v1provider.py.bak +src/deepgram/types/deepgram.py.bak # Backward-compat patch: AgentV1SettingsAgentContext schema restructure as of # 2026-05-05. The new schema nests messages under .context.messages; this file @@ -89,12 +89,12 @@ src/deepgram/types/deepgram.py # kwarg and remaps it to `context={"messages": ...}` so existing callers keep # producing the correct wire payload, plus a read-side `.messages` property so # existing attribute access keeps working. -src/deepgram/agent/v1/types/agent_v1settings_agent_context.py -src/deepgram/agent/v1/types/agent_v1settings_agent.py -src/deepgram/agent/v1/types/agent_v1settings.py -src/deepgram/agent/v1/requests/agent_v1settings_agent_context.py -src/deepgram/agent/v1/requests/agent_v1settings_agent.py -src/deepgram/agent/v1/requests/agent_v1settings.py +src/deepgram/agent/v1/types/agent_v1settings_agent_context.py.bak +src/deepgram/agent/v1/types/agent_v1settings_agent.py.bak +src/deepgram/agent/v1/types/agent_v1settings.py.bak +src/deepgram/agent/v1/requests/agent_v1settings_agent_context.py.bak +src/deepgram/agent/v1/requests/agent_v1settings_agent.py.bak +src/deepgram/agent/v1/requests/agent_v1settings.py.bak # Backward-compatibility alias shims for renamed generated public types/params. # These are hand-written wrappers around the current generated names and must not be regenerated. @@ -169,9 +169,9 @@ src/deepgram/requests/deepgram_listen_provider_v2language_hint.py # remaps a legacy `language_hint=` kwarg to `language_hints` and drops the dead singular # key. Remove and unfreeze these shims when the singular alias is intentionally retired in a # future major release. -src/deepgram/types/deepgram_listen_provider_v2.py -src/deepgram/agent/v1/types/agent_v1settings_agent_listen_provider.py -src/deepgram/agent/v1/types/agent_v1settings_agent_context_listen_provider.py +src/deepgram/types/deepgram_listen_provider_v2.py.bak +src/deepgram/agent/v1/types/agent_v1settings_agent_listen_provider.py.bak +src/deepgram/agent/v1/types/agent_v1settings_agent_context_listen_provider.py.bak # Backward-compat patch for the 2026-07-31 AgentV1UpdateListen provider retype. The # generated `provider` field is now the required discriminated union @@ -180,7 +180,7 @@ src/deepgram/agent/v1/types/agent_v1settings_agent_context_listen_provider.py # that coerces a legacy DeepgramListenProviderV1/V2 (or a dict lacking the version # discriminant) into the new shape so existing callers keep working. Remove and unfreeze # when the old provider payloads are retired in a future major. -src/deepgram/agent/v1/types/agent_v1update_listen_listen.py +src/deepgram/agent/v1/types/agent_v1update_listen_listen.py.bak # Hand-written compat shim recreating ListenV2CloseStreamType, which Fern removed in the # 2026-06-15 regen (docs #946). The original generated type wrongly allowed @@ -193,17 +193,17 @@ src/deepgram/listen/v2/types/listen_v2close_stream_type.py # Temporarily frozen generated package barrels that carry hand-applied legacy alias # re-exports. Before each regen, swap these originals to .bak paths so Fern can add new # exports; then restore the aliases alongside every genuine generated addition. -src/deepgram/__init__.py -src/deepgram/agent/__init__.py -src/deepgram/agent/v1/__init__.py -src/deepgram/agent/v1/types/__init__.py -src/deepgram/agent/v1/requests/__init__.py -src/deepgram/types/__init__.py -src/deepgram/requests/__init__.py +src/deepgram/__init__.py.bak +src/deepgram/agent/__init__.py.bak +src/deepgram/agent/v1/__init__.py.bak +src/deepgram/agent/v1/types/__init__.py.bak +src/deepgram/agent/v1/requests/__init__.py.bak +src/deepgram/types/__init__.py.bak +src/deepgram/requests/__init__.py.bak # listen __init__.py files re-export the ListenV2CloseStreamType shim above. -src/deepgram/listen/__init__.py -src/deepgram/listen/v2/__init__.py -src/deepgram/listen/v2/types/__init__.py +src/deepgram/listen/__init__.py.bak +src/deepgram/listen/v2/__init__.py.bak +src/deepgram/listen/v2/types/__init__.py.bak # Coerces Python bools to lowercase "true"/"false" before urlencode, which # otherwise stringifies via str() and produces "True"/"False" — rejected by @@ -220,40 +220,40 @@ src/deepgram/listen/v2/types/__init__.py # the websockets DEBUG handshake logs; this is the other path to it. Unfreeze if the # generator starts redacting credentials itself. -src/deepgram/core/api_error.py -src/deepgram/core/parse_error.py +src/deepgram/core/api_error.py.bak +src/deepgram/core/parse_error.py.bak # Pydantic 2.14+ adapter annotations are now generated natively. -src/deepgram/core/query_encoder.py +src/deepgram/core/query_encoder.py.bak # The generated metadata fallback must match the published SDK version in source # checkouts and carries a release-please marker so it is updated on release. # [temporarily frozen — remove when Fern emits a release-managed fallback] -src/deepgram/core/client_wrapper.py +src/deepgram/core/client_wrapper.py.bak # Generated docstrings have a local whitespace cleanup. # [temporarily frozen — remove when Fern emits whitespace-clean docstrings] -src/deepgram/speak/v2/types/speak_v2warning.py -src/deepgram/speak/v2/requests/speak_v2warning.py -src/deepgram/agent/v1/types/agent_v1inject_dynamic_agent_message.py -src/deepgram/agent/v1/requests/agent_v1inject_dynamic_agent_message.py -src/deepgram/listen/v1/types/listen_v1configure_failure.py -src/deepgram/listen/v1/requests/listen_v1configure_failure.py +src/deepgram/speak/v2/types/speak_v2warning.py.bak +src/deepgram/speak/v2/requests/speak_v2warning.py.bak +src/deepgram/agent/v1/types/agent_v1inject_dynamic_agent_message.py.bak +src/deepgram/agent/v1/requests/agent_v1inject_dynamic_agent_message.py.bak +src/deepgram/listen/v1/types/listen_v1configure_failure.py.bak +src/deepgram/listen/v1/requests/listen_v1configure_failure.py.bak # Read-side compatibility for the SDK 7.7 Listen V2 response retype. These # generated response models inherit the hand-written base above so callers can # temporarily use both attribute and read-only subscript access. Remove the custom # inheritance and unfreeze these files in the next major release. # [temporarily frozen -- manual patch described above] -src/deepgram/listen/v2/types/listen_v2connected.py -src/deepgram/listen/v2/types/listen_v2turn_info.py -src/deepgram/listen/v2/types/listen_v2turn_info_words_item.py -src/deepgram/listen/v2/types/listen_v2configure_success.py -src/deepgram/listen/v2/types/listen_v2configure_success_thresholds.py -src/deepgram/listen/v2/types/listen_v2configure_failure.py -src/deepgram/listen/v2/types/listen_v2fatal_error.py -src/deepgram/listen/v2/types/listen_v2warning.py +src/deepgram/listen/v2/types/listen_v2connected.py.bak +src/deepgram/listen/v2/types/listen_v2turn_info.py.bak +src/deepgram/listen/v2/types/listen_v2turn_info_words_item.py.bak +src/deepgram/listen/v2/types/listen_v2configure_success.py.bak +src/deepgram/listen/v2/types/listen_v2configure_success_thresholds.py.bak +src/deepgram/listen/v2/types/listen_v2configure_failure.py.bak +src/deepgram/listen/v2/types/listen_v2fatal_error.py.bak +src/deepgram/listen/v2/types/listen_v2warning.py.bak # Hand-written custom tests tests/custom/test_agent_custom_think_provider.py @@ -298,14 +298,14 @@ tests/custom/test_voice_agent_force_end_turn_example.py tests/typecheck/compat_aliases.py # Wire test with restored compatibility coverage for legacy create-key request alias -tests/wire/test_manage_v1_projects_keys.py +tests/wire/test_manage_v1_projects_keys.py.bak # Wire test with restored query-parameter coverage for manage.v1.projects.requests.list. # The 2026-08-11 regen simplified the upstream spec *example* for this endpoint, and Fern # derives the wire test from the example, so the generated test dropped all ten optional # query params (including the datetime -> ISO-8601 Z encoding) while the client signature # still forwards them. Frozen so future regens do not silently drop that check again. -tests/wire/test_manage_v1_projects_requests.py +tests/wire/test_manage_v1_projects_requests.py.bak # Wire test with restored query-parameter coverage for listen.v1.media.transcribe_url. # Third instance of the same mechanism as the two entries above: the 2026-08-18 regen @@ -314,7 +314,7 @@ tests/wire/test_manage_v1_projects_requests.py # dropped all 37 optional query params -- including the bool -> lowercase "true"/"false" # assertions -- while the client signature still forwards every one of them. Frozen so # future regens cannot silently drop that check again. -tests/wire/test_listen_v1_media.py +tests/wire/test_listen_v1_media.py.bak # Manual standalone tests tests/manual @@ -364,7 +364,7 @@ AGENTS.md # file before (fdcce88, ad93815, 4bee463) and would strip them. # [temporarily frozen — unfreeze + re-diff before each regen, then re-apply the # three coverage lines] -.gitignore +.gitignore.bak # Folders to ignore .github diff --git a/.gitignore.bak b/.gitignore.bak new file mode 100644 index 00000000..765eb109 --- /dev/null +++ b/.gitignore.bak @@ -0,0 +1,8 @@ +.mypy_cache/ +.ruff_cache/ +__pycache__/ +dist/ +poetry.toml +.coverage +htmlcov/ +coverage.xml diff --git a/src/deepgram/__init__.py.bak b/src/deepgram/__init__.py.bak new file mode 100644 index 00000000..9fade4cd --- /dev/null +++ b/src/deepgram/__init__.py.bak @@ -0,0 +1,1420 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .types import ( + AgentConfigurationV1, + AgentThinkModelsV1Response, + AgentThinkModelsV1ResponseModelsItem, + AgentThinkModelsV1ResponseModelsItemId, + AgentThinkModelsV1ResponseModelsItemOne, + AgentThinkModelsV1ResponseModelsItemOneId, + AgentThinkModelsV1ResponseModelsItemThree, + AgentThinkModelsV1ResponseModelsItemTwo, + AgentThinkModelsV1ResponseModelsItemTwoId, + AgentThinkModelsV1ResponseModelsItemZero, + AgentThinkModelsV1ResponseModelsItemZeroId, + AgentVariableV1, + Anthropic, + AnthropicModel, + AwsBedrockThinkProvider, + AwsBedrockThinkProviderCredentials, + AwsBedrockThinkProviderCredentialsType, + AwsBedrockThinkProviderModel, + AwsPollySpeakProvider, + AwsPollySpeakProviderCredentials, + AwsPollySpeakProviderCredentialsType, + AwsPollySpeakProviderEngine, + AwsPollySpeakProviderVoice, + BillingBreakdownV1Response, + BillingBreakdownV1ResponseResolution, + BillingBreakdownV1ResponseResultsItem, + BillingBreakdownV1ResponseResultsItemGrouping, + Cartesia, + CartesiaModelId, + CartesiaVoice, + CreateAgentConfigurationV1Response, + CreateKeyV1Request, + CreateKeyV1Response, + CreateProjectDistributionCredentialsV1Response, + CreateProjectDistributionCredentialsV1ResponseDistributionCredentials, + CreateProjectDistributionCredentialsV1ResponseMember, + CreateProjectInviteV1Response, + Deepgram, + DeepgramListenProviderV1, + DeepgramListenProviderV2, + DeepgramModel, + DeepgramThinkLiveProviderV1, + DeepgramThinkProvider, + DeepgramThinkProviderModel, + DeepgramThinkProviderReasoningMode, + DeleteAgentConfigurationV1Response, + DeleteAgentVariableV1Response, + DeleteProjectInviteV1Response, + DeleteProjectKeyV1Response, + DeleteProjectMemberV1Response, + DeleteProjectV1Response, + ElevenLabsSpeakProvider, + ElevenLabsSpeakProviderModelId, + ErrorResponse, + ErrorResponseLegacyError, + ErrorResponseModernError, + ErrorResponseTextError, + GetModelV1Response, + GetModelV1ResponseBatch, + GetModelV1ResponseMetadata, + GetModelV1ResponseMetadataMetadata, + GetProjectBalanceV1Response, + GetProjectDistributionCredentialsV1Response, + GetProjectDistributionCredentialsV1ResponseDistributionCredentials, + GetProjectDistributionCredentialsV1ResponseMember, + GetProjectKeyV1Response, + GetProjectKeyV1ResponseItem, + GetProjectKeyV1ResponseItemMember, + GetProjectKeyV1ResponseItemMemberApiKey, + GetProjectRequestV1Response, + GetProjectV1Response, + Google, + GoogleModel, + GoogleVersion, + GrantV1Response, + Groq, + GroqReasoningMode, + LeaveProjectV1Response, + ListAgentConfigurationsV1Response, + ListAgentVariablesV1Response, + ListBillingFieldsV1Response, + ListBillingFieldsV1ResponseDeploymentsItem, + ListModelsV1Response, + ListModelsV1ResponseSttModels, + ListModelsV1ResponseTtsModels, + ListModelsV1ResponseTtsModelsMetadata, + ListProjectBalancesV1Response, + ListProjectBalancesV1ResponseBalancesItem, + ListProjectDistributionCredentialsV1Response, + ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItem, + ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemDistributionCredentials, + ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemMember, + ListProjectInvitesV1Response, + ListProjectInvitesV1ResponseInvitesItem, + ListProjectKeysV1Response, + ListProjectKeysV1ResponseApiKeysItem, + ListProjectKeysV1ResponseApiKeysItemApiKey, + ListProjectKeysV1ResponseApiKeysItemMember, + ListProjectMemberScopesV1Response, + ListProjectMembersV1Response, + ListProjectMembersV1ResponseMembersItem, + ListProjectPurchasesV1Response, + ListProjectPurchasesV1ResponseOrdersItem, + ListProjectRequestsV1Response, + ListProjectsV1Response, + ListProjectsV1ResponseProjectsItem, + ListenV1AcceptedResponse, + ListenV1Callback, + ListenV1CallbackMethod, + ListenV1Channels, + ListenV1DetectEntities, + ListenV1Diarize, + ListenV1Dictation, + ListenV1Encoding, + ListenV1Endpointing, + ListenV1Extra, + ListenV1InterimResults, + ListenV1Keyterm, + ListenV1Keywords, + ListenV1Language, + ListenV1LanguageHint, + ListenV1MipOptOut, + ListenV1Model, + ListenV1Multichannel, + ListenV1Numerals, + ListenV1ProfanityFilter, + ListenV1Punctuate, + ListenV1Redact, + ListenV1RedactUsage, + ListenV1Replace, + ListenV1RequestFile, + ListenV1Response, + ListenV1ResponseMetadata, + ListenV1ResponseMetadataDiarizeInfo, + ListenV1ResponseMetadataIntentsInfo, + ListenV1ResponseMetadataSentimentInfo, + ListenV1ResponseMetadataSummaryInfo, + ListenV1ResponseMetadataTopicsInfo, + ListenV1ResponseResults, + ListenV1ResponseResultsChannels, + ListenV1ResponseResultsChannelsItem, + ListenV1ResponseResultsChannelsItemAlternativesItem, + ListenV1ResponseResultsChannelsItemAlternativesItemEntitiesItem, + ListenV1ResponseResultsChannelsItemAlternativesItemParagraphs, + ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParagraphsItem, + ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParagraphsItemSentencesItem, + ListenV1ResponseResultsChannelsItemAlternativesItemSummariesItem, + ListenV1ResponseResultsChannelsItemAlternativesItemTopicsItem, + ListenV1ResponseResultsChannelsItemAlternativesItemWordsItem, + ListenV1ResponseResultsChannelsItemSearchItem, + ListenV1ResponseResultsChannelsItemSearchItemHitsItem, + ListenV1ResponseResultsSummary, + ListenV1ResponseResultsUtterances, + ListenV1ResponseResultsUtterancesItem, + ListenV1ResponseResultsUtterancesItemWordsItem, + ListenV1SampleRate, + ListenV1Search, + ListenV1SmartFormat, + ListenV1Tag, + ListenV1UtteranceEndMs, + ListenV1VadEvents, + ListenV1Version, + ListenV2ConfigureNumerals, + ListenV2ConfigureRedactUsage, + ListenV2EagerEotThreshold, + ListenV2Encoding, + ListenV2EotThreshold, + ListenV2EotTimeoutMs, + ListenV2Keyterm, + ListenV2LanguageHint, + ListenV2MipOptOut, + ListenV2Model, + ListenV2Numerals, + ListenV2ProfanityFilter, + ListenV2Redact, + ListenV2RedactUsage, + ListenV2SampleRate, + ListenV2Tag, + OpenAiSpeakProvider, + OpenAiSpeakProviderModel, + OpenAiSpeakProviderVoice, + OpenAiThinkProvider, + OpenAiThinkProviderModel, + OpenAiThinkProviderReasoningMode, + ProjectRequestResponse, + ReadV1Request, + ReadV1RequestText, + ReadV1RequestUrl, + ReadV1Response, + ReadV1ResponseMetadata, + ReadV1ResponseMetadataMetadata, + ReadV1ResponseMetadataMetadataIntentsInfo, + ReadV1ResponseMetadataMetadataSentimentInfo, + ReadV1ResponseMetadataMetadataSummaryInfo, + ReadV1ResponseMetadataMetadataTopicsInfo, + ReadV1ResponseResults, + ReadV1ResponseResultsSummary, + ReadV1ResponseResultsSummaryResults, + ReadV1ResponseResultsSummaryResultsSummary, + SharedIntents, + SharedIntentsSegmentsItem, + SharedIntentsSegmentsItemIntentsItem, + SharedSentiments, + SharedSentimentsAverage, + SharedSentimentsSegmentsItem, + SharedTopics, + SharedTopicsSegmentsItem, + SharedTopicsSegmentsItemTopicsItem, + SpeakSettingsV1, + SpeakSettingsV1Endpoint, + SpeakSettingsV1Provider, + SpeakSettingsV1Provider_AwsPolly, + SpeakSettingsV1Provider_Cartesia, + SpeakSettingsV1Provider_Deepgram, + SpeakSettingsV1Provider_ElevenLabs, + SpeakSettingsV1Provider_OpenAi, + SpeakV1Encoding, + SpeakV1MipOptOut, + SpeakV1Model, + SpeakV1Response, + SpeakV1SampleRate, + SpeakV1Speed, + SpeakV2AcceptedResponse, + SpeakV2Encoding, + SpeakV2Expressivity, + SpeakV2MipOptOut, + SpeakV2Model, + SpeakV2NormalizeVolume, + SpeakV2Response, + SpeakV2SampleRate, + SpeakV2Speed, + SpeakV2SpeedValue, + SpeakV2Tag, + ThinkLiveSettingsV1, + ThinkSettingsV1, + ThinkSettingsV1ContextLength, + ThinkSettingsV1Endpoint, + ThinkSettingsV1FunctionsItem, + ThinkSettingsV1FunctionsItemEndpoint, + ThinkSettingsV1Provider, + ThinkSettingsV1Provider_Anthropic, + ThinkSettingsV1Provider_AwsBedrock, + ThinkSettingsV1Provider_Deepgram, + ThinkSettingsV1Provider_Google, + ThinkSettingsV1Provider_Groq, + ThinkSettingsV1Provider_OpenAi, + UpdateProjectMemberScopesV1Response, + UpdateProjectV1Response, + UsageBreakdownV1Response, + UsageBreakdownV1ResponseResolution, + UsageBreakdownV1ResponseResultsItem, + UsageBreakdownV1ResponseResultsItemGrouping, + UsageFieldsV1Response, + UsageFieldsV1ResponseModelsItem, + UsageV1Response, + UsageV1ResponseResolution, + ) + from .errors import BadRequestError + from . import agent, auth, listen, manage, read, self_hosted, speak, voice_agent + from ._default_clients import DefaultAioHttpClient, DefaultAsyncHttpxClient + from .client import AsyncDeepgramClient, DeepgramClient + from .environment import DeepgramClientEnvironment + from .requests import ( + AgentConfigurationV1Params, + AgentThinkModelsV1ResponseModelsItemIdParams, + AgentThinkModelsV1ResponseModelsItemOneParams, + AgentThinkModelsV1ResponseModelsItemParams, + AgentThinkModelsV1ResponseModelsItemThreeParams, + AgentThinkModelsV1ResponseModelsItemTwoParams, + AgentThinkModelsV1ResponseModelsItemZeroParams, + AgentThinkModelsV1ResponseParams, + AgentVariableV1Params, + AnthropicParams, + AwsBedrockThinkProviderCredentialsParams, + AwsBedrockThinkProviderParams, + AwsPollySpeakProviderCredentialsParams, + AwsPollySpeakProviderParams, + BillingBreakdownV1ResponseParams, + BillingBreakdownV1ResponseResolutionParams, + BillingBreakdownV1ResponseResultsItemGroupingParams, + BillingBreakdownV1ResponseResultsItemParams, + CartesiaParams, + CartesiaVoiceParams, + CreateAgentConfigurationV1ResponseParams, + CreateKeyV1RequestParams, + CreateKeyV1ResponseParams, + CreateProjectDistributionCredentialsV1ResponseDistributionCredentialsParams, + CreateProjectDistributionCredentialsV1ResponseMemberParams, + CreateProjectDistributionCredentialsV1ResponseParams, + CreateProjectInviteV1ResponseParams, + DeepgramListenProviderV1Params, + DeepgramListenProviderV2Params, + DeepgramParams, + DeepgramThinkLiveProviderV1Params, + DeepgramThinkProviderParams, + DeleteProjectInviteV1ResponseParams, + DeleteProjectKeyV1ResponseParams, + DeleteProjectMemberV1ResponseParams, + DeleteProjectV1ResponseParams, + ElevenLabsSpeakProviderParams, + ErrorResponseLegacyErrorParams, + ErrorResponseModernErrorParams, + ErrorResponseParams, + GetModelV1ResponseBatchParams, + GetModelV1ResponseMetadataMetadataParams, + GetModelV1ResponseMetadataParams, + GetModelV1ResponseParams, + GetProjectBalanceV1ResponseParams, + GetProjectDistributionCredentialsV1ResponseDistributionCredentialsParams, + GetProjectDistributionCredentialsV1ResponseMemberParams, + GetProjectDistributionCredentialsV1ResponseParams, + GetProjectKeyV1ResponseItemMemberApiKeyParams, + GetProjectKeyV1ResponseItemMemberParams, + GetProjectKeyV1ResponseItemParams, + GetProjectKeyV1ResponseParams, + GetProjectRequestV1ResponseParams, + GetProjectV1ResponseParams, + GoogleParams, + GrantV1ResponseParams, + GroqParams, + LeaveProjectV1ResponseParams, + ListAgentConfigurationsV1ResponseParams, + ListAgentVariablesV1ResponseParams, + ListBillingFieldsV1ResponseParams, + ListModelsV1ResponseParams, + ListModelsV1ResponseSttModelsParams, + ListModelsV1ResponseTtsModelsMetadataParams, + ListModelsV1ResponseTtsModelsParams, + ListProjectBalancesV1ResponseBalancesItemParams, + ListProjectBalancesV1ResponseParams, + ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemDistributionCredentialsParams, + ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemMemberParams, + ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemParams, + ListProjectDistributionCredentialsV1ResponseParams, + ListProjectInvitesV1ResponseInvitesItemParams, + ListProjectInvitesV1ResponseParams, + ListProjectKeysV1ResponseApiKeysItemApiKeyParams, + ListProjectKeysV1ResponseApiKeysItemMemberParams, + ListProjectKeysV1ResponseApiKeysItemParams, + ListProjectKeysV1ResponseParams, + ListProjectMemberScopesV1ResponseParams, + ListProjectMembersV1ResponseMembersItemParams, + ListProjectMembersV1ResponseParams, + ListProjectPurchasesV1ResponseOrdersItemParams, + ListProjectPurchasesV1ResponseParams, + ListProjectRequestsV1ResponseParams, + ListProjectsV1ResponseParams, + ListProjectsV1ResponseProjectsItemParams, + ListenV1AcceptedResponseParams, + ListenV1LanguageHintParams, + ListenV1ResponseMetadataDiarizeInfoParams, + ListenV1ResponseMetadataIntentsInfoParams, + ListenV1ResponseMetadataParams, + ListenV1ResponseMetadataSentimentInfoParams, + ListenV1ResponseMetadataSummaryInfoParams, + ListenV1ResponseMetadataTopicsInfoParams, + ListenV1ResponseParams, + ListenV1ResponseResultsChannelsItemAlternativesItemEntitiesItemParams, + ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParagraphsItemParams, + ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParagraphsItemSentencesItemParams, + ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParams, + ListenV1ResponseResultsChannelsItemAlternativesItemParams, + ListenV1ResponseResultsChannelsItemAlternativesItemSummariesItemParams, + ListenV1ResponseResultsChannelsItemAlternativesItemTopicsItemParams, + ListenV1ResponseResultsChannelsItemAlternativesItemWordsItemParams, + ListenV1ResponseResultsChannelsItemParams, + ListenV1ResponseResultsChannelsItemSearchItemHitsItemParams, + ListenV1ResponseResultsChannelsItemSearchItemParams, + ListenV1ResponseResultsChannelsParams, + ListenV1ResponseResultsParams, + ListenV1ResponseResultsSummaryParams, + ListenV1ResponseResultsUtterancesItemParams, + ListenV1ResponseResultsUtterancesItemWordsItemParams, + ListenV1ResponseResultsUtterancesParams, + ListenV2KeytermParams, + ListenV2LanguageHintParams, + OpenAiSpeakProviderParams, + OpenAiThinkProviderParams, + ProjectRequestResponseParams, + ReadV1RequestParams, + ReadV1RequestTextParams, + ReadV1RequestUrlParams, + ReadV1ResponseMetadataMetadataIntentsInfoParams, + ReadV1ResponseMetadataMetadataParams, + ReadV1ResponseMetadataMetadataSentimentInfoParams, + ReadV1ResponseMetadataMetadataSummaryInfoParams, + ReadV1ResponseMetadataMetadataTopicsInfoParams, + ReadV1ResponseMetadataParams, + ReadV1ResponseParams, + ReadV1ResponseResultsParams, + ReadV1ResponseResultsSummaryParams, + ReadV1ResponseResultsSummaryResultsParams, + ReadV1ResponseResultsSummaryResultsSummaryParams, + SharedIntentsParams, + SharedIntentsSegmentsItemIntentsItemParams, + SharedIntentsSegmentsItemParams, + SharedSentimentsAverageParams, + SharedSentimentsParams, + SharedSentimentsSegmentsItemParams, + SharedTopicsParams, + SharedTopicsSegmentsItemParams, + SharedTopicsSegmentsItemTopicsItemParams, + SpeakSettingsV1EndpointParams, + SpeakSettingsV1Params, + SpeakSettingsV1ProviderParams, + SpeakSettingsV1Provider_AwsPollyParams, + SpeakSettingsV1Provider_CartesiaParams, + SpeakSettingsV1Provider_DeepgramParams, + SpeakSettingsV1Provider_ElevenLabsParams, + SpeakSettingsV1Provider_OpenAiParams, + SpeakV2AcceptedResponseParams, + ThinkLiveSettingsV1Params, + ThinkSettingsV1ContextLengthParams, + ThinkSettingsV1EndpointParams, + ThinkSettingsV1FunctionsItemEndpointParams, + ThinkSettingsV1FunctionsItemParams, + ThinkSettingsV1Params, + ThinkSettingsV1ProviderParams, + ThinkSettingsV1Provider_AnthropicParams, + ThinkSettingsV1Provider_AwsBedrockParams, + ThinkSettingsV1Provider_DeepgramParams, + ThinkSettingsV1Provider_GoogleParams, + ThinkSettingsV1Provider_GroqParams, + ThinkSettingsV1Provider_OpenAiParams, + UpdateProjectMemberScopesV1ResponseParams, + UpdateProjectV1ResponseParams, + UsageBreakdownV1ResponseParams, + UsageBreakdownV1ResponseResolutionParams, + UsageBreakdownV1ResponseResultsItemGroupingParams, + UsageBreakdownV1ResponseResultsItemParams, + UsageFieldsV1ResponseModelsItemParams, + UsageFieldsV1ResponseParams, + UsageV1ResponseParams, + UsageV1ResponseResolutionParams, + ) + from .version import __version__ +_dynamic_imports: typing.Dict[str, str] = { + "AgentConfigurationV1": ".types", + "AgentConfigurationV1Params": ".requests", + "AgentThinkModelsV1Response": ".types", + "AgentThinkModelsV1ResponseModelsItem": ".types", + "AgentThinkModelsV1ResponseModelsItemId": ".types", + "AgentThinkModelsV1ResponseModelsItemIdParams": ".requests", + "AgentThinkModelsV1ResponseModelsItemOne": ".types", + "AgentThinkModelsV1ResponseModelsItemOneId": ".types", + "AgentThinkModelsV1ResponseModelsItemOneParams": ".requests", + "AgentThinkModelsV1ResponseModelsItemParams": ".requests", + "AgentThinkModelsV1ResponseModelsItemThree": ".types", + "AgentThinkModelsV1ResponseModelsItemThreeParams": ".requests", + "AgentThinkModelsV1ResponseModelsItemTwo": ".types", + "AgentThinkModelsV1ResponseModelsItemTwoId": ".types", + "AgentThinkModelsV1ResponseModelsItemTwoParams": ".requests", + "AgentThinkModelsV1ResponseModelsItemZero": ".types", + "AgentThinkModelsV1ResponseModelsItemZeroId": ".types", + "AgentThinkModelsV1ResponseModelsItemZeroParams": ".requests", + "AgentThinkModelsV1ResponseParams": ".requests", + "AgentVariableV1": ".types", + "AgentVariableV1Params": ".requests", + "Anthropic": ".types", + "AnthropicModel": ".types", + "AnthropicParams": ".requests", + "AsyncDeepgramClient": ".client", + "AwsBedrockThinkProvider": ".types", + "AwsBedrockThinkProviderCredentials": ".types", + "AwsBedrockThinkProviderCredentialsParams": ".requests", + "AwsBedrockThinkProviderCredentialsType": ".types", + "AwsBedrockThinkProviderModel": ".types", + "AwsBedrockThinkProviderParams": ".requests", + "AwsPollySpeakProvider": ".types", + "AwsPollySpeakProviderCredentials": ".types", + "AwsPollySpeakProviderCredentialsParams": ".requests", + "AwsPollySpeakProviderCredentialsType": ".types", + "AwsPollySpeakProviderEngine": ".types", + "AwsPollySpeakProviderParams": ".requests", + "AwsPollySpeakProviderVoice": ".types", + "BadRequestError": ".errors", + "BillingBreakdownV1Response": ".types", + "BillingBreakdownV1ResponseParams": ".requests", + "BillingBreakdownV1ResponseResolution": ".types", + "BillingBreakdownV1ResponseResolutionParams": ".requests", + "BillingBreakdownV1ResponseResultsItem": ".types", + "BillingBreakdownV1ResponseResultsItemGrouping": ".types", + "BillingBreakdownV1ResponseResultsItemGroupingParams": ".requests", + "BillingBreakdownV1ResponseResultsItemParams": ".requests", + "Cartesia": ".types", + "CartesiaModelId": ".types", + "CartesiaParams": ".requests", + "CartesiaVoice": ".types", + "CartesiaVoiceParams": ".requests", + "CreateAgentConfigurationV1Response": ".types", + "CreateAgentConfigurationV1ResponseParams": ".requests", + "CreateKeyV1Request": ".types", + "CreateKeyV1RequestParams": ".requests", + "CreateKeyV1Response": ".types", + "CreateKeyV1ResponseParams": ".requests", + "CreateProjectDistributionCredentialsV1Response": ".types", + "CreateProjectDistributionCredentialsV1ResponseDistributionCredentials": ".types", + "CreateProjectDistributionCredentialsV1ResponseDistributionCredentialsParams": ".requests", + "CreateProjectDistributionCredentialsV1ResponseMember": ".types", + "CreateProjectDistributionCredentialsV1ResponseMemberParams": ".requests", + "CreateProjectDistributionCredentialsV1ResponseParams": ".requests", + "CreateProjectInviteV1Response": ".types", + "CreateProjectInviteV1ResponseParams": ".requests", + "Deepgram": ".types", + "DeepgramClient": ".client", + "DeepgramClientEnvironment": ".environment", + "DeepgramListenProviderV1": ".types", + "DeepgramListenProviderV1Params": ".requests", + "DeepgramListenProviderV2": ".types", + "DeepgramListenProviderV2Params": ".requests", + "DeepgramModel": ".types", + "DeepgramParams": ".requests", + "DeepgramThinkLiveProviderV1": ".types", + "DeepgramThinkLiveProviderV1Params": ".requests", + "DeepgramThinkProvider": ".types", + "DeepgramThinkProviderModel": ".types", + "DeepgramThinkProviderParams": ".requests", + "DeepgramThinkProviderReasoningMode": ".types", + "DefaultAioHttpClient": "._default_clients", + "DefaultAsyncHttpxClient": "._default_clients", + "DeleteAgentConfigurationV1Response": ".types", + "DeleteAgentVariableV1Response": ".types", + "DeleteProjectInviteV1Response": ".types", + "DeleteProjectInviteV1ResponseParams": ".requests", + "DeleteProjectKeyV1Response": ".types", + "DeleteProjectKeyV1ResponseParams": ".requests", + "DeleteProjectMemberV1Response": ".types", + "DeleteProjectMemberV1ResponseParams": ".requests", + "DeleteProjectV1Response": ".types", + "DeleteProjectV1ResponseParams": ".requests", + "ElevenLabsSpeakProvider": ".types", + "ElevenLabsSpeakProviderModelId": ".types", + "ElevenLabsSpeakProviderParams": ".requests", + "ErrorResponse": ".types", + "ErrorResponseLegacyError": ".types", + "ErrorResponseLegacyErrorParams": ".requests", + "ErrorResponseModernError": ".types", + "ErrorResponseModernErrorParams": ".requests", + "ErrorResponseParams": ".requests", + "ErrorResponseTextError": ".types", + "GetModelV1Response": ".types", + "GetModelV1ResponseBatch": ".types", + "GetModelV1ResponseBatchParams": ".requests", + "GetModelV1ResponseMetadata": ".types", + "GetModelV1ResponseMetadataMetadata": ".types", + "GetModelV1ResponseMetadataMetadataParams": ".requests", + "GetModelV1ResponseMetadataParams": ".requests", + "GetModelV1ResponseParams": ".requests", + "GetProjectBalanceV1Response": ".types", + "GetProjectBalanceV1ResponseParams": ".requests", + "GetProjectDistributionCredentialsV1Response": ".types", + "GetProjectDistributionCredentialsV1ResponseDistributionCredentials": ".types", + "GetProjectDistributionCredentialsV1ResponseDistributionCredentialsParams": ".requests", + "GetProjectDistributionCredentialsV1ResponseMember": ".types", + "GetProjectDistributionCredentialsV1ResponseMemberParams": ".requests", + "GetProjectDistributionCredentialsV1ResponseParams": ".requests", + "GetProjectKeyV1Response": ".types", + "GetProjectKeyV1ResponseItem": ".types", + "GetProjectKeyV1ResponseItemMember": ".types", + "GetProjectKeyV1ResponseItemMemberApiKey": ".types", + "GetProjectKeyV1ResponseItemMemberApiKeyParams": ".requests", + "GetProjectKeyV1ResponseItemMemberParams": ".requests", + "GetProjectKeyV1ResponseItemParams": ".requests", + "GetProjectKeyV1ResponseParams": ".requests", + "GetProjectRequestV1Response": ".types", + "GetProjectRequestV1ResponseParams": ".requests", + "GetProjectV1Response": ".types", + "GetProjectV1ResponseParams": ".requests", + "Google": ".types", + "GoogleModel": ".types", + "GoogleParams": ".requests", + "GoogleVersion": ".types", + "GrantV1Response": ".types", + "GrantV1ResponseParams": ".requests", + "Groq": ".types", + "GroqParams": ".requests", + "GroqReasoningMode": ".types", + "LeaveProjectV1Response": ".types", + "LeaveProjectV1ResponseParams": ".requests", + "ListAgentConfigurationsV1Response": ".types", + "ListAgentConfigurationsV1ResponseParams": ".requests", + "ListAgentVariablesV1Response": ".types", + "ListAgentVariablesV1ResponseParams": ".requests", + "ListBillingFieldsV1Response": ".types", + "ListBillingFieldsV1ResponseDeploymentsItem": ".types", + "ListBillingFieldsV1ResponseParams": ".requests", + "ListModelsV1Response": ".types", + "ListModelsV1ResponseParams": ".requests", + "ListModelsV1ResponseSttModels": ".types", + "ListModelsV1ResponseSttModelsParams": ".requests", + "ListModelsV1ResponseTtsModels": ".types", + "ListModelsV1ResponseTtsModelsMetadata": ".types", + "ListModelsV1ResponseTtsModelsMetadataParams": ".requests", + "ListModelsV1ResponseTtsModelsParams": ".requests", + "ListProjectBalancesV1Response": ".types", + "ListProjectBalancesV1ResponseBalancesItem": ".types", + "ListProjectBalancesV1ResponseBalancesItemParams": ".requests", + "ListProjectBalancesV1ResponseParams": ".requests", + "ListProjectDistributionCredentialsV1Response": ".types", + "ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItem": ".types", + "ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemDistributionCredentials": ".types", + "ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemDistributionCredentialsParams": ".requests", + "ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemMember": ".types", + "ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemMemberParams": ".requests", + "ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemParams": ".requests", + "ListProjectDistributionCredentialsV1ResponseParams": ".requests", + "ListProjectInvitesV1Response": ".types", + "ListProjectInvitesV1ResponseInvitesItem": ".types", + "ListProjectInvitesV1ResponseInvitesItemParams": ".requests", + "ListProjectInvitesV1ResponseParams": ".requests", + "ListProjectKeysV1Response": ".types", + "ListProjectKeysV1ResponseApiKeysItem": ".types", + "ListProjectKeysV1ResponseApiKeysItemApiKey": ".types", + "ListProjectKeysV1ResponseApiKeysItemApiKeyParams": ".requests", + "ListProjectKeysV1ResponseApiKeysItemMember": ".types", + "ListProjectKeysV1ResponseApiKeysItemMemberParams": ".requests", + "ListProjectKeysV1ResponseApiKeysItemParams": ".requests", + "ListProjectKeysV1ResponseParams": ".requests", + "ListProjectMemberScopesV1Response": ".types", + "ListProjectMemberScopesV1ResponseParams": ".requests", + "ListProjectMembersV1Response": ".types", + "ListProjectMembersV1ResponseMembersItem": ".types", + "ListProjectMembersV1ResponseMembersItemParams": ".requests", + "ListProjectMembersV1ResponseParams": ".requests", + "ListProjectPurchasesV1Response": ".types", + "ListProjectPurchasesV1ResponseOrdersItem": ".types", + "ListProjectPurchasesV1ResponseOrdersItemParams": ".requests", + "ListProjectPurchasesV1ResponseParams": ".requests", + "ListProjectRequestsV1Response": ".types", + "ListProjectRequestsV1ResponseParams": ".requests", + "ListProjectsV1Response": ".types", + "ListProjectsV1ResponseParams": ".requests", + "ListProjectsV1ResponseProjectsItem": ".types", + "ListProjectsV1ResponseProjectsItemParams": ".requests", + "ListenV1AcceptedResponse": ".types", + "ListenV1AcceptedResponseParams": ".requests", + "ListenV1Callback": ".types", + "ListenV1CallbackMethod": ".types", + "ListenV1Channels": ".types", + "ListenV1DetectEntities": ".types", + "ListenV1Diarize": ".types", + "ListenV1Dictation": ".types", + "ListenV1Encoding": ".types", + "ListenV1Endpointing": ".types", + "ListenV1Extra": ".types", + "ListenV1InterimResults": ".types", + "ListenV1Keyterm": ".types", + "ListenV1Keywords": ".types", + "ListenV1Language": ".types", + "ListenV1LanguageHint": ".types", + "ListenV1LanguageHintParams": ".requests", + "ListenV1MipOptOut": ".types", + "ListenV1Model": ".types", + "ListenV1Multichannel": ".types", + "ListenV1Numerals": ".types", + "ListenV1ProfanityFilter": ".types", + "ListenV1Punctuate": ".types", + "ListenV1Redact": ".types", + "ListenV1RedactUsage": ".types", + "ListenV1Replace": ".types", + "ListenV1RequestFile": ".types", + "ListenV1Response": ".types", + "ListenV1ResponseMetadata": ".types", + "ListenV1ResponseMetadataDiarizeInfo": ".types", + "ListenV1ResponseMetadataDiarizeInfoParams": ".requests", + "ListenV1ResponseMetadataIntentsInfo": ".types", + "ListenV1ResponseMetadataIntentsInfoParams": ".requests", + "ListenV1ResponseMetadataParams": ".requests", + "ListenV1ResponseMetadataSentimentInfo": ".types", + "ListenV1ResponseMetadataSentimentInfoParams": ".requests", + "ListenV1ResponseMetadataSummaryInfo": ".types", + "ListenV1ResponseMetadataSummaryInfoParams": ".requests", + "ListenV1ResponseMetadataTopicsInfo": ".types", + "ListenV1ResponseMetadataTopicsInfoParams": ".requests", + "ListenV1ResponseParams": ".requests", + "ListenV1ResponseResults": ".types", + "ListenV1ResponseResultsChannels": ".types", + "ListenV1ResponseResultsChannelsItem": ".types", + "ListenV1ResponseResultsChannelsItemAlternativesItem": ".types", + "ListenV1ResponseResultsChannelsItemAlternativesItemEntitiesItem": ".types", + "ListenV1ResponseResultsChannelsItemAlternativesItemEntitiesItemParams": ".requests", + "ListenV1ResponseResultsChannelsItemAlternativesItemParagraphs": ".types", + "ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParagraphsItem": ".types", + "ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParagraphsItemParams": ".requests", + "ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParagraphsItemSentencesItem": ".types", + "ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParagraphsItemSentencesItemParams": ".requests", + "ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParams": ".requests", + "ListenV1ResponseResultsChannelsItemAlternativesItemParams": ".requests", + "ListenV1ResponseResultsChannelsItemAlternativesItemSummariesItem": ".types", + "ListenV1ResponseResultsChannelsItemAlternativesItemSummariesItemParams": ".requests", + "ListenV1ResponseResultsChannelsItemAlternativesItemTopicsItem": ".types", + "ListenV1ResponseResultsChannelsItemAlternativesItemTopicsItemParams": ".requests", + "ListenV1ResponseResultsChannelsItemAlternativesItemWordsItem": ".types", + "ListenV1ResponseResultsChannelsItemAlternativesItemWordsItemParams": ".requests", + "ListenV1ResponseResultsChannelsItemParams": ".requests", + "ListenV1ResponseResultsChannelsItemSearchItem": ".types", + "ListenV1ResponseResultsChannelsItemSearchItemHitsItem": ".types", + "ListenV1ResponseResultsChannelsItemSearchItemHitsItemParams": ".requests", + "ListenV1ResponseResultsChannelsItemSearchItemParams": ".requests", + "ListenV1ResponseResultsChannelsParams": ".requests", + "ListenV1ResponseResultsParams": ".requests", + "ListenV1ResponseResultsSummary": ".types", + "ListenV1ResponseResultsSummaryParams": ".requests", + "ListenV1ResponseResultsUtterances": ".types", + "ListenV1ResponseResultsUtterancesItem": ".types", + "ListenV1ResponseResultsUtterancesItemParams": ".requests", + "ListenV1ResponseResultsUtterancesItemWordsItem": ".types", + "ListenV1ResponseResultsUtterancesItemWordsItemParams": ".requests", + "ListenV1ResponseResultsUtterancesParams": ".requests", + "ListenV1SampleRate": ".types", + "ListenV1Search": ".types", + "ListenV1SmartFormat": ".types", + "ListenV1Tag": ".types", + "ListenV1UtteranceEndMs": ".types", + "ListenV1VadEvents": ".types", + "ListenV1Version": ".types", + "ListenV2ConfigureNumerals": ".types", + "ListenV2ConfigureRedactUsage": ".types", + "ListenV2EagerEotThreshold": ".types", + "ListenV2Encoding": ".types", + "ListenV2EotThreshold": ".types", + "ListenV2EotTimeoutMs": ".types", + "ListenV2Keyterm": ".types", + "ListenV2KeytermParams": ".requests", + "ListenV2LanguageHint": ".types", + "ListenV2LanguageHintParams": ".requests", + "ListenV2MipOptOut": ".types", + "ListenV2Model": ".types", + "ListenV2Numerals": ".types", + "ListenV2ProfanityFilter": ".types", + "ListenV2Redact": ".types", + "ListenV2RedactUsage": ".types", + "ListenV2SampleRate": ".types", + "ListenV2Tag": ".types", + "OpenAiSpeakProvider": ".types", + "OpenAiSpeakProviderModel": ".types", + "OpenAiSpeakProviderParams": ".requests", + "OpenAiSpeakProviderVoice": ".types", + "OpenAiThinkProvider": ".types", + "OpenAiThinkProviderModel": ".types", + "OpenAiThinkProviderParams": ".requests", + "OpenAiThinkProviderReasoningMode": ".types", + "ProjectRequestResponse": ".types", + "ProjectRequestResponseParams": ".requests", + "ReadV1Request": ".types", + "ReadV1RequestParams": ".requests", + "ReadV1RequestText": ".types", + "ReadV1RequestTextParams": ".requests", + "ReadV1RequestUrl": ".types", + "ReadV1RequestUrlParams": ".requests", + "ReadV1Response": ".types", + "ReadV1ResponseMetadata": ".types", + "ReadV1ResponseMetadataMetadata": ".types", + "ReadV1ResponseMetadataMetadataIntentsInfo": ".types", + "ReadV1ResponseMetadataMetadataIntentsInfoParams": ".requests", + "ReadV1ResponseMetadataMetadataParams": ".requests", + "ReadV1ResponseMetadataMetadataSentimentInfo": ".types", + "ReadV1ResponseMetadataMetadataSentimentInfoParams": ".requests", + "ReadV1ResponseMetadataMetadataSummaryInfo": ".types", + "ReadV1ResponseMetadataMetadataSummaryInfoParams": ".requests", + "ReadV1ResponseMetadataMetadataTopicsInfo": ".types", + "ReadV1ResponseMetadataMetadataTopicsInfoParams": ".requests", + "ReadV1ResponseMetadataParams": ".requests", + "ReadV1ResponseParams": ".requests", + "ReadV1ResponseResults": ".types", + "ReadV1ResponseResultsParams": ".requests", + "ReadV1ResponseResultsSummary": ".types", + "ReadV1ResponseResultsSummaryParams": ".requests", + "ReadV1ResponseResultsSummaryResults": ".types", + "ReadV1ResponseResultsSummaryResultsParams": ".requests", + "ReadV1ResponseResultsSummaryResultsSummary": ".types", + "ReadV1ResponseResultsSummaryResultsSummaryParams": ".requests", + "SharedIntents": ".types", + "SharedIntentsParams": ".requests", + "SharedIntentsSegmentsItem": ".types", + "SharedIntentsSegmentsItemIntentsItem": ".types", + "SharedIntentsSegmentsItemIntentsItemParams": ".requests", + "SharedIntentsSegmentsItemParams": ".requests", + "SharedSentiments": ".types", + "SharedSentimentsAverage": ".types", + "SharedSentimentsAverageParams": ".requests", + "SharedSentimentsParams": ".requests", + "SharedSentimentsSegmentsItem": ".types", + "SharedSentimentsSegmentsItemParams": ".requests", + "SharedTopics": ".types", + "SharedTopicsParams": ".requests", + "SharedTopicsSegmentsItem": ".types", + "SharedTopicsSegmentsItemParams": ".requests", + "SharedTopicsSegmentsItemTopicsItem": ".types", + "SharedTopicsSegmentsItemTopicsItemParams": ".requests", + "SpeakSettingsV1": ".types", + "SpeakSettingsV1Endpoint": ".types", + "SpeakSettingsV1EndpointParams": ".requests", + "SpeakSettingsV1Params": ".requests", + "SpeakSettingsV1Provider": ".types", + "SpeakSettingsV1ProviderParams": ".requests", + "SpeakSettingsV1Provider_AwsPolly": ".types", + "SpeakSettingsV1Provider_AwsPollyParams": ".requests", + "SpeakSettingsV1Provider_Cartesia": ".types", + "SpeakSettingsV1Provider_CartesiaParams": ".requests", + "SpeakSettingsV1Provider_Deepgram": ".types", + "SpeakSettingsV1Provider_DeepgramParams": ".requests", + "SpeakSettingsV1Provider_ElevenLabs": ".types", + "SpeakSettingsV1Provider_ElevenLabsParams": ".requests", + "SpeakSettingsV1Provider_OpenAi": ".types", + "SpeakSettingsV1Provider_OpenAiParams": ".requests", + "SpeakV1Encoding": ".types", + "SpeakV1MipOptOut": ".types", + "SpeakV1Model": ".types", + "SpeakV1Response": ".types", + "SpeakV1SampleRate": ".types", + "SpeakV1Speed": ".types", + "SpeakV2AcceptedResponse": ".types", + "SpeakV2AcceptedResponseParams": ".requests", + "SpeakV2Encoding": ".types", + "SpeakV2Expressivity": ".types", + "SpeakV2MipOptOut": ".types", + "SpeakV2Model": ".types", + "SpeakV2NormalizeVolume": ".types", + "SpeakV2Response": ".types", + "SpeakV2SampleRate": ".types", + "SpeakV2Speed": ".types", + "SpeakV2SpeedValue": ".types", + "SpeakV2Tag": ".types", + "ThinkLiveSettingsV1": ".types", + "ThinkLiveSettingsV1Params": ".requests", + "ThinkSettingsV1": ".types", + "ThinkSettingsV1ContextLength": ".types", + "ThinkSettingsV1ContextLengthParams": ".requests", + "ThinkSettingsV1Endpoint": ".types", + "ThinkSettingsV1EndpointParams": ".requests", + "ThinkSettingsV1FunctionsItem": ".types", + "ThinkSettingsV1FunctionsItemEndpoint": ".types", + "ThinkSettingsV1FunctionsItemEndpointParams": ".requests", + "ThinkSettingsV1FunctionsItemParams": ".requests", + "ThinkSettingsV1Params": ".requests", + "ThinkSettingsV1Provider": ".types", + "ThinkSettingsV1ProviderParams": ".requests", + "ThinkSettingsV1Provider_Anthropic": ".types", + "ThinkSettingsV1Provider_AnthropicParams": ".requests", + "ThinkSettingsV1Provider_AwsBedrock": ".types", + "ThinkSettingsV1Provider_AwsBedrockParams": ".requests", + "ThinkSettingsV1Provider_Deepgram": ".types", + "ThinkSettingsV1Provider_DeepgramParams": ".requests", + "ThinkSettingsV1Provider_Google": ".types", + "ThinkSettingsV1Provider_GoogleParams": ".requests", + "ThinkSettingsV1Provider_Groq": ".types", + "ThinkSettingsV1Provider_GroqParams": ".requests", + "ThinkSettingsV1Provider_OpenAi": ".types", + "ThinkSettingsV1Provider_OpenAiParams": ".requests", + "UpdateProjectMemberScopesV1Response": ".types", + "UpdateProjectMemberScopesV1ResponseParams": ".requests", + "UpdateProjectV1Response": ".types", + "UpdateProjectV1ResponseParams": ".requests", + "UsageBreakdownV1Response": ".types", + "UsageBreakdownV1ResponseParams": ".requests", + "UsageBreakdownV1ResponseResolution": ".types", + "UsageBreakdownV1ResponseResolutionParams": ".requests", + "UsageBreakdownV1ResponseResultsItem": ".types", + "UsageBreakdownV1ResponseResultsItemGrouping": ".types", + "UsageBreakdownV1ResponseResultsItemGroupingParams": ".requests", + "UsageBreakdownV1ResponseResultsItemParams": ".requests", + "UsageFieldsV1Response": ".types", + "UsageFieldsV1ResponseModelsItem": ".types", + "UsageFieldsV1ResponseModelsItemParams": ".requests", + "UsageFieldsV1ResponseParams": ".requests", + "UsageV1Response": ".types", + "UsageV1ResponseParams": ".requests", + "UsageV1ResponseResolution": ".types", + "UsageV1ResponseResolutionParams": ".requests", + "__version__": ".version", + "agent": ".agent", + "auth": ".auth", + "listen": ".listen", + "manage": ".manage", + "read": ".read", + "self_hosted": ".self_hosted", + "speak": ".speak", + "voice_agent": ".voice_agent", +} + +_dynamic_imports.update( + { + "SharedIntentsResults": ".types", + "SharedIntentsResultsIntents": ".types", + "SharedIntentsResultsIntentsParams": ".requests", + "SharedIntentsResultsIntentsSegmentsItem": ".types", + "SharedIntentsResultsIntentsSegmentsItemIntentsItem": ".types", + "SharedIntentsResultsIntentsSegmentsItemIntentsItemParams": ".requests", + "SharedIntentsResultsIntentsSegmentsItemParams": ".requests", + "SharedIntentsResultsParams": ".requests", + "SharedTopicsResults": ".types", + "SharedTopicsResultsParams": ".requests", + "SharedTopicsResultsTopics": ".types", + "SharedTopicsResultsTopicsParams": ".requests", + "SharedTopicsResultsTopicsSegmentsItem": ".types", + "SharedTopicsResultsTopicsSegmentsItemParams": ".requests", + "SharedTopicsResultsTopicsSegmentsItemTopicsItem": ".types", + "SharedTopicsResultsTopicsSegmentsItemTopicsItemParams": ".requests", + "AnthropicThinkProviderModel": ".types", + "CartesiaSpeakProviderModelId": ".types", + "CartesiaSpeakProviderVoice": ".types", + "CartesiaSpeakProviderVoiceParams": ".requests", + "CreateKeyV1RequestOne": ".types", + "DeepgramListenProviderV2LanguageHint": ".types", + "DeepgramListenProviderV2LanguageHintParams": ".requests", + "DeepgramSpeakProviderModel": ".types", + "GoogleThinkProviderModel": ".types", + "GoogleThinkProviderVersion": ".types", + "GroqThinkProviderReasoningMode": ".types", + } +) + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = [ + "AgentConfigurationV1", + "AgentConfigurationV1Params", + "AgentThinkModelsV1Response", + "AgentThinkModelsV1ResponseModelsItem", + "AgentThinkModelsV1ResponseModelsItemId", + "AgentThinkModelsV1ResponseModelsItemIdParams", + "AgentThinkModelsV1ResponseModelsItemOne", + "AgentThinkModelsV1ResponseModelsItemOneId", + "AgentThinkModelsV1ResponseModelsItemOneParams", + "AgentThinkModelsV1ResponseModelsItemParams", + "AgentThinkModelsV1ResponseModelsItemThree", + "AgentThinkModelsV1ResponseModelsItemThreeParams", + "AgentThinkModelsV1ResponseModelsItemTwo", + "AgentThinkModelsV1ResponseModelsItemTwoId", + "AgentThinkModelsV1ResponseModelsItemTwoParams", + "AgentThinkModelsV1ResponseModelsItemZero", + "AgentThinkModelsV1ResponseModelsItemZeroId", + "AgentThinkModelsV1ResponseModelsItemZeroParams", + "AgentThinkModelsV1ResponseParams", + "AgentVariableV1", + "AgentVariableV1Params", + "Anthropic", + "AnthropicModel", + "AnthropicParams", + "AsyncDeepgramClient", + "AwsBedrockThinkProvider", + "AwsBedrockThinkProviderCredentials", + "AwsBedrockThinkProviderCredentialsParams", + "AwsBedrockThinkProviderCredentialsType", + "AwsBedrockThinkProviderModel", + "AwsBedrockThinkProviderParams", + "AwsPollySpeakProvider", + "AwsPollySpeakProviderCredentials", + "AwsPollySpeakProviderCredentialsParams", + "AwsPollySpeakProviderCredentialsType", + "AwsPollySpeakProviderEngine", + "AwsPollySpeakProviderParams", + "AwsPollySpeakProviderVoice", + "BadRequestError", + "BillingBreakdownV1Response", + "BillingBreakdownV1ResponseParams", + "BillingBreakdownV1ResponseResolution", + "BillingBreakdownV1ResponseResolutionParams", + "BillingBreakdownV1ResponseResultsItem", + "BillingBreakdownV1ResponseResultsItemGrouping", + "BillingBreakdownV1ResponseResultsItemGroupingParams", + "BillingBreakdownV1ResponseResultsItemParams", + "Cartesia", + "CartesiaModelId", + "CartesiaParams", + "CartesiaVoice", + "CartesiaVoiceParams", + "CreateAgentConfigurationV1Response", + "CreateAgentConfigurationV1ResponseParams", + "CreateKeyV1Request", + "CreateKeyV1RequestParams", + "CreateKeyV1Response", + "CreateKeyV1ResponseParams", + "CreateProjectDistributionCredentialsV1Response", + "CreateProjectDistributionCredentialsV1ResponseDistributionCredentials", + "CreateProjectDistributionCredentialsV1ResponseDistributionCredentialsParams", + "CreateProjectDistributionCredentialsV1ResponseMember", + "CreateProjectDistributionCredentialsV1ResponseMemberParams", + "CreateProjectDistributionCredentialsV1ResponseParams", + "CreateProjectInviteV1Response", + "CreateProjectInviteV1ResponseParams", + "Deepgram", + "DeepgramClient", + "DeepgramClientEnvironment", + "DeepgramListenProviderV1", + "DeepgramListenProviderV1Params", + "DeepgramListenProviderV2", + "DeepgramListenProviderV2Params", + "DeepgramModel", + "DeepgramParams", + "DeepgramThinkLiveProviderV1", + "DeepgramThinkLiveProviderV1Params", + "DeepgramThinkProvider", + "DeepgramThinkProviderModel", + "DeepgramThinkProviderParams", + "DeepgramThinkProviderReasoningMode", + "DefaultAioHttpClient", + "DefaultAsyncHttpxClient", + "DeleteAgentConfigurationV1Response", + "DeleteAgentVariableV1Response", + "DeleteProjectInviteV1Response", + "DeleteProjectInviteV1ResponseParams", + "DeleteProjectKeyV1Response", + "DeleteProjectKeyV1ResponseParams", + "DeleteProjectMemberV1Response", + "DeleteProjectMemberV1ResponseParams", + "DeleteProjectV1Response", + "DeleteProjectV1ResponseParams", + "ElevenLabsSpeakProvider", + "ElevenLabsSpeakProviderModelId", + "ElevenLabsSpeakProviderParams", + "ErrorResponse", + "ErrorResponseLegacyError", + "ErrorResponseLegacyErrorParams", + "ErrorResponseModernError", + "ErrorResponseModernErrorParams", + "ErrorResponseParams", + "ErrorResponseTextError", + "GetModelV1Response", + "GetModelV1ResponseBatch", + "GetModelV1ResponseBatchParams", + "GetModelV1ResponseMetadata", + "GetModelV1ResponseMetadataMetadata", + "GetModelV1ResponseMetadataMetadataParams", + "GetModelV1ResponseMetadataParams", + "GetModelV1ResponseParams", + "GetProjectBalanceV1Response", + "GetProjectBalanceV1ResponseParams", + "GetProjectDistributionCredentialsV1Response", + "GetProjectDistributionCredentialsV1ResponseDistributionCredentials", + "GetProjectDistributionCredentialsV1ResponseDistributionCredentialsParams", + "GetProjectDistributionCredentialsV1ResponseMember", + "GetProjectDistributionCredentialsV1ResponseMemberParams", + "GetProjectDistributionCredentialsV1ResponseParams", + "GetProjectKeyV1Response", + "GetProjectKeyV1ResponseItem", + "GetProjectKeyV1ResponseItemMember", + "GetProjectKeyV1ResponseItemMemberApiKey", + "GetProjectKeyV1ResponseItemMemberApiKeyParams", + "GetProjectKeyV1ResponseItemMemberParams", + "GetProjectKeyV1ResponseItemParams", + "GetProjectKeyV1ResponseParams", + "GetProjectRequestV1Response", + "GetProjectRequestV1ResponseParams", + "GetProjectV1Response", + "GetProjectV1ResponseParams", + "Google", + "GoogleModel", + "GoogleParams", + "GoogleVersion", + "GrantV1Response", + "GrantV1ResponseParams", + "Groq", + "GroqParams", + "GroqReasoningMode", + "LeaveProjectV1Response", + "LeaveProjectV1ResponseParams", + "ListAgentConfigurationsV1Response", + "ListAgentConfigurationsV1ResponseParams", + "ListAgentVariablesV1Response", + "ListAgentVariablesV1ResponseParams", + "ListBillingFieldsV1Response", + "ListBillingFieldsV1ResponseDeploymentsItem", + "ListBillingFieldsV1ResponseParams", + "ListModelsV1Response", + "ListModelsV1ResponseParams", + "ListModelsV1ResponseSttModels", + "ListModelsV1ResponseSttModelsParams", + "ListModelsV1ResponseTtsModels", + "ListModelsV1ResponseTtsModelsMetadata", + "ListModelsV1ResponseTtsModelsMetadataParams", + "ListModelsV1ResponseTtsModelsParams", + "ListProjectBalancesV1Response", + "ListProjectBalancesV1ResponseBalancesItem", + "ListProjectBalancesV1ResponseBalancesItemParams", + "ListProjectBalancesV1ResponseParams", + "ListProjectDistributionCredentialsV1Response", + "ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItem", + "ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemDistributionCredentials", + "ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemDistributionCredentialsParams", + "ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemMember", + "ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemMemberParams", + "ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemParams", + "ListProjectDistributionCredentialsV1ResponseParams", + "ListProjectInvitesV1Response", + "ListProjectInvitesV1ResponseInvitesItem", + "ListProjectInvitesV1ResponseInvitesItemParams", + "ListProjectInvitesV1ResponseParams", + "ListProjectKeysV1Response", + "ListProjectKeysV1ResponseApiKeysItem", + "ListProjectKeysV1ResponseApiKeysItemApiKey", + "ListProjectKeysV1ResponseApiKeysItemApiKeyParams", + "ListProjectKeysV1ResponseApiKeysItemMember", + "ListProjectKeysV1ResponseApiKeysItemMemberParams", + "ListProjectKeysV1ResponseApiKeysItemParams", + "ListProjectKeysV1ResponseParams", + "ListProjectMemberScopesV1Response", + "ListProjectMemberScopesV1ResponseParams", + "ListProjectMembersV1Response", + "ListProjectMembersV1ResponseMembersItem", + "ListProjectMembersV1ResponseMembersItemParams", + "ListProjectMembersV1ResponseParams", + "ListProjectPurchasesV1Response", + "ListProjectPurchasesV1ResponseOrdersItem", + "ListProjectPurchasesV1ResponseOrdersItemParams", + "ListProjectPurchasesV1ResponseParams", + "ListProjectRequestsV1Response", + "ListProjectRequestsV1ResponseParams", + "ListProjectsV1Response", + "ListProjectsV1ResponseParams", + "ListProjectsV1ResponseProjectsItem", + "ListProjectsV1ResponseProjectsItemParams", + "ListenV1AcceptedResponse", + "ListenV1AcceptedResponseParams", + "ListenV1Callback", + "ListenV1CallbackMethod", + "ListenV1Channels", + "ListenV1DetectEntities", + "ListenV1Diarize", + "ListenV1Dictation", + "ListenV1Encoding", + "ListenV1Endpointing", + "ListenV1Extra", + "ListenV1InterimResults", + "ListenV1Keyterm", + "ListenV1Keywords", + "ListenV1Language", + "ListenV1LanguageHint", + "ListenV1LanguageHintParams", + "ListenV1MipOptOut", + "ListenV1Model", + "ListenV1Multichannel", + "ListenV1Numerals", + "ListenV1ProfanityFilter", + "ListenV1Punctuate", + "ListenV1Redact", + "ListenV1RedactUsage", + "ListenV1Replace", + "ListenV1RequestFile", + "ListenV1Response", + "ListenV1ResponseMetadata", + "ListenV1ResponseMetadataDiarizeInfo", + "ListenV1ResponseMetadataDiarizeInfoParams", + "ListenV1ResponseMetadataIntentsInfo", + "ListenV1ResponseMetadataIntentsInfoParams", + "ListenV1ResponseMetadataParams", + "ListenV1ResponseMetadataSentimentInfo", + "ListenV1ResponseMetadataSentimentInfoParams", + "ListenV1ResponseMetadataSummaryInfo", + "ListenV1ResponseMetadataSummaryInfoParams", + "ListenV1ResponseMetadataTopicsInfo", + "ListenV1ResponseMetadataTopicsInfoParams", + "ListenV1ResponseParams", + "ListenV1ResponseResults", + "ListenV1ResponseResultsChannels", + "ListenV1ResponseResultsChannelsItem", + "ListenV1ResponseResultsChannelsItemAlternativesItem", + "ListenV1ResponseResultsChannelsItemAlternativesItemEntitiesItem", + "ListenV1ResponseResultsChannelsItemAlternativesItemEntitiesItemParams", + "ListenV1ResponseResultsChannelsItemAlternativesItemParagraphs", + "ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParagraphsItem", + "ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParagraphsItemParams", + "ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParagraphsItemSentencesItem", + "ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParagraphsItemSentencesItemParams", + "ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParams", + "ListenV1ResponseResultsChannelsItemAlternativesItemParams", + "ListenV1ResponseResultsChannelsItemAlternativesItemSummariesItem", + "ListenV1ResponseResultsChannelsItemAlternativesItemSummariesItemParams", + "ListenV1ResponseResultsChannelsItemAlternativesItemTopicsItem", + "ListenV1ResponseResultsChannelsItemAlternativesItemTopicsItemParams", + "ListenV1ResponseResultsChannelsItemAlternativesItemWordsItem", + "ListenV1ResponseResultsChannelsItemAlternativesItemWordsItemParams", + "ListenV1ResponseResultsChannelsItemParams", + "ListenV1ResponseResultsChannelsItemSearchItem", + "ListenV1ResponseResultsChannelsItemSearchItemHitsItem", + "ListenV1ResponseResultsChannelsItemSearchItemHitsItemParams", + "ListenV1ResponseResultsChannelsItemSearchItemParams", + "ListenV1ResponseResultsChannelsParams", + "ListenV1ResponseResultsParams", + "ListenV1ResponseResultsSummary", + "ListenV1ResponseResultsSummaryParams", + "ListenV1ResponseResultsUtterances", + "ListenV1ResponseResultsUtterancesItem", + "ListenV1ResponseResultsUtterancesItemParams", + "ListenV1ResponseResultsUtterancesItemWordsItem", + "ListenV1ResponseResultsUtterancesItemWordsItemParams", + "ListenV1ResponseResultsUtterancesParams", + "ListenV1SampleRate", + "ListenV1Search", + "ListenV1SmartFormat", + "ListenV1Tag", + "ListenV1UtteranceEndMs", + "ListenV1VadEvents", + "ListenV1Version", + "ListenV2ConfigureNumerals", + "ListenV2ConfigureRedactUsage", + "ListenV2EagerEotThreshold", + "ListenV2Encoding", + "ListenV2EotThreshold", + "ListenV2EotTimeoutMs", + "ListenV2Keyterm", + "ListenV2KeytermParams", + "ListenV2LanguageHint", + "ListenV2LanguageHintParams", + "ListenV2MipOptOut", + "ListenV2Model", + "ListenV2Numerals", + "ListenV2ProfanityFilter", + "ListenV2Redact", + "ListenV2RedactUsage", + "ListenV2SampleRate", + "ListenV2Tag", + "OpenAiSpeakProvider", + "OpenAiSpeakProviderModel", + "OpenAiSpeakProviderParams", + "OpenAiSpeakProviderVoice", + "OpenAiThinkProvider", + "OpenAiThinkProviderModel", + "OpenAiThinkProviderParams", + "OpenAiThinkProviderReasoningMode", + "ProjectRequestResponse", + "ProjectRequestResponseParams", + "ReadV1Request", + "ReadV1RequestParams", + "ReadV1RequestText", + "ReadV1RequestTextParams", + "ReadV1RequestUrl", + "ReadV1RequestUrlParams", + "ReadV1Response", + "ReadV1ResponseMetadata", + "ReadV1ResponseMetadataMetadata", + "ReadV1ResponseMetadataMetadataIntentsInfo", + "ReadV1ResponseMetadataMetadataIntentsInfoParams", + "ReadV1ResponseMetadataMetadataParams", + "ReadV1ResponseMetadataMetadataSentimentInfo", + "ReadV1ResponseMetadataMetadataSentimentInfoParams", + "ReadV1ResponseMetadataMetadataSummaryInfo", + "ReadV1ResponseMetadataMetadataSummaryInfoParams", + "ReadV1ResponseMetadataMetadataTopicsInfo", + "ReadV1ResponseMetadataMetadataTopicsInfoParams", + "ReadV1ResponseMetadataParams", + "ReadV1ResponseParams", + "ReadV1ResponseResults", + "ReadV1ResponseResultsParams", + "ReadV1ResponseResultsSummary", + "ReadV1ResponseResultsSummaryParams", + "ReadV1ResponseResultsSummaryResults", + "ReadV1ResponseResultsSummaryResultsParams", + "ReadV1ResponseResultsSummaryResultsSummary", + "ReadV1ResponseResultsSummaryResultsSummaryParams", + "SharedIntents", + "SharedIntentsParams", + "SharedIntentsSegmentsItem", + "SharedIntentsSegmentsItemIntentsItem", + "SharedIntentsSegmentsItemIntentsItemParams", + "SharedIntentsSegmentsItemParams", + "SharedSentiments", + "SharedSentimentsAverage", + "SharedSentimentsAverageParams", + "SharedSentimentsParams", + "SharedSentimentsSegmentsItem", + "SharedSentimentsSegmentsItemParams", + "SharedTopics", + "SharedTopicsParams", + "SharedTopicsSegmentsItem", + "SharedTopicsSegmentsItemParams", + "SharedTopicsSegmentsItemTopicsItem", + "SharedTopicsSegmentsItemTopicsItemParams", + "SpeakSettingsV1", + "SpeakSettingsV1Endpoint", + "SpeakSettingsV1EndpointParams", + "SpeakSettingsV1Params", + "SpeakSettingsV1Provider", + "SpeakSettingsV1ProviderParams", + "SpeakSettingsV1Provider_AwsPolly", + "SpeakSettingsV1Provider_AwsPollyParams", + "SpeakSettingsV1Provider_Cartesia", + "SpeakSettingsV1Provider_CartesiaParams", + "SpeakSettingsV1Provider_Deepgram", + "SpeakSettingsV1Provider_DeepgramParams", + "SpeakSettingsV1Provider_ElevenLabs", + "SpeakSettingsV1Provider_ElevenLabsParams", + "SpeakSettingsV1Provider_OpenAi", + "SpeakSettingsV1Provider_OpenAiParams", + "SpeakV1Encoding", + "SpeakV1MipOptOut", + "SpeakV1Model", + "SpeakV1Response", + "SpeakV1SampleRate", + "SpeakV1Speed", + "SpeakV2AcceptedResponse", + "SpeakV2AcceptedResponseParams", + "SpeakV2Encoding", + "SpeakV2Expressivity", + "SpeakV2MipOptOut", + "SpeakV2Model", + "SpeakV2NormalizeVolume", + "SpeakV2Response", + "SpeakV2SampleRate", + "SpeakV2Speed", + "SpeakV2SpeedValue", + "SpeakV2Tag", + "ThinkLiveSettingsV1", + "ThinkLiveSettingsV1Params", + "ThinkSettingsV1", + "ThinkSettingsV1ContextLength", + "ThinkSettingsV1ContextLengthParams", + "ThinkSettingsV1Endpoint", + "ThinkSettingsV1EndpointParams", + "ThinkSettingsV1FunctionsItem", + "ThinkSettingsV1FunctionsItemEndpoint", + "ThinkSettingsV1FunctionsItemEndpointParams", + "ThinkSettingsV1FunctionsItemParams", + "ThinkSettingsV1Params", + "ThinkSettingsV1Provider", + "ThinkSettingsV1ProviderParams", + "ThinkSettingsV1Provider_Anthropic", + "ThinkSettingsV1Provider_AnthropicParams", + "ThinkSettingsV1Provider_AwsBedrock", + "ThinkSettingsV1Provider_AwsBedrockParams", + "ThinkSettingsV1Provider_Deepgram", + "ThinkSettingsV1Provider_DeepgramParams", + "ThinkSettingsV1Provider_Google", + "ThinkSettingsV1Provider_GoogleParams", + "ThinkSettingsV1Provider_Groq", + "ThinkSettingsV1Provider_GroqParams", + "ThinkSettingsV1Provider_OpenAi", + "ThinkSettingsV1Provider_OpenAiParams", + "UpdateProjectMemberScopesV1Response", + "UpdateProjectMemberScopesV1ResponseParams", + "UpdateProjectV1Response", + "UpdateProjectV1ResponseParams", + "UsageBreakdownV1Response", + "UsageBreakdownV1ResponseParams", + "UsageBreakdownV1ResponseResolution", + "UsageBreakdownV1ResponseResolutionParams", + "UsageBreakdownV1ResponseResultsItem", + "UsageBreakdownV1ResponseResultsItemGrouping", + "UsageBreakdownV1ResponseResultsItemGroupingParams", + "UsageBreakdownV1ResponseResultsItemParams", + "UsageFieldsV1Response", + "UsageFieldsV1ResponseModelsItem", + "UsageFieldsV1ResponseModelsItemParams", + "UsageFieldsV1ResponseParams", + "UsageV1Response", + "UsageV1ResponseParams", + "UsageV1ResponseResolution", + "UsageV1ResponseResolutionParams", + "__version__", + "agent", + "auth", + "listen", + "manage", + "read", + "self_hosted", + "speak", + "voice_agent", +] + +__all__.extend( + [ + "SharedIntentsResults", + "SharedIntentsResultsIntents", + "SharedIntentsResultsIntentsParams", + "SharedIntentsResultsIntentsSegmentsItem", + "SharedIntentsResultsIntentsSegmentsItemIntentsItem", + "SharedIntentsResultsIntentsSegmentsItemIntentsItemParams", + "SharedIntentsResultsIntentsSegmentsItemParams", + "SharedIntentsResultsParams", + "SharedTopicsResults", + "SharedTopicsResultsParams", + "SharedTopicsResultsTopics", + "SharedTopicsResultsTopicsParams", + "SharedTopicsResultsTopicsSegmentsItem", + "SharedTopicsResultsTopicsSegmentsItemParams", + "SharedTopicsResultsTopicsSegmentsItemTopicsItem", + "SharedTopicsResultsTopicsSegmentsItemTopicsItemParams", + "AnthropicThinkProviderModel", + "CartesiaSpeakProviderModelId", + "CartesiaSpeakProviderVoice", + "CartesiaSpeakProviderVoiceParams", + "CreateKeyV1RequestOne", + "DeepgramListenProviderV2LanguageHint", + "DeepgramListenProviderV2LanguageHintParams", + "DeepgramSpeakProviderModel", + "GoogleThinkProviderModel", + "GoogleThinkProviderVersion", + "GroqThinkProviderReasoningMode", + ] +) diff --git a/src/deepgram/agent/__init__.py.bak b/src/deepgram/agent/__init__.py.bak new file mode 100644 index 00000000..23f670de --- /dev/null +++ b/src/deepgram/agent/__init__.py.bak @@ -0,0 +1,528 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from . import v1 + from .v1 import ( + AgentV1AgentAudioDone, + AgentV1AgentAudioDoneParams, + AgentV1AgentStartedSpeaking, + AgentV1AgentStartedSpeakingParams, + AgentV1AgentThinking, + AgentV1AgentThinkingParams, + AgentV1ConversationText, + AgentV1ConversationTextConversationalBehavior, + AgentV1ConversationTextParams, + AgentV1ConversationTextRole, + AgentV1CustomFromThinkProvider, + AgentV1CustomFromThinkProviderParams, + AgentV1CustomToThinkProvider, + AgentV1CustomToThinkProviderParams, + AgentV1Error, + AgentV1ErrorParams, + AgentV1ForceEndTurn, + AgentV1ForceEndTurnParams, + AgentV1FrustrationDetected, + AgentV1FrustrationDetectedParams, + AgentV1FunctionCallCancelled, + AgentV1FunctionCallCancelledFunctionsItem, + AgentV1FunctionCallCancelledFunctionsItemParams, + AgentV1FunctionCallCancelledParams, + AgentV1FunctionCallRequest, + AgentV1FunctionCallRequestFunctionsItem, + AgentV1FunctionCallRequestFunctionsItemParams, + AgentV1FunctionCallRequestParams, + AgentV1History, + AgentV1HistoryParams, + AgentV1InjectAgentMessage, + AgentV1InjectAgentMessageBehavior, + AgentV1InjectAgentMessageParams, + AgentV1InjectDynamicAgentMessage, + AgentV1InjectDynamicAgentMessageBehavior, + AgentV1InjectDynamicAgentMessageParams, + AgentV1InjectUserMessage, + AgentV1InjectUserMessageParams, + AgentV1InjectionRefused, + AgentV1InjectionRefusedParams, + AgentV1KeepAlive, + AgentV1KeepAliveParams, + AgentV1LatencyReport, + AgentV1LatencyReportParams, + AgentV1ListenUpdated, + AgentV1ListenUpdatedParams, + AgentV1PromptUpdated, + AgentV1PromptUpdatedParams, + AgentV1ReceiveFunctionCallResponse, + AgentV1ReceiveFunctionCallResponseParams, + AgentV1SendFunctionCallResponse, + AgentV1SendFunctionCallResponseParams, + AgentV1Settings, + AgentV1SettingsAgent, + AgentV1SettingsAgentContext, + AgentV1SettingsAgentContextContext, + AgentV1SettingsAgentContextContextMessagesItem, + AgentV1SettingsAgentContextContextMessagesItemParams, + AgentV1SettingsAgentContextContextParams, + AgentV1SettingsAgentContextListen, + AgentV1SettingsAgentContextListenParams, + AgentV1SettingsAgentContextListenProvider, + AgentV1SettingsAgentContextListenProviderParams, + AgentV1SettingsAgentContextListenProvider_V1, + AgentV1SettingsAgentContextListenProvider_V1Params, + AgentV1SettingsAgentContextListenProvider_V2, + AgentV1SettingsAgentContextListenProvider_V2Params, + AgentV1SettingsAgentContextParams, + AgentV1SettingsAgentContextSpeak, + AgentV1SettingsAgentContextSpeakParams, + AgentV1SettingsAgentContextThink, + AgentV1SettingsAgentContextThinkParams, + AgentV1SettingsAgentListen, + AgentV1SettingsAgentListenParams, + AgentV1SettingsAgentListenProvider, + AgentV1SettingsAgentListenProviderParams, + AgentV1SettingsAgentListenProvider_V1, + AgentV1SettingsAgentListenProvider_V1Params, + AgentV1SettingsAgentListenProvider_V2, + AgentV1SettingsAgentListenProvider_V2Params, + AgentV1SettingsAgentParams, + AgentV1SettingsAgentSpeak, + AgentV1SettingsAgentSpeakParams, + AgentV1SettingsAgentThink, + AgentV1SettingsAgentThinkParams, + AgentV1SettingsApplied, + AgentV1SettingsAppliedParams, + AgentV1SettingsAudio, + AgentV1SettingsAudioInput, + AgentV1SettingsAudioInputEncoding, + AgentV1SettingsAudioInputParams, + AgentV1SettingsAudioOutput, + AgentV1SettingsAudioOutputContainer, + AgentV1SettingsAudioOutputEncoding, + AgentV1SettingsAudioOutputParams, + AgentV1SettingsAudioParams, + AgentV1SettingsFlags, + AgentV1SettingsFlagsParams, + AgentV1SettingsParams, + AgentV1SpeakUpdated, + AgentV1SpeakUpdatedParams, + AgentV1ThinkLiveUpdated, + AgentV1ThinkLiveUpdatedParams, + AgentV1ThinkUpdated, + AgentV1ThinkUpdatedParams, + AgentV1UpdateListen, + AgentV1UpdateListenListen, + AgentV1UpdateListenListenParams, + AgentV1UpdateListenListenProvider, + AgentV1UpdateListenListenProviderParams, + AgentV1UpdateListenListenProvider_V1, + AgentV1UpdateListenListenProvider_V1Params, + AgentV1UpdateListenListenProvider_V2, + AgentV1UpdateListenListenProvider_V2Params, + AgentV1UpdateListenParams, + AgentV1UpdatePrompt, + AgentV1UpdatePromptParams, + AgentV1UpdateSpeak, + AgentV1UpdateSpeakParams, + AgentV1UpdateSpeakSpeak, + AgentV1UpdateSpeakSpeakParams, + AgentV1UpdateThink, + AgentV1UpdateThinkLive, + AgentV1UpdateThinkLiveParams, + AgentV1UpdateThinkParams, + AgentV1UpdateThinkThink, + AgentV1UpdateThinkThinkParams, + AgentV1UserStartedSpeaking, + AgentV1UserStartedSpeakingParams, + AgentV1Warning, + AgentV1WarningParams, + AgentV1Welcome, + AgentV1WelcomeParams, + ConversationHistoryMessage, + ConversationHistoryMessageParams, + ConversationHistoryMessageRole, + FunctionCallHistoryMessage, + FunctionCallHistoryMessageFunctionCallsItem, + FunctionCallHistoryMessageFunctionCallsItemParams, + FunctionCallHistoryMessageParams, + ) +_dynamic_imports: typing.Dict[str, str] = { + "AgentV1AgentAudioDone": ".v1", + "AgentV1AgentAudioDoneParams": ".v1", + "AgentV1AgentStartedSpeaking": ".v1", + "AgentV1AgentStartedSpeakingParams": ".v1", + "AgentV1AgentThinking": ".v1", + "AgentV1AgentThinkingParams": ".v1", + "AgentV1ConversationText": ".v1", + "AgentV1ConversationTextConversationalBehavior": ".v1", + "AgentV1ConversationTextParams": ".v1", + "AgentV1ConversationTextRole": ".v1", + "AgentV1CustomFromThinkProvider": ".v1", + "AgentV1CustomFromThinkProviderParams": ".v1", + "AgentV1CustomToThinkProvider": ".v1", + "AgentV1CustomToThinkProviderParams": ".v1", + "AgentV1Error": ".v1", + "AgentV1ErrorParams": ".v1", + "AgentV1ForceEndTurn": ".v1", + "AgentV1ForceEndTurnParams": ".v1", + "AgentV1FrustrationDetected": ".v1", + "AgentV1FrustrationDetectedParams": ".v1", + "AgentV1FunctionCallCancelled": ".v1", + "AgentV1FunctionCallCancelledFunctionsItem": ".v1", + "AgentV1FunctionCallCancelledFunctionsItemParams": ".v1", + "AgentV1FunctionCallCancelledParams": ".v1", + "AgentV1FunctionCallRequest": ".v1", + "AgentV1FunctionCallRequestFunctionsItem": ".v1", + "AgentV1FunctionCallRequestFunctionsItemParams": ".v1", + "AgentV1FunctionCallRequestParams": ".v1", + "AgentV1History": ".v1", + "AgentV1HistoryParams": ".v1", + "AgentV1InjectAgentMessage": ".v1", + "AgentV1InjectAgentMessageBehavior": ".v1", + "AgentV1InjectAgentMessageParams": ".v1", + "AgentV1InjectDynamicAgentMessage": ".v1", + "AgentV1InjectDynamicAgentMessageBehavior": ".v1", + "AgentV1InjectDynamicAgentMessageParams": ".v1", + "AgentV1InjectUserMessage": ".v1", + "AgentV1InjectUserMessageParams": ".v1", + "AgentV1InjectionRefused": ".v1", + "AgentV1InjectionRefusedParams": ".v1", + "AgentV1KeepAlive": ".v1", + "AgentV1KeepAliveParams": ".v1", + "AgentV1LatencyReport": ".v1", + "AgentV1LatencyReportParams": ".v1", + "AgentV1ListenUpdated": ".v1", + "AgentV1ListenUpdatedParams": ".v1", + "AgentV1PromptUpdated": ".v1", + "AgentV1PromptUpdatedParams": ".v1", + "AgentV1ReceiveFunctionCallResponse": ".v1", + "AgentV1ReceiveFunctionCallResponseParams": ".v1", + "AgentV1SendFunctionCallResponse": ".v1", + "AgentV1SendFunctionCallResponseParams": ".v1", + "AgentV1Settings": ".v1", + "AgentV1SettingsAgent": ".v1", + "AgentV1SettingsAgentContext": ".v1", + "AgentV1SettingsAgentContextContext": ".v1", + "AgentV1SettingsAgentContextContextMessagesItem": ".v1", + "AgentV1SettingsAgentContextContextMessagesItemParams": ".v1", + "AgentV1SettingsAgentContextContextParams": ".v1", + "AgentV1SettingsAgentContextListen": ".v1", + "AgentV1SettingsAgentContextListenParams": ".v1", + "AgentV1SettingsAgentContextListenProvider": ".v1", + "AgentV1SettingsAgentContextListenProviderParams": ".v1", + "AgentV1SettingsAgentContextListenProvider_V1": ".v1", + "AgentV1SettingsAgentContextListenProvider_V1Params": ".v1", + "AgentV1SettingsAgentContextListenProvider_V2": ".v1", + "AgentV1SettingsAgentContextListenProvider_V2Params": ".v1", + "AgentV1SettingsAgentContextParams": ".v1", + "AgentV1SettingsAgentContextSpeak": ".v1", + "AgentV1SettingsAgentContextSpeakParams": ".v1", + "AgentV1SettingsAgentContextThink": ".v1", + "AgentV1SettingsAgentContextThinkParams": ".v1", + "AgentV1SettingsAgentListen": ".v1", + "AgentV1SettingsAgentListenParams": ".v1", + "AgentV1SettingsAgentListenProvider": ".v1", + "AgentV1SettingsAgentListenProviderParams": ".v1", + "AgentV1SettingsAgentListenProvider_V1": ".v1", + "AgentV1SettingsAgentListenProvider_V1Params": ".v1", + "AgentV1SettingsAgentListenProvider_V2": ".v1", + "AgentV1SettingsAgentListenProvider_V2Params": ".v1", + "AgentV1SettingsAgentParams": ".v1", + "AgentV1SettingsAgentSpeak": ".v1", + "AgentV1SettingsAgentSpeakParams": ".v1", + "AgentV1SettingsAgentThink": ".v1", + "AgentV1SettingsAgentThinkParams": ".v1", + "AgentV1SettingsApplied": ".v1", + "AgentV1SettingsAppliedParams": ".v1", + "AgentV1SettingsAudio": ".v1", + "AgentV1SettingsAudioInput": ".v1", + "AgentV1SettingsAudioInputEncoding": ".v1", + "AgentV1SettingsAudioInputParams": ".v1", + "AgentV1SettingsAudioOutput": ".v1", + "AgentV1SettingsAudioOutputContainer": ".v1", + "AgentV1SettingsAudioOutputEncoding": ".v1", + "AgentV1SettingsAudioOutputParams": ".v1", + "AgentV1SettingsAudioParams": ".v1", + "AgentV1SettingsFlags": ".v1", + "AgentV1SettingsFlagsParams": ".v1", + "AgentV1SettingsParams": ".v1", + "AgentV1SpeakUpdated": ".v1", + "AgentV1SpeakUpdatedParams": ".v1", + "AgentV1ThinkLiveUpdated": ".v1", + "AgentV1ThinkLiveUpdatedParams": ".v1", + "AgentV1ThinkUpdated": ".v1", + "AgentV1ThinkUpdatedParams": ".v1", + "AgentV1UpdateListen": ".v1", + "AgentV1UpdateListenListen": ".v1", + "AgentV1UpdateListenListenParams": ".v1", + "AgentV1UpdateListenListenProvider": ".v1", + "AgentV1UpdateListenListenProviderParams": ".v1", + "AgentV1UpdateListenListenProvider_V1": ".v1", + "AgentV1UpdateListenListenProvider_V1Params": ".v1", + "AgentV1UpdateListenListenProvider_V2": ".v1", + "AgentV1UpdateListenListenProvider_V2Params": ".v1", + "AgentV1UpdateListenParams": ".v1", + "AgentV1UpdatePrompt": ".v1", + "AgentV1UpdatePromptParams": ".v1", + "AgentV1UpdateSpeak": ".v1", + "AgentV1UpdateSpeakParams": ".v1", + "AgentV1UpdateSpeakSpeak": ".v1", + "AgentV1UpdateSpeakSpeakParams": ".v1", + "AgentV1UpdateThink": ".v1", + "AgentV1UpdateThinkLive": ".v1", + "AgentV1UpdateThinkLiveParams": ".v1", + "AgentV1UpdateThinkParams": ".v1", + "AgentV1UpdateThinkThink": ".v1", + "AgentV1UpdateThinkThinkParams": ".v1", + "AgentV1UserStartedSpeaking": ".v1", + "AgentV1UserStartedSpeakingParams": ".v1", + "AgentV1Warning": ".v1", + "AgentV1WarningParams": ".v1", + "AgentV1Welcome": ".v1", + "AgentV1WelcomeParams": ".v1", + "ConversationHistoryMessage": ".v1", + "ConversationHistoryMessageParams": ".v1", + "ConversationHistoryMessageRole": ".v1", + "FunctionCallHistoryMessage": ".v1", + "FunctionCallHistoryMessageFunctionCallsItem": ".v1", + "FunctionCallHistoryMessageFunctionCallsItemParams": ".v1", + "FunctionCallHistoryMessageParams": ".v1", + "v1": ".v1", +} + +_dynamic_imports.update( + { + "AgentV1HistoryContent": ".v1", + "AgentV1HistoryContentParams": ".v1", + "AgentV1HistoryContentRole": ".v1", + "AgentV1HistoryFunctionCalls": ".v1", + "AgentV1HistoryFunctionCallsFunctionCallsItem": ".v1", + "AgentV1HistoryFunctionCallsFunctionCallsItemParams": ".v1", + "AgentV1HistoryFunctionCallsParams": ".v1", + "AgentV1SettingsAgentContextContextMessagesItemContentRole": ".v1", + "AgentV1SettingsAgentContextContextMessagesItemFunctionCallsFunctionCallsItem": ".v1", + "AgentV1SettingsAgentContextContextMessagesItemFunctionCallsFunctionCallsItemParams": ".v1", + "AgentV1SettingsAgentContextListenProviderV1": ".v1", + "AgentV1SettingsAgentContextListenProviderV1Params": ".v1", + "AgentV1SettingsAgentContextListenProviderV2": ".v1", + "AgentV1SettingsAgentContextListenProviderV2LanguageHint": ".v1", + "AgentV1SettingsAgentContextListenProviderV2LanguageHintParams": ".v1", + "AgentV1SettingsAgentContextListenProviderV2Params": ".v1", + "AgentV1SettingsAgentContextMessagesItem": ".v1", + "AgentV1SettingsAgentContextMessagesItemContent": ".v1", + "AgentV1SettingsAgentContextMessagesItemContentParams": ".v1", + "AgentV1SettingsAgentContextMessagesItemContentRole": ".v1", + "AgentV1SettingsAgentContextMessagesItemFunctionCalls": ".v1", + "AgentV1SettingsAgentContextMessagesItemFunctionCallsFunctionCallsItem": ".v1", + "AgentV1SettingsAgentContextMessagesItemFunctionCallsFunctionCallsItemParams": ".v1", + "AgentV1SettingsAgentContextMessagesItemFunctionCallsParams": ".v1", + "AgentV1SettingsAgentContextMessagesItemParams": ".v1", + "AgentV1SettingsAgentListenProviderV1": ".v1", + "AgentV1SettingsAgentListenProviderV1Params": ".v1", + "AgentV1SettingsAgentListenProviderV2": ".v1", + "AgentV1SettingsAgentListenProviderV2Params": ".v1", + } +) + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = [ + "AgentV1AgentAudioDone", + "AgentV1AgentAudioDoneParams", + "AgentV1AgentStartedSpeaking", + "AgentV1AgentStartedSpeakingParams", + "AgentV1AgentThinking", + "AgentV1AgentThinkingParams", + "AgentV1ConversationText", + "AgentV1ConversationTextConversationalBehavior", + "AgentV1ConversationTextParams", + "AgentV1ConversationTextRole", + "AgentV1CustomFromThinkProvider", + "AgentV1CustomFromThinkProviderParams", + "AgentV1CustomToThinkProvider", + "AgentV1CustomToThinkProviderParams", + "AgentV1Error", + "AgentV1ErrorParams", + "AgentV1ForceEndTurn", + "AgentV1ForceEndTurnParams", + "AgentV1FrustrationDetected", + "AgentV1FrustrationDetectedParams", + "AgentV1FunctionCallCancelled", + "AgentV1FunctionCallCancelledFunctionsItem", + "AgentV1FunctionCallCancelledFunctionsItemParams", + "AgentV1FunctionCallCancelledParams", + "AgentV1FunctionCallRequest", + "AgentV1FunctionCallRequestFunctionsItem", + "AgentV1FunctionCallRequestFunctionsItemParams", + "AgentV1FunctionCallRequestParams", + "AgentV1History", + "AgentV1HistoryParams", + "AgentV1InjectAgentMessage", + "AgentV1InjectAgentMessageBehavior", + "AgentV1InjectAgentMessageParams", + "AgentV1InjectDynamicAgentMessage", + "AgentV1InjectDynamicAgentMessageBehavior", + "AgentV1InjectDynamicAgentMessageParams", + "AgentV1InjectUserMessage", + "AgentV1InjectUserMessageParams", + "AgentV1InjectionRefused", + "AgentV1InjectionRefusedParams", + "AgentV1KeepAlive", + "AgentV1KeepAliveParams", + "AgentV1LatencyReport", + "AgentV1LatencyReportParams", + "AgentV1ListenUpdated", + "AgentV1ListenUpdatedParams", + "AgentV1PromptUpdated", + "AgentV1PromptUpdatedParams", + "AgentV1ReceiveFunctionCallResponse", + "AgentV1ReceiveFunctionCallResponseParams", + "AgentV1SendFunctionCallResponse", + "AgentV1SendFunctionCallResponseParams", + "AgentV1Settings", + "AgentV1SettingsAgent", + "AgentV1SettingsAgentContext", + "AgentV1SettingsAgentContextContext", + "AgentV1SettingsAgentContextContextMessagesItem", + "AgentV1SettingsAgentContextContextMessagesItemParams", + "AgentV1SettingsAgentContextContextParams", + "AgentV1SettingsAgentContextListen", + "AgentV1SettingsAgentContextListenParams", + "AgentV1SettingsAgentContextListenProvider", + "AgentV1SettingsAgentContextListenProviderParams", + "AgentV1SettingsAgentContextListenProvider_V1", + "AgentV1SettingsAgentContextListenProvider_V1Params", + "AgentV1SettingsAgentContextListenProvider_V2", + "AgentV1SettingsAgentContextListenProvider_V2Params", + "AgentV1SettingsAgentContextParams", + "AgentV1SettingsAgentContextSpeak", + "AgentV1SettingsAgentContextSpeakParams", + "AgentV1SettingsAgentContextThink", + "AgentV1SettingsAgentContextThinkParams", + "AgentV1SettingsAgentListen", + "AgentV1SettingsAgentListenParams", + "AgentV1SettingsAgentListenProvider", + "AgentV1SettingsAgentListenProviderParams", + "AgentV1SettingsAgentListenProvider_V1", + "AgentV1SettingsAgentListenProvider_V1Params", + "AgentV1SettingsAgentListenProvider_V2", + "AgentV1SettingsAgentListenProvider_V2Params", + "AgentV1SettingsAgentParams", + "AgentV1SettingsAgentSpeak", + "AgentV1SettingsAgentSpeakParams", + "AgentV1SettingsAgentThink", + "AgentV1SettingsAgentThinkParams", + "AgentV1SettingsApplied", + "AgentV1SettingsAppliedParams", + "AgentV1SettingsAudio", + "AgentV1SettingsAudioInput", + "AgentV1SettingsAudioInputEncoding", + "AgentV1SettingsAudioInputParams", + "AgentV1SettingsAudioOutput", + "AgentV1SettingsAudioOutputContainer", + "AgentV1SettingsAudioOutputEncoding", + "AgentV1SettingsAudioOutputParams", + "AgentV1SettingsAudioParams", + "AgentV1SettingsFlags", + "AgentV1SettingsFlagsParams", + "AgentV1SettingsParams", + "AgentV1SpeakUpdated", + "AgentV1SpeakUpdatedParams", + "AgentV1ThinkLiveUpdated", + "AgentV1ThinkLiveUpdatedParams", + "AgentV1ThinkUpdated", + "AgentV1ThinkUpdatedParams", + "AgentV1UpdateListen", + "AgentV1UpdateListenListen", + "AgentV1UpdateListenListenParams", + "AgentV1UpdateListenListenProvider", + "AgentV1UpdateListenListenProviderParams", + "AgentV1UpdateListenListenProvider_V1", + "AgentV1UpdateListenListenProvider_V1Params", + "AgentV1UpdateListenListenProvider_V2", + "AgentV1UpdateListenListenProvider_V2Params", + "AgentV1UpdateListenParams", + "AgentV1UpdatePrompt", + "AgentV1UpdatePromptParams", + "AgentV1UpdateSpeak", + "AgentV1UpdateSpeakParams", + "AgentV1UpdateSpeakSpeak", + "AgentV1UpdateSpeakSpeakParams", + "AgentV1UpdateThink", + "AgentV1UpdateThinkLive", + "AgentV1UpdateThinkLiveParams", + "AgentV1UpdateThinkParams", + "AgentV1UpdateThinkThink", + "AgentV1UpdateThinkThinkParams", + "AgentV1UserStartedSpeaking", + "AgentV1UserStartedSpeakingParams", + "AgentV1Warning", + "AgentV1WarningParams", + "AgentV1Welcome", + "AgentV1WelcomeParams", + "ConversationHistoryMessage", + "ConversationHistoryMessageParams", + "ConversationHistoryMessageRole", + "FunctionCallHistoryMessage", + "FunctionCallHistoryMessageFunctionCallsItem", + "FunctionCallHistoryMessageFunctionCallsItemParams", + "FunctionCallHistoryMessageParams", + "v1", +] + +__all__.extend( + [ + "AgentV1HistoryContent", + "AgentV1HistoryContentParams", + "AgentV1HistoryContentRole", + "AgentV1HistoryFunctionCalls", + "AgentV1HistoryFunctionCallsFunctionCallsItem", + "AgentV1HistoryFunctionCallsFunctionCallsItemParams", + "AgentV1HistoryFunctionCallsParams", + "AgentV1SettingsAgentContextContextMessagesItemContentRole", + "AgentV1SettingsAgentContextContextMessagesItemFunctionCallsFunctionCallsItem", + "AgentV1SettingsAgentContextContextMessagesItemFunctionCallsFunctionCallsItemParams", + "AgentV1SettingsAgentContextListenProviderV1", + "AgentV1SettingsAgentContextListenProviderV1Params", + "AgentV1SettingsAgentContextListenProviderV2", + "AgentV1SettingsAgentContextListenProviderV2LanguageHint", + "AgentV1SettingsAgentContextListenProviderV2LanguageHintParams", + "AgentV1SettingsAgentContextListenProviderV2Params", + "AgentV1SettingsAgentContextMessagesItem", + "AgentV1SettingsAgentContextMessagesItemContent", + "AgentV1SettingsAgentContextMessagesItemContentParams", + "AgentV1SettingsAgentContextMessagesItemContentRole", + "AgentV1SettingsAgentContextMessagesItemFunctionCalls", + "AgentV1SettingsAgentContextMessagesItemFunctionCallsFunctionCallsItem", + "AgentV1SettingsAgentContextMessagesItemFunctionCallsFunctionCallsItemParams", + "AgentV1SettingsAgentContextMessagesItemFunctionCallsParams", + "AgentV1SettingsAgentContextMessagesItemParams", + "AgentV1SettingsAgentListenProviderV1", + "AgentV1SettingsAgentListenProviderV1Params", + "AgentV1SettingsAgentListenProviderV2", + "AgentV1SettingsAgentListenProviderV2Params", + ] +) diff --git a/src/deepgram/agent/v1/__init__.py.bak b/src/deepgram/agent/v1/__init__.py.bak new file mode 100644 index 00000000..205d398c --- /dev/null +++ b/src/deepgram/agent/v1/__init__.py.bak @@ -0,0 +1,530 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .types import ( + AgentV1AgentAudioDone, + AgentV1AgentStartedSpeaking, + AgentV1AgentThinking, + AgentV1ConversationText, + AgentV1ConversationTextConversationalBehavior, + AgentV1ConversationTextRole, + AgentV1CustomFromThinkProvider, + AgentV1CustomToThinkProvider, + AgentV1Error, + AgentV1ForceEndTurn, + AgentV1FrustrationDetected, + AgentV1FunctionCallCancelled, + AgentV1FunctionCallCancelledFunctionsItem, + AgentV1FunctionCallRequest, + AgentV1FunctionCallRequestFunctionsItem, + AgentV1History, + AgentV1InjectAgentMessage, + AgentV1InjectAgentMessageBehavior, + AgentV1InjectDynamicAgentMessage, + AgentV1InjectDynamicAgentMessageBehavior, + AgentV1InjectUserMessage, + AgentV1InjectionRefused, + AgentV1KeepAlive, + AgentV1LatencyReport, + AgentV1ListenUpdated, + AgentV1PromptUpdated, + AgentV1ReceiveFunctionCallResponse, + AgentV1SendFunctionCallResponse, + AgentV1Settings, + AgentV1SettingsAgent, + AgentV1SettingsAgentContext, + AgentV1SettingsAgentContextContext, + AgentV1SettingsAgentContextContextMessagesItem, + AgentV1SettingsAgentContextListen, + AgentV1SettingsAgentContextListenProvider, + AgentV1SettingsAgentContextListenProvider_V1, + AgentV1SettingsAgentContextListenProvider_V2, + AgentV1SettingsAgentContextSpeak, + AgentV1SettingsAgentContextThink, + AgentV1SettingsAgentListen, + AgentV1SettingsAgentListenProvider, + AgentV1SettingsAgentListenProvider_V1, + AgentV1SettingsAgentListenProvider_V2, + AgentV1SettingsAgentSpeak, + AgentV1SettingsAgentThink, + AgentV1SettingsApplied, + AgentV1SettingsAudio, + AgentV1SettingsAudioInput, + AgentV1SettingsAudioInputEncoding, + AgentV1SettingsAudioOutput, + AgentV1SettingsAudioOutputContainer, + AgentV1SettingsAudioOutputEncoding, + AgentV1SettingsFlags, + AgentV1SpeakUpdated, + AgentV1ThinkLiveUpdated, + AgentV1ThinkUpdated, + AgentV1UpdateListen, + AgentV1UpdateListenListen, + AgentV1UpdateListenListenProvider, + AgentV1UpdateListenListenProvider_V1, + AgentV1UpdateListenListenProvider_V2, + AgentV1UpdatePrompt, + AgentV1UpdateSpeak, + AgentV1UpdateSpeakSpeak, + AgentV1UpdateThink, + AgentV1UpdateThinkLive, + AgentV1UpdateThinkThink, + AgentV1UserStartedSpeaking, + AgentV1Warning, + AgentV1Welcome, + ConversationHistoryMessage, + ConversationHistoryMessageRole, + FunctionCallHistoryMessage, + FunctionCallHistoryMessageFunctionCallsItem, + ) + from . import settings + from .requests import ( + AgentV1AgentAudioDoneParams, + AgentV1AgentStartedSpeakingParams, + AgentV1AgentThinkingParams, + AgentV1ConversationTextParams, + AgentV1CustomFromThinkProviderParams, + AgentV1CustomToThinkProviderParams, + AgentV1ErrorParams, + AgentV1ForceEndTurnParams, + AgentV1FrustrationDetectedParams, + AgentV1FunctionCallCancelledFunctionsItemParams, + AgentV1FunctionCallCancelledParams, + AgentV1FunctionCallRequestFunctionsItemParams, + AgentV1FunctionCallRequestParams, + AgentV1HistoryParams, + AgentV1InjectAgentMessageParams, + AgentV1InjectDynamicAgentMessageParams, + AgentV1InjectUserMessageParams, + AgentV1InjectionRefusedParams, + AgentV1KeepAliveParams, + AgentV1LatencyReportParams, + AgentV1ListenUpdatedParams, + AgentV1PromptUpdatedParams, + AgentV1ReceiveFunctionCallResponseParams, + AgentV1SendFunctionCallResponseParams, + AgentV1SettingsAgentContextContextMessagesItemParams, + AgentV1SettingsAgentContextContextParams, + AgentV1SettingsAgentContextListenParams, + AgentV1SettingsAgentContextListenProviderParams, + AgentV1SettingsAgentContextListenProvider_V1Params, + AgentV1SettingsAgentContextListenProvider_V2Params, + AgentV1SettingsAgentContextParams, + AgentV1SettingsAgentContextSpeakParams, + AgentV1SettingsAgentContextThinkParams, + AgentV1SettingsAgentListenParams, + AgentV1SettingsAgentListenProviderParams, + AgentV1SettingsAgentListenProvider_V1Params, + AgentV1SettingsAgentListenProvider_V2Params, + AgentV1SettingsAgentParams, + AgentV1SettingsAgentSpeakParams, + AgentV1SettingsAgentThinkParams, + AgentV1SettingsAppliedParams, + AgentV1SettingsAudioInputParams, + AgentV1SettingsAudioOutputParams, + AgentV1SettingsAudioParams, + AgentV1SettingsFlagsParams, + AgentV1SettingsParams, + AgentV1SpeakUpdatedParams, + AgentV1ThinkLiveUpdatedParams, + AgentV1ThinkUpdatedParams, + AgentV1UpdateListenListenParams, + AgentV1UpdateListenListenProviderParams, + AgentV1UpdateListenListenProvider_V1Params, + AgentV1UpdateListenListenProvider_V2Params, + AgentV1UpdateListenParams, + AgentV1UpdatePromptParams, + AgentV1UpdateSpeakParams, + AgentV1UpdateSpeakSpeakParams, + AgentV1UpdateThinkLiveParams, + AgentV1UpdateThinkParams, + AgentV1UpdateThinkThinkParams, + AgentV1UserStartedSpeakingParams, + AgentV1WarningParams, + AgentV1WelcomeParams, + ConversationHistoryMessageParams, + FunctionCallHistoryMessageFunctionCallsItemParams, + FunctionCallHistoryMessageParams, + ) +_dynamic_imports: typing.Dict[str, str] = { + "AgentV1AgentAudioDone": ".types", + "AgentV1AgentAudioDoneParams": ".requests", + "AgentV1AgentStartedSpeaking": ".types", + "AgentV1AgentStartedSpeakingParams": ".requests", + "AgentV1AgentThinking": ".types", + "AgentV1AgentThinkingParams": ".requests", + "AgentV1ConversationText": ".types", + "AgentV1ConversationTextConversationalBehavior": ".types", + "AgentV1ConversationTextParams": ".requests", + "AgentV1ConversationTextRole": ".types", + "AgentV1CustomFromThinkProvider": ".types", + "AgentV1CustomFromThinkProviderParams": ".requests", + "AgentV1CustomToThinkProvider": ".types", + "AgentV1CustomToThinkProviderParams": ".requests", + "AgentV1Error": ".types", + "AgentV1ErrorParams": ".requests", + "AgentV1ForceEndTurn": ".types", + "AgentV1ForceEndTurnParams": ".requests", + "AgentV1FrustrationDetected": ".types", + "AgentV1FrustrationDetectedParams": ".requests", + "AgentV1FunctionCallCancelled": ".types", + "AgentV1FunctionCallCancelledFunctionsItem": ".types", + "AgentV1FunctionCallCancelledFunctionsItemParams": ".requests", + "AgentV1FunctionCallCancelledParams": ".requests", + "AgentV1FunctionCallRequest": ".types", + "AgentV1FunctionCallRequestFunctionsItem": ".types", + "AgentV1FunctionCallRequestFunctionsItemParams": ".requests", + "AgentV1FunctionCallRequestParams": ".requests", + "AgentV1History": ".types", + "AgentV1HistoryParams": ".requests", + "AgentV1InjectAgentMessage": ".types", + "AgentV1InjectAgentMessageBehavior": ".types", + "AgentV1InjectAgentMessageParams": ".requests", + "AgentV1InjectDynamicAgentMessage": ".types", + "AgentV1InjectDynamicAgentMessageBehavior": ".types", + "AgentV1InjectDynamicAgentMessageParams": ".requests", + "AgentV1InjectUserMessage": ".types", + "AgentV1InjectUserMessageParams": ".requests", + "AgentV1InjectionRefused": ".types", + "AgentV1InjectionRefusedParams": ".requests", + "AgentV1KeepAlive": ".types", + "AgentV1KeepAliveParams": ".requests", + "AgentV1LatencyReport": ".types", + "AgentV1LatencyReportParams": ".requests", + "AgentV1ListenUpdated": ".types", + "AgentV1ListenUpdatedParams": ".requests", + "AgentV1PromptUpdated": ".types", + "AgentV1PromptUpdatedParams": ".requests", + "AgentV1ReceiveFunctionCallResponse": ".types", + "AgentV1ReceiveFunctionCallResponseParams": ".requests", + "AgentV1SendFunctionCallResponse": ".types", + "AgentV1SendFunctionCallResponseParams": ".requests", + "AgentV1Settings": ".types", + "AgentV1SettingsAgent": ".types", + "AgentV1SettingsAgentContext": ".types", + "AgentV1SettingsAgentContextContext": ".types", + "AgentV1SettingsAgentContextContextMessagesItem": ".types", + "AgentV1SettingsAgentContextContextMessagesItemParams": ".requests", + "AgentV1SettingsAgentContextContextParams": ".requests", + "AgentV1SettingsAgentContextListen": ".types", + "AgentV1SettingsAgentContextListenParams": ".requests", + "AgentV1SettingsAgentContextListenProvider": ".types", + "AgentV1SettingsAgentContextListenProviderParams": ".requests", + "AgentV1SettingsAgentContextListenProvider_V1": ".types", + "AgentV1SettingsAgentContextListenProvider_V1Params": ".requests", + "AgentV1SettingsAgentContextListenProvider_V2": ".types", + "AgentV1SettingsAgentContextListenProvider_V2Params": ".requests", + "AgentV1SettingsAgentContextParams": ".requests", + "AgentV1SettingsAgentContextSpeak": ".types", + "AgentV1SettingsAgentContextSpeakParams": ".requests", + "AgentV1SettingsAgentContextThink": ".types", + "AgentV1SettingsAgentContextThinkParams": ".requests", + "AgentV1SettingsAgentListen": ".types", + "AgentV1SettingsAgentListenParams": ".requests", + "AgentV1SettingsAgentListenProvider": ".types", + "AgentV1SettingsAgentListenProviderParams": ".requests", + "AgentV1SettingsAgentListenProvider_V1": ".types", + "AgentV1SettingsAgentListenProvider_V1Params": ".requests", + "AgentV1SettingsAgentListenProvider_V2": ".types", + "AgentV1SettingsAgentListenProvider_V2Params": ".requests", + "AgentV1SettingsAgentParams": ".requests", + "AgentV1SettingsAgentSpeak": ".types", + "AgentV1SettingsAgentSpeakParams": ".requests", + "AgentV1SettingsAgentThink": ".types", + "AgentV1SettingsAgentThinkParams": ".requests", + "AgentV1SettingsApplied": ".types", + "AgentV1SettingsAppliedParams": ".requests", + "AgentV1SettingsAudio": ".types", + "AgentV1SettingsAudioInput": ".types", + "AgentV1SettingsAudioInputEncoding": ".types", + "AgentV1SettingsAudioInputParams": ".requests", + "AgentV1SettingsAudioOutput": ".types", + "AgentV1SettingsAudioOutputContainer": ".types", + "AgentV1SettingsAudioOutputEncoding": ".types", + "AgentV1SettingsAudioOutputParams": ".requests", + "AgentV1SettingsAudioParams": ".requests", + "AgentV1SettingsFlags": ".types", + "AgentV1SettingsFlagsParams": ".requests", + "AgentV1SettingsParams": ".requests", + "AgentV1SpeakUpdated": ".types", + "AgentV1SpeakUpdatedParams": ".requests", + "AgentV1ThinkLiveUpdated": ".types", + "AgentV1ThinkLiveUpdatedParams": ".requests", + "AgentV1ThinkUpdated": ".types", + "AgentV1ThinkUpdatedParams": ".requests", + "AgentV1UpdateListen": ".types", + "AgentV1UpdateListenListen": ".types", + "AgentV1UpdateListenListenParams": ".requests", + "AgentV1UpdateListenListenProvider": ".types", + "AgentV1UpdateListenListenProviderParams": ".requests", + "AgentV1UpdateListenListenProvider_V1": ".types", + "AgentV1UpdateListenListenProvider_V1Params": ".requests", + "AgentV1UpdateListenListenProvider_V2": ".types", + "AgentV1UpdateListenListenProvider_V2Params": ".requests", + "AgentV1UpdateListenParams": ".requests", + "AgentV1UpdatePrompt": ".types", + "AgentV1UpdatePromptParams": ".requests", + "AgentV1UpdateSpeak": ".types", + "AgentV1UpdateSpeakParams": ".requests", + "AgentV1UpdateSpeakSpeak": ".types", + "AgentV1UpdateSpeakSpeakParams": ".requests", + "AgentV1UpdateThink": ".types", + "AgentV1UpdateThinkLive": ".types", + "AgentV1UpdateThinkLiveParams": ".requests", + "AgentV1UpdateThinkParams": ".requests", + "AgentV1UpdateThinkThink": ".types", + "AgentV1UpdateThinkThinkParams": ".requests", + "AgentV1UserStartedSpeaking": ".types", + "AgentV1UserStartedSpeakingParams": ".requests", + "AgentV1Warning": ".types", + "AgentV1WarningParams": ".requests", + "AgentV1Welcome": ".types", + "AgentV1WelcomeParams": ".requests", + "ConversationHistoryMessage": ".types", + "ConversationHistoryMessageParams": ".requests", + "ConversationHistoryMessageRole": ".types", + "FunctionCallHistoryMessage": ".types", + "FunctionCallHistoryMessageFunctionCallsItem": ".types", + "FunctionCallHistoryMessageFunctionCallsItemParams": ".requests", + "FunctionCallHistoryMessageParams": ".requests", + "settings": ".settings", +} + +_dynamic_imports.update( + { + "AgentV1HistoryContent": ".types", + "AgentV1HistoryContentParams": ".requests", + "AgentV1HistoryContentRole": ".types", + "AgentV1HistoryFunctionCalls": ".types", + "AgentV1HistoryFunctionCallsFunctionCallsItem": ".types", + "AgentV1HistoryFunctionCallsFunctionCallsItemParams": ".requests", + "AgentV1HistoryFunctionCallsParams": ".requests", + "AgentV1SettingsAgentContextContextMessagesItemContentRole": ".types", + "AgentV1SettingsAgentContextContextMessagesItemFunctionCallsFunctionCallsItem": ".types", + "AgentV1SettingsAgentContextContextMessagesItemFunctionCallsFunctionCallsItemParams": ".requests", + "AgentV1SettingsAgentContextListenProviderV1": ".types", + "AgentV1SettingsAgentContextListenProviderV1Params": ".requests", + "AgentV1SettingsAgentContextListenProviderV2": ".types", + "AgentV1SettingsAgentContextListenProviderV2LanguageHint": ".types", + "AgentV1SettingsAgentContextListenProviderV2LanguageHintParams": ".requests", + "AgentV1SettingsAgentContextListenProviderV2Params": ".requests", + "AgentV1SettingsAgentContextMessagesItem": ".types", + "AgentV1SettingsAgentContextMessagesItemContent": ".types", + "AgentV1SettingsAgentContextMessagesItemContentParams": ".requests", + "AgentV1SettingsAgentContextMessagesItemContentRole": ".types", + "AgentV1SettingsAgentContextMessagesItemFunctionCalls": ".types", + "AgentV1SettingsAgentContextMessagesItemFunctionCallsFunctionCallsItem": ".types", + "AgentV1SettingsAgentContextMessagesItemFunctionCallsFunctionCallsItemParams": ".requests", + "AgentV1SettingsAgentContextMessagesItemFunctionCallsParams": ".requests", + "AgentV1SettingsAgentContextMessagesItemParams": ".requests", + "AgentV1SettingsAgentListenProviderV1": ".types", + "AgentV1SettingsAgentListenProviderV1Params": ".requests", + "AgentV1SettingsAgentListenProviderV2": ".types", + "AgentV1SettingsAgentListenProviderV2Params": ".requests", + } +) + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = [ + "AgentV1AgentAudioDone", + "AgentV1AgentAudioDoneParams", + "AgentV1AgentStartedSpeaking", + "AgentV1AgentStartedSpeakingParams", + "AgentV1AgentThinking", + "AgentV1AgentThinkingParams", + "AgentV1ConversationText", + "AgentV1ConversationTextConversationalBehavior", + "AgentV1ConversationTextParams", + "AgentV1ConversationTextRole", + "AgentV1CustomFromThinkProvider", + "AgentV1CustomFromThinkProviderParams", + "AgentV1CustomToThinkProvider", + "AgentV1CustomToThinkProviderParams", + "AgentV1Error", + "AgentV1ErrorParams", + "AgentV1ForceEndTurn", + "AgentV1ForceEndTurnParams", + "AgentV1FrustrationDetected", + "AgentV1FrustrationDetectedParams", + "AgentV1FunctionCallCancelled", + "AgentV1FunctionCallCancelledFunctionsItem", + "AgentV1FunctionCallCancelledFunctionsItemParams", + "AgentV1FunctionCallCancelledParams", + "AgentV1FunctionCallRequest", + "AgentV1FunctionCallRequestFunctionsItem", + "AgentV1FunctionCallRequestFunctionsItemParams", + "AgentV1FunctionCallRequestParams", + "AgentV1History", + "AgentV1HistoryParams", + "AgentV1InjectAgentMessage", + "AgentV1InjectAgentMessageBehavior", + "AgentV1InjectAgentMessageParams", + "AgentV1InjectDynamicAgentMessage", + "AgentV1InjectDynamicAgentMessageBehavior", + "AgentV1InjectDynamicAgentMessageParams", + "AgentV1InjectUserMessage", + "AgentV1InjectUserMessageParams", + "AgentV1InjectionRefused", + "AgentV1InjectionRefusedParams", + "AgentV1KeepAlive", + "AgentV1KeepAliveParams", + "AgentV1LatencyReport", + "AgentV1LatencyReportParams", + "AgentV1ListenUpdated", + "AgentV1ListenUpdatedParams", + "AgentV1PromptUpdated", + "AgentV1PromptUpdatedParams", + "AgentV1ReceiveFunctionCallResponse", + "AgentV1ReceiveFunctionCallResponseParams", + "AgentV1SendFunctionCallResponse", + "AgentV1SendFunctionCallResponseParams", + "AgentV1Settings", + "AgentV1SettingsAgent", + "AgentV1SettingsAgentContext", + "AgentV1SettingsAgentContextContext", + "AgentV1SettingsAgentContextContextMessagesItem", + "AgentV1SettingsAgentContextContextMessagesItemParams", + "AgentV1SettingsAgentContextContextParams", + "AgentV1SettingsAgentContextListen", + "AgentV1SettingsAgentContextListenParams", + "AgentV1SettingsAgentContextListenProvider", + "AgentV1SettingsAgentContextListenProviderParams", + "AgentV1SettingsAgentContextListenProvider_V1", + "AgentV1SettingsAgentContextListenProvider_V1Params", + "AgentV1SettingsAgentContextListenProvider_V2", + "AgentV1SettingsAgentContextListenProvider_V2Params", + "AgentV1SettingsAgentContextParams", + "AgentV1SettingsAgentContextSpeak", + "AgentV1SettingsAgentContextSpeakParams", + "AgentV1SettingsAgentContextThink", + "AgentV1SettingsAgentContextThinkParams", + "AgentV1SettingsAgentListen", + "AgentV1SettingsAgentListenParams", + "AgentV1SettingsAgentListenProvider", + "AgentV1SettingsAgentListenProviderParams", + "AgentV1SettingsAgentListenProvider_V1", + "AgentV1SettingsAgentListenProvider_V1Params", + "AgentV1SettingsAgentListenProvider_V2", + "AgentV1SettingsAgentListenProvider_V2Params", + "AgentV1SettingsAgentParams", + "AgentV1SettingsAgentSpeak", + "AgentV1SettingsAgentSpeakParams", + "AgentV1SettingsAgentThink", + "AgentV1SettingsAgentThinkParams", + "AgentV1SettingsApplied", + "AgentV1SettingsAppliedParams", + "AgentV1SettingsAudio", + "AgentV1SettingsAudioInput", + "AgentV1SettingsAudioInputEncoding", + "AgentV1SettingsAudioInputParams", + "AgentV1SettingsAudioOutput", + "AgentV1SettingsAudioOutputContainer", + "AgentV1SettingsAudioOutputEncoding", + "AgentV1SettingsAudioOutputParams", + "AgentV1SettingsAudioParams", + "AgentV1SettingsFlags", + "AgentV1SettingsFlagsParams", + "AgentV1SettingsParams", + "AgentV1SpeakUpdated", + "AgentV1SpeakUpdatedParams", + "AgentV1ThinkLiveUpdated", + "AgentV1ThinkLiveUpdatedParams", + "AgentV1ThinkUpdated", + "AgentV1ThinkUpdatedParams", + "AgentV1UpdateListen", + "AgentV1UpdateListenListen", + "AgentV1UpdateListenListenParams", + "AgentV1UpdateListenListenProvider", + "AgentV1UpdateListenListenProviderParams", + "AgentV1UpdateListenListenProvider_V1", + "AgentV1UpdateListenListenProvider_V1Params", + "AgentV1UpdateListenListenProvider_V2", + "AgentV1UpdateListenListenProvider_V2Params", + "AgentV1UpdateListenParams", + "AgentV1UpdatePrompt", + "AgentV1UpdatePromptParams", + "AgentV1UpdateSpeak", + "AgentV1UpdateSpeakParams", + "AgentV1UpdateSpeakSpeak", + "AgentV1UpdateSpeakSpeakParams", + "AgentV1UpdateThink", + "AgentV1UpdateThinkLive", + "AgentV1UpdateThinkLiveParams", + "AgentV1UpdateThinkParams", + "AgentV1UpdateThinkThink", + "AgentV1UpdateThinkThinkParams", + "AgentV1UserStartedSpeaking", + "AgentV1UserStartedSpeakingParams", + "AgentV1Warning", + "AgentV1WarningParams", + "AgentV1Welcome", + "AgentV1WelcomeParams", + "ConversationHistoryMessage", + "ConversationHistoryMessageParams", + "ConversationHistoryMessageRole", + "FunctionCallHistoryMessage", + "FunctionCallHistoryMessageFunctionCallsItem", + "FunctionCallHistoryMessageFunctionCallsItemParams", + "FunctionCallHistoryMessageParams", + "settings", +] + +__all__.extend( + [ + "AgentV1HistoryContent", + "AgentV1HistoryContentParams", + "AgentV1HistoryContentRole", + "AgentV1HistoryFunctionCalls", + "AgentV1HistoryFunctionCallsFunctionCallsItem", + "AgentV1HistoryFunctionCallsFunctionCallsItemParams", + "AgentV1HistoryFunctionCallsParams", + "AgentV1SettingsAgentContextContextMessagesItemContentRole", + "AgentV1SettingsAgentContextContextMessagesItemFunctionCallsFunctionCallsItem", + "AgentV1SettingsAgentContextContextMessagesItemFunctionCallsFunctionCallsItemParams", + "AgentV1SettingsAgentContextListenProviderV1", + "AgentV1SettingsAgentContextListenProviderV1Params", + "AgentV1SettingsAgentContextListenProviderV2", + "AgentV1SettingsAgentContextListenProviderV2LanguageHint", + "AgentV1SettingsAgentContextListenProviderV2LanguageHintParams", + "AgentV1SettingsAgentContextListenProviderV2Params", + "AgentV1SettingsAgentContextMessagesItem", + "AgentV1SettingsAgentContextMessagesItemContent", + "AgentV1SettingsAgentContextMessagesItemContentParams", + "AgentV1SettingsAgentContextMessagesItemContentRole", + "AgentV1SettingsAgentContextMessagesItemFunctionCalls", + "AgentV1SettingsAgentContextMessagesItemFunctionCallsFunctionCallsItem", + "AgentV1SettingsAgentContextMessagesItemFunctionCallsFunctionCallsItemParams", + "AgentV1SettingsAgentContextMessagesItemFunctionCallsParams", + "AgentV1SettingsAgentContextMessagesItemParams", + "AgentV1SettingsAgentListenProviderV1", + "AgentV1SettingsAgentListenProviderV1Params", + "AgentV1SettingsAgentListenProviderV2", + "AgentV1SettingsAgentListenProviderV2Params", + ] +) diff --git a/src/deepgram/agent/v1/requests/__init__.py.bak b/src/deepgram/agent/v1/requests/__init__.py.bak new file mode 100644 index 00000000..766d9807 --- /dev/null +++ b/src/deepgram/agent/v1/requests/__init__.py.bak @@ -0,0 +1,279 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .agent_v1agent_audio_done import AgentV1AgentAudioDoneParams + from .agent_v1agent_started_speaking import AgentV1AgentStartedSpeakingParams + from .agent_v1agent_thinking import AgentV1AgentThinkingParams + from .agent_v1conversation_text import AgentV1ConversationTextParams + from .agent_v1custom_from_think_provider import AgentV1CustomFromThinkProviderParams + from .agent_v1custom_to_think_provider import AgentV1CustomToThinkProviderParams + from .agent_v1error import AgentV1ErrorParams + from .agent_v1force_end_turn import AgentV1ForceEndTurnParams + from .agent_v1frustration_detected import AgentV1FrustrationDetectedParams + from .agent_v1function_call_cancelled import AgentV1FunctionCallCancelledParams + from .agent_v1function_call_cancelled_functions_item import AgentV1FunctionCallCancelledFunctionsItemParams + from .agent_v1function_call_request import AgentV1FunctionCallRequestParams + from .agent_v1function_call_request_functions_item import AgentV1FunctionCallRequestFunctionsItemParams + from .agent_v1history import AgentV1HistoryParams + from .agent_v1history_content import AgentV1HistoryContentParams # noqa: F401 + from .agent_v1history_function_calls import AgentV1HistoryFunctionCallsParams # noqa: F401 + from .agent_v1inject_agent_message import AgentV1InjectAgentMessageParams + from .agent_v1inject_dynamic_agent_message import AgentV1InjectDynamicAgentMessageParams + from .agent_v1inject_user_message import AgentV1InjectUserMessageParams + from .agent_v1injection_refused import AgentV1InjectionRefusedParams + from .agent_v1keep_alive import AgentV1KeepAliveParams + from .agent_v1latency_report import AgentV1LatencyReportParams + from .agent_v1listen_updated import AgentV1ListenUpdatedParams + from .agent_v1prompt_updated import AgentV1PromptUpdatedParams + from .agent_v1receive_function_call_response import AgentV1ReceiveFunctionCallResponseParams + from .agent_v1send_function_call_response import AgentV1SendFunctionCallResponseParams + from .agent_v1settings import AgentV1SettingsParams + from .agent_v1settings_agent import AgentV1SettingsAgentParams + from .agent_v1settings_agent_context import AgentV1SettingsAgentContextParams + from .agent_v1settings_agent_context_context import AgentV1SettingsAgentContextContextParams + from .agent_v1settings_agent_context_context_messages_item import ( + AgentV1SettingsAgentContextContextMessagesItemParams, + ) + from .agent_v1settings_agent_context_listen import AgentV1SettingsAgentContextListenParams + from .agent_v1settings_agent_context_listen_provider import ( + AgentV1SettingsAgentContextListenProviderParams, + AgentV1SettingsAgentContextListenProvider_V1Params, + AgentV1SettingsAgentContextListenProvider_V2Params, + ) + from .agent_v1settings_agent_context_speak import AgentV1SettingsAgentContextSpeakParams + from .agent_v1settings_agent_context_think import AgentV1SettingsAgentContextThinkParams + from .agent_v1settings_agent_listen import AgentV1SettingsAgentListenParams + from .agent_v1settings_agent_listen_provider import ( + AgentV1SettingsAgentListenProviderParams, + AgentV1SettingsAgentListenProvider_V1Params, + AgentV1SettingsAgentListenProvider_V2Params, + ) + from .agent_v1settings_agent_speak import AgentV1SettingsAgentSpeakParams + from .agent_v1settings_agent_think import AgentV1SettingsAgentThinkParams + from .agent_v1settings_applied import AgentV1SettingsAppliedParams + from .agent_v1settings_audio import AgentV1SettingsAudioParams + from .agent_v1settings_audio_input import AgentV1SettingsAudioInputParams + from .agent_v1settings_audio_output import AgentV1SettingsAudioOutputParams + from .agent_v1settings_flags import AgentV1SettingsFlagsParams + from .agent_v1speak_updated import AgentV1SpeakUpdatedParams + from .agent_v1think_live_updated import AgentV1ThinkLiveUpdatedParams + from .agent_v1think_updated import AgentV1ThinkUpdatedParams + from .agent_v1update_listen import AgentV1UpdateListenParams + from .agent_v1update_listen_listen import AgentV1UpdateListenListenParams + from .agent_v1update_listen_listen_provider import ( + AgentV1UpdateListenListenProviderParams, + AgentV1UpdateListenListenProvider_V1Params, + AgentV1UpdateListenListenProvider_V2Params, + ) + from .agent_v1update_prompt import AgentV1UpdatePromptParams + from .agent_v1update_speak import AgentV1UpdateSpeakParams + from .agent_v1update_speak_speak import AgentV1UpdateSpeakSpeakParams + from .agent_v1update_think import AgentV1UpdateThinkParams + from .agent_v1update_think_live import AgentV1UpdateThinkLiveParams + from .agent_v1update_think_think import AgentV1UpdateThinkThinkParams + from .agent_v1user_started_speaking import AgentV1UserStartedSpeakingParams + from .agent_v1warning import AgentV1WarningParams + from .agent_v1welcome import AgentV1WelcomeParams + from .conversation_history_message import ConversationHistoryMessageParams + from .function_call_history_message import FunctionCallHistoryMessageParams + from .function_call_history_message_function_calls_item import FunctionCallHistoryMessageFunctionCallsItemParams +_dynamic_imports: typing.Dict[str, str] = { + "AgentV1AgentAudioDoneParams": ".agent_v1agent_audio_done", + "AgentV1AgentStartedSpeakingParams": ".agent_v1agent_started_speaking", + "AgentV1AgentThinkingParams": ".agent_v1agent_thinking", + "AgentV1ConversationTextParams": ".agent_v1conversation_text", + "AgentV1CustomFromThinkProviderParams": ".agent_v1custom_from_think_provider", + "AgentV1CustomToThinkProviderParams": ".agent_v1custom_to_think_provider", + "AgentV1ErrorParams": ".agent_v1error", + "AgentV1ForceEndTurnParams": ".agent_v1force_end_turn", + "AgentV1FrustrationDetectedParams": ".agent_v1frustration_detected", + "AgentV1FunctionCallCancelledFunctionsItemParams": ".agent_v1function_call_cancelled_functions_item", + "AgentV1FunctionCallCancelledParams": ".agent_v1function_call_cancelled", + "AgentV1FunctionCallRequestFunctionsItemParams": ".agent_v1function_call_request_functions_item", + "AgentV1FunctionCallRequestParams": ".agent_v1function_call_request", + "AgentV1HistoryParams": ".agent_v1history", + "AgentV1InjectAgentMessageParams": ".agent_v1inject_agent_message", + "AgentV1InjectDynamicAgentMessageParams": ".agent_v1inject_dynamic_agent_message", + "AgentV1InjectUserMessageParams": ".agent_v1inject_user_message", + "AgentV1InjectionRefusedParams": ".agent_v1injection_refused", + "AgentV1KeepAliveParams": ".agent_v1keep_alive", + "AgentV1LatencyReportParams": ".agent_v1latency_report", + "AgentV1ListenUpdatedParams": ".agent_v1listen_updated", + "AgentV1PromptUpdatedParams": ".agent_v1prompt_updated", + "AgentV1ReceiveFunctionCallResponseParams": ".agent_v1receive_function_call_response", + "AgentV1SendFunctionCallResponseParams": ".agent_v1send_function_call_response", + "AgentV1SettingsAgentContextContextMessagesItemParams": ".agent_v1settings_agent_context_context_messages_item", + "AgentV1SettingsAgentContextContextParams": ".agent_v1settings_agent_context_context", + "AgentV1SettingsAgentContextListenParams": ".agent_v1settings_agent_context_listen", + "AgentV1SettingsAgentContextListenProviderParams": ".agent_v1settings_agent_context_listen_provider", + "AgentV1SettingsAgentContextListenProvider_V1Params": ".agent_v1settings_agent_context_listen_provider", + "AgentV1SettingsAgentContextListenProvider_V2Params": ".agent_v1settings_agent_context_listen_provider", + "AgentV1SettingsAgentContextParams": ".agent_v1settings_agent_context", + "AgentV1SettingsAgentContextSpeakParams": ".agent_v1settings_agent_context_speak", + "AgentV1SettingsAgentContextThinkParams": ".agent_v1settings_agent_context_think", + "AgentV1SettingsAgentListenParams": ".agent_v1settings_agent_listen", + "AgentV1SettingsAgentListenProviderParams": ".agent_v1settings_agent_listen_provider", + "AgentV1SettingsAgentListenProvider_V1Params": ".agent_v1settings_agent_listen_provider", + "AgentV1SettingsAgentListenProvider_V2Params": ".agent_v1settings_agent_listen_provider", + "AgentV1SettingsAgentParams": ".agent_v1settings_agent", + "AgentV1SettingsAgentSpeakParams": ".agent_v1settings_agent_speak", + "AgentV1SettingsAgentThinkParams": ".agent_v1settings_agent_think", + "AgentV1SettingsAppliedParams": ".agent_v1settings_applied", + "AgentV1SettingsAudioInputParams": ".agent_v1settings_audio_input", + "AgentV1SettingsAudioOutputParams": ".agent_v1settings_audio_output", + "AgentV1SettingsAudioParams": ".agent_v1settings_audio", + "AgentV1SettingsFlagsParams": ".agent_v1settings_flags", + "AgentV1SettingsParams": ".agent_v1settings", + "AgentV1SpeakUpdatedParams": ".agent_v1speak_updated", + "AgentV1ThinkLiveUpdatedParams": ".agent_v1think_live_updated", + "AgentV1ThinkUpdatedParams": ".agent_v1think_updated", + "AgentV1UpdateListenListenParams": ".agent_v1update_listen_listen", + "AgentV1UpdateListenListenProviderParams": ".agent_v1update_listen_listen_provider", + "AgentV1UpdateListenListenProvider_V1Params": ".agent_v1update_listen_listen_provider", + "AgentV1UpdateListenListenProvider_V2Params": ".agent_v1update_listen_listen_provider", + "AgentV1UpdateListenParams": ".agent_v1update_listen", + "AgentV1UpdatePromptParams": ".agent_v1update_prompt", + "AgentV1UpdateSpeakParams": ".agent_v1update_speak", + "AgentV1UpdateSpeakSpeakParams": ".agent_v1update_speak_speak", + "AgentV1UpdateThinkLiveParams": ".agent_v1update_think_live", + "AgentV1UpdateThinkParams": ".agent_v1update_think", + "AgentV1UpdateThinkThinkParams": ".agent_v1update_think_think", + "AgentV1UserStartedSpeakingParams": ".agent_v1user_started_speaking", + "AgentV1WarningParams": ".agent_v1warning", + "AgentV1WelcomeParams": ".agent_v1welcome", + "ConversationHistoryMessageParams": ".conversation_history_message", + "FunctionCallHistoryMessageFunctionCallsItemParams": ".function_call_history_message_function_calls_item", + "FunctionCallHistoryMessageParams": ".function_call_history_message", +} + +_dynamic_imports.update( + { + "AgentV1HistoryContentParams": ".agent_v1history_content", + "AgentV1HistoryFunctionCallsParams": ".agent_v1history_function_calls", + "AgentV1HistoryFunctionCallsFunctionCallsItemParams": ".agent_v1history_function_calls_function_calls_item", + "AgentV1SettingsAgentContextContextMessagesItemFunctionCallsFunctionCallsItemParams": ".agent_v1settings_agent_context_context_messages_item_function_calls_function_calls_item", + "AgentV1SettingsAgentContextListenProviderV1Params": ".agent_v1settings_agent_context_listen_provider_v1", + "AgentV1SettingsAgentContextListenProviderV2Params": ".agent_v1settings_agent_context_listen_provider_v2", + "AgentV1SettingsAgentContextListenProviderV2LanguageHintParams": ".agent_v1settings_agent_context_listen_provider_v2language_hint", + "AgentV1SettingsAgentContextMessagesItemParams": ".agent_v1settings_agent_context_messages_item", + "AgentV1SettingsAgentContextMessagesItemContentParams": ".agent_v1settings_agent_context_messages_item_content", + "AgentV1SettingsAgentContextMessagesItemFunctionCallsParams": ".agent_v1settings_agent_context_messages_item_function_calls", + "AgentV1SettingsAgentContextMessagesItemFunctionCallsFunctionCallsItemParams": ".agent_v1settings_agent_context_messages_item_function_calls_function_calls_item", + "AgentV1SettingsAgentListenProviderV1Params": ".agent_v1settings_agent_listen_provider_v1", + "AgentV1SettingsAgentListenProviderV2Params": ".agent_v1settings_agent_listen_provider_v2", + } +) + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = [ + "AgentV1AgentAudioDoneParams", + "AgentV1AgentStartedSpeakingParams", + "AgentV1AgentThinkingParams", + "AgentV1ConversationTextParams", + "AgentV1CustomFromThinkProviderParams", + "AgentV1CustomToThinkProviderParams", + "AgentV1ErrorParams", + "AgentV1ForceEndTurnParams", + "AgentV1FrustrationDetectedParams", + "AgentV1FunctionCallCancelledFunctionsItemParams", + "AgentV1FunctionCallCancelledParams", + "AgentV1FunctionCallRequestFunctionsItemParams", + "AgentV1FunctionCallRequestParams", + "AgentV1HistoryParams", + "AgentV1InjectAgentMessageParams", + "AgentV1InjectDynamicAgentMessageParams", + "AgentV1InjectUserMessageParams", + "AgentV1InjectionRefusedParams", + "AgentV1KeepAliveParams", + "AgentV1LatencyReportParams", + "AgentV1ListenUpdatedParams", + "AgentV1PromptUpdatedParams", + "AgentV1ReceiveFunctionCallResponseParams", + "AgentV1SendFunctionCallResponseParams", + "AgentV1SettingsAgentContextContextMessagesItemParams", + "AgentV1SettingsAgentContextContextParams", + "AgentV1SettingsAgentContextListenParams", + "AgentV1SettingsAgentContextListenProviderParams", + "AgentV1SettingsAgentContextListenProvider_V1Params", + "AgentV1SettingsAgentContextListenProvider_V2Params", + "AgentV1SettingsAgentContextParams", + "AgentV1SettingsAgentContextSpeakParams", + "AgentV1SettingsAgentContextThinkParams", + "AgentV1SettingsAgentListenParams", + "AgentV1SettingsAgentListenProviderParams", + "AgentV1SettingsAgentListenProvider_V1Params", + "AgentV1SettingsAgentListenProvider_V2Params", + "AgentV1SettingsAgentParams", + "AgentV1SettingsAgentSpeakParams", + "AgentV1SettingsAgentThinkParams", + "AgentV1SettingsAppliedParams", + "AgentV1SettingsAudioInputParams", + "AgentV1SettingsAudioOutputParams", + "AgentV1SettingsAudioParams", + "AgentV1SettingsFlagsParams", + "AgentV1SettingsParams", + "AgentV1SpeakUpdatedParams", + "AgentV1ThinkLiveUpdatedParams", + "AgentV1ThinkUpdatedParams", + "AgentV1UpdateListenListenParams", + "AgentV1UpdateListenListenProviderParams", + "AgentV1UpdateListenListenProvider_V1Params", + "AgentV1UpdateListenListenProvider_V2Params", + "AgentV1UpdateListenParams", + "AgentV1UpdatePromptParams", + "AgentV1UpdateSpeakParams", + "AgentV1UpdateSpeakSpeakParams", + "AgentV1UpdateThinkLiveParams", + "AgentV1UpdateThinkParams", + "AgentV1UpdateThinkThinkParams", + "AgentV1UserStartedSpeakingParams", + "AgentV1WarningParams", + "AgentV1WelcomeParams", + "ConversationHistoryMessageParams", + "FunctionCallHistoryMessageFunctionCallsItemParams", + "FunctionCallHistoryMessageParams", +] + +__all__.extend( + [ + "AgentV1HistoryContentParams", + "AgentV1HistoryFunctionCallsParams", + "AgentV1HistoryFunctionCallsFunctionCallsItemParams", + "AgentV1SettingsAgentContextContextMessagesItemFunctionCallsFunctionCallsItemParams", + "AgentV1SettingsAgentContextListenProviderV1Params", + "AgentV1SettingsAgentContextListenProviderV2Params", + "AgentV1SettingsAgentContextListenProviderV2LanguageHintParams", + "AgentV1SettingsAgentContextMessagesItemParams", + "AgentV1SettingsAgentContextMessagesItemContentParams", + "AgentV1SettingsAgentContextMessagesItemFunctionCallsParams", + "AgentV1SettingsAgentContextMessagesItemFunctionCallsFunctionCallsItemParams", + "AgentV1SettingsAgentListenProviderV1Params", + "AgentV1SettingsAgentListenProviderV2Params", + ] +) diff --git a/src/deepgram/agent/v1/requests/agent_v1conversation_text.py.bak b/src/deepgram/agent/v1/requests/agent_v1conversation_text.py.bak new file mode 100644 index 00000000..059f094a --- /dev/null +++ b/src/deepgram/agent/v1/requests/agent_v1conversation_text.py.bak @@ -0,0 +1,39 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import typing_extensions +from ..types.agent_v1conversation_text_conversational_behavior import AgentV1ConversationTextConversationalBehavior +from ..types.agent_v1conversation_text_role import AgentV1ConversationTextRole + + +class AgentV1ConversationTextParams(typing_extensions.TypedDict): + type: typing.Literal["ConversationText"] + """ + Message type identifier for conversation text + """ + + role: AgentV1ConversationTextRole + """ + Identifies who spoke the statement + """ + + content: str + """ + The actual statement that was spoken + """ + + conversational_behavior: typing_extensions.NotRequired[AgentV1ConversationTextConversationalBehavior] + """ + Annotates what kind of utterance the message represents: `default` (a standard turn), `backchannel` (a short acknowledgement while the user held the floor), `presence_check` (a prompt after extended silence), or `filler` (a line covering a wait on a function call or a dynamic InjectAgentMessage). Always sent; it is `default` for every message while Think Live is off + """ + + languages_hinted: typing_extensions.NotRequired[typing.Sequence[str]] + """ + The language hints that were active at the time of the turn. Only present on user-role messages when the listen model is flux-general-multi. + """ + + languages: typing_extensions.NotRequired[typing.Sequence[str]] + """ + Languages detected in the user's speech, sorted by word count (descending). Only present on user-role messages when the listen model is flux-general-multi. + """ diff --git a/src/deepgram/agent/v1/requests/agent_v1inject_dynamic_agent_message.py.bak b/src/deepgram/agent/v1/requests/agent_v1inject_dynamic_agent_message.py.bak new file mode 100644 index 00000000..1d912428 --- /dev/null +++ b/src/deepgram/agent/v1/requests/agent_v1inject_dynamic_agent_message.py.bak @@ -0,0 +1,27 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import typing_extensions +from ..types.agent_v1inject_dynamic_agent_message_behavior import AgentV1InjectDynamicAgentMessageBehavior + + +class AgentV1InjectDynamicAgentMessageParams(typing_extensions.TypedDict): + type: typing.Literal["InjectAgentMessage"] + """ + Message type identifier for injecting an agent message + """ + + is_dynamic: typing.Literal[True] + """ + Must be `true`. The Think Live model generates the line, so no `message` is sent + """ + + behavior: typing_extensions.NotRequired[AgentV1InjectDynamicAgentMessageBehavior] + """ + Controls how the injection interacts with any in-progress user or agent turn. + + * `default` — The agent speaks only if neither the user nor the agent is mid-turn. If a turn is in progress, the server replies with `InjectionRefused`. + * `queue` — The message is appended after any already-queued `ConversationText` without interrupting the current agent turn or think response. If nothing is queued, the message plays immediately. + * `interrupt` — The agent immediately speaks. If the agent was already speaking, it interrupts the current speech and replaces it with the new message. If the user is speaking, the agent interrupts with the new message, but the user's continued speech triggers `UserStartedSpeaking`, which quickly interrupts the agent. + """ diff --git a/src/deepgram/agent/v1/requests/agent_v1settings.py.bak b/src/deepgram/agent/v1/requests/agent_v1settings.py.bak new file mode 100644 index 00000000..5ada0975 --- /dev/null +++ b/src/deepgram/agent/v1/requests/agent_v1settings.py.bak @@ -0,0 +1,31 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import typing_extensions +from .agent_v1settings_agent import AgentV1SettingsAgentParams +from .agent_v1settings_agent_context import AgentV1SettingsAgentContextParams +from .agent_v1settings_audio import AgentV1SettingsAudioParams +from .agent_v1settings_flags import AgentV1SettingsFlagsParams + + +class AgentV1SettingsParams(typing_extensions.TypedDict): + type: typing.Literal["Settings"] + tags: typing_extensions.NotRequired[typing.Sequence[str]] + """ + Tags to associate with the request + """ + + experimental: typing_extensions.NotRequired[bool] + """ + To enable experimental features + """ + + flags: typing_extensions.NotRequired[AgentV1SettingsFlagsParams] + mip_opt_out: typing_extensions.NotRequired[bool] + """ + To opt out of Deepgram Model Improvement Program + """ + + audio: AgentV1SettingsAudioParams + agent: typing.Union[AgentV1SettingsAgentParams, AgentV1SettingsAgentContextParams, str] diff --git a/src/deepgram/agent/v1/requests/agent_v1settings_agent.py.bak b/src/deepgram/agent/v1/requests/agent_v1settings_agent.py.bak new file mode 100644 index 00000000..4a2bcf8c --- /dev/null +++ b/src/deepgram/agent/v1/requests/agent_v1settings_agent.py.bak @@ -0,0 +1,18 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing_extensions +from ....requests.think_live_settings_v1 import ThinkLiveSettingsV1Params +from .agent_v1settings_agent_context import AgentV1SettingsAgentContextParams +from .agent_v1settings_agent_listen import AgentV1SettingsAgentListenParams +from .agent_v1settings_agent_speak import AgentV1SettingsAgentSpeakParams +from .agent_v1settings_agent_think import AgentV1SettingsAgentThinkParams + + +class AgentV1SettingsAgentParams(typing_extensions.TypedDict): + language: typing_extensions.NotRequired[str] + context: typing_extensions.NotRequired[AgentV1SettingsAgentContextParams] + listen: typing_extensions.NotRequired[AgentV1SettingsAgentListenParams] + think: typing_extensions.NotRequired[AgentV1SettingsAgentThinkParams] + think_live: typing_extensions.NotRequired[ThinkLiveSettingsV1Params] + speak: typing_extensions.NotRequired[AgentV1SettingsAgentSpeakParams] + greeting: typing_extensions.NotRequired[str] diff --git a/src/deepgram/agent/v1/requests/agent_v1settings_agent_context.py.bak b/src/deepgram/agent/v1/requests/agent_v1settings_agent_context.py.bak new file mode 100644 index 00000000..19503b6f --- /dev/null +++ b/src/deepgram/agent/v1/requests/agent_v1settings_agent_context.py.bak @@ -0,0 +1,37 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import typing_extensions +from ....requests.think_live_settings_v1 import ThinkLiveSettingsV1Params +from .agent_v1settings_agent_context_context import AgentV1SettingsAgentContextContextParams +from .agent_v1settings_agent_context_listen import AgentV1SettingsAgentContextListenParams +from .agent_v1settings_agent_context_messages_item import AgentV1SettingsAgentContextMessagesItemParams +from .agent_v1settings_agent_context_speak import AgentV1SettingsAgentContextSpeakParams +from .agent_v1settings_agent_context_think import AgentV1SettingsAgentContextThinkParams + + +class AgentV1SettingsAgentContextParams(typing_extensions.TypedDict): + language: typing_extensions.NotRequired[str] + """ + Deprecated. Use `listen.provider.language` and `speak.provider.language` fields instead. + """ + + messages: typing_extensions.NotRequired[typing.Sequence[AgentV1SettingsAgentContextMessagesItemParams]] + context: typing_extensions.NotRequired[AgentV1SettingsAgentContextContextParams] + """ + Conversation context including the history of messages and function calls + """ + + listen: typing_extensions.NotRequired[AgentV1SettingsAgentContextListenParams] + think: typing_extensions.NotRequired[AgentV1SettingsAgentContextThinkParams] + """ + Your reasoning LLM. With Think Live on, this is the reasoning half of the pair, running alongside the Think Live model configured in `think_live` + """ + + think_live: typing_extensions.NotRequired[ThinkLiveSettingsV1Params] + speak: typing_extensions.NotRequired[AgentV1SettingsAgentContextSpeakParams] + greeting: typing_extensions.NotRequired[str] + """ + Optional message that agent will speak at the start + """ diff --git a/src/deepgram/agent/v1/socket_client.py.bak b/src/deepgram/agent/v1/socket_client.py.bak new file mode 100644 index 00000000..44ffcaed --- /dev/null +++ b/src/deepgram/agent/v1/socket_client.py.bak @@ -0,0 +1,447 @@ +# This file was auto-generated by Fern from our API Definition. + +import json +import logging +import typing + +import websockets.sync.connection as websockets_sync_connection +from ...core.events import EventEmitterMixin, EventType +from ...core.unchecked_base_model import construct_type +from .types.agent_v1agent_audio_done import AgentV1AgentAudioDone +from .types.agent_v1agent_started_speaking import AgentV1AgentStartedSpeaking +from .types.agent_v1agent_thinking import AgentV1AgentThinking +from .types.agent_v1conversation_text import AgentV1ConversationText +from .types.agent_v1custom_from_think_provider import AgentV1CustomFromThinkProvider +from .types.agent_v1custom_to_think_provider import AgentV1CustomToThinkProvider +from .types.agent_v1error import AgentV1Error +from .types.agent_v1force_end_turn import AgentV1ForceEndTurn +from .types.agent_v1frustration_detected import AgentV1FrustrationDetected +from .types.agent_v1function_call_cancelled import AgentV1FunctionCallCancelled +from .types.agent_v1function_call_request import AgentV1FunctionCallRequest +from .types.agent_v1history import AgentV1History +from .types.agent_v1inject_agent_message import AgentV1InjectAgentMessage +from .types.agent_v1inject_dynamic_agent_message import AgentV1InjectDynamicAgentMessage +from .types.agent_v1inject_user_message import AgentV1InjectUserMessage +from .types.agent_v1injection_refused import AgentV1InjectionRefused +from .types.agent_v1keep_alive import AgentV1KeepAlive +from .types.agent_v1latency_report import AgentV1LatencyReport +from .types.agent_v1listen_updated import AgentV1ListenUpdated +from .types.agent_v1prompt_updated import AgentV1PromptUpdated +from .types.agent_v1receive_function_call_response import AgentV1ReceiveFunctionCallResponse +from .types.agent_v1send_function_call_response import AgentV1SendFunctionCallResponse +from .types.agent_v1settings import AgentV1Settings +from .types.agent_v1settings_applied import AgentV1SettingsApplied +from .types.agent_v1speak_updated import AgentV1SpeakUpdated +from .types.agent_v1think_live_updated import AgentV1ThinkLiveUpdated +from .types.agent_v1think_updated import AgentV1ThinkUpdated +from .types.agent_v1update_listen import AgentV1UpdateListen +from .types.agent_v1update_prompt import AgentV1UpdatePrompt +from .types.agent_v1update_speak import AgentV1UpdateSpeak +from .types.agent_v1update_think import AgentV1UpdateThink +from .types.agent_v1update_think_live import AgentV1UpdateThinkLive +from .types.agent_v1user_started_speaking import AgentV1UserStartedSpeaking +from .types.agent_v1warning import AgentV1Warning +from .types.agent_v1welcome import AgentV1Welcome + +try: + from websockets.legacy.client import WebSocketClientProtocol # type: ignore +except ImportError: + from websockets import WebSocketClientProtocol # type: ignore + + +def _sanitize_numeric_types(obj: typing.Any) -> typing.Any: + """Convert whole-number floats to integers for wire-compatible JSON.""" + if isinstance(obj, dict): + return {key: _sanitize_numeric_types(value) for key, value in obj.items()} + if isinstance(obj, list): + return [_sanitize_numeric_types(item) for item in obj] + if isinstance(obj, float) and obj.is_integer(): + return int(obj) + return obj + + +_logger = logging.getLogger(__name__) +V1SocketClientResponse = typing.Union[ + AgentV1ListenUpdated, + AgentV1ThinkUpdated, + AgentV1ThinkLiveUpdated, + AgentV1FrustrationDetected, + AgentV1ReceiveFunctionCallResponse, + AgentV1PromptUpdated, + AgentV1SpeakUpdated, + AgentV1InjectionRefused, + AgentV1Welcome, + AgentV1SettingsApplied, + AgentV1ConversationText, + AgentV1UserStartedSpeaking, + AgentV1AgentThinking, + AgentV1LatencyReport, + AgentV1FunctionCallRequest, + AgentV1FunctionCallCancelled, + AgentV1AgentStartedSpeaking, + AgentV1AgentAudioDone, + AgentV1CustomFromThinkProvider, + AgentV1Error, + AgentV1Warning, + AgentV1History, + bytes, + typing.Dict[str, typing.Any], +] + + +class AsyncV1SocketClient(EventEmitterMixin): + def __init__(self, *, websocket: WebSocketClientProtocol): + super().__init__() + self._websocket = websocket + + async def __aiter__(self) -> typing.AsyncIterator[V1SocketClientResponse]: + async for message in self._websocket: + if isinstance(message, bytes): + yield message # type: ignore + else: + try: + yield construct_type(type_=V1SocketClientResponse, object_=json.loads(message)) # type: ignore + except Exception: + _logger.warning( + "Skipping unknown WebSocket message; update your SDK version to support new message types." + ) + continue + + async def start_listening(self): + """ + Start listening for messages on the websocket connection. + + Emits events in the following order: + - EventType.OPEN when connection is established + - EventType.MESSAGE for each message received + - EventType.ERROR if an error occurs + - EventType.CLOSE when connection is closed + """ + await self._emit_async(EventType.OPEN, None) + try: + async for raw_message in self._websocket: + if isinstance(raw_message, bytes): + parsed = raw_message + else: + json_data = json.loads(raw_message) + try: + parsed = construct_type(type_=V1SocketClientResponse, object_=json_data) # type: ignore + except Exception: + _logger.warning( + "Skipping unknown WebSocket message; update your SDK version to support new message types." + ) + continue + await self._emit_async(EventType.MESSAGE, parsed) + except Exception as exc: + await self._emit_async(EventType.ERROR, exc) + finally: + await self._emit_async(EventType.CLOSE, None) + + async def send_settings(self, message: AgentV1Settings) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a AgentV1Settings. + """ + await self._send_model(message) + + async def send_update_listen(self, message: AgentV1UpdateListen) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a AgentV1UpdateListen. + """ + await self._send_model(message) + + async def send_update_think(self, message: AgentV1UpdateThink) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a AgentV1UpdateThink. + """ + await self._send_model(message) + + async def send_update_think_live(self, message: AgentV1UpdateThinkLive) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a AgentV1UpdateThinkLive. + """ + await self._send_model(message) + + async def send_update_speak(self, message: AgentV1UpdateSpeak) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a AgentV1UpdateSpeak. + """ + await self._send_model(message) + + async def send_inject_user_message(self, message: AgentV1InjectUserMessage) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a AgentV1InjectUserMessage. + """ + await self._send_model(message) + + async def send_inject_agent_message(self, message: AgentV1InjectAgentMessage) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a AgentV1InjectAgentMessage. + """ + await self._send_model(message) + + async def send_inject_dynamic_agent_message(self, message: AgentV1InjectDynamicAgentMessage) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a AgentV1InjectDynamicAgentMessage. + """ + await self._send_model(message) + + async def send_function_call_response(self, message: AgentV1SendFunctionCallResponse) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a AgentV1SendFunctionCallResponse. + """ + await self._send_model(message) + + async def send_keep_alive(self, message: typing.Optional[AgentV1KeepAlive] = None) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a AgentV1KeepAlive. + """ + await self._send_model(message or AgentV1KeepAlive(type="KeepAlive")) + + async def send_update_prompt(self, message: AgentV1UpdatePrompt) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a AgentV1UpdatePrompt. + """ + await self._send_model(message) + + async def send_force_end_turn(self, message: typing.Optional[AgentV1ForceEndTurn] = None) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a AgentV1ForceEndTurn. + """ + await self._send_model(message or AgentV1ForceEndTurn(type="ForceEndTurn")) + + async def send_custom_to_think_provider(self, message: AgentV1CustomToThinkProvider) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a AgentV1CustomToThinkProvider. + """ + await self._send_model(message) + + async def send_raw(self, message: typing.Union[typing.Dict[str, typing.Any], str]) -> None: + """Send a JSON control frame without model validation.""" + await self._send(message) + + async def send_media(self, message: bytes) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a bytes. + """ + await self._send(message) + + async def recv(self) -> V1SocketClientResponse: + """ + Receive a message from the websocket connection. + """ + data = await self._websocket.recv() + if isinstance(data, bytes): + return data # type: ignore + json_data = json.loads(data) + try: + return construct_type(type_=V1SocketClientResponse, object_=json_data) # type: ignore + except Exception: + _logger.warning("Skipping unknown WebSocket message; update your SDK version to support new message types.") + return json_data # type: ignore + + async def _send(self, data: typing.Any) -> None: + """ + Send a message to the websocket connection. + """ + if isinstance(data, dict): + data = json.dumps(data) + await self._websocket.send(data) + + async def _send_model(self, data: typing.Any) -> None: + """ + Send a Pydantic model to the websocket connection. + """ + await self._send(_sanitize_numeric_types(data.dict())) + + +class V1SocketClient(EventEmitterMixin): + def __init__(self, *, websocket: websockets_sync_connection.Connection): + super().__init__() + self._websocket = websocket + + def __iter__(self) -> typing.Iterator[V1SocketClientResponse]: + for message in self._websocket: + if isinstance(message, bytes): + yield message # type: ignore + else: + try: + yield construct_type(type_=V1SocketClientResponse, object_=json.loads(message)) # type: ignore + except Exception: + _logger.warning( + "Skipping unknown WebSocket message; update your SDK version to support new message types." + ) + continue + + def start_listening(self): + """ + Start listening for messages on the websocket connection. + + Emits events in the following order: + - EventType.OPEN when connection is established + - EventType.MESSAGE for each message received + - EventType.ERROR if an error occurs + - EventType.CLOSE when connection is closed + """ + self._emit(EventType.OPEN, None) + try: + for raw_message in self._websocket: + if isinstance(raw_message, bytes): + parsed = raw_message + else: + json_data = json.loads(raw_message) + try: + parsed = construct_type(type_=V1SocketClientResponse, object_=json_data) # type: ignore + except Exception: + _logger.warning( + "Skipping unknown WebSocket message; update your SDK version to support new message types." + ) + continue + self._emit(EventType.MESSAGE, parsed) + except Exception as exc: + self._emit(EventType.ERROR, exc) + finally: + self._emit(EventType.CLOSE, None) + + def send_settings(self, message: AgentV1Settings) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a AgentV1Settings. + """ + self._send_model(message) + + def send_update_listen(self, message: AgentV1UpdateListen) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a AgentV1UpdateListen. + """ + self._send_model(message) + + def send_update_think(self, message: AgentV1UpdateThink) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a AgentV1UpdateThink. + """ + self._send_model(message) + + def send_update_think_live(self, message: AgentV1UpdateThinkLive) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a AgentV1UpdateThinkLive. + """ + self._send_model(message) + + def send_update_speak(self, message: AgentV1UpdateSpeak) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a AgentV1UpdateSpeak. + """ + self._send_model(message) + + def send_inject_user_message(self, message: AgentV1InjectUserMessage) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a AgentV1InjectUserMessage. + """ + self._send_model(message) + + def send_inject_agent_message(self, message: AgentV1InjectAgentMessage) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a AgentV1InjectAgentMessage. + """ + self._send_model(message) + + def send_inject_dynamic_agent_message(self, message: AgentV1InjectDynamicAgentMessage) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a AgentV1InjectDynamicAgentMessage. + """ + self._send_model(message) + + def send_function_call_response(self, message: AgentV1SendFunctionCallResponse) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a AgentV1SendFunctionCallResponse. + """ + self._send_model(message) + + def send_keep_alive(self, message: typing.Optional[AgentV1KeepAlive] = None) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a AgentV1KeepAlive. + """ + self._send_model(message or AgentV1KeepAlive(type="KeepAlive")) + + def send_update_prompt(self, message: AgentV1UpdatePrompt) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a AgentV1UpdatePrompt. + """ + self._send_model(message) + + def send_force_end_turn(self, message: typing.Optional[AgentV1ForceEndTurn] = None) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a AgentV1ForceEndTurn. + """ + self._send_model(message or AgentV1ForceEndTurn(type="ForceEndTurn")) + + def send_custom_to_think_provider(self, message: AgentV1CustomToThinkProvider) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a AgentV1CustomToThinkProvider. + """ + self._send_model(message) + + def send_raw(self, message: typing.Union[typing.Dict[str, typing.Any], str]) -> None: + """Send a JSON control frame without model validation.""" + self._send(message) + + def send_media(self, message: bytes) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a bytes. + """ + self._send(message) + + def recv(self) -> V1SocketClientResponse: + """ + Receive a message from the websocket connection. + """ + data = self._websocket.recv() + if isinstance(data, bytes): + return data # type: ignore + json_data = json.loads(data) + try: + return construct_type(type_=V1SocketClientResponse, object_=json_data) # type: ignore + except Exception: + _logger.warning("Skipping unknown WebSocket message; update your SDK version to support new message types.") + return json_data # type: ignore + + def _send(self, data: typing.Any) -> None: + """ + Send a message to the websocket connection. + """ + if isinstance(data, dict): + data = json.dumps(data) + self._websocket.send(data) + + def _send_model(self, data: typing.Any) -> None: + """ + Send a Pydantic model to the websocket connection. + """ + self._send(_sanitize_numeric_types(data.dict())) diff --git a/src/deepgram/agent/v1/types/__init__.py.bak b/src/deepgram/agent/v1/types/__init__.py.bak new file mode 100644 index 00000000..e6a3fdc7 --- /dev/null +++ b/src/deepgram/agent/v1/types/__init__.py.bak @@ -0,0 +1,305 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .agent_v1agent_audio_done import AgentV1AgentAudioDone + from .agent_v1agent_started_speaking import AgentV1AgentStartedSpeaking + from .agent_v1agent_thinking import AgentV1AgentThinking + from .agent_v1conversation_text import AgentV1ConversationText + from .agent_v1conversation_text_conversational_behavior import AgentV1ConversationTextConversationalBehavior + from .agent_v1conversation_text_role import AgentV1ConversationTextRole + from .agent_v1custom_from_think_provider import AgentV1CustomFromThinkProvider + from .agent_v1custom_to_think_provider import AgentV1CustomToThinkProvider + from .agent_v1error import AgentV1Error + from .agent_v1force_end_turn import AgentV1ForceEndTurn + from .agent_v1frustration_detected import AgentV1FrustrationDetected + from .agent_v1function_call_cancelled import AgentV1FunctionCallCancelled + from .agent_v1function_call_cancelled_functions_item import AgentV1FunctionCallCancelledFunctionsItem + from .agent_v1function_call_request import AgentV1FunctionCallRequest + from .agent_v1function_call_request_functions_item import AgentV1FunctionCallRequestFunctionsItem + from .agent_v1history import AgentV1History + from .agent_v1inject_agent_message import AgentV1InjectAgentMessage + from .agent_v1inject_agent_message_behavior import AgentV1InjectAgentMessageBehavior + from .agent_v1inject_dynamic_agent_message import AgentV1InjectDynamicAgentMessage + from .agent_v1inject_dynamic_agent_message_behavior import AgentV1InjectDynamicAgentMessageBehavior + from .agent_v1inject_user_message import AgentV1InjectUserMessage + from .agent_v1injection_refused import AgentV1InjectionRefused + from .agent_v1keep_alive import AgentV1KeepAlive + from .agent_v1latency_report import AgentV1LatencyReport + from .agent_v1listen_updated import AgentV1ListenUpdated + from .agent_v1prompt_updated import AgentV1PromptUpdated + from .agent_v1receive_function_call_response import AgentV1ReceiveFunctionCallResponse + from .agent_v1send_function_call_response import AgentV1SendFunctionCallResponse + from .agent_v1settings import AgentV1Settings + from .agent_v1settings_agent import AgentV1SettingsAgent + from .agent_v1settings_agent_context import AgentV1SettingsAgentContext + from .agent_v1settings_agent_context_context import AgentV1SettingsAgentContextContext + from .agent_v1settings_agent_context_context_messages_item import AgentV1SettingsAgentContextContextMessagesItem + from .agent_v1settings_agent_context_listen import AgentV1SettingsAgentContextListen + from .agent_v1settings_agent_context_listen_provider import ( + AgentV1SettingsAgentContextListenProvider, + AgentV1SettingsAgentContextListenProvider_V1, + AgentV1SettingsAgentContextListenProvider_V2, + ) + from .agent_v1settings_agent_context_speak import AgentV1SettingsAgentContextSpeak + from .agent_v1settings_agent_context_think import AgentV1SettingsAgentContextThink + from .agent_v1settings_agent_listen import AgentV1SettingsAgentListen + from .agent_v1settings_agent_listen_provider import ( + AgentV1SettingsAgentListenProvider, + AgentV1SettingsAgentListenProvider_V1, + AgentV1SettingsAgentListenProvider_V2, + ) + from .agent_v1settings_agent_speak import AgentV1SettingsAgentSpeak + from .agent_v1settings_agent_think import AgentV1SettingsAgentThink + from .agent_v1settings_applied import AgentV1SettingsApplied + from .agent_v1settings_audio import AgentV1SettingsAudio + from .agent_v1settings_audio_input import AgentV1SettingsAudioInput + from .agent_v1settings_audio_input_encoding import AgentV1SettingsAudioInputEncoding + from .agent_v1settings_audio_output import AgentV1SettingsAudioOutput + from .agent_v1settings_audio_output_container import AgentV1SettingsAudioOutputContainer + from .agent_v1settings_audio_output_encoding import AgentV1SettingsAudioOutputEncoding + from .agent_v1settings_flags import AgentV1SettingsFlags + from .agent_v1speak_updated import AgentV1SpeakUpdated + from .agent_v1think_live_updated import AgentV1ThinkLiveUpdated + from .agent_v1think_updated import AgentV1ThinkUpdated + from .agent_v1update_listen import AgentV1UpdateListen + from .agent_v1update_listen_listen import AgentV1UpdateListenListen + from .agent_v1update_listen_listen_provider import ( + AgentV1UpdateListenListenProvider, + AgentV1UpdateListenListenProvider_V1, + AgentV1UpdateListenListenProvider_V2, + ) + from .agent_v1update_prompt import AgentV1UpdatePrompt + from .agent_v1update_speak import AgentV1UpdateSpeak + from .agent_v1update_speak_speak import AgentV1UpdateSpeakSpeak + from .agent_v1update_think import AgentV1UpdateThink + from .agent_v1update_think_live import AgentV1UpdateThinkLive + from .agent_v1update_think_think import AgentV1UpdateThinkThink + from .agent_v1user_started_speaking import AgentV1UserStartedSpeaking + from .agent_v1warning import AgentV1Warning + from .agent_v1welcome import AgentV1Welcome + from .conversation_history_message import ConversationHistoryMessage + from .conversation_history_message_role import ConversationHistoryMessageRole + from .function_call_history_message import FunctionCallHistoryMessage + from .function_call_history_message_function_calls_item import FunctionCallHistoryMessageFunctionCallsItem +_dynamic_imports: typing.Dict[str, str] = { + "AgentV1AgentAudioDone": ".agent_v1agent_audio_done", + "AgentV1AgentStartedSpeaking": ".agent_v1agent_started_speaking", + "AgentV1AgentThinking": ".agent_v1agent_thinking", + "AgentV1ConversationText": ".agent_v1conversation_text", + "AgentV1ConversationTextConversationalBehavior": ".agent_v1conversation_text_conversational_behavior", + "AgentV1ConversationTextRole": ".agent_v1conversation_text_role", + "AgentV1CustomFromThinkProvider": ".agent_v1custom_from_think_provider", + "AgentV1CustomToThinkProvider": ".agent_v1custom_to_think_provider", + "AgentV1Error": ".agent_v1error", + "AgentV1ForceEndTurn": ".agent_v1force_end_turn", + "AgentV1FrustrationDetected": ".agent_v1frustration_detected", + "AgentV1FunctionCallCancelled": ".agent_v1function_call_cancelled", + "AgentV1FunctionCallCancelledFunctionsItem": ".agent_v1function_call_cancelled_functions_item", + "AgentV1FunctionCallRequest": ".agent_v1function_call_request", + "AgentV1FunctionCallRequestFunctionsItem": ".agent_v1function_call_request_functions_item", + "AgentV1History": ".agent_v1history", + "AgentV1InjectAgentMessage": ".agent_v1inject_agent_message", + "AgentV1InjectAgentMessageBehavior": ".agent_v1inject_agent_message_behavior", + "AgentV1InjectDynamicAgentMessage": ".agent_v1inject_dynamic_agent_message", + "AgentV1InjectDynamicAgentMessageBehavior": ".agent_v1inject_dynamic_agent_message_behavior", + "AgentV1InjectUserMessage": ".agent_v1inject_user_message", + "AgentV1InjectionRefused": ".agent_v1injection_refused", + "AgentV1KeepAlive": ".agent_v1keep_alive", + "AgentV1LatencyReport": ".agent_v1latency_report", + "AgentV1ListenUpdated": ".agent_v1listen_updated", + "AgentV1PromptUpdated": ".agent_v1prompt_updated", + "AgentV1ReceiveFunctionCallResponse": ".agent_v1receive_function_call_response", + "AgentV1SendFunctionCallResponse": ".agent_v1send_function_call_response", + "AgentV1Settings": ".agent_v1settings", + "AgentV1SettingsAgent": ".agent_v1settings_agent", + "AgentV1SettingsAgentContext": ".agent_v1settings_agent_context", + "AgentV1SettingsAgentContextContext": ".agent_v1settings_agent_context_context", + "AgentV1SettingsAgentContextContextMessagesItem": ".agent_v1settings_agent_context_context_messages_item", + "AgentV1SettingsAgentContextListen": ".agent_v1settings_agent_context_listen", + "AgentV1SettingsAgentContextListenProvider": ".agent_v1settings_agent_context_listen_provider", + "AgentV1SettingsAgentContextListenProvider_V1": ".agent_v1settings_agent_context_listen_provider", + "AgentV1SettingsAgentContextListenProvider_V2": ".agent_v1settings_agent_context_listen_provider", + "AgentV1SettingsAgentContextSpeak": ".agent_v1settings_agent_context_speak", + "AgentV1SettingsAgentContextThink": ".agent_v1settings_agent_context_think", + "AgentV1SettingsAgentListen": ".agent_v1settings_agent_listen", + "AgentV1SettingsAgentListenProvider": ".agent_v1settings_agent_listen_provider", + "AgentV1SettingsAgentListenProvider_V1": ".agent_v1settings_agent_listen_provider", + "AgentV1SettingsAgentListenProvider_V2": ".agent_v1settings_agent_listen_provider", + "AgentV1SettingsAgentSpeak": ".agent_v1settings_agent_speak", + "AgentV1SettingsAgentThink": ".agent_v1settings_agent_think", + "AgentV1SettingsApplied": ".agent_v1settings_applied", + "AgentV1SettingsAudio": ".agent_v1settings_audio", + "AgentV1SettingsAudioInput": ".agent_v1settings_audio_input", + "AgentV1SettingsAudioInputEncoding": ".agent_v1settings_audio_input_encoding", + "AgentV1SettingsAudioOutput": ".agent_v1settings_audio_output", + "AgentV1SettingsAudioOutputContainer": ".agent_v1settings_audio_output_container", + "AgentV1SettingsAudioOutputEncoding": ".agent_v1settings_audio_output_encoding", + "AgentV1SettingsFlags": ".agent_v1settings_flags", + "AgentV1SpeakUpdated": ".agent_v1speak_updated", + "AgentV1ThinkLiveUpdated": ".agent_v1think_live_updated", + "AgentV1ThinkUpdated": ".agent_v1think_updated", + "AgentV1UpdateListen": ".agent_v1update_listen", + "AgentV1UpdateListenListen": ".agent_v1update_listen_listen", + "AgentV1UpdateListenListenProvider": ".agent_v1update_listen_listen_provider", + "AgentV1UpdateListenListenProvider_V1": ".agent_v1update_listen_listen_provider", + "AgentV1UpdateListenListenProvider_V2": ".agent_v1update_listen_listen_provider", + "AgentV1UpdatePrompt": ".agent_v1update_prompt", + "AgentV1UpdateSpeak": ".agent_v1update_speak", + "AgentV1UpdateSpeakSpeak": ".agent_v1update_speak_speak", + "AgentV1UpdateThink": ".agent_v1update_think", + "AgentV1UpdateThinkLive": ".agent_v1update_think_live", + "AgentV1UpdateThinkThink": ".agent_v1update_think_think", + "AgentV1UserStartedSpeaking": ".agent_v1user_started_speaking", + "AgentV1Warning": ".agent_v1warning", + "AgentV1Welcome": ".agent_v1welcome", + "ConversationHistoryMessage": ".conversation_history_message", + "ConversationHistoryMessageRole": ".conversation_history_message_role", + "FunctionCallHistoryMessage": ".function_call_history_message", + "FunctionCallHistoryMessageFunctionCallsItem": ".function_call_history_message_function_calls_item", +} + +_dynamic_imports.update( + { + "AgentV1HistoryContent": ".agent_v1history_content", + "AgentV1HistoryContentRole": ".agent_v1history_content_role", + "AgentV1HistoryFunctionCalls": ".agent_v1history_function_calls", + "AgentV1HistoryFunctionCallsFunctionCallsItem": ".agent_v1history_function_calls_function_calls_item", + "AgentV1SettingsAgentContextContextMessagesItemContentRole": ".agent_v1settings_agent_context_context_messages_item_content_role", + "AgentV1SettingsAgentContextContextMessagesItemFunctionCallsFunctionCallsItem": ".agent_v1settings_agent_context_context_messages_item_function_calls_function_calls_item", + "AgentV1SettingsAgentContextListenProviderV1": ".agent_v1settings_agent_context_listen_provider_v1", + "AgentV1SettingsAgentContextListenProviderV2": ".agent_v1settings_agent_context_listen_provider_v2", + "AgentV1SettingsAgentContextListenProviderV2LanguageHint": ".agent_v1settings_agent_context_listen_provider_v2language_hint", + "AgentV1SettingsAgentContextMessagesItem": ".agent_v1settings_agent_context_messages_item", + "AgentV1SettingsAgentContextMessagesItemContent": ".agent_v1settings_agent_context_messages_item_content", + "AgentV1SettingsAgentContextMessagesItemContentRole": ".agent_v1settings_agent_context_messages_item_content_role", + "AgentV1SettingsAgentContextMessagesItemFunctionCalls": ".agent_v1settings_agent_context_messages_item_function_calls", + "AgentV1SettingsAgentContextMessagesItemFunctionCallsFunctionCallsItem": ".agent_v1settings_agent_context_messages_item_function_calls_function_calls_item", + "AgentV1SettingsAgentListenProviderV1": ".agent_v1settings_agent_listen_provider_v1", + "AgentV1SettingsAgentListenProviderV2": ".agent_v1settings_agent_listen_provider_v2", + } +) + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = [ + "AgentV1AgentAudioDone", + "AgentV1AgentStartedSpeaking", + "AgentV1AgentThinking", + "AgentV1ConversationText", + "AgentV1ConversationTextConversationalBehavior", + "AgentV1ConversationTextRole", + "AgentV1CustomFromThinkProvider", + "AgentV1CustomToThinkProvider", + "AgentV1Error", + "AgentV1ForceEndTurn", + "AgentV1FrustrationDetected", + "AgentV1FunctionCallCancelled", + "AgentV1FunctionCallCancelledFunctionsItem", + "AgentV1FunctionCallRequest", + "AgentV1FunctionCallRequestFunctionsItem", + "AgentV1History", + "AgentV1InjectAgentMessage", + "AgentV1InjectAgentMessageBehavior", + "AgentV1InjectDynamicAgentMessage", + "AgentV1InjectDynamicAgentMessageBehavior", + "AgentV1InjectUserMessage", + "AgentV1InjectionRefused", + "AgentV1KeepAlive", + "AgentV1LatencyReport", + "AgentV1ListenUpdated", + "AgentV1PromptUpdated", + "AgentV1ReceiveFunctionCallResponse", + "AgentV1SendFunctionCallResponse", + "AgentV1Settings", + "AgentV1SettingsAgent", + "AgentV1SettingsAgentContext", + "AgentV1SettingsAgentContextContext", + "AgentV1SettingsAgentContextContextMessagesItem", + "AgentV1SettingsAgentContextListen", + "AgentV1SettingsAgentContextListenProvider", + "AgentV1SettingsAgentContextListenProvider_V1", + "AgentV1SettingsAgentContextListenProvider_V2", + "AgentV1SettingsAgentContextSpeak", + "AgentV1SettingsAgentContextThink", + "AgentV1SettingsAgentListen", + "AgentV1SettingsAgentListenProvider", + "AgentV1SettingsAgentListenProvider_V1", + "AgentV1SettingsAgentListenProvider_V2", + "AgentV1SettingsAgentSpeak", + "AgentV1SettingsAgentThink", + "AgentV1SettingsApplied", + "AgentV1SettingsAudio", + "AgentV1SettingsAudioInput", + "AgentV1SettingsAudioInputEncoding", + "AgentV1SettingsAudioOutput", + "AgentV1SettingsAudioOutputContainer", + "AgentV1SettingsAudioOutputEncoding", + "AgentV1SettingsFlags", + "AgentV1SpeakUpdated", + "AgentV1ThinkLiveUpdated", + "AgentV1ThinkUpdated", + "AgentV1UpdateListen", + "AgentV1UpdateListenListen", + "AgentV1UpdateListenListenProvider", + "AgentV1UpdateListenListenProvider_V1", + "AgentV1UpdateListenListenProvider_V2", + "AgentV1UpdatePrompt", + "AgentV1UpdateSpeak", + "AgentV1UpdateSpeakSpeak", + "AgentV1UpdateThink", + "AgentV1UpdateThinkLive", + "AgentV1UpdateThinkThink", + "AgentV1UserStartedSpeaking", + "AgentV1Warning", + "AgentV1Welcome", + "ConversationHistoryMessage", + "ConversationHistoryMessageRole", + "FunctionCallHistoryMessage", + "FunctionCallHistoryMessageFunctionCallsItem", +] + +__all__.extend( + [ + "AgentV1HistoryContent", + "AgentV1HistoryContentRole", + "AgentV1HistoryFunctionCalls", + "AgentV1HistoryFunctionCallsFunctionCallsItem", + "AgentV1SettingsAgentContextContextMessagesItemContentRole", + "AgentV1SettingsAgentContextContextMessagesItemFunctionCallsFunctionCallsItem", + "AgentV1SettingsAgentContextListenProviderV1", + "AgentV1SettingsAgentContextListenProviderV2", + "AgentV1SettingsAgentContextListenProviderV2LanguageHint", + "AgentV1SettingsAgentContextMessagesItem", + "AgentV1SettingsAgentContextMessagesItemContent", + "AgentV1SettingsAgentContextMessagesItemContentRole", + "AgentV1SettingsAgentContextMessagesItemFunctionCalls", + "AgentV1SettingsAgentContextMessagesItemFunctionCallsFunctionCallsItem", + "AgentV1SettingsAgentListenProviderV1", + "AgentV1SettingsAgentListenProviderV2", + ] +) diff --git a/src/deepgram/agent/v1/types/agent_v1conversation_text.py.bak b/src/deepgram/agent/v1/types/agent_v1conversation_text.py.bak new file mode 100644 index 00000000..eb33f9f0 --- /dev/null +++ b/src/deepgram/agent/v1/types/agent_v1conversation_text.py.bak @@ -0,0 +1,50 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ....core.pydantic_utilities import IS_PYDANTIC_V2 +from ....core.unchecked_base_model import UncheckedBaseModel +from .agent_v1conversation_text_conversational_behavior import AgentV1ConversationTextConversationalBehavior +from .agent_v1conversation_text_role import AgentV1ConversationTextRole + + +class AgentV1ConversationText(UncheckedBaseModel): + type: typing.Literal["ConversationText"] = pydantic.Field(default="ConversationText") + """ + Message type identifier for conversation text + """ + + role: AgentV1ConversationTextRole = pydantic.Field() + """ + Identifies who spoke the statement + """ + + content: str = pydantic.Field() + """ + The actual statement that was spoken + """ + + conversational_behavior: AgentV1ConversationTextConversationalBehavior = pydantic.Field(default="default") + """ + Annotates what kind of utterance the message represents: `default` (a standard turn), `backchannel` (a short acknowledgement while the user held the floor), `presence_check` (a prompt after extended silence), or `filler` (a line covering a wait on a function call or a dynamic InjectAgentMessage). Always sent; it is `default` for every message while Think Live is off. Defaults to `default` when an older or self-hosted server omits it. + """ + + languages_hinted: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + The language hints that were active at the time of the turn. Only present on user-role messages when the listen model is flux-general-multi. + """ + + languages: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + Languages detected in the user's speech, sorted by word count (descending). Only present on user-role messages when the listen model is flux-general-multi. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/deepgram/agent/v1/types/agent_v1inject_dynamic_agent_message.py.bak b/src/deepgram/agent/v1/types/agent_v1inject_dynamic_agent_message.py.bak new file mode 100644 index 00000000..471d6f61 --- /dev/null +++ b/src/deepgram/agent/v1/types/agent_v1inject_dynamic_agent_message.py.bak @@ -0,0 +1,38 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ....core.pydantic_utilities import IS_PYDANTIC_V2 +from ....core.unchecked_base_model import UncheckedBaseModel +from .agent_v1inject_dynamic_agent_message_behavior import AgentV1InjectDynamicAgentMessageBehavior + + +class AgentV1InjectDynamicAgentMessage(UncheckedBaseModel): + type: typing.Literal["InjectAgentMessage"] = pydantic.Field(default="InjectAgentMessage") + """ + Message type identifier for injecting an agent message + """ + + is_dynamic: typing.Literal[True] = pydantic.Field(default=True) + """ + Must be `true`. The Think Live model generates the line, so no `message` is sent + """ + + behavior: typing.Optional[AgentV1InjectDynamicAgentMessageBehavior] = pydantic.Field(default=None) + """ + Controls how the injection interacts with any in-progress user or agent turn. + + * `default` — The agent speaks only if neither the user nor the agent is mid-turn. If a turn is in progress, the server replies with `InjectionRefused`. + * `queue` — The message is appended after any already-queued `ConversationText` without interrupting the current agent turn or think response. If nothing is queued, the message plays immediately. + * `interrupt` — The agent immediately speaks. If the agent was already speaking, it interrupts the current speech and replaces it with the new message. If the user is speaking, the agent interrupts with the new message, but the user's continued speech triggers `UserStartedSpeaking`, which quickly interrupts the agent. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/deepgram/agent/v1/types/agent_v1settings.py.bak b/src/deepgram/agent/v1/types/agent_v1settings.py.bak new file mode 100644 index 00000000..ff58da13 --- /dev/null +++ b/src/deepgram/agent/v1/types/agent_v1settings.py.bak @@ -0,0 +1,42 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ....core.pydantic_utilities import IS_PYDANTIC_V2 +from ....core.unchecked_base_model import UncheckedBaseModel +from .agent_v1settings_agent import AgentV1SettingsAgent +from .agent_v1settings_agent_context import AgentV1SettingsAgentContext +from .agent_v1settings_audio import AgentV1SettingsAudio +from .agent_v1settings_flags import AgentV1SettingsFlags + + +class AgentV1Settings(UncheckedBaseModel): + type: typing.Literal["Settings"] = "Settings" + tags: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + Tags to associate with the request + """ + + experimental: typing.Optional[bool] = pydantic.Field(default=None) + """ + To enable experimental features + """ + + flags: typing.Optional[AgentV1SettingsFlags] = None + mip_opt_out: typing.Optional[bool] = pydantic.Field(default=None) + """ + To opt out of Deepgram Model Improvement Program + """ + + audio: AgentV1SettingsAudio + agent: typing.Union[AgentV1SettingsAgent, AgentV1SettingsAgentContext, str] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/deepgram/agent/v1/types/agent_v1settings_agent.py.bak b/src/deepgram/agent/v1/types/agent_v1settings_agent.py.bak new file mode 100644 index 00000000..1a4d67fd --- /dev/null +++ b/src/deepgram/agent/v1/types/agent_v1settings_agent.py.bak @@ -0,0 +1,58 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ....core.pydantic_utilities import IS_PYDANTIC_V2 +from .agent_v1settings_agent_context import AgentV1SettingsAgentContext +from .agent_v1settings_agent_listen import AgentV1SettingsAgentListen + + +class AgentV1SettingsAgent(AgentV1SettingsAgentContext): + if IS_PYDANTIC_V2: + + @pydantic.model_validator(mode="before") + @classmethod + def _migrate_legacy_nested_context(cls, values: typing.Any) -> typing.Any: + if not isinstance(values, dict): + return values + context = values.get("context") + if isinstance(context, AgentV1SettingsAgentContext) and ( + context.context is not None + and context.language is None + and context.listen is None + and context.think is None + and context.think_live is None + and context.speak is None + and context.greeting is None + ): + values = dict(values) + values["context"] = context.context + listen = values.get("listen") + if isinstance(listen, AgentV1SettingsAgentListen): + values = dict(values) + values["listen"] = listen.dict() + return values + else: + + @pydantic.root_validator(pre=True) # type: ignore[deprecated] + def _migrate_legacy_nested_context(cls, values: typing.Any) -> typing.Any: # type: ignore[no-redef] + if not isinstance(values, dict): + return values + context = values.get("context") + if isinstance(context, AgentV1SettingsAgentContext) and ( + context.context is not None + and context.language is None + and context.listen is None + and context.think is None + and context.think_live is None + and context.speak is None + and context.greeting is None + ): + values = dict(values) + values["context"] = context.context + listen = values.get("listen") + if isinstance(listen, AgentV1SettingsAgentListen): + values = dict(values) + values["listen"] = listen.dict() + return values diff --git a/src/deepgram/agent/v1/types/agent_v1settings_agent_context.py.bak b/src/deepgram/agent/v1/types/agent_v1settings_agent_context.py.bak new file mode 100644 index 00000000..181472b4 --- /dev/null +++ b/src/deepgram/agent/v1/types/agent_v1settings_agent_context.py.bak @@ -0,0 +1,67 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ....core.pydantic_utilities import IS_PYDANTIC_V2 +from ....core.unchecked_base_model import UncheckedBaseModel +from ....types.think_live_settings_v1 import ThinkLiveSettingsV1 +from .agent_v1settings_agent_context_context import AgentV1SettingsAgentContextContext +from .agent_v1settings_agent_context_listen import AgentV1SettingsAgentContextListen +from .agent_v1settings_agent_context_messages_item import AgentV1SettingsAgentContextMessagesItem +from .agent_v1settings_agent_context_speak import AgentV1SettingsAgentContextSpeak +from .agent_v1settings_agent_context_think import AgentV1SettingsAgentContextThink + + +class AgentV1SettingsAgentContext(UncheckedBaseModel): + language: typing.Optional[str] = pydantic.Field(default=None) + """ + Deprecated. Use `listen.provider.language` and `speak.provider.language` fields instead. + """ + + context: typing.Optional[AgentV1SettingsAgentContextContext] = pydantic.Field(default=None) + """ + Conversation context including the history of messages and function calls + """ + + listen: typing.Optional[AgentV1SettingsAgentContextListen] = None + think: typing.Optional[AgentV1SettingsAgentContextThink] = pydantic.Field(default=None) + """ + Your reasoning LLM. With Think Live on, this is the reasoning half of the pair, running alongside the Think Live model configured in `think_live` + """ + + think_live: typing.Optional[ThinkLiveSettingsV1] = None + speak: typing.Optional[AgentV1SettingsAgentContextSpeak] = None + greeting: typing.Optional[str] = pydantic.Field(default=None) + """ + Optional message that agent will speak at the start + """ + + if IS_PYDANTIC_V2: + + @pydantic.model_validator(mode="before") + @classmethod + def _migrate_legacy_messages_to_context(cls, values: typing.Any) -> typing.Any: + if isinstance(values, dict) and "messages" in values and "context" not in values: + values = dict(values) + values["context"] = {"messages": values.pop("messages")} + return values + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + @pydantic.root_validator(pre=True) # type: ignore[deprecated] + def _migrate_legacy_messages_to_context(cls, values: typing.Any) -> typing.Any: # type: ignore[no-redef] + if isinstance(values, dict) and "messages" in values and "context" not in values: + values = dict(values) + values["context"] = {"messages": values.pop("messages")} + return values + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + @property + def messages(self) -> typing.Optional[typing.List[AgentV1SettingsAgentContextMessagesItem]]: + return None if self.context is None else self.context.messages diff --git a/src/deepgram/agent/v1/types/agent_v1settings_agent_context_listen_provider.py.bak b/src/deepgram/agent/v1/types/agent_v1settings_agent_context_listen_provider.py.bak new file mode 100644 index 00000000..222c18a3 --- /dev/null +++ b/src/deepgram/agent/v1/types/agent_v1settings_agent_context_listen_provider.py.bak @@ -0,0 +1,77 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +import typing_extensions +from ....core.pydantic_utilities import IS_PYDANTIC_V2 +from ....core.unchecked_base_model import UncheckedBaseModel, UnionMetadata + + +class AgentV1SettingsAgentContextListenProvider_V1(UncheckedBaseModel): + version: typing.Literal["v1"] = "v1" + type: typing.Literal["deepgram"] = "deepgram" + model: typing.Optional[str] = None + language: typing.Optional[str] = None + keyterms: typing.Optional[typing.List[str]] = None + smart_format: typing.Optional[bool] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AgentV1SettingsAgentContextListenProvider_V2(UncheckedBaseModel): + version: typing.Literal["v2"] = "v2" + type: typing.Literal["deepgram"] = "deepgram" + model: str + language_hints: typing.Optional[typing.List[str]] = None + language_hint: typing.Optional[typing.Union[str, typing.List[str]]] = pydantic.Field(default=None, exclude=True) + eot_threshold: typing.Optional[float] = None + eager_eot_threshold: typing.Optional[float] = None + eot_timeout_ms: typing.Optional[int] = None + keyterms: typing.Optional[typing.List[str]] = None + + if IS_PYDANTIC_V2: + + @pydantic.model_validator(mode="before") + @classmethod + def _migrate_language_hint(cls, values: typing.Any) -> typing.Any: + if not isinstance(values, dict) or "language_hint" not in values: + return values + values = dict(values) + hint = values.pop("language_hint") + if hint is not None and values.get("language_hints") is None: + values["language_hints"] = [hint] if isinstance(hint, str) else list(hint) + return values + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + @pydantic.root_validator(pre=True) # type: ignore[deprecated] + def _migrate_language_hint(cls, values: typing.Any) -> typing.Any: # type: ignore[no-redef] + if not isinstance(values, dict) or "language_hint" not in values: + return values + values = dict(values) + hint = values.pop("language_hint") + if hint is not None and values.get("language_hints") is None: + values["language_hints"] = [hint] if isinstance(hint, str) else list(hint) + return values + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +AgentV1SettingsAgentContextListenProvider = typing_extensions.Annotated[ + typing.Union[AgentV1SettingsAgentContextListenProvider_V1, AgentV1SettingsAgentContextListenProvider_V2], + UnionMetadata(discriminant="version"), +] diff --git a/src/deepgram/agent/v1/types/agent_v1settings_agent_listen_provider.py.bak b/src/deepgram/agent/v1/types/agent_v1settings_agent_listen_provider.py.bak new file mode 100644 index 00000000..d225e261 --- /dev/null +++ b/src/deepgram/agent/v1/types/agent_v1settings_agent_listen_provider.py.bak @@ -0,0 +1,77 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +import typing_extensions +from ....core.pydantic_utilities import IS_PYDANTIC_V2 +from ....core.unchecked_base_model import UncheckedBaseModel, UnionMetadata + + +class AgentV1SettingsAgentListenProvider_V1(UncheckedBaseModel): + version: typing.Literal["v1"] = "v1" + type: typing.Literal["deepgram"] = "deepgram" + model: typing.Optional[str] = None + language: typing.Optional[str] = None + keyterms: typing.Optional[typing.List[str]] = None + smart_format: typing.Optional[bool] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AgentV1SettingsAgentListenProvider_V2(UncheckedBaseModel): + version: typing.Literal["v2"] = "v2" + type: typing.Literal["deepgram"] = "deepgram" + model: str + language_hints: typing.Optional[typing.List[str]] = None + language_hint: typing.Optional[typing.Union[str, typing.List[str]]] = pydantic.Field(default=None, exclude=True) + eot_threshold: typing.Optional[float] = None + eager_eot_threshold: typing.Optional[float] = None + eot_timeout_ms: typing.Optional[int] = None + keyterms: typing.Optional[typing.List[str]] = None + + if IS_PYDANTIC_V2: + + @pydantic.model_validator(mode="before") + @classmethod + def _migrate_language_hint(cls, values: typing.Any) -> typing.Any: + if not isinstance(values, dict) or "language_hint" not in values: + return values + values = dict(values) + hint = values.pop("language_hint") + if hint is not None and values.get("language_hints") is None: + values["language_hints"] = [hint] if isinstance(hint, str) else list(hint) + return values + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + @pydantic.root_validator(pre=True) # type: ignore[deprecated] + def _migrate_language_hint(cls, values: typing.Any) -> typing.Any: # type: ignore[no-redef] + if not isinstance(values, dict) or "language_hint" not in values: + return values + values = dict(values) + hint = values.pop("language_hint") + if hint is not None and values.get("language_hints") is None: + values["language_hints"] = [hint] if isinstance(hint, str) else list(hint) + return values + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +AgentV1SettingsAgentListenProvider = typing_extensions.Annotated[ + typing.Union[AgentV1SettingsAgentListenProvider_V1, AgentV1SettingsAgentListenProvider_V2], + UnionMetadata(discriminant="version"), +] diff --git a/src/deepgram/agent/v1/types/agent_v1update_listen_listen.py.bak b/src/deepgram/agent/v1/types/agent_v1update_listen_listen.py.bak new file mode 100644 index 00000000..d7ed4fab --- /dev/null +++ b/src/deepgram/agent/v1/types/agent_v1update_listen_listen.py.bak @@ -0,0 +1,61 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ....core.pydantic_utilities import IS_PYDANTIC_V2 +from ....core.unchecked_base_model import UncheckedBaseModel +from ....types.deepgram_listen_provider_v1 import DeepgramListenProviderV1 +from ....types.deepgram_listen_provider_v2 import DeepgramListenProviderV2 +from .agent_v1update_listen_listen_provider import AgentV1UpdateListenListenProvider + +_V1_ONLY_KEYS = frozenset({"language", "smart_format"}) + + +def _coerce_legacy_update_listen_provider(values: typing.Any) -> typing.Any: + if not isinstance(values, dict): + return values + provider = values.get("provider") + if isinstance(provider, DeepgramListenProviderV2): + values = dict(values) + values["provider"] = {**provider.dict(), "version": "v2"} + elif isinstance(provider, DeepgramListenProviderV1): + values = dict(values) + values["provider"] = {**provider.dict(), "version": "v1"} + elif isinstance(provider, dict) and "version" not in provider: + values = dict(values) + version = "v1" if _V1_ONLY_KEYS & provider.keys() else "v2" + provider_cls = DeepgramListenProviderV1 if version == "v1" else DeepgramListenProviderV2 + try: + coerced = provider_cls(**provider).dict() + except Exception: + coerced = dict(provider) + values["provider"] = {**coerced, "version": version} + return values + + +class AgentV1UpdateListenListen(UncheckedBaseModel): + """ + Listen configuration to update. Contains a provider object with the same schema as Settings. The model and language can be changed mid-session. Keyterms can only be updated mid-session for Flux models. + """ + + provider: AgentV1UpdateListenListenProvider + + if IS_PYDANTIC_V2: + + @pydantic.model_validator(mode="before") + @classmethod + def _migrate_legacy_provider(cls, values: typing.Any) -> typing.Any: + return _coerce_legacy_update_listen_provider(values) + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + @pydantic.root_validator(pre=True) # type: ignore[deprecated] + def _migrate_legacy_provider(cls, values: typing.Any) -> typing.Any: # type: ignore[no-redef] + return _coerce_legacy_update_listen_provider(values) + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/deepgram/core/api_error.py.bak b/src/deepgram/core/api_error.py.bak new file mode 100644 index 00000000..2aa93914 --- /dev/null +++ b/src/deepgram/core/api_error.py.bak @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +from typing import Any, Dict, Optional + +from .._secure_logging import redact_sensitive_headers + + +class ApiError(Exception): + headers: Optional[Dict[str, str]] + status_code: Optional[int] + body: Any + + def __init__( + self, + *, + headers: Optional[Dict[str, str]] = None, + status_code: Optional[int] = None, + body: Any = None, + ) -> None: + self.headers = redact_sensitive_headers(headers) + self.status_code = status_code + self.body = body + + def __str__(self) -> str: + return f"headers: {self.headers}, status_code: {self.status_code}, body: {self.body}" diff --git a/src/deepgram/core/client_wrapper.py.bak b/src/deepgram/core/client_wrapper.py.bak new file mode 100644 index 00000000..f8afc3bb --- /dev/null +++ b/src/deepgram/core/client_wrapper.py.bak @@ -0,0 +1,146 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import httpx +from ..environment import DeepgramClientEnvironment +from .http_client import AsyncHttpClient, HttpClient +from .logging import LogConfig, Logger + + +class BaseClientWrapper: + def __init__( + self, + *, + api_key: str, + headers: typing.Optional[typing.Dict[str, str]] = None, + environment: DeepgramClientEnvironment, + timeout: typing.Optional[float] = None, + max_retries: int = 2, + stream_reconnection_enabled: typing.Optional[bool] = None, + max_stream_reconnection_attempts: typing.Optional[int] = None, + logging: typing.Optional[typing.Union[LogConfig, Logger]] = None, + ): + self.api_key = api_key + self._headers = headers + self._environment = environment + self._timeout = timeout + self._max_retries = max_retries + self._stream_reconnection_enabled = stream_reconnection_enabled + self._max_stream_reconnection_attempts = max_stream_reconnection_attempts + self._logging = logging + + def get_headers(self) -> typing.Dict[str, str]: + import platform + from importlib import metadata as _fern_importlib_metadata + + try: + _sdk_version = _fern_importlib_metadata.version("deepgram-sdk") + except _fern_importlib_metadata.PackageNotFoundError: + _sdk_version = "7.20.0" # x-release-please-version + + headers: typing.Dict[str, str] = { + "User-Agent": "deepgram-sdk/" + _sdk_version, + "X-Fern-Language": "Python", + "X-Fern-Runtime": f"python/{platform.python_version()}", + "X-Fern-Platform": f"{platform.system().lower()}/{platform.release()}", + "X-Fern-SDK-Name": "deepgram-sdk", + "X-Fern-SDK-Version": _sdk_version, + **(self.get_custom_headers() or {}), + } + headers["Authorization"] = f"Token {self.api_key}" + return headers + + def get_custom_headers(self) -> typing.Optional[typing.Dict[str, str]]: + return self._headers + + def get_environment(self) -> DeepgramClientEnvironment: + return self._environment + + def get_timeout(self) -> typing.Optional[float]: + return self._timeout + + def get_max_retries(self) -> int: + return self._max_retries + + def get_stream_reconnection_enabled(self) -> bool: + return self._stream_reconnection_enabled if self._stream_reconnection_enabled is not None else True + + def get_max_stream_reconnection_attempts(self) -> typing.Optional[int]: + return self._max_stream_reconnection_attempts + + +class SyncClientWrapper(BaseClientWrapper): + def __init__( + self, + *, + api_key: str, + headers: typing.Optional[typing.Dict[str, str]] = None, + environment: DeepgramClientEnvironment, + timeout: typing.Optional[float] = None, + max_retries: int = 2, + stream_reconnection_enabled: typing.Optional[bool] = None, + max_stream_reconnection_attempts: typing.Optional[int] = None, + logging: typing.Optional[typing.Union[LogConfig, Logger]] = None, + httpx_client: httpx.Client, + ): + super().__init__( + api_key=api_key, + headers=headers, + environment=environment, + timeout=timeout, + max_retries=max_retries, + stream_reconnection_enabled=stream_reconnection_enabled, + max_stream_reconnection_attempts=max_stream_reconnection_attempts, + logging=logging, + ) + self.httpx_client = HttpClient( + httpx_client=httpx_client, + base_headers=self.get_headers, + base_timeout=self.get_timeout, + base_max_retries=self.get_max_retries(), + logging_config=self._logging, + ) + + +class AsyncClientWrapper(BaseClientWrapper): + def __init__( + self, + *, + api_key: str, + headers: typing.Optional[typing.Dict[str, str]] = None, + environment: DeepgramClientEnvironment, + timeout: typing.Optional[float] = None, + max_retries: int = 2, + stream_reconnection_enabled: typing.Optional[bool] = None, + max_stream_reconnection_attempts: typing.Optional[int] = None, + logging: typing.Optional[typing.Union[LogConfig, Logger]] = None, + async_token: typing.Optional[typing.Callable[[], typing.Awaitable[str]]] = None, + httpx_client: httpx.AsyncClient, + ): + super().__init__( + api_key=api_key, + headers=headers, + environment=environment, + timeout=timeout, + max_retries=max_retries, + stream_reconnection_enabled=stream_reconnection_enabled, + max_stream_reconnection_attempts=max_stream_reconnection_attempts, + logging=logging, + ) + self._async_token = async_token + self.httpx_client = AsyncHttpClient( + httpx_client=httpx_client, + base_headers=self.get_headers, + base_timeout=self.get_timeout, + base_max_retries=self.get_max_retries(), + async_base_headers=self.async_get_headers, + logging_config=self._logging, + ) + + async def async_get_headers(self) -> typing.Dict[str, str]: + headers = self.get_headers() + if self._async_token is not None: + token = await self._async_token() + headers["Authorization"] = f"Bearer {token}" + return headers diff --git a/src/deepgram/core/parse_error.py.bak b/src/deepgram/core/parse_error.py.bak new file mode 100644 index 00000000..c510c0e8 --- /dev/null +++ b/src/deepgram/core/parse_error.py.bak @@ -0,0 +1,38 @@ +# This file was auto-generated by Fern from our API Definition. + +from typing import Any, Dict, Optional + +from .._secure_logging import redact_sensitive_headers + + +class ParsingError(Exception): + """ + Raised when the SDK fails to parse/validate a response from the server. + This typically indicates that the server returned a response whose shape + does not match the expected schema. + """ + + headers: Optional[Dict[str, str]] + status_code: Optional[int] + body: Any + cause: Optional[Exception] + + def __init__( + self, + *, + headers: Optional[Dict[str, str]] = None, + status_code: Optional[int] = None, + body: Any = None, + cause: Optional[Exception] = None, + ) -> None: + self.headers = redact_sensitive_headers(headers) + self.status_code = status_code + self.body = body + self.cause = cause + super().__init__() + if cause is not None: + self.__cause__ = cause + + def __str__(self) -> str: + cause_str = f", cause: {self.cause}" if self.cause is not None else "" + return f"headers: {self.headers}, status_code: {self.status_code}, body: {self.body}{cause_str}" diff --git a/src/deepgram/core/query_encoder.py.bak b/src/deepgram/core/query_encoder.py.bak new file mode 100644 index 00000000..58088258 --- /dev/null +++ b/src/deepgram/core/query_encoder.py.bak @@ -0,0 +1,65 @@ +# This file was auto-generated by Fern from our API Definition. + +from typing import Any, Dict, List, Optional, Tuple + +import pydantic + + +def _coerce_query_value(value: Any) -> Any: + # urllib.parse.urlencode would otherwise turn bools into "True"/"False". + if isinstance(value, bool): + return "true" if value else "false" + return value + + +# Flattens dicts to be of the form {"key[subkey][subkey2]": value} where value is not a dict +def traverse_query_dict(dict_flat: Dict[str, Any], key_prefix: Optional[str] = None) -> List[Tuple[str, Any]]: + result = [] + for k, v in dict_flat.items(): + key = f"{key_prefix}[{k}]" if key_prefix is not None else k + if isinstance(v, dict): + result.extend(traverse_query_dict(v, key)) + elif isinstance(v, list): + for arr_v in v: + if isinstance(arr_v, dict): + result.extend(traverse_query_dict(arr_v, key)) + else: + result.append((key, _coerce_query_value(arr_v))) + else: + result.append((key, _coerce_query_value(v))) + return result + + +def single_query_encoder(query_key: str, query_value: Any) -> List[Tuple[str, Any]]: + if isinstance(query_value, pydantic.BaseModel) or isinstance(query_value, dict): + if isinstance(query_value, pydantic.BaseModel): + obj_dict = query_value.dict(by_alias=True) + else: + obj_dict = query_value + return traverse_query_dict(obj_dict, query_key) + elif isinstance(query_value, list): + encoded_values: List[Tuple[str, Any]] = [] + for value in query_value: + if isinstance(value, pydantic.BaseModel) or isinstance(value, dict): + if isinstance(value, pydantic.BaseModel): + obj_dict = value.dict(by_alias=True) + elif isinstance(value, dict): + obj_dict = value + + encoded_values.extend(single_query_encoder(query_key, obj_dict)) + else: + encoded_values.append((query_key, _coerce_query_value(value))) + + return encoded_values + + return [(query_key, _coerce_query_value(query_value))] + + +def encode_query(query: Optional[Dict[str, Any]]) -> Optional[List[Tuple[str, Any]]]: + if query is None: + return None + + encoded_query = [] + for k, v in query.items(): + encoded_query.extend(single_query_encoder(k, v)) + return encoded_query diff --git a/src/deepgram/listen/__init__.py.bak b/src/deepgram/listen/__init__.py.bak new file mode 100644 index 00000000..d2b6487e --- /dev/null +++ b/src/deepgram/listen/__init__.py.bak @@ -0,0 +1,246 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from . import v1, v2 + from .v1 import ( + DiarizeModel, + ListenV1CloseStream, + ListenV1CloseStreamParams, + ListenV1CloseStreamType, + ListenV1Configure, + ListenV1ConfigureFailure, + ListenV1ConfigureFailureCode, + ListenV1ConfigureFailureParams, + ListenV1ConfigureParams, + ListenV1ConfigureSuccess, + ListenV1ConfigureSuccessParams, + ListenV1Error, + ListenV1ErrorParams, + ListenV1Finalize, + ListenV1FinalizeParams, + ListenV1FinalizeType, + ListenV1KeepAlive, + ListenV1KeepAliveParams, + ListenV1KeepAliveType, + ListenV1Metadata, + ListenV1MetadataParams, + ListenV1Results, + ListenV1ResultsChannel, + ListenV1ResultsChannelAlternativesItem, + ListenV1ResultsChannelAlternativesItemParams, + ListenV1ResultsChannelAlternativesItemWordsItem, + ListenV1ResultsChannelAlternativesItemWordsItemParams, + ListenV1ResultsChannelParams, + ListenV1ResultsEntitiesItem, + ListenV1ResultsEntitiesItemParams, + ListenV1ResultsMetadata, + ListenV1ResultsMetadataDiarizeInfo, + ListenV1ResultsMetadataDiarizeInfoParams, + ListenV1ResultsMetadataModelInfo, + ListenV1ResultsMetadataModelInfoParams, + ListenV1ResultsMetadataParams, + ListenV1ResultsParams, + ListenV1SpeechStarted, + ListenV1SpeechStartedParams, + ListenV1UtteranceEnd, + ListenV1UtteranceEndParams, + ) + from .v2 import ( + ListenV2CloseStream, + ListenV2CloseStreamParams, + ListenV2Configure, + ListenV2ConfigureFailure, + ListenV2ConfigureFailureParams, + ListenV2ConfigureParams, + ListenV2ConfigureSuccess, + ListenV2ConfigureSuccessParams, + ListenV2ConfigureSuccessThresholds, + ListenV2ConfigureSuccessThresholdsParams, + ListenV2ConfigureThresholds, + ListenV2ConfigureThresholdsParams, + ListenV2Connected, + ListenV2ConnectedParams, + ListenV2FatalError, + ListenV2FatalErrorParams, + ListenV2ForceEndTurn, + ListenV2ForceEndTurnParams, + ListenV2TurnInfo, + ListenV2TurnInfoEvent, + ListenV2TurnInfoParams, + ListenV2TurnInfoWordsItem, + ListenV2TurnInfoWordsItemParams, + ListenV2Warning, + ListenV2WarningParams, + ) +_dynamic_imports: typing.Dict[str, str] = { + "DiarizeModel": ".v1", + "ListenV1CloseStream": ".v1", + "ListenV1CloseStreamParams": ".v1", + "ListenV1CloseStreamType": ".v1", + "ListenV1Configure": ".v1", + "ListenV1ConfigureFailure": ".v1", + "ListenV1ConfigureFailureCode": ".v1", + "ListenV1ConfigureFailureParams": ".v1", + "ListenV1ConfigureParams": ".v1", + "ListenV1ConfigureSuccess": ".v1", + "ListenV1ConfigureSuccessParams": ".v1", + "ListenV1Error": ".v1", + "ListenV1ErrorParams": ".v1", + "ListenV1Finalize": ".v1", + "ListenV1FinalizeParams": ".v1", + "ListenV1FinalizeType": ".v1", + "ListenV1KeepAlive": ".v1", + "ListenV1KeepAliveParams": ".v1", + "ListenV1KeepAliveType": ".v1", + "ListenV1Metadata": ".v1", + "ListenV1MetadataParams": ".v1", + "ListenV1Results": ".v1", + "ListenV1ResultsChannel": ".v1", + "ListenV1ResultsChannelAlternativesItem": ".v1", + "ListenV1ResultsChannelAlternativesItemParams": ".v1", + "ListenV1ResultsChannelAlternativesItemWordsItem": ".v1", + "ListenV1ResultsChannelAlternativesItemWordsItemParams": ".v1", + "ListenV1ResultsChannelParams": ".v1", + "ListenV1ResultsEntitiesItem": ".v1", + "ListenV1ResultsEntitiesItemParams": ".v1", + "ListenV1ResultsMetadata": ".v1", + "ListenV1ResultsMetadataDiarizeInfo": ".v1", + "ListenV1ResultsMetadataDiarizeInfoParams": ".v1", + "ListenV1ResultsMetadataModelInfo": ".v1", + "ListenV1ResultsMetadataModelInfoParams": ".v1", + "ListenV1ResultsMetadataParams": ".v1", + "ListenV1ResultsParams": ".v1", + "ListenV1SpeechStarted": ".v1", + "ListenV1SpeechStartedParams": ".v1", + "ListenV1UtteranceEnd": ".v1", + "ListenV1UtteranceEndParams": ".v1", + "ListenV2CloseStream": ".v2", + "ListenV2CloseStreamParams": ".v2", + "ListenV2Configure": ".v2", + "ListenV2ConfigureFailure": ".v2", + "ListenV2ConfigureFailureParams": ".v2", + "ListenV2ConfigureParams": ".v2", + "ListenV2ConfigureSuccess": ".v2", + "ListenV2ConfigureSuccessParams": ".v2", + "ListenV2ConfigureSuccessThresholds": ".v2", + "ListenV2ConfigureSuccessThresholdsParams": ".v2", + "ListenV2ConfigureThresholds": ".v2", + "ListenV2ConfigureThresholdsParams": ".v2", + "ListenV2Connected": ".v2", + "ListenV2ConnectedParams": ".v2", + "ListenV2FatalError": ".v2", + "ListenV2FatalErrorParams": ".v2", + "ListenV2ForceEndTurn": ".v2", + "ListenV2ForceEndTurnParams": ".v2", + "ListenV2TurnInfo": ".v2", + "ListenV2TurnInfoEvent": ".v2", + "ListenV2TurnInfoParams": ".v2", + "ListenV2TurnInfoWordsItem": ".v2", + "ListenV2TurnInfoWordsItemParams": ".v2", + "ListenV2Warning": ".v2", + "ListenV2WarningParams": ".v2", + "v1": ".v1", + "v2": ".v2", +} + +_dynamic_imports["ListenV2CloseStreamType"] = ".v2" + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = [ + "DiarizeModel", + "ListenV1CloseStream", + "ListenV1CloseStreamParams", + "ListenV1CloseStreamType", + "ListenV1Configure", + "ListenV1ConfigureFailure", + "ListenV1ConfigureFailureCode", + "ListenV1ConfigureFailureParams", + "ListenV1ConfigureParams", + "ListenV1ConfigureSuccess", + "ListenV1ConfigureSuccessParams", + "ListenV1Error", + "ListenV1ErrorParams", + "ListenV1Finalize", + "ListenV1FinalizeParams", + "ListenV1FinalizeType", + "ListenV1KeepAlive", + "ListenV1KeepAliveParams", + "ListenV1KeepAliveType", + "ListenV1Metadata", + "ListenV1MetadataParams", + "ListenV1Results", + "ListenV1ResultsChannel", + "ListenV1ResultsChannelAlternativesItem", + "ListenV1ResultsChannelAlternativesItemParams", + "ListenV1ResultsChannelAlternativesItemWordsItem", + "ListenV1ResultsChannelAlternativesItemWordsItemParams", + "ListenV1ResultsChannelParams", + "ListenV1ResultsEntitiesItem", + "ListenV1ResultsEntitiesItemParams", + "ListenV1ResultsMetadata", + "ListenV1ResultsMetadataDiarizeInfo", + "ListenV1ResultsMetadataDiarizeInfoParams", + "ListenV1ResultsMetadataModelInfo", + "ListenV1ResultsMetadataModelInfoParams", + "ListenV1ResultsMetadataParams", + "ListenV1ResultsParams", + "ListenV1SpeechStarted", + "ListenV1SpeechStartedParams", + "ListenV1UtteranceEnd", + "ListenV1UtteranceEndParams", + "ListenV2CloseStream", + "ListenV2CloseStreamParams", + "ListenV2Configure", + "ListenV2ConfigureFailure", + "ListenV2ConfigureFailureParams", + "ListenV2ConfigureParams", + "ListenV2ConfigureSuccess", + "ListenV2ConfigureSuccessParams", + "ListenV2ConfigureSuccessThresholds", + "ListenV2ConfigureSuccessThresholdsParams", + "ListenV2ConfigureThresholds", + "ListenV2ConfigureThresholdsParams", + "ListenV2Connected", + "ListenV2ConnectedParams", + "ListenV2FatalError", + "ListenV2FatalErrorParams", + "ListenV2ForceEndTurn", + "ListenV2ForceEndTurnParams", + "ListenV2TurnInfo", + "ListenV2TurnInfoEvent", + "ListenV2TurnInfoParams", + "ListenV2TurnInfoWordsItem", + "ListenV2TurnInfoWordsItemParams", + "ListenV2Warning", + "ListenV2WarningParams", + "v1", + "v2", +] + +__all__.append("ListenV2CloseStreamType") diff --git a/src/deepgram/listen/v1/requests/listen_v1configure_failure.py.bak b/src/deepgram/listen/v1/requests/listen_v1configure_failure.py.bak new file mode 100644 index 00000000..af007f39 --- /dev/null +++ b/src/deepgram/listen/v1/requests/listen_v1configure_failure.py.bak @@ -0,0 +1,34 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import typing_extensions +from ..types.listen_v1configure_failure_code import ListenV1ConfigureFailureCode + + +class ListenV1ConfigureFailureParams(typing_extensions.TypedDict): + type: typing.Literal["ConfigureFailure"] + """ + Message type identifier + """ + + request_id: str + """ + The unique identifier of the request + """ + + code: ListenV1ConfigureFailureCode + """ + Identifies why the `Configure` was rejected. + + - `CONFIGURE_KEYTERMS_NOT_SUPPORTED`: the stream's model does not support mid-stream keyterm updates. Only + Nova-3 models do. + - `CONFIGURE_KEYTERM_LIMIT_EXCEEDED`: the keyterms exceed the 500-token keyterm limit. + - `CONFIGURE_ALREADY_PENDING`: another `Configure` is still awaiting its response. + - `CONFIGURE_INTERNAL_ERROR`: the server failed to apply the configuration. + """ + + description: str + """ + A human-readable explanation of the rejection + """ diff --git a/src/deepgram/listen/v1/socket_client.py.bak b/src/deepgram/listen/v1/socket_client.py.bak new file mode 100644 index 00000000..20d466f4 --- /dev/null +++ b/src/deepgram/listen/v1/socket_client.py.bak @@ -0,0 +1,262 @@ +# This file was auto-generated by Fern from our API Definition. + +import json +import logging +import typing + +import websockets.sync.connection as websockets_sync_connection +from ...core.events import EventEmitterMixin, EventType +from ...core.unchecked_base_model import construct_type +from .types.listen_v1close_stream import ListenV1CloseStream +from .types.listen_v1configure import ListenV1Configure +from .types.listen_v1configure_failure import ListenV1ConfigureFailure +from .types.listen_v1configure_success import ListenV1ConfigureSuccess +from .types.listen_v1error import ListenV1Error +from .types.listen_v1finalize import ListenV1Finalize +from .types.listen_v1keep_alive import ListenV1KeepAlive +from .types.listen_v1metadata import ListenV1Metadata +from .types.listen_v1results import ListenV1Results +from .types.listen_v1speech_started import ListenV1SpeechStarted +from .types.listen_v1utterance_end import ListenV1UtteranceEnd + +try: + from websockets.legacy.client import WebSocketClientProtocol # type: ignore +except ImportError: + from websockets import WebSocketClientProtocol # type: ignore + +_logger = logging.getLogger(__name__) +V1SocketClientResponse = typing.Union[ + bytes, + ListenV1ConfigureSuccess, + ListenV1ConfigureFailure, + ListenV1Results, + ListenV1Metadata, + ListenV1UtteranceEnd, + ListenV1SpeechStarted, + ListenV1Error, + typing.Dict[str, typing.Any], +] + + +class AsyncV1SocketClient(EventEmitterMixin): + def __init__(self, *, websocket: WebSocketClientProtocol): + super().__init__() + self._websocket = websocket + + async def __aiter__(self) -> typing.AsyncIterator[V1SocketClientResponse]: + async for message in self._websocket: + if isinstance(message, bytes): + yield message # type: ignore + else: + try: + yield construct_type(type_=V1SocketClientResponse, object_=json.loads(message)) # type: ignore + except Exception: + _logger.warning( + "Skipping unknown WebSocket message; update your SDK version to support new message types." + ) + continue + + async def start_listening(self): + """ + Start listening for messages on the websocket connection. + + Emits events in the following order: + - EventType.OPEN when connection is established + - EventType.MESSAGE for each message received + - EventType.ERROR if an error occurs + - EventType.CLOSE when connection is closed + """ + await self._emit_async(EventType.OPEN, None) + try: + async for raw_message in self._websocket: + if isinstance(raw_message, bytes): + parsed = raw_message + else: + json_data = json.loads(raw_message) + try: + parsed = construct_type(type_=V1SocketClientResponse, object_=json_data) # type: ignore + except Exception: + _logger.warning( + "Skipping unknown WebSocket message; update your SDK version to support new message types." + ) + continue + await self._emit_async(EventType.MESSAGE, parsed) + except Exception as exc: + await self._emit_async(EventType.ERROR, exc) + finally: + await self._emit_async(EventType.CLOSE, None) + + async def send_media(self, message: bytes) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a bytes. + """ + await self._send(message) + + async def send_finalize(self, message: typing.Optional[ListenV1Finalize] = None) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a ListenV1Finalize. + """ + await self._send_model(message or ListenV1Finalize(type="Finalize")) + + async def send_close_stream(self, message: typing.Optional[ListenV1CloseStream] = None) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a ListenV1CloseStream. + """ + await self._send_model(message or ListenV1CloseStream(type="CloseStream")) + + async def send_keep_alive(self, message: typing.Optional[ListenV1KeepAlive] = None) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a ListenV1KeepAlive. + """ + await self._send_model(message or ListenV1KeepAlive(type="KeepAlive")) + + async def send_configure(self, message: ListenV1Configure) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a ListenV1Configure. + """ + await self._send_model(message) + + async def recv(self) -> V1SocketClientResponse: + """ + Receive a message from the websocket connection. + """ + data = await self._websocket.recv() + if isinstance(data, bytes): + return data # type: ignore + json_data = json.loads(data) + try: + return construct_type(type_=V1SocketClientResponse, object_=json_data) # type: ignore + except Exception: + _logger.warning("Skipping unknown WebSocket message; update your SDK version to support new message types.") + return json_data # type: ignore + + async def _send(self, data: typing.Any) -> None: + """ + Send a message to the websocket connection. + """ + if isinstance(data, dict): + data = json.dumps(data) + await self._websocket.send(data) + + async def _send_model(self, data: typing.Any) -> None: + """ + Send a Pydantic model to the websocket connection. + """ + await self._send(data.dict()) + + +class V1SocketClient(EventEmitterMixin): + def __init__(self, *, websocket: websockets_sync_connection.Connection): + super().__init__() + self._websocket = websocket + + def __iter__(self) -> typing.Iterator[V1SocketClientResponse]: + for message in self._websocket: + if isinstance(message, bytes): + yield message # type: ignore + else: + try: + yield construct_type(type_=V1SocketClientResponse, object_=json.loads(message)) # type: ignore + except Exception: + _logger.warning( + "Skipping unknown WebSocket message; update your SDK version to support new message types." + ) + continue + + def start_listening(self): + """ + Start listening for messages on the websocket connection. + + Emits events in the following order: + - EventType.OPEN when connection is established + - EventType.MESSAGE for each message received + - EventType.ERROR if an error occurs + - EventType.CLOSE when connection is closed + """ + self._emit(EventType.OPEN, None) + try: + for raw_message in self._websocket: + if isinstance(raw_message, bytes): + parsed = raw_message + else: + json_data = json.loads(raw_message) + try: + parsed = construct_type(type_=V1SocketClientResponse, object_=json_data) # type: ignore + except Exception: + _logger.warning( + "Skipping unknown WebSocket message; update your SDK version to support new message types." + ) + continue + self._emit(EventType.MESSAGE, parsed) + except Exception as exc: + self._emit(EventType.ERROR, exc) + finally: + self._emit(EventType.CLOSE, None) + + def send_media(self, message: bytes) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a bytes. + """ + self._send(message) + + def send_finalize(self, message: typing.Optional[ListenV1Finalize] = None) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a ListenV1Finalize. + """ + self._send_model(message or ListenV1Finalize(type="Finalize")) + + def send_close_stream(self, message: typing.Optional[ListenV1CloseStream] = None) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a ListenV1CloseStream. + """ + self._send_model(message or ListenV1CloseStream(type="CloseStream")) + + def send_keep_alive(self, message: typing.Optional[ListenV1KeepAlive] = None) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a ListenV1KeepAlive. + """ + self._send_model(message or ListenV1KeepAlive(type="KeepAlive")) + + def send_configure(self, message: ListenV1Configure) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a ListenV1Configure. + """ + self._send_model(message) + + def recv(self) -> V1SocketClientResponse: + """ + Receive a message from the websocket connection. + """ + data = self._websocket.recv() + if isinstance(data, bytes): + return data # type: ignore + json_data = json.loads(data) + try: + return construct_type(type_=V1SocketClientResponse, object_=json_data) # type: ignore + except Exception: + _logger.warning("Skipping unknown WebSocket message; update your SDK version to support new message types.") + return json_data # type: ignore + + def _send(self, data: typing.Any) -> None: + """ + Send a message to the websocket connection. + """ + if isinstance(data, dict): + data = json.dumps(data) + self._websocket.send(data) + + def _send_model(self, data: typing.Any) -> None: + """ + Send a Pydantic model to the websocket connection. + """ + self._send(data.dict()) diff --git a/src/deepgram/listen/v1/types/listen_v1configure_failure.py.bak b/src/deepgram/listen/v1/types/listen_v1configure_failure.py.bak new file mode 100644 index 00000000..859a834c --- /dev/null +++ b/src/deepgram/listen/v1/types/listen_v1configure_failure.py.bak @@ -0,0 +1,45 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ....core.pydantic_utilities import IS_PYDANTIC_V2 +from ....core.unchecked_base_model import UncheckedBaseModel +from .listen_v1configure_failure_code import ListenV1ConfigureFailureCode + + +class ListenV1ConfigureFailure(UncheckedBaseModel): + type: typing.Literal["ConfigureFailure"] = pydantic.Field(default="ConfigureFailure") + """ + Message type identifier + """ + + request_id: str = pydantic.Field() + """ + The unique identifier of the request + """ + + code: ListenV1ConfigureFailureCode = pydantic.Field() + """ + Identifies why the `Configure` was rejected. + + - `CONFIGURE_KEYTERMS_NOT_SUPPORTED`: the stream's model does not support mid-stream keyterm updates. Only + Nova-3 models do. + - `CONFIGURE_KEYTERM_LIMIT_EXCEEDED`: the keyterms exceed the 500-token keyterm limit. + - `CONFIGURE_ALREADY_PENDING`: another `Configure` is still awaiting its response. + - `CONFIGURE_INTERNAL_ERROR`: the server failed to apply the configuration. + """ + + description: str = pydantic.Field() + """ + A human-readable explanation of the rejection + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/deepgram/listen/v2/__init__.py.bak b/src/deepgram/listen/v2/__init__.py.bak new file mode 100644 index 00000000..7585b5ab --- /dev/null +++ b/src/deepgram/listen/v2/__init__.py.bak @@ -0,0 +1,118 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .types import ( + ListenV2CloseStream, + ListenV2Configure, + ListenV2ConfigureFailure, + ListenV2ConfigureSuccess, + ListenV2ConfigureSuccessThresholds, + ListenV2ConfigureThresholds, + ListenV2Connected, + ListenV2FatalError, + ListenV2ForceEndTurn, + ListenV2TurnInfo, + ListenV2TurnInfoEvent, + ListenV2TurnInfoWordsItem, + ListenV2Warning, + ) + from .requests import ( + ListenV2CloseStreamParams, + ListenV2ConfigureFailureParams, + ListenV2ConfigureParams, + ListenV2ConfigureSuccessParams, + ListenV2ConfigureSuccessThresholdsParams, + ListenV2ConfigureThresholdsParams, + ListenV2ConnectedParams, + ListenV2FatalErrorParams, + ListenV2ForceEndTurnParams, + ListenV2TurnInfoParams, + ListenV2TurnInfoWordsItemParams, + ListenV2WarningParams, + ) +_dynamic_imports: typing.Dict[str, str] = { + "ListenV2CloseStream": ".types", + "ListenV2CloseStreamParams": ".requests", + "ListenV2Configure": ".types", + "ListenV2ConfigureFailure": ".types", + "ListenV2ConfigureFailureParams": ".requests", + "ListenV2ConfigureParams": ".requests", + "ListenV2ConfigureSuccess": ".types", + "ListenV2ConfigureSuccessParams": ".requests", + "ListenV2ConfigureSuccessThresholds": ".types", + "ListenV2ConfigureSuccessThresholdsParams": ".requests", + "ListenV2ConfigureThresholds": ".types", + "ListenV2ConfigureThresholdsParams": ".requests", + "ListenV2Connected": ".types", + "ListenV2ConnectedParams": ".requests", + "ListenV2FatalError": ".types", + "ListenV2FatalErrorParams": ".requests", + "ListenV2ForceEndTurn": ".types", + "ListenV2ForceEndTurnParams": ".requests", + "ListenV2TurnInfo": ".types", + "ListenV2TurnInfoEvent": ".types", + "ListenV2TurnInfoParams": ".requests", + "ListenV2TurnInfoWordsItem": ".types", + "ListenV2TurnInfoWordsItemParams": ".requests", + "ListenV2Warning": ".types", + "ListenV2WarningParams": ".requests", +} + +_dynamic_imports["ListenV2CloseStreamType"] = ".types" + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = [ + "ListenV2CloseStream", + "ListenV2CloseStreamParams", + "ListenV2Configure", + "ListenV2ConfigureFailure", + "ListenV2ConfigureFailureParams", + "ListenV2ConfigureParams", + "ListenV2ConfigureSuccess", + "ListenV2ConfigureSuccessParams", + "ListenV2ConfigureSuccessThresholds", + "ListenV2ConfigureSuccessThresholdsParams", + "ListenV2ConfigureThresholds", + "ListenV2ConfigureThresholdsParams", + "ListenV2Connected", + "ListenV2ConnectedParams", + "ListenV2FatalError", + "ListenV2FatalErrorParams", + "ListenV2ForceEndTurn", + "ListenV2ForceEndTurnParams", + "ListenV2TurnInfo", + "ListenV2TurnInfoEvent", + "ListenV2TurnInfoParams", + "ListenV2TurnInfoWordsItem", + "ListenV2TurnInfoWordsItemParams", + "ListenV2Warning", + "ListenV2WarningParams", +] + +__all__.append("ListenV2CloseStreamType") diff --git a/src/deepgram/listen/v2/socket_client.py.bak b/src/deepgram/listen/v2/socket_client.py.bak new file mode 100644 index 00000000..4295e44c --- /dev/null +++ b/src/deepgram/listen/v2/socket_client.py.bak @@ -0,0 +1,251 @@ +# This file was auto-generated by Fern from our API Definition. + +import json +import logging +import typing + +import websockets.sync.connection as websockets_sync_connection +from ...core.events import EventEmitterMixin, EventType +from ...core.unchecked_base_model import construct_type +from .types.listen_v2close_stream import ListenV2CloseStream +from .types.listen_v2configure import ListenV2Configure +from .types.listen_v2configure_failure import ListenV2ConfigureFailure +from .types.listen_v2configure_success import ListenV2ConfigureSuccess +from .types.listen_v2connected import ListenV2Connected +from .types.listen_v2fatal_error import ListenV2FatalError +from .types.listen_v2force_end_turn import ListenV2ForceEndTurn +from .types.listen_v2turn_info import ListenV2TurnInfo +from .types.listen_v2warning import ListenV2Warning + +try: + from websockets.legacy.client import WebSocketClientProtocol # type: ignore +except ImportError: + from websockets import WebSocketClientProtocol # type: ignore + +_logger = logging.getLogger(__name__) +V2SocketClientResponse = typing.Union[ + bytes, + ListenV2Connected, + ListenV2TurnInfo, + ListenV2ConfigureSuccess, + ListenV2ConfigureFailure, + ListenV2Warning, + ListenV2FatalError, + typing.Dict[str, typing.Any], +] + + +class AsyncV2SocketClient(EventEmitterMixin): + def __init__(self, *, websocket: WebSocketClientProtocol): + super().__init__() + self._websocket = websocket + + async def __aiter__(self) -> typing.AsyncIterator[V2SocketClientResponse]: + async for message in self._websocket: + if isinstance(message, bytes): + yield message # type: ignore + else: + try: + yield construct_type(type_=V2SocketClientResponse, object_=json.loads(message)) # type: ignore + except Exception: + _logger.warning( + "Skipping unknown WebSocket message; update your SDK version to support new message types." + ) + continue + + async def start_listening(self): + """ + Start listening for messages on the websocket connection. + + Emits events in the following order: + - EventType.OPEN when connection is established + - EventType.MESSAGE for each message received + - EventType.ERROR if an error occurs + - EventType.CLOSE when connection is closed + """ + await self._emit_async(EventType.OPEN, None) + try: + async for raw_message in self._websocket: + if isinstance(raw_message, bytes): + parsed = raw_message + else: + json_data = json.loads(raw_message) + try: + parsed = construct_type(type_=V2SocketClientResponse, object_=json_data) # type: ignore + except Exception: + _logger.warning( + "Skipping unknown WebSocket message; update your SDK version to support new message types." + ) + continue + await self._emit_async(EventType.MESSAGE, parsed) + except Exception as exc: + await self._emit_async(EventType.ERROR, exc) + finally: + await self._emit_async(EventType.CLOSE, None) + + async def send_media(self, message: bytes) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a bytes. + """ + await self._send(message) + + async def send_close_stream(self, message: typing.Optional[ListenV2CloseStream] = None) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a ListenV2CloseStream. + """ + await self._send_model(message or ListenV2CloseStream(type="CloseStream")) + + async def send_force_end_turn(self, message: typing.Optional[ListenV2ForceEndTurn] = None) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a ListenV2ForceEndTurn. + """ + await self._send_model(message or ListenV2ForceEndTurn(type="ForceEndTurn")) + + async def send_configure(self, message: typing.Union[ListenV2Configure, typing.Dict[str, typing.Any]]) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a ListenV2Configure. + """ + if isinstance(message, dict): + await self._send(message) + else: + await self._send_model(message) + + async def recv(self) -> V2SocketClientResponse: + """ + Receive a message from the websocket connection. + """ + data = await self._websocket.recv() + if isinstance(data, bytes): + return data # type: ignore + json_data = json.loads(data) + try: + return construct_type(type_=V2SocketClientResponse, object_=json_data) # type: ignore + except Exception: + _logger.warning("Skipping unknown WebSocket message; update your SDK version to support new message types.") + return json_data # type: ignore + + async def _send(self, data: typing.Any) -> None: + """ + Send a message to the websocket connection. + """ + if isinstance(data, dict): + data = json.dumps(data) + await self._websocket.send(data) + + async def _send_model(self, data: typing.Any) -> None: + """ + Send a Pydantic model to the websocket connection. + """ + await self._send(data.dict()) + + +class V2SocketClient(EventEmitterMixin): + def __init__(self, *, websocket: websockets_sync_connection.Connection): + super().__init__() + self._websocket = websocket + + def __iter__(self) -> typing.Iterator[V2SocketClientResponse]: + for message in self._websocket: + if isinstance(message, bytes): + yield message # type: ignore + else: + try: + yield construct_type(type_=V2SocketClientResponse, object_=json.loads(message)) # type: ignore + except Exception: + _logger.warning( + "Skipping unknown WebSocket message; update your SDK version to support new message types." + ) + continue + + def start_listening(self): + """ + Start listening for messages on the websocket connection. + + Emits events in the following order: + - EventType.OPEN when connection is established + - EventType.MESSAGE for each message received + - EventType.ERROR if an error occurs + - EventType.CLOSE when connection is closed + """ + self._emit(EventType.OPEN, None) + try: + for raw_message in self._websocket: + if isinstance(raw_message, bytes): + parsed = raw_message + else: + json_data = json.loads(raw_message) + try: + parsed = construct_type(type_=V2SocketClientResponse, object_=json_data) # type: ignore + except Exception: + _logger.warning( + "Skipping unknown WebSocket message; update your SDK version to support new message types." + ) + continue + self._emit(EventType.MESSAGE, parsed) + except Exception as exc: + self._emit(EventType.ERROR, exc) + finally: + self._emit(EventType.CLOSE, None) + + def send_media(self, message: bytes) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a bytes. + """ + self._send(message) + + def send_close_stream(self, message: typing.Optional[ListenV2CloseStream] = None) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a ListenV2CloseStream. + """ + self._send_model(message or ListenV2CloseStream(type="CloseStream")) + + def send_force_end_turn(self, message: typing.Optional[ListenV2ForceEndTurn] = None) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a ListenV2ForceEndTurn. + """ + self._send_model(message or ListenV2ForceEndTurn(type="ForceEndTurn")) + + def send_configure(self, message: typing.Union[ListenV2Configure, typing.Dict[str, typing.Any]]) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a ListenV2Configure. + """ + if isinstance(message, dict): + self._send(message) + else: + self._send_model(message) + + def recv(self) -> V2SocketClientResponse: + """ + Receive a message from the websocket connection. + """ + data = self._websocket.recv() + if isinstance(data, bytes): + return data # type: ignore + json_data = json.loads(data) + try: + return construct_type(type_=V2SocketClientResponse, object_=json_data) # type: ignore + except Exception: + _logger.warning("Skipping unknown WebSocket message; update your SDK version to support new message types.") + return json_data # type: ignore + + def _send(self, data: typing.Any) -> None: + """ + Send a message to the websocket connection. + """ + if isinstance(data, dict): + data = json.dumps(data) + self._websocket.send(data) + + def _send_model(self, data: typing.Any) -> None: + """ + Send a Pydantic model to the websocket connection. + """ + self._send(data.dict()) diff --git a/src/deepgram/listen/v2/types/__init__.py.bak b/src/deepgram/listen/v2/types/__init__.py.bak new file mode 100644 index 00000000..8ec84d29 --- /dev/null +++ b/src/deepgram/listen/v2/types/__init__.py.bak @@ -0,0 +1,78 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .listen_v2close_stream import ListenV2CloseStream + from .listen_v2configure import ListenV2Configure + from .listen_v2configure_failure import ListenV2ConfigureFailure + from .listen_v2configure_success import ListenV2ConfigureSuccess + from .listen_v2configure_success_thresholds import ListenV2ConfigureSuccessThresholds + from .listen_v2configure_thresholds import ListenV2ConfigureThresholds + from .listen_v2connected import ListenV2Connected + from .listen_v2fatal_error import ListenV2FatalError + from .listen_v2force_end_turn import ListenV2ForceEndTurn + from .listen_v2turn_info import ListenV2TurnInfo + from .listen_v2turn_info_event import ListenV2TurnInfoEvent + from .listen_v2turn_info_words_item import ListenV2TurnInfoWordsItem + from .listen_v2warning import ListenV2Warning +_dynamic_imports: typing.Dict[str, str] = { + "ListenV2CloseStream": ".listen_v2close_stream", + "ListenV2Configure": ".listen_v2configure", + "ListenV2ConfigureFailure": ".listen_v2configure_failure", + "ListenV2ConfigureSuccess": ".listen_v2configure_success", + "ListenV2ConfigureSuccessThresholds": ".listen_v2configure_success_thresholds", + "ListenV2ConfigureThresholds": ".listen_v2configure_thresholds", + "ListenV2Connected": ".listen_v2connected", + "ListenV2FatalError": ".listen_v2fatal_error", + "ListenV2ForceEndTurn": ".listen_v2force_end_turn", + "ListenV2TurnInfo": ".listen_v2turn_info", + "ListenV2TurnInfoEvent": ".listen_v2turn_info_event", + "ListenV2TurnInfoWordsItem": ".listen_v2turn_info_words_item", + "ListenV2Warning": ".listen_v2warning", +} + +_dynamic_imports["ListenV2CloseStreamType"] = ".listen_v2close_stream_type" + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = [ + "ListenV2CloseStream", + "ListenV2Configure", + "ListenV2ConfigureFailure", + "ListenV2ConfigureSuccess", + "ListenV2ConfigureSuccessThresholds", + "ListenV2ConfigureThresholds", + "ListenV2Connected", + "ListenV2FatalError", + "ListenV2ForceEndTurn", + "ListenV2TurnInfo", + "ListenV2TurnInfoEvent", + "ListenV2TurnInfoWordsItem", + "ListenV2Warning", +] + +__all__.append("ListenV2CloseStreamType") diff --git a/src/deepgram/listen/v2/types/listen_v2configure_failure.py.bak b/src/deepgram/listen/v2/types/listen_v2configure_failure.py.bak new file mode 100644 index 00000000..1daf8af6 --- /dev/null +++ b/src/deepgram/listen/v2/types/listen_v2configure_failure.py.bak @@ -0,0 +1,45 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ....core.pydantic_utilities import IS_PYDANTIC_V2 +from ._dict_compat import ListenV2ResponseDictCompatModel + + +class ListenV2ConfigureFailure(ListenV2ResponseDictCompatModel): + type: typing.Literal["ConfigureFailure"] = pydantic.Field(default="ConfigureFailure") + """ + Message type identifier + """ + + request_id: str = pydantic.Field() + """ + The unique identifier of the request + """ + + sequence_id: int = pydantic.Field() + """ + Starts at `0` and increments for each message the server sends + to the client. This includes messages of other types, like + `TurnInfo` messages. + """ + + code: typing.Optional[str] = pydantic.Field(default=None) + """ + Failure code identifying the rejected configuration + """ + + description: typing.Optional[str] = pydantic.Field(default=None) + """ + A human-readable description of the configuration failure + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/deepgram/listen/v2/types/listen_v2configure_success.py.bak b/src/deepgram/listen/v2/types/listen_v2configure_success.py.bak new file mode 100644 index 00000000..0faaec9d --- /dev/null +++ b/src/deepgram/listen/v2/types/listen_v2configure_success.py.bak @@ -0,0 +1,60 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ....core.pydantic_utilities import IS_PYDANTIC_V2 +from ....types.listen_v2configure_numerals import ListenV2ConfigureNumerals +from ....types.listen_v2keyterm import ListenV2Keyterm +from ._dict_compat import ListenV2ResponseDictCompatModel +from .listen_v2configure_success_thresholds import ListenV2ConfigureSuccessThresholds + + +class ListenV2ConfigureSuccess(ListenV2ResponseDictCompatModel): + type: typing.Literal["ConfigureSuccess"] = pydantic.Field(default="ConfigureSuccess") + """ + Message type identifier + """ + + request_id: str = pydantic.Field() + """ + The unique identifier of the request + """ + + thresholds: ListenV2ConfigureSuccessThresholds = pydantic.Field() + """ + Updates each parameter, if it is supplied. If a particular threshold parameter + is not supplied, the configuration continues using the currently configured value. + """ + + keyterms: ListenV2Keyterm + language_hints: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + The currently active language hints. Only applicable to the flux-general-multi model. + """ + + numerals: typing.Optional[ListenV2ConfigureNumerals] = pydantic.Field(default=None) + """ + Whether numeral formatting is enabled for transcripts Flux STT sends after it processes the update. + """ + + redact_usage: typing.Optional[bool] = pydantic.Field(default=None) + """ + Whether usage redaction is on for this connection. + """ + + sequence_id: int = pydantic.Field() + """ + Starts at `0` and increments for each message the server sends + to the client. This includes messages of other types, like + `TurnInfo` messages. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/deepgram/listen/v2/types/listen_v2configure_success_thresholds.py.bak b/src/deepgram/listen/v2/types/listen_v2configure_success_thresholds.py.bak new file mode 100644 index 00000000..e0353ec9 --- /dev/null +++ b/src/deepgram/listen/v2/types/listen_v2configure_success_thresholds.py.bak @@ -0,0 +1,30 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ....core.pydantic_utilities import IS_PYDANTIC_V2 +from ....types.listen_v2eager_eot_threshold import ListenV2EagerEotThreshold +from ....types.listen_v2eot_threshold import ListenV2EotThreshold +from ....types.listen_v2eot_timeout_ms import ListenV2EotTimeoutMs +from ._dict_compat import ListenV2ResponseDictCompatModel + + +class ListenV2ConfigureSuccessThresholds(ListenV2ResponseDictCompatModel): + """ + Updates each parameter, if it is supplied. If a particular threshold parameter + is not supplied, the configuration continues using the currently configured value. + """ + + eager_eot_threshold: typing.Optional[ListenV2EagerEotThreshold] = None + eot_threshold: typing.Optional[ListenV2EotThreshold] = None + eot_timeout_ms: typing.Optional[ListenV2EotTimeoutMs] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/deepgram/listen/v2/types/listen_v2connected.py.bak b/src/deepgram/listen/v2/types/listen_v2connected.py.bak new file mode 100644 index 00000000..b253d86c --- /dev/null +++ b/src/deepgram/listen/v2/types/listen_v2connected.py.bak @@ -0,0 +1,35 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ....core.pydantic_utilities import IS_PYDANTIC_V2 +from ._dict_compat import ListenV2ResponseDictCompatModel + + +class ListenV2Connected(ListenV2ResponseDictCompatModel): + type: typing.Literal["Connected"] = pydantic.Field(default="Connected") + """ + Message type identifier + """ + + request_id: str = pydantic.Field() + """ + The unique identifier of the request + """ + + sequence_id: int = pydantic.Field() + """ + Starts at `0` and increments for each message the server sends + to the client. This includes messages of other types, like + `TurnInfo` messages. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/deepgram/listen/v2/types/listen_v2fatal_error.py.bak b/src/deepgram/listen/v2/types/listen_v2fatal_error.py.bak new file mode 100644 index 00000000..2202c82e --- /dev/null +++ b/src/deepgram/listen/v2/types/listen_v2fatal_error.py.bak @@ -0,0 +1,40 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ....core.pydantic_utilities import IS_PYDANTIC_V2 +from ._dict_compat import ListenV2ResponseDictCompatModel + + +class ListenV2FatalError(ListenV2ResponseDictCompatModel): + type: typing.Literal["Error"] = pydantic.Field(default="Error") + """ + Message type identifier + """ + + sequence_id: int = pydantic.Field() + """ + Starts at `0` and increments for each message the server sends + to the client. This includes messages of other types, like + `Connected` messages. + """ + + code: str = pydantic.Field() + """ + A string code describing the error, e.g. `INTERNAL_SERVER_ERROR` + """ + + description: str = pydantic.Field() + """ + Prose description of the error + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/deepgram/listen/v2/types/listen_v2turn_info.py.bak b/src/deepgram/listen/v2/types/listen_v2turn_info.py.bak new file mode 100644 index 00000000..969d6d0c --- /dev/null +++ b/src/deepgram/listen/v2/types/listen_v2turn_info.py.bak @@ -0,0 +1,102 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ....core.pydantic_utilities import IS_PYDANTIC_V2 +from ._dict_compat import ListenV2ResponseDictCompatModel +from .listen_v2turn_info_event import ListenV2TurnInfoEvent +from .listen_v2turn_info_words_item import ListenV2TurnInfoWordsItem + + +class ListenV2TurnInfo(ListenV2ResponseDictCompatModel): + """ + Describes the current turn and latest state of the turn + """ + + type: typing.Literal["TurnInfo"] = "TurnInfo" + request_id: str = pydantic.Field() + """ + The unique identifier of the request + """ + + sequence_id: int = pydantic.Field() + """ + Starts at `0` and increments for each message the server sends to the client. This includes messages of other types, like `Connected` messages. + """ + + event: ListenV2TurnInfoEvent = pydantic.Field() + """ + The type of event being reported. + + - **Update** - Additional audio has been transcribed, but the turn state hasn't changed + - **StartOfTurn** - The user has begun speaking for the first time in the turn + - **EagerEndOfTurn** - The system has moderate confidence that the user has finished speaking for the turn. This is an opportunity to begin preparing an agent reply + - **TurnResumed** - The system detected that speech had ended and therefore sent an **EagerEndOfTurn** event, but speech is actually continuing for this turn + - **EndOfTurn** - The user has finished speaking for the turn + """ + + turn_index: int = pydantic.Field() + """ + The index of the current turn + """ + + audio_window_start: float = pydantic.Field() + """ + Start time in seconds of the audio range that was transcribed + """ + + audio_window_end: float = pydantic.Field() + """ + End time in seconds of the audio range that was transcribed + """ + + transcript: str = pydantic.Field() + """ + Text that was said over the course of the current turn + """ + + words: typing.List[ListenV2TurnInfoWordsItem] = pydantic.Field() + """ + The words in the `transcript` + """ + + end_of_turn_confidence: float = pydantic.Field() + """ + Confidence that no more speech is coming in this turn + """ + + trigger: typing.Optional[str] = pydantic.Field(default=None) + """ + The cause of the turn ending. Present on every `EndOfTurn` event and only there. + + - **model** - the turn ended by Flux's native end-of-turn detection + + - **manual** - the turn ended because a `ForceEndTurn` message was sent + + - **timeout** - the turn ended because `eot_timeout_ms` elapsed + + This is an open enum. New values may be added over time, so clients must tolerate values they do not recognize. + """ + + languages: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + Detected languages sorted by descending frequency in the + transcript. Only present when the flux-general-multi model + detects languages in the audio. + """ + + languages_hinted: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + The language hints that were supplied for this turn. Only + present when language hints are configured. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/deepgram/listen/v2/types/listen_v2turn_info_words_item.py.bak b/src/deepgram/listen/v2/types/listen_v2turn_info_words_item.py.bak new file mode 100644 index 00000000..88240cd9 --- /dev/null +++ b/src/deepgram/listen/v2/types/listen_v2turn_info_words_item.py.bak @@ -0,0 +1,38 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ....core.pydantic_utilities import IS_PYDANTIC_V2 +from ._dict_compat import ListenV2ResponseDictCompatModel + + +class ListenV2TurnInfoWordsItem(ListenV2ResponseDictCompatModel): + word: str = pydantic.Field() + """ + The individual punctuated, properly-cased word from the transcript + """ + + confidence: float = pydantic.Field() + """ + Confidence that this word was transcribed correctly + """ + + start: typing.Optional[float] = pydantic.Field(default=None) + """ + The start time of the word + """ + + end: typing.Optional[float] = pydantic.Field(default=None) + """ + The end time of the word + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/deepgram/listen/v2/types/listen_v2warning.py.bak b/src/deepgram/listen/v2/types/listen_v2warning.py.bak new file mode 100644 index 00000000..19bfe19a --- /dev/null +++ b/src/deepgram/listen/v2/types/listen_v2warning.py.bak @@ -0,0 +1,45 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ....core.pydantic_utilities import IS_PYDANTIC_V2 +from ._dict_compat import ListenV2ResponseDictCompatModel + + +class ListenV2Warning(ListenV2ResponseDictCompatModel): + type: typing.Literal["Warning"] = pydantic.Field(default="Warning") + """ + Message type identifier + """ + + request_id: str = pydantic.Field() + """ + The unique identifier of the request + """ + + sequence_id: int = pydantic.Field() + """ + Starts at `0` and increments for each message the server sends + to the client. This includes messages of other types, like + `TurnInfo` messages. + """ + + code: str = pydantic.Field() + """ + Warning code identifying the condition, in `SCREAMING_SNAKE_CASE` + """ + + description: str = pydantic.Field() + """ + A human-readable description of the warning + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/deepgram/requests/__init__.py.bak b/src/deepgram/requests/__init__.py.bak new file mode 100644 index 00000000..beb2e2db --- /dev/null +++ b/src/deepgram/requests/__init__.py.bak @@ -0,0 +1,618 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .agent_configuration_v1 import AgentConfigurationV1Params + from .agent_think_models_v1response import AgentThinkModelsV1ResponseParams + from .agent_think_models_v1response_models_item import AgentThinkModelsV1ResponseModelsItemParams + from .agent_think_models_v1response_models_item_id import AgentThinkModelsV1ResponseModelsItemIdParams + from .agent_think_models_v1response_models_item_one import AgentThinkModelsV1ResponseModelsItemOneParams + from .agent_think_models_v1response_models_item_three import AgentThinkModelsV1ResponseModelsItemThreeParams + from .agent_think_models_v1response_models_item_two import AgentThinkModelsV1ResponseModelsItemTwoParams + from .agent_think_models_v1response_models_item_zero import AgentThinkModelsV1ResponseModelsItemZeroParams + from .agent_variable_v1 import AgentVariableV1Params + from .anthropic import AnthropicParams + from .aws_bedrock_think_provider import AwsBedrockThinkProviderParams + from .aws_bedrock_think_provider_credentials import AwsBedrockThinkProviderCredentialsParams + from .aws_polly_speak_provider import AwsPollySpeakProviderParams + from .aws_polly_speak_provider_credentials import AwsPollySpeakProviderCredentialsParams + from .billing_breakdown_v1response import BillingBreakdownV1ResponseParams + from .billing_breakdown_v1response_resolution import BillingBreakdownV1ResponseResolutionParams + from .billing_breakdown_v1response_results_item import BillingBreakdownV1ResponseResultsItemParams + from .billing_breakdown_v1response_results_item_grouping import BillingBreakdownV1ResponseResultsItemGroupingParams + from .cartesia import CartesiaParams + from .cartesia_voice import CartesiaVoiceParams + from .create_agent_configuration_v1response import CreateAgentConfigurationV1ResponseParams + from .create_key_v1request import CreateKeyV1RequestParams + from .create_key_v1response import CreateKeyV1ResponseParams + from .create_project_distribution_credentials_v1response import CreateProjectDistributionCredentialsV1ResponseParams + from .create_project_distribution_credentials_v1response_distribution_credentials import ( + CreateProjectDistributionCredentialsV1ResponseDistributionCredentialsParams, + ) + from .create_project_distribution_credentials_v1response_member import ( + CreateProjectDistributionCredentialsV1ResponseMemberParams, + ) + from .create_project_invite_v1response import CreateProjectInviteV1ResponseParams + from .deepgram import DeepgramParams + from .deepgram_listen_provider_v1 import DeepgramListenProviderV1Params + from .deepgram_listen_provider_v2 import DeepgramListenProviderV2Params + from .deepgram_think_live_provider_v1 import DeepgramThinkLiveProviderV1Params + from .deepgram_think_provider import DeepgramThinkProviderParams + from .delete_project_invite_v1response import DeleteProjectInviteV1ResponseParams + from .delete_project_key_v1response import DeleteProjectKeyV1ResponseParams + from .delete_project_member_v1response import DeleteProjectMemberV1ResponseParams + from .delete_project_v1response import DeleteProjectV1ResponseParams + from .eleven_labs_speak_provider import ElevenLabsSpeakProviderParams + from .error_response import ErrorResponseParams + from .error_response_legacy_error import ErrorResponseLegacyErrorParams + from .error_response_modern_error import ErrorResponseModernErrorParams + from .get_model_v1response import GetModelV1ResponseParams + from .get_model_v1response_batch import GetModelV1ResponseBatchParams + from .get_model_v1response_metadata import GetModelV1ResponseMetadataParams + from .get_model_v1response_metadata_metadata import GetModelV1ResponseMetadataMetadataParams + from .get_project_balance_v1response import GetProjectBalanceV1ResponseParams + from .get_project_distribution_credentials_v1response import GetProjectDistributionCredentialsV1ResponseParams + from .get_project_distribution_credentials_v1response_distribution_credentials import ( + GetProjectDistributionCredentialsV1ResponseDistributionCredentialsParams, + ) + from .get_project_distribution_credentials_v1response_member import ( + GetProjectDistributionCredentialsV1ResponseMemberParams, + ) + from .get_project_key_v1response import GetProjectKeyV1ResponseParams + from .get_project_key_v1response_item import GetProjectKeyV1ResponseItemParams + from .get_project_key_v1response_item_member import GetProjectKeyV1ResponseItemMemberParams + from .get_project_key_v1response_item_member_api_key import GetProjectKeyV1ResponseItemMemberApiKeyParams + from .get_project_request_v1response import GetProjectRequestV1ResponseParams + from .get_project_v1response import GetProjectV1ResponseParams + from .google import GoogleParams + from .grant_v1response import GrantV1ResponseParams + from .groq import GroqParams + from .leave_project_v1response import LeaveProjectV1ResponseParams + from .list_agent_configurations_v1response import ListAgentConfigurationsV1ResponseParams + from .list_agent_variables_v1response import ListAgentVariablesV1ResponseParams + from .list_billing_fields_v1response import ListBillingFieldsV1ResponseParams + from .list_models_v1response import ListModelsV1ResponseParams + from .list_models_v1response_stt_models import ListModelsV1ResponseSttModelsParams + from .list_models_v1response_tts_models import ListModelsV1ResponseTtsModelsParams + from .list_models_v1response_tts_models_metadata import ListModelsV1ResponseTtsModelsMetadataParams + from .list_project_balances_v1response import ListProjectBalancesV1ResponseParams + from .list_project_balances_v1response_balances_item import ListProjectBalancesV1ResponseBalancesItemParams + from .list_project_distribution_credentials_v1response import ListProjectDistributionCredentialsV1ResponseParams + from .list_project_distribution_credentials_v1response_distribution_credentials_item import ( + ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemParams, + ) + from .list_project_distribution_credentials_v1response_distribution_credentials_item_distribution_credentials import ( + ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemDistributionCredentialsParams, + ) + from .list_project_distribution_credentials_v1response_distribution_credentials_item_member import ( + ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemMemberParams, + ) + from .list_project_invites_v1response import ListProjectInvitesV1ResponseParams + from .list_project_invites_v1response_invites_item import ListProjectInvitesV1ResponseInvitesItemParams + from .list_project_keys_v1response import ListProjectKeysV1ResponseParams + from .list_project_keys_v1response_api_keys_item import ListProjectKeysV1ResponseApiKeysItemParams + from .list_project_keys_v1response_api_keys_item_api_key import ListProjectKeysV1ResponseApiKeysItemApiKeyParams + from .list_project_keys_v1response_api_keys_item_member import ListProjectKeysV1ResponseApiKeysItemMemberParams + from .list_project_member_scopes_v1response import ListProjectMemberScopesV1ResponseParams + from .list_project_members_v1response import ListProjectMembersV1ResponseParams + from .list_project_members_v1response_members_item import ListProjectMembersV1ResponseMembersItemParams + from .list_project_purchases_v1response import ListProjectPurchasesV1ResponseParams + from .list_project_purchases_v1response_orders_item import ListProjectPurchasesV1ResponseOrdersItemParams + from .list_project_requests_v1response import ListProjectRequestsV1ResponseParams + from .list_projects_v1response import ListProjectsV1ResponseParams + from .list_projects_v1response_projects_item import ListProjectsV1ResponseProjectsItemParams + from .listen_v1accepted_response import ListenV1AcceptedResponseParams + from .listen_v1language_hint import ListenV1LanguageHintParams + from .listen_v1response import ListenV1ResponseParams + from .listen_v1response_metadata import ListenV1ResponseMetadataParams + from .listen_v1response_metadata_diarize_info import ListenV1ResponseMetadataDiarizeInfoParams + from .listen_v1response_metadata_intents_info import ListenV1ResponseMetadataIntentsInfoParams + from .listen_v1response_metadata_sentiment_info import ListenV1ResponseMetadataSentimentInfoParams + from .listen_v1response_metadata_summary_info import ListenV1ResponseMetadataSummaryInfoParams + from .listen_v1response_metadata_topics_info import ListenV1ResponseMetadataTopicsInfoParams + from .listen_v1response_results import ListenV1ResponseResultsParams + from .listen_v1response_results_channels import ListenV1ResponseResultsChannelsParams + from .listen_v1response_results_channels_item import ListenV1ResponseResultsChannelsItemParams + from .listen_v1response_results_channels_item_alternatives_item import ( + ListenV1ResponseResultsChannelsItemAlternativesItemParams, + ) + from .listen_v1response_results_channels_item_alternatives_item_entities_item import ( + ListenV1ResponseResultsChannelsItemAlternativesItemEntitiesItemParams, + ) + from .listen_v1response_results_channels_item_alternatives_item_paragraphs import ( + ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParams, + ) + from .listen_v1response_results_channels_item_alternatives_item_paragraphs_paragraphs_item import ( + ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParagraphsItemParams, + ) + from .listen_v1response_results_channels_item_alternatives_item_paragraphs_paragraphs_item_sentences_item import ( + ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParagraphsItemSentencesItemParams, + ) + from .listen_v1response_results_channels_item_alternatives_item_summaries_item import ( + ListenV1ResponseResultsChannelsItemAlternativesItemSummariesItemParams, + ) + from .listen_v1response_results_channels_item_alternatives_item_topics_item import ( + ListenV1ResponseResultsChannelsItemAlternativesItemTopicsItemParams, + ) + from .listen_v1response_results_channels_item_alternatives_item_words_item import ( + ListenV1ResponseResultsChannelsItemAlternativesItemWordsItemParams, + ) + from .listen_v1response_results_channels_item_search_item import ListenV1ResponseResultsChannelsItemSearchItemParams + from .listen_v1response_results_channels_item_search_item_hits_item import ( + ListenV1ResponseResultsChannelsItemSearchItemHitsItemParams, + ) + from .listen_v1response_results_summary import ListenV1ResponseResultsSummaryParams + from .listen_v1response_results_utterances import ListenV1ResponseResultsUtterancesParams + from .listen_v1response_results_utterances_item import ListenV1ResponseResultsUtterancesItemParams + from .listen_v1response_results_utterances_item_words_item import ( + ListenV1ResponseResultsUtterancesItemWordsItemParams, + ) + from .listen_v2keyterm import ListenV2KeytermParams + from .listen_v2language_hint import ListenV2LanguageHintParams + from .open_ai_speak_provider import OpenAiSpeakProviderParams + from .open_ai_think_provider import OpenAiThinkProviderParams + from .project_request_response import ProjectRequestResponseParams + from .read_v1request import ReadV1RequestParams + from .read_v1request_text import ReadV1RequestTextParams + from .read_v1request_url import ReadV1RequestUrlParams + from .read_v1response import ReadV1ResponseParams + from .read_v1response_metadata import ReadV1ResponseMetadataParams + from .read_v1response_metadata_metadata import ReadV1ResponseMetadataMetadataParams + from .read_v1response_metadata_metadata_intents_info import ReadV1ResponseMetadataMetadataIntentsInfoParams + from .read_v1response_metadata_metadata_sentiment_info import ReadV1ResponseMetadataMetadataSentimentInfoParams + from .read_v1response_metadata_metadata_summary_info import ReadV1ResponseMetadataMetadataSummaryInfoParams + from .read_v1response_metadata_metadata_topics_info import ReadV1ResponseMetadataMetadataTopicsInfoParams + from .read_v1response_results import ReadV1ResponseResultsParams + from .read_v1response_results_summary import ReadV1ResponseResultsSummaryParams + from .read_v1response_results_summary_results import ReadV1ResponseResultsSummaryResultsParams + from .read_v1response_results_summary_results_summary import ReadV1ResponseResultsSummaryResultsSummaryParams + from .shared_intents import SharedIntentsParams + from .shared_intents_segments_item import SharedIntentsSegmentsItemParams + from .shared_intents_segments_item_intents_item import SharedIntentsSegmentsItemIntentsItemParams + from .shared_sentiments import SharedSentimentsParams + from .shared_sentiments_average import SharedSentimentsAverageParams + from .shared_sentiments_segments_item import SharedSentimentsSegmentsItemParams + from .shared_topics import SharedTopicsParams + from .shared_topics_segments_item import SharedTopicsSegmentsItemParams + from .shared_topics_segments_item_topics_item import SharedTopicsSegmentsItemTopicsItemParams + from .speak_settings_v1 import SpeakSettingsV1Params + from .speak_settings_v1endpoint import SpeakSettingsV1EndpointParams + from .speak_settings_v1provider import ( + SpeakSettingsV1ProviderParams, + SpeakSettingsV1Provider_AwsPollyParams, + SpeakSettingsV1Provider_CartesiaParams, + SpeakSettingsV1Provider_DeepgramParams, + SpeakSettingsV1Provider_ElevenLabsParams, + SpeakSettingsV1Provider_OpenAiParams, + ) + from .speak_v2accepted_response import SpeakV2AcceptedResponseParams + from .think_live_settings_v1 import ThinkLiveSettingsV1Params + from .think_settings_v1 import ThinkSettingsV1Params + from .think_settings_v1context_length import ThinkSettingsV1ContextLengthParams + from .think_settings_v1endpoint import ThinkSettingsV1EndpointParams + from .think_settings_v1functions_item import ThinkSettingsV1FunctionsItemParams + from .think_settings_v1functions_item_endpoint import ThinkSettingsV1FunctionsItemEndpointParams + from .think_settings_v1provider import ( + ThinkSettingsV1ProviderParams, + ThinkSettingsV1Provider_AnthropicParams, + ThinkSettingsV1Provider_AwsBedrockParams, + ThinkSettingsV1Provider_DeepgramParams, + ThinkSettingsV1Provider_GoogleParams, + ThinkSettingsV1Provider_GroqParams, + ThinkSettingsV1Provider_OpenAiParams, + ) + from .update_project_member_scopes_v1response import UpdateProjectMemberScopesV1ResponseParams + from .update_project_v1response import UpdateProjectV1ResponseParams + from .usage_breakdown_v1response import UsageBreakdownV1ResponseParams + from .usage_breakdown_v1response_resolution import UsageBreakdownV1ResponseResolutionParams + from .usage_breakdown_v1response_results_item import UsageBreakdownV1ResponseResultsItemParams + from .usage_breakdown_v1response_results_item_grouping import UsageBreakdownV1ResponseResultsItemGroupingParams + from .usage_fields_v1response import UsageFieldsV1ResponseParams + from .usage_fields_v1response_models_item import UsageFieldsV1ResponseModelsItemParams + from .usage_v1response import UsageV1ResponseParams + from .usage_v1response_resolution import UsageV1ResponseResolutionParams +_dynamic_imports: typing.Dict[str, str] = { + "AgentConfigurationV1Params": ".agent_configuration_v1", + "AgentThinkModelsV1ResponseModelsItemIdParams": ".agent_think_models_v1response_models_item_id", + "AgentThinkModelsV1ResponseModelsItemOneParams": ".agent_think_models_v1response_models_item_one", + "AgentThinkModelsV1ResponseModelsItemParams": ".agent_think_models_v1response_models_item", + "AgentThinkModelsV1ResponseModelsItemThreeParams": ".agent_think_models_v1response_models_item_three", + "AgentThinkModelsV1ResponseModelsItemTwoParams": ".agent_think_models_v1response_models_item_two", + "AgentThinkModelsV1ResponseModelsItemZeroParams": ".agent_think_models_v1response_models_item_zero", + "AgentThinkModelsV1ResponseParams": ".agent_think_models_v1response", + "AgentVariableV1Params": ".agent_variable_v1", + "AnthropicParams": ".anthropic", + "AwsBedrockThinkProviderCredentialsParams": ".aws_bedrock_think_provider_credentials", + "AwsBedrockThinkProviderParams": ".aws_bedrock_think_provider", + "AwsPollySpeakProviderCredentialsParams": ".aws_polly_speak_provider_credentials", + "AwsPollySpeakProviderParams": ".aws_polly_speak_provider", + "BillingBreakdownV1ResponseParams": ".billing_breakdown_v1response", + "BillingBreakdownV1ResponseResolutionParams": ".billing_breakdown_v1response_resolution", + "BillingBreakdownV1ResponseResultsItemGroupingParams": ".billing_breakdown_v1response_results_item_grouping", + "BillingBreakdownV1ResponseResultsItemParams": ".billing_breakdown_v1response_results_item", + "CartesiaParams": ".cartesia", + "CartesiaVoiceParams": ".cartesia_voice", + "CreateAgentConfigurationV1ResponseParams": ".create_agent_configuration_v1response", + "CreateKeyV1RequestParams": ".create_key_v1request", + "CreateKeyV1ResponseParams": ".create_key_v1response", + "CreateProjectDistributionCredentialsV1ResponseDistributionCredentialsParams": ".create_project_distribution_credentials_v1response_distribution_credentials", + "CreateProjectDistributionCredentialsV1ResponseMemberParams": ".create_project_distribution_credentials_v1response_member", + "CreateProjectDistributionCredentialsV1ResponseParams": ".create_project_distribution_credentials_v1response", + "CreateProjectInviteV1ResponseParams": ".create_project_invite_v1response", + "DeepgramListenProviderV1Params": ".deepgram_listen_provider_v1", + "DeepgramListenProviderV2Params": ".deepgram_listen_provider_v2", + "DeepgramParams": ".deepgram", + "DeepgramThinkLiveProviderV1Params": ".deepgram_think_live_provider_v1", + "DeepgramThinkProviderParams": ".deepgram_think_provider", + "DeleteProjectInviteV1ResponseParams": ".delete_project_invite_v1response", + "DeleteProjectKeyV1ResponseParams": ".delete_project_key_v1response", + "DeleteProjectMemberV1ResponseParams": ".delete_project_member_v1response", + "DeleteProjectV1ResponseParams": ".delete_project_v1response", + "ElevenLabsSpeakProviderParams": ".eleven_labs_speak_provider", + "ErrorResponseLegacyErrorParams": ".error_response_legacy_error", + "ErrorResponseModernErrorParams": ".error_response_modern_error", + "ErrorResponseParams": ".error_response", + "GetModelV1ResponseBatchParams": ".get_model_v1response_batch", + "GetModelV1ResponseMetadataMetadataParams": ".get_model_v1response_metadata_metadata", + "GetModelV1ResponseMetadataParams": ".get_model_v1response_metadata", + "GetModelV1ResponseParams": ".get_model_v1response", + "GetProjectBalanceV1ResponseParams": ".get_project_balance_v1response", + "GetProjectDistributionCredentialsV1ResponseDistributionCredentialsParams": ".get_project_distribution_credentials_v1response_distribution_credentials", + "GetProjectDistributionCredentialsV1ResponseMemberParams": ".get_project_distribution_credentials_v1response_member", + "GetProjectDistributionCredentialsV1ResponseParams": ".get_project_distribution_credentials_v1response", + "GetProjectKeyV1ResponseItemMemberApiKeyParams": ".get_project_key_v1response_item_member_api_key", + "GetProjectKeyV1ResponseItemMemberParams": ".get_project_key_v1response_item_member", + "GetProjectKeyV1ResponseItemParams": ".get_project_key_v1response_item", + "GetProjectKeyV1ResponseParams": ".get_project_key_v1response", + "GetProjectRequestV1ResponseParams": ".get_project_request_v1response", + "GetProjectV1ResponseParams": ".get_project_v1response", + "GoogleParams": ".google", + "GrantV1ResponseParams": ".grant_v1response", + "GroqParams": ".groq", + "LeaveProjectV1ResponseParams": ".leave_project_v1response", + "ListAgentConfigurationsV1ResponseParams": ".list_agent_configurations_v1response", + "ListAgentVariablesV1ResponseParams": ".list_agent_variables_v1response", + "ListBillingFieldsV1ResponseParams": ".list_billing_fields_v1response", + "ListModelsV1ResponseParams": ".list_models_v1response", + "ListModelsV1ResponseSttModelsParams": ".list_models_v1response_stt_models", + "ListModelsV1ResponseTtsModelsMetadataParams": ".list_models_v1response_tts_models_metadata", + "ListModelsV1ResponseTtsModelsParams": ".list_models_v1response_tts_models", + "ListProjectBalancesV1ResponseBalancesItemParams": ".list_project_balances_v1response_balances_item", + "ListProjectBalancesV1ResponseParams": ".list_project_balances_v1response", + "ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemDistributionCredentialsParams": ".list_project_distribution_credentials_v1response_distribution_credentials_item_distribution_credentials", + "ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemMemberParams": ".list_project_distribution_credentials_v1response_distribution_credentials_item_member", + "ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemParams": ".list_project_distribution_credentials_v1response_distribution_credentials_item", + "ListProjectDistributionCredentialsV1ResponseParams": ".list_project_distribution_credentials_v1response", + "ListProjectInvitesV1ResponseInvitesItemParams": ".list_project_invites_v1response_invites_item", + "ListProjectInvitesV1ResponseParams": ".list_project_invites_v1response", + "ListProjectKeysV1ResponseApiKeysItemApiKeyParams": ".list_project_keys_v1response_api_keys_item_api_key", + "ListProjectKeysV1ResponseApiKeysItemMemberParams": ".list_project_keys_v1response_api_keys_item_member", + "ListProjectKeysV1ResponseApiKeysItemParams": ".list_project_keys_v1response_api_keys_item", + "ListProjectKeysV1ResponseParams": ".list_project_keys_v1response", + "ListProjectMemberScopesV1ResponseParams": ".list_project_member_scopes_v1response", + "ListProjectMembersV1ResponseMembersItemParams": ".list_project_members_v1response_members_item", + "ListProjectMembersV1ResponseParams": ".list_project_members_v1response", + "ListProjectPurchasesV1ResponseOrdersItemParams": ".list_project_purchases_v1response_orders_item", + "ListProjectPurchasesV1ResponseParams": ".list_project_purchases_v1response", + "ListProjectRequestsV1ResponseParams": ".list_project_requests_v1response", + "ListProjectsV1ResponseParams": ".list_projects_v1response", + "ListProjectsV1ResponseProjectsItemParams": ".list_projects_v1response_projects_item", + "ListenV1AcceptedResponseParams": ".listen_v1accepted_response", + "ListenV1LanguageHintParams": ".listen_v1language_hint", + "ListenV1ResponseMetadataDiarizeInfoParams": ".listen_v1response_metadata_diarize_info", + "ListenV1ResponseMetadataIntentsInfoParams": ".listen_v1response_metadata_intents_info", + "ListenV1ResponseMetadataParams": ".listen_v1response_metadata", + "ListenV1ResponseMetadataSentimentInfoParams": ".listen_v1response_metadata_sentiment_info", + "ListenV1ResponseMetadataSummaryInfoParams": ".listen_v1response_metadata_summary_info", + "ListenV1ResponseMetadataTopicsInfoParams": ".listen_v1response_metadata_topics_info", + "ListenV1ResponseParams": ".listen_v1response", + "ListenV1ResponseResultsChannelsItemAlternativesItemEntitiesItemParams": ".listen_v1response_results_channels_item_alternatives_item_entities_item", + "ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParagraphsItemParams": ".listen_v1response_results_channels_item_alternatives_item_paragraphs_paragraphs_item", + "ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParagraphsItemSentencesItemParams": ".listen_v1response_results_channels_item_alternatives_item_paragraphs_paragraphs_item_sentences_item", + "ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParams": ".listen_v1response_results_channels_item_alternatives_item_paragraphs", + "ListenV1ResponseResultsChannelsItemAlternativesItemParams": ".listen_v1response_results_channels_item_alternatives_item", + "ListenV1ResponseResultsChannelsItemAlternativesItemSummariesItemParams": ".listen_v1response_results_channels_item_alternatives_item_summaries_item", + "ListenV1ResponseResultsChannelsItemAlternativesItemTopicsItemParams": ".listen_v1response_results_channels_item_alternatives_item_topics_item", + "ListenV1ResponseResultsChannelsItemAlternativesItemWordsItemParams": ".listen_v1response_results_channels_item_alternatives_item_words_item", + "ListenV1ResponseResultsChannelsItemParams": ".listen_v1response_results_channels_item", + "ListenV1ResponseResultsChannelsItemSearchItemHitsItemParams": ".listen_v1response_results_channels_item_search_item_hits_item", + "ListenV1ResponseResultsChannelsItemSearchItemParams": ".listen_v1response_results_channels_item_search_item", + "ListenV1ResponseResultsChannelsParams": ".listen_v1response_results_channels", + "ListenV1ResponseResultsParams": ".listen_v1response_results", + "ListenV1ResponseResultsSummaryParams": ".listen_v1response_results_summary", + "ListenV1ResponseResultsUtterancesItemParams": ".listen_v1response_results_utterances_item", + "ListenV1ResponseResultsUtterancesItemWordsItemParams": ".listen_v1response_results_utterances_item_words_item", + "ListenV1ResponseResultsUtterancesParams": ".listen_v1response_results_utterances", + "ListenV2KeytermParams": ".listen_v2keyterm", + "ListenV2LanguageHintParams": ".listen_v2language_hint", + "OpenAiSpeakProviderParams": ".open_ai_speak_provider", + "OpenAiThinkProviderParams": ".open_ai_think_provider", + "ProjectRequestResponseParams": ".project_request_response", + "ReadV1RequestParams": ".read_v1request", + "ReadV1RequestTextParams": ".read_v1request_text", + "ReadV1RequestUrlParams": ".read_v1request_url", + "ReadV1ResponseMetadataMetadataIntentsInfoParams": ".read_v1response_metadata_metadata_intents_info", + "ReadV1ResponseMetadataMetadataParams": ".read_v1response_metadata_metadata", + "ReadV1ResponseMetadataMetadataSentimentInfoParams": ".read_v1response_metadata_metadata_sentiment_info", + "ReadV1ResponseMetadataMetadataSummaryInfoParams": ".read_v1response_metadata_metadata_summary_info", + "ReadV1ResponseMetadataMetadataTopicsInfoParams": ".read_v1response_metadata_metadata_topics_info", + "ReadV1ResponseMetadataParams": ".read_v1response_metadata", + "ReadV1ResponseParams": ".read_v1response", + "ReadV1ResponseResultsParams": ".read_v1response_results", + "ReadV1ResponseResultsSummaryParams": ".read_v1response_results_summary", + "ReadV1ResponseResultsSummaryResultsParams": ".read_v1response_results_summary_results", + "ReadV1ResponseResultsSummaryResultsSummaryParams": ".read_v1response_results_summary_results_summary", + "SharedIntentsParams": ".shared_intents", + "SharedIntentsSegmentsItemIntentsItemParams": ".shared_intents_segments_item_intents_item", + "SharedIntentsSegmentsItemParams": ".shared_intents_segments_item", + "SharedSentimentsAverageParams": ".shared_sentiments_average", + "SharedSentimentsParams": ".shared_sentiments", + "SharedSentimentsSegmentsItemParams": ".shared_sentiments_segments_item", + "SharedTopicsParams": ".shared_topics", + "SharedTopicsSegmentsItemParams": ".shared_topics_segments_item", + "SharedTopicsSegmentsItemTopicsItemParams": ".shared_topics_segments_item_topics_item", + "SpeakSettingsV1EndpointParams": ".speak_settings_v1endpoint", + "SpeakSettingsV1Params": ".speak_settings_v1", + "SpeakSettingsV1ProviderParams": ".speak_settings_v1provider", + "SpeakSettingsV1Provider_AwsPollyParams": ".speak_settings_v1provider", + "SpeakSettingsV1Provider_CartesiaParams": ".speak_settings_v1provider", + "SpeakSettingsV1Provider_DeepgramParams": ".speak_settings_v1provider", + "SpeakSettingsV1Provider_ElevenLabsParams": ".speak_settings_v1provider", + "SpeakSettingsV1Provider_OpenAiParams": ".speak_settings_v1provider", + "SpeakV2AcceptedResponseParams": ".speak_v2accepted_response", + "ThinkLiveSettingsV1Params": ".think_live_settings_v1", + "ThinkSettingsV1ContextLengthParams": ".think_settings_v1context_length", + "ThinkSettingsV1EndpointParams": ".think_settings_v1endpoint", + "ThinkSettingsV1FunctionsItemEndpointParams": ".think_settings_v1functions_item_endpoint", + "ThinkSettingsV1FunctionsItemParams": ".think_settings_v1functions_item", + "ThinkSettingsV1Params": ".think_settings_v1", + "ThinkSettingsV1ProviderParams": ".think_settings_v1provider", + "ThinkSettingsV1Provider_AnthropicParams": ".think_settings_v1provider", + "ThinkSettingsV1Provider_AwsBedrockParams": ".think_settings_v1provider", + "ThinkSettingsV1Provider_DeepgramParams": ".think_settings_v1provider", + "ThinkSettingsV1Provider_GoogleParams": ".think_settings_v1provider", + "ThinkSettingsV1Provider_GroqParams": ".think_settings_v1provider", + "ThinkSettingsV1Provider_OpenAiParams": ".think_settings_v1provider", + "UpdateProjectMemberScopesV1ResponseParams": ".update_project_member_scopes_v1response", + "UpdateProjectV1ResponseParams": ".update_project_v1response", + "UsageBreakdownV1ResponseParams": ".usage_breakdown_v1response", + "UsageBreakdownV1ResponseResolutionParams": ".usage_breakdown_v1response_resolution", + "UsageBreakdownV1ResponseResultsItemGroupingParams": ".usage_breakdown_v1response_results_item_grouping", + "UsageBreakdownV1ResponseResultsItemParams": ".usage_breakdown_v1response_results_item", + "UsageFieldsV1ResponseModelsItemParams": ".usage_fields_v1response_models_item", + "UsageFieldsV1ResponseParams": ".usage_fields_v1response", + "UsageV1ResponseParams": ".usage_v1response", + "UsageV1ResponseResolutionParams": ".usage_v1response_resolution", +} + +_dynamic_imports.update( + { + "SharedIntentsResultsParams": ".shared_intents_results", + "SharedIntentsResultsIntentsParams": ".shared_intents_results_intents", + "SharedIntentsResultsIntentsSegmentsItemParams": ".shared_intents_results_intents_segments_item", + "SharedIntentsResultsIntentsSegmentsItemIntentsItemParams": ".shared_intents_results_intents_segments_item_intents_item", + "SharedTopicsResultsParams": ".shared_topics_results", + "SharedTopicsResultsTopicsParams": ".shared_topics_results_topics", + "SharedTopicsResultsTopicsSegmentsItemParams": ".shared_topics_results_topics_segments_item", + "SharedTopicsResultsTopicsSegmentsItemTopicsItemParams": ".shared_topics_results_topics_segments_item_topics_item", + "CartesiaSpeakProviderVoiceParams": ".cartesia_speak_provider_voice", + "CreateKeyV1RequestOneParams": ".create_key_v1request_one", + "DeepgramListenProviderV2LanguageHintParams": ".deepgram_listen_provider_v2language_hint", + } +) + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = [ + "AgentConfigurationV1Params", + "AgentThinkModelsV1ResponseModelsItemIdParams", + "AgentThinkModelsV1ResponseModelsItemOneParams", + "AgentThinkModelsV1ResponseModelsItemParams", + "AgentThinkModelsV1ResponseModelsItemThreeParams", + "AgentThinkModelsV1ResponseModelsItemTwoParams", + "AgentThinkModelsV1ResponseModelsItemZeroParams", + "AgentThinkModelsV1ResponseParams", + "AgentVariableV1Params", + "AnthropicParams", + "AwsBedrockThinkProviderCredentialsParams", + "AwsBedrockThinkProviderParams", + "AwsPollySpeakProviderCredentialsParams", + "AwsPollySpeakProviderParams", + "BillingBreakdownV1ResponseParams", + "BillingBreakdownV1ResponseResolutionParams", + "BillingBreakdownV1ResponseResultsItemGroupingParams", + "BillingBreakdownV1ResponseResultsItemParams", + "CartesiaParams", + "CartesiaVoiceParams", + "CreateAgentConfigurationV1ResponseParams", + "CreateKeyV1RequestParams", + "CreateKeyV1ResponseParams", + "CreateProjectDistributionCredentialsV1ResponseDistributionCredentialsParams", + "CreateProjectDistributionCredentialsV1ResponseMemberParams", + "CreateProjectDistributionCredentialsV1ResponseParams", + "CreateProjectInviteV1ResponseParams", + "DeepgramListenProviderV1Params", + "DeepgramListenProviderV2Params", + "DeepgramParams", + "DeepgramThinkLiveProviderV1Params", + "DeepgramThinkProviderParams", + "DeleteProjectInviteV1ResponseParams", + "DeleteProjectKeyV1ResponseParams", + "DeleteProjectMemberV1ResponseParams", + "DeleteProjectV1ResponseParams", + "ElevenLabsSpeakProviderParams", + "ErrorResponseLegacyErrorParams", + "ErrorResponseModernErrorParams", + "ErrorResponseParams", + "GetModelV1ResponseBatchParams", + "GetModelV1ResponseMetadataMetadataParams", + "GetModelV1ResponseMetadataParams", + "GetModelV1ResponseParams", + "GetProjectBalanceV1ResponseParams", + "GetProjectDistributionCredentialsV1ResponseDistributionCredentialsParams", + "GetProjectDistributionCredentialsV1ResponseMemberParams", + "GetProjectDistributionCredentialsV1ResponseParams", + "GetProjectKeyV1ResponseItemMemberApiKeyParams", + "GetProjectKeyV1ResponseItemMemberParams", + "GetProjectKeyV1ResponseItemParams", + "GetProjectKeyV1ResponseParams", + "GetProjectRequestV1ResponseParams", + "GetProjectV1ResponseParams", + "GoogleParams", + "GrantV1ResponseParams", + "GroqParams", + "LeaveProjectV1ResponseParams", + "ListAgentConfigurationsV1ResponseParams", + "ListAgentVariablesV1ResponseParams", + "ListBillingFieldsV1ResponseParams", + "ListModelsV1ResponseParams", + "ListModelsV1ResponseSttModelsParams", + "ListModelsV1ResponseTtsModelsMetadataParams", + "ListModelsV1ResponseTtsModelsParams", + "ListProjectBalancesV1ResponseBalancesItemParams", + "ListProjectBalancesV1ResponseParams", + "ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemDistributionCredentialsParams", + "ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemMemberParams", + "ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemParams", + "ListProjectDistributionCredentialsV1ResponseParams", + "ListProjectInvitesV1ResponseInvitesItemParams", + "ListProjectInvitesV1ResponseParams", + "ListProjectKeysV1ResponseApiKeysItemApiKeyParams", + "ListProjectKeysV1ResponseApiKeysItemMemberParams", + "ListProjectKeysV1ResponseApiKeysItemParams", + "ListProjectKeysV1ResponseParams", + "ListProjectMemberScopesV1ResponseParams", + "ListProjectMembersV1ResponseMembersItemParams", + "ListProjectMembersV1ResponseParams", + "ListProjectPurchasesV1ResponseOrdersItemParams", + "ListProjectPurchasesV1ResponseParams", + "ListProjectRequestsV1ResponseParams", + "ListProjectsV1ResponseParams", + "ListProjectsV1ResponseProjectsItemParams", + "ListenV1AcceptedResponseParams", + "ListenV1LanguageHintParams", + "ListenV1ResponseMetadataDiarizeInfoParams", + "ListenV1ResponseMetadataIntentsInfoParams", + "ListenV1ResponseMetadataParams", + "ListenV1ResponseMetadataSentimentInfoParams", + "ListenV1ResponseMetadataSummaryInfoParams", + "ListenV1ResponseMetadataTopicsInfoParams", + "ListenV1ResponseParams", + "ListenV1ResponseResultsChannelsItemAlternativesItemEntitiesItemParams", + "ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParagraphsItemParams", + "ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParagraphsItemSentencesItemParams", + "ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParams", + "ListenV1ResponseResultsChannelsItemAlternativesItemParams", + "ListenV1ResponseResultsChannelsItemAlternativesItemSummariesItemParams", + "ListenV1ResponseResultsChannelsItemAlternativesItemTopicsItemParams", + "ListenV1ResponseResultsChannelsItemAlternativesItemWordsItemParams", + "ListenV1ResponseResultsChannelsItemParams", + "ListenV1ResponseResultsChannelsItemSearchItemHitsItemParams", + "ListenV1ResponseResultsChannelsItemSearchItemParams", + "ListenV1ResponseResultsChannelsParams", + "ListenV1ResponseResultsParams", + "ListenV1ResponseResultsSummaryParams", + "ListenV1ResponseResultsUtterancesItemParams", + "ListenV1ResponseResultsUtterancesItemWordsItemParams", + "ListenV1ResponseResultsUtterancesParams", + "ListenV2KeytermParams", + "ListenV2LanguageHintParams", + "OpenAiSpeakProviderParams", + "OpenAiThinkProviderParams", + "ProjectRequestResponseParams", + "ReadV1RequestParams", + "ReadV1RequestTextParams", + "ReadV1RequestUrlParams", + "ReadV1ResponseMetadataMetadataIntentsInfoParams", + "ReadV1ResponseMetadataMetadataParams", + "ReadV1ResponseMetadataMetadataSentimentInfoParams", + "ReadV1ResponseMetadataMetadataSummaryInfoParams", + "ReadV1ResponseMetadataMetadataTopicsInfoParams", + "ReadV1ResponseMetadataParams", + "ReadV1ResponseParams", + "ReadV1ResponseResultsParams", + "ReadV1ResponseResultsSummaryParams", + "ReadV1ResponseResultsSummaryResultsParams", + "ReadV1ResponseResultsSummaryResultsSummaryParams", + "SharedIntentsParams", + "SharedIntentsSegmentsItemIntentsItemParams", + "SharedIntentsSegmentsItemParams", + "SharedSentimentsAverageParams", + "SharedSentimentsParams", + "SharedSentimentsSegmentsItemParams", + "SharedTopicsParams", + "SharedTopicsSegmentsItemParams", + "SharedTopicsSegmentsItemTopicsItemParams", + "SpeakSettingsV1EndpointParams", + "SpeakSettingsV1Params", + "SpeakSettingsV1ProviderParams", + "SpeakSettingsV1Provider_AwsPollyParams", + "SpeakSettingsV1Provider_CartesiaParams", + "SpeakSettingsV1Provider_DeepgramParams", + "SpeakSettingsV1Provider_ElevenLabsParams", + "SpeakSettingsV1Provider_OpenAiParams", + "SpeakV2AcceptedResponseParams", + "ThinkLiveSettingsV1Params", + "ThinkSettingsV1ContextLengthParams", + "ThinkSettingsV1EndpointParams", + "ThinkSettingsV1FunctionsItemEndpointParams", + "ThinkSettingsV1FunctionsItemParams", + "ThinkSettingsV1Params", + "ThinkSettingsV1ProviderParams", + "ThinkSettingsV1Provider_AnthropicParams", + "ThinkSettingsV1Provider_AwsBedrockParams", + "ThinkSettingsV1Provider_DeepgramParams", + "ThinkSettingsV1Provider_GoogleParams", + "ThinkSettingsV1Provider_GroqParams", + "ThinkSettingsV1Provider_OpenAiParams", + "UpdateProjectMemberScopesV1ResponseParams", + "UpdateProjectV1ResponseParams", + "UsageBreakdownV1ResponseParams", + "UsageBreakdownV1ResponseResolutionParams", + "UsageBreakdownV1ResponseResultsItemGroupingParams", + "UsageBreakdownV1ResponseResultsItemParams", + "UsageFieldsV1ResponseModelsItemParams", + "UsageFieldsV1ResponseParams", + "UsageV1ResponseParams", + "UsageV1ResponseResolutionParams", +] + +__all__.extend( + [ + "SharedIntentsResultsParams", + "SharedIntentsResultsIntentsParams", + "SharedIntentsResultsIntentsSegmentsItemParams", + "SharedIntentsResultsIntentsSegmentsItemIntentsItemParams", + "SharedTopicsResultsParams", + "SharedTopicsResultsTopicsParams", + "SharedTopicsResultsTopicsSegmentsItemParams", + "SharedTopicsResultsTopicsSegmentsItemTopicsItemParams", + "CartesiaSpeakProviderVoiceParams", + "CreateKeyV1RequestOneParams", + "DeepgramListenProviderV2LanguageHintParams", + ] +) diff --git a/src/deepgram/requests/shared_intents.py.bak b/src/deepgram/requests/shared_intents.py.bak new file mode 100644 index 00000000..8f699d26 --- /dev/null +++ b/src/deepgram/requests/shared_intents.py.bak @@ -0,0 +1,16 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import typing_extensions +from .shared_intents_results import SharedIntentsResultsParams +from .shared_intents_segments_item import SharedIntentsSegmentsItemParams + + +class SharedIntentsParams(typing_extensions.TypedDict): + """ + Output whenever `intents=true` is used + """ + + segments: typing_extensions.NotRequired[typing.Sequence[SharedIntentsSegmentsItemParams]] + results: typing_extensions.NotRequired[SharedIntentsResultsParams] diff --git a/src/deepgram/requests/shared_topics.py.bak b/src/deepgram/requests/shared_topics.py.bak new file mode 100644 index 00000000..88c0816d --- /dev/null +++ b/src/deepgram/requests/shared_topics.py.bak @@ -0,0 +1,16 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import typing_extensions +from .shared_topics_results import SharedTopicsResultsParams +from .shared_topics_segments_item import SharedTopicsSegmentsItemParams + + +class SharedTopicsParams(typing_extensions.TypedDict): + """ + Output whenever `topics=true` is used + """ + + segments: typing_extensions.NotRequired[typing.Sequence[SharedTopicsSegmentsItemParams]] + results: typing_extensions.NotRequired[SharedTopicsResultsParams] diff --git a/src/deepgram/speak/v1/socket_client.py.bak b/src/deepgram/speak/v1/socket_client.py.bak new file mode 100644 index 00000000..f268acb4 --- /dev/null +++ b/src/deepgram/speak/v1/socket_client.py.bak @@ -0,0 +1,237 @@ +# This file was auto-generated by Fern from our API Definition. + +import json +import logging +import typing + +import websockets.sync.connection as websockets_sync_connection +from ...core.events import EventEmitterMixin, EventType +from ...core.unchecked_base_model import construct_type +from .types.speak_v1clear import SpeakV1Clear +from .types.speak_v1cleared import SpeakV1Cleared +from .types.speak_v1close import SpeakV1Close +from .types.speak_v1flush import SpeakV1Flush +from .types.speak_v1flushed import SpeakV1Flushed +from .types.speak_v1metadata import SpeakV1Metadata +from .types.speak_v1text import SpeakV1Text +from .types.speak_v1warning import SpeakV1Warning + +try: + from websockets.legacy.client import WebSocketClientProtocol # type: ignore +except ImportError: + from websockets import WebSocketClientProtocol # type: ignore + +_logger = logging.getLogger(__name__) +V1SocketClientResponse = typing.Union[ + bytes, SpeakV1Metadata, SpeakV1Flushed, SpeakV1Cleared, SpeakV1Warning, typing.Dict[str, typing.Any] +] + + +class AsyncV1SocketClient(EventEmitterMixin): + def __init__(self, *, websocket: WebSocketClientProtocol): + super().__init__() + self._websocket = websocket + + async def __aiter__(self) -> typing.AsyncIterator[V1SocketClientResponse]: + async for message in self._websocket: + if isinstance(message, bytes): + yield message # type: ignore + else: + try: + yield construct_type(type_=V1SocketClientResponse, object_=json.loads(message)) # type: ignore + except Exception: + _logger.warning( + "Skipping unknown WebSocket message; update your SDK version to support new message types." + ) + continue + + async def start_listening(self): + """ + Start listening for messages on the websocket connection. + + Emits events in the following order: + - EventType.OPEN when connection is established + - EventType.MESSAGE for each message received + - EventType.ERROR if an error occurs + - EventType.CLOSE when connection is closed + """ + await self._emit_async(EventType.OPEN, None) + try: + async for raw_message in self._websocket: + if isinstance(raw_message, bytes): + parsed = raw_message + else: + json_data = json.loads(raw_message) + try: + parsed = construct_type(type_=V1SocketClientResponse, object_=json_data) # type: ignore + except Exception: + _logger.warning( + "Skipping unknown WebSocket message; update your SDK version to support new message types." + ) + continue + await self._emit_async(EventType.MESSAGE, parsed) + except Exception as exc: + await self._emit_async(EventType.ERROR, exc) + finally: + await self._emit_async(EventType.CLOSE, None) + + async def send_text(self, message: SpeakV1Text) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a SpeakV1Text. + """ + await self._send_model(message) + + async def send_flush(self, message: typing.Optional[SpeakV1Flush] = None) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a SpeakV1Flush. + """ + await self._send_model(message or SpeakV1Flush(type="Flush")) + + async def send_clear(self, message: typing.Optional[SpeakV1Clear] = None) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a SpeakV1Clear. + """ + await self._send_model(message or SpeakV1Clear(type="Clear")) + + async def send_close(self, message: typing.Optional[SpeakV1Close] = None) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a SpeakV1Close. + """ + await self._send_model(message or SpeakV1Close(type="Close")) + + async def recv(self) -> V1SocketClientResponse: + """ + Receive a message from the websocket connection. + """ + data = await self._websocket.recv() + if isinstance(data, bytes): + return data # type: ignore + json_data = json.loads(data) + try: + return construct_type(type_=V1SocketClientResponse, object_=json_data) # type: ignore + except Exception: + _logger.warning("Skipping unknown WebSocket message; update your SDK version to support new message types.") + return json_data # type: ignore + + async def _send(self, data: typing.Any) -> None: + """ + Send a message to the websocket connection. + """ + if isinstance(data, dict): + data = json.dumps(data) + await self._websocket.send(data) + + async def _send_model(self, data: typing.Any) -> None: + """ + Send a Pydantic model to the websocket connection. + """ + await self._send(data.dict()) + + +class V1SocketClient(EventEmitterMixin): + def __init__(self, *, websocket: websockets_sync_connection.Connection): + super().__init__() + self._websocket = websocket + + def __iter__(self) -> typing.Iterator[V1SocketClientResponse]: + for message in self._websocket: + if isinstance(message, bytes): + yield message # type: ignore + else: + try: + yield construct_type(type_=V1SocketClientResponse, object_=json.loads(message)) # type: ignore + except Exception: + _logger.warning( + "Skipping unknown WebSocket message; update your SDK version to support new message types." + ) + continue + + def start_listening(self): + """ + Start listening for messages on the websocket connection. + + Emits events in the following order: + - EventType.OPEN when connection is established + - EventType.MESSAGE for each message received + - EventType.ERROR if an error occurs + - EventType.CLOSE when connection is closed + """ + self._emit(EventType.OPEN, None) + try: + for raw_message in self._websocket: + if isinstance(raw_message, bytes): + parsed = raw_message + else: + json_data = json.loads(raw_message) + try: + parsed = construct_type(type_=V1SocketClientResponse, object_=json_data) # type: ignore + except Exception: + _logger.warning( + "Skipping unknown WebSocket message; update your SDK version to support new message types." + ) + continue + self._emit(EventType.MESSAGE, parsed) + except Exception as exc: + self._emit(EventType.ERROR, exc) + finally: + self._emit(EventType.CLOSE, None) + + def send_text(self, message: SpeakV1Text) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a SpeakV1Text. + """ + self._send_model(message) + + def send_flush(self, message: typing.Optional[SpeakV1Flush] = None) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a SpeakV1Flush. + """ + self._send_model(message or SpeakV1Flush(type="Flush")) + + def send_clear(self, message: typing.Optional[SpeakV1Clear] = None) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a SpeakV1Clear. + """ + self._send_model(message or SpeakV1Clear(type="Clear")) + + def send_close(self, message: typing.Optional[SpeakV1Close] = None) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a SpeakV1Close. + """ + self._send_model(message or SpeakV1Close(type="Close")) + + def recv(self) -> V1SocketClientResponse: + """ + Receive a message from the websocket connection. + """ + data = self._websocket.recv() + if isinstance(data, bytes): + return data # type: ignore + json_data = json.loads(data) + try: + return construct_type(type_=V1SocketClientResponse, object_=json_data) # type: ignore + except Exception: + _logger.warning("Skipping unknown WebSocket message; update your SDK version to support new message types.") + return json_data # type: ignore + + def _send(self, data: typing.Any) -> None: + """ + Send a message to the websocket connection. + """ + if isinstance(data, dict): + data = json.dumps(data) + self._websocket.send(data) + + def _send_model(self, data: typing.Any) -> None: + """ + Send a Pydantic model to the websocket connection. + """ + self._send(data.dict()) diff --git a/src/deepgram/speak/v2/requests/speak_v2warning.py.bak b/src/deepgram/speak/v2/requests/speak_v2warning.py.bak new file mode 100644 index 00000000..6686af44 --- /dev/null +++ b/src/deepgram/speak/v2/requests/speak_v2warning.py.bak @@ -0,0 +1,30 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import typing_extensions + + +class SpeakV2WarningParams(typing_extensions.TypedDict): + type: typing.Literal["Warning"] + """ + Message type identifier + """ + + code: str + """ + Warning code identifying the condition, in `SCREAMING_SNAKE_CASE`. + + Turn-scoped codes: `NO_ACTIVE_SPEECH` (a speech-scoped message arrived with no active turn), `NO_SYNTHESIZABLE_TEXT` (the turn's text was entirely whitespace or punctuation, so it produced no audio and is completed with a zero-duration `SpeechMetadata`), and `SYNTHESIS_RETRYING` (a synthesis request failed and is being retried). + + Pronunciation codes: `PRONUNCIATION_WARNINGS` (a pronunciation override contained invalid IPA; it is still applied best-effort and counted in `pronunciations_applied`), `PRONUNCIATION_TOO_LONG` (an IPA string exceeded the length limit), `PRONUNCIATIONS_LIMIT_EXCEEDED` (too many pronunciation controls in one turn). + + Pause codes (`BREAKS_LIMIT_EXCEEDED`, `BREAK_TOKENS_OUT_OF_RANGE`, `BREAK_TOKENS_WITH_INVALID_INCREMENTS`) are reserved and not emitted: inline pause controls are batch-only, and a pause marker on the WebSocket fails the connection instead. + + Interrupt-scoped codes, each meaning the `Interrupt` was ignored: `NO_AUDIO_GENERATED` (the session has produced no audio yet, so there is nothing to interrupt), `INTERRUPT_IN_PROGRESS` (an earlier `Interrupt` is still being processed — at most one is handled at a time), `INVALID_INTERRUPT_OFFSET` (the `playback_offset` did not advance past the position a prior interrupt established). + """ + + description: str + """ + A human-readable description of the warning + """ diff --git a/src/deepgram/speak/v2/socket_client.py.bak b/src/deepgram/speak/v2/socket_client.py.bak new file mode 100644 index 00000000..57c5f8ab --- /dev/null +++ b/src/deepgram/speak/v2/socket_client.py.bak @@ -0,0 +1,269 @@ +# This file was auto-generated by Fern from our API Definition. + +import json +import logging +import typing + +import websockets.sync.connection as websockets_sync_connection +from ...core.events import EventEmitterMixin, EventType +from ...core.unchecked_base_model import construct_type +from .types.speak_v2close import SpeakV2Close +from .types.speak_v2configure import SpeakV2Configure +from .types.speak_v2configure_failure import SpeakV2ConfigureFailure +from .types.speak_v2configure_success import SpeakV2ConfigureSuccess +from .types.speak_v2connected import SpeakV2Connected +from .types.speak_v2error import SpeakV2Error +from .types.speak_v2flush import SpeakV2Flush +from .types.speak_v2flushed import SpeakV2Flushed +from .types.speak_v2interrupt import SpeakV2Interrupt +from .types.speak_v2session_metadata import SpeakV2SessionMetadata +from .types.speak_v2speak import SpeakV2Speak +from .types.speak_v2speech_interrupted import SpeakV2SpeechInterrupted +from .types.speak_v2speech_metadata import SpeakV2SpeechMetadata +from .types.speak_v2speech_started import SpeakV2SpeechStarted +from .types.speak_v2warning import SpeakV2Warning + +try: + from websockets.legacy.client import WebSocketClientProtocol # type: ignore +except ImportError: + from websockets import WebSocketClientProtocol # type: ignore + +_logger = logging.getLogger(__name__) +V2SocketClientResponse = typing.Union[ + bytes, + SpeakV2Connected, + SpeakV2SpeechStarted, + SpeakV2SpeechMetadata, + SpeakV2SpeechInterrupted, + SpeakV2Flushed, + SpeakV2SessionMetadata, + SpeakV2ConfigureSuccess, + SpeakV2ConfigureFailure, + SpeakV2Warning, + SpeakV2Error, + typing.Dict[str, typing.Any], +] + + +class AsyncV2SocketClient(EventEmitterMixin): + def __init__(self, *, websocket: WebSocketClientProtocol): + super().__init__() + self._websocket = websocket + + async def __aiter__(self) -> typing.AsyncIterator[V2SocketClientResponse]: + async for message in self._websocket: + if isinstance(message, bytes): + yield message # type: ignore + else: + try: + yield construct_type(type_=V2SocketClientResponse, object_=json.loads(message)) # type: ignore + except Exception: + _logger.warning( + "Skipping unknown WebSocket message; update your SDK version to support new message types." + ) + continue + + async def start_listening(self): + """ + Start listening for messages on the websocket connection. + + Emits events in the following order: + - EventType.OPEN when connection is established + - EventType.MESSAGE for each message received + - EventType.ERROR if an error occurs + - EventType.CLOSE when connection is closed + """ + await self._emit_async(EventType.OPEN, None) + try: + async for raw_message in self._websocket: + if isinstance(raw_message, bytes): + parsed = raw_message + else: + json_data = json.loads(raw_message) + try: + parsed = construct_type(type_=V2SocketClientResponse, object_=json_data) # type: ignore + except Exception: + _logger.warning( + "Skipping unknown WebSocket message; update your SDK version to support new message types." + ) + continue + await self._emit_async(EventType.MESSAGE, parsed) + except Exception as exc: + await self._emit_async(EventType.ERROR, exc) + finally: + await self._emit_async(EventType.CLOSE, None) + + async def send_speak(self, message: SpeakV2Speak) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a SpeakV2Speak. + """ + await self._send_model(message) + + async def send_flush(self, message: typing.Optional[SpeakV2Flush] = None) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a SpeakV2Flush. + """ + await self._send_model(message or SpeakV2Flush(type="Flush")) + + async def send_interrupt(self, message: typing.Optional[SpeakV2Interrupt] = None) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a SpeakV2Interrupt. + """ + await self._send_model(message or SpeakV2Interrupt(type="Interrupt")) + + async def send_configure(self, message: SpeakV2Configure) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a SpeakV2Configure. + """ + await self._send_model(message) + + async def send_close(self, message: typing.Optional[SpeakV2Close] = None) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a SpeakV2Close. + """ + await self._send_model(message or SpeakV2Close(type="Close")) + + async def recv(self) -> V2SocketClientResponse: + """ + Receive a message from the websocket connection. + """ + data = await self._websocket.recv() + if isinstance(data, bytes): + return data # type: ignore + json_data = json.loads(data) + try: + return construct_type(type_=V2SocketClientResponse, object_=json_data) # type: ignore + except Exception: + _logger.warning("Skipping unknown WebSocket message; update your SDK version to support new message types.") + return json_data # type: ignore + + async def _send(self, data: typing.Any) -> None: + """ + Send a message to the websocket connection. + """ + if isinstance(data, dict): + data = json.dumps(data) + await self._websocket.send(data) + + async def _send_model(self, data: typing.Any) -> None: + """ + Send a Pydantic model to the websocket connection. + """ + await self._send(data.dict()) + + +class V2SocketClient(EventEmitterMixin): + def __init__(self, *, websocket: websockets_sync_connection.Connection): + super().__init__() + self._websocket = websocket + + def __iter__(self) -> typing.Iterator[V2SocketClientResponse]: + for message in self._websocket: + if isinstance(message, bytes): + yield message # type: ignore + else: + try: + yield construct_type(type_=V2SocketClientResponse, object_=json.loads(message)) # type: ignore + except Exception: + _logger.warning( + "Skipping unknown WebSocket message; update your SDK version to support new message types." + ) + continue + + def start_listening(self): + """ + Start listening for messages on the websocket connection. + + Emits events in the following order: + - EventType.OPEN when connection is established + - EventType.MESSAGE for each message received + - EventType.ERROR if an error occurs + - EventType.CLOSE when connection is closed + """ + self._emit(EventType.OPEN, None) + try: + for raw_message in self._websocket: + if isinstance(raw_message, bytes): + parsed = raw_message + else: + json_data = json.loads(raw_message) + try: + parsed = construct_type(type_=V2SocketClientResponse, object_=json_data) # type: ignore + except Exception: + _logger.warning( + "Skipping unknown WebSocket message; update your SDK version to support new message types." + ) + continue + self._emit(EventType.MESSAGE, parsed) + except Exception as exc: + self._emit(EventType.ERROR, exc) + finally: + self._emit(EventType.CLOSE, None) + + def send_speak(self, message: SpeakV2Speak) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a SpeakV2Speak. + """ + self._send_model(message) + + def send_flush(self, message: typing.Optional[SpeakV2Flush] = None) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a SpeakV2Flush. + """ + self._send_model(message or SpeakV2Flush(type="Flush")) + + def send_interrupt(self, message: typing.Optional[SpeakV2Interrupt] = None) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a SpeakV2Interrupt. + """ + self._send_model(message or SpeakV2Interrupt(type="Interrupt")) + + def send_configure(self, message: SpeakV2Configure) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a SpeakV2Configure. + """ + self._send_model(message) + + def send_close(self, message: typing.Optional[SpeakV2Close] = None) -> None: + """ + Send a message to the websocket connection. + The message will be sent as a SpeakV2Close. + """ + self._send_model(message or SpeakV2Close(type="Close")) + + def recv(self) -> V2SocketClientResponse: + """ + Receive a message from the websocket connection. + """ + data = self._websocket.recv() + if isinstance(data, bytes): + return data # type: ignore + json_data = json.loads(data) + try: + return construct_type(type_=V2SocketClientResponse, object_=json_data) # type: ignore + except Exception: + _logger.warning("Skipping unknown WebSocket message; update your SDK version to support new message types.") + return json_data # type: ignore + + def _send(self, data: typing.Any) -> None: + """ + Send a message to the websocket connection. + """ + if isinstance(data, dict): + data = json.dumps(data) + self._websocket.send(data) + + def _send_model(self, data: typing.Any) -> None: + """ + Send a Pydantic model to the websocket connection. + """ + self._send(data.dict()) diff --git a/src/deepgram/speak/v2/types/speak_v2warning.py.bak b/src/deepgram/speak/v2/types/speak_v2warning.py.bak new file mode 100644 index 00000000..ac771641 --- /dev/null +++ b/src/deepgram/speak/v2/types/speak_v2warning.py.bak @@ -0,0 +1,41 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ....core.pydantic_utilities import IS_PYDANTIC_V2 +from ....core.unchecked_base_model import UncheckedBaseModel + + +class SpeakV2Warning(UncheckedBaseModel): + type: typing.Literal["Warning"] = pydantic.Field(default="Warning") + """ + Message type identifier + """ + + code: str = pydantic.Field() + """ + Warning code identifying the condition, in `SCREAMING_SNAKE_CASE`. + + Turn-scoped codes: `NO_ACTIVE_SPEECH` (a speech-scoped message arrived with no active turn), `NO_SYNTHESIZABLE_TEXT` (the turn's text was entirely whitespace or punctuation, so it produced no audio and is completed with a zero-duration `SpeechMetadata`), and `SYNTHESIS_RETRYING` (a synthesis request failed and is being retried). + + Pronunciation codes: `PRONUNCIATION_WARNINGS` (a pronunciation override contained invalid IPA; it is still applied best-effort and counted in `pronunciations_applied`), `PRONUNCIATION_TOO_LONG` (an IPA string exceeded the length limit), `PRONUNCIATIONS_LIMIT_EXCEEDED` (too many pronunciation controls in one turn). + + Pause codes (`BREAKS_LIMIT_EXCEEDED`, `BREAK_TOKENS_OUT_OF_RANGE`, `BREAK_TOKENS_WITH_INVALID_INCREMENTS`) are reserved and not emitted: inline pause controls are batch-only, and a pause marker on the WebSocket fails the connection instead. + + Interrupt-scoped codes, each meaning the `Interrupt` was ignored: `NO_AUDIO_GENERATED` (the session has produced no audio yet, so there is nothing to interrupt), `INTERRUPT_IN_PROGRESS` (an earlier `Interrupt` is still being processed — at most one is handled at a time), `INVALID_INTERRUPT_OFFSET` (the `playback_offset` did not advance past the position a prior interrupt established). + """ + + description: str = pydantic.Field() + """ + A human-readable description of the warning + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/deepgram/types/__init__.py.bak b/src/deepgram/types/__init__.py.bak new file mode 100644 index 00000000..3c76081d --- /dev/null +++ b/src/deepgram/types/__init__.py.bak @@ -0,0 +1,883 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .agent_configuration_v1 import AgentConfigurationV1 + from .agent_think_models_v1response import AgentThinkModelsV1Response + from .agent_think_models_v1response_models_item import AgentThinkModelsV1ResponseModelsItem + from .agent_think_models_v1response_models_item_id import AgentThinkModelsV1ResponseModelsItemId + from .agent_think_models_v1response_models_item_one import AgentThinkModelsV1ResponseModelsItemOne + from .agent_think_models_v1response_models_item_one_id import AgentThinkModelsV1ResponseModelsItemOneId + from .agent_think_models_v1response_models_item_three import AgentThinkModelsV1ResponseModelsItemThree + from .agent_think_models_v1response_models_item_two import AgentThinkModelsV1ResponseModelsItemTwo + from .agent_think_models_v1response_models_item_two_id import AgentThinkModelsV1ResponseModelsItemTwoId + from .agent_think_models_v1response_models_item_zero import AgentThinkModelsV1ResponseModelsItemZero + from .agent_think_models_v1response_models_item_zero_id import AgentThinkModelsV1ResponseModelsItemZeroId + from .agent_variable_v1 import AgentVariableV1 + from .anthropic import Anthropic + from .anthropic_model import AnthropicModel + from .aws_bedrock_think_provider import AwsBedrockThinkProvider + from .aws_bedrock_think_provider_credentials import AwsBedrockThinkProviderCredentials + from .aws_bedrock_think_provider_credentials_type import AwsBedrockThinkProviderCredentialsType + from .aws_bedrock_think_provider_model import AwsBedrockThinkProviderModel + from .aws_polly_speak_provider import AwsPollySpeakProvider + from .aws_polly_speak_provider_credentials import AwsPollySpeakProviderCredentials + from .aws_polly_speak_provider_credentials_type import AwsPollySpeakProviderCredentialsType + from .aws_polly_speak_provider_engine import AwsPollySpeakProviderEngine + from .aws_polly_speak_provider_voice import AwsPollySpeakProviderVoice + from .billing_breakdown_v1response import BillingBreakdownV1Response + from .billing_breakdown_v1response_resolution import BillingBreakdownV1ResponseResolution + from .billing_breakdown_v1response_results_item import BillingBreakdownV1ResponseResultsItem + from .billing_breakdown_v1response_results_item_grouping import BillingBreakdownV1ResponseResultsItemGrouping + from .cartesia import Cartesia + from .cartesia_model_id import CartesiaModelId + from .cartesia_voice import CartesiaVoice + from .create_agent_configuration_v1response import CreateAgentConfigurationV1Response + from .create_key_v1request import CreateKeyV1Request + from .create_key_v1response import CreateKeyV1Response + from .create_project_distribution_credentials_v1response import CreateProjectDistributionCredentialsV1Response + from .create_project_distribution_credentials_v1response_distribution_credentials import ( + CreateProjectDistributionCredentialsV1ResponseDistributionCredentials, + ) + from .create_project_distribution_credentials_v1response_member import ( + CreateProjectDistributionCredentialsV1ResponseMember, + ) + from .create_project_invite_v1response import CreateProjectInviteV1Response + from .deepgram import Deepgram + from .deepgram_listen_provider_v1 import DeepgramListenProviderV1 + from .deepgram_listen_provider_v2 import DeepgramListenProviderV2 + from .deepgram_model import DeepgramModel + from .deepgram_think_live_provider_v1 import DeepgramThinkLiveProviderV1 + from .deepgram_think_provider import DeepgramThinkProvider + from .deepgram_think_provider_model import DeepgramThinkProviderModel + from .deepgram_think_provider_reasoning_mode import DeepgramThinkProviderReasoningMode + from .delete_agent_configuration_v1response import DeleteAgentConfigurationV1Response + from .delete_agent_variable_v1response import DeleteAgentVariableV1Response + from .delete_project_invite_v1response import DeleteProjectInviteV1Response + from .delete_project_key_v1response import DeleteProjectKeyV1Response + from .delete_project_member_v1response import DeleteProjectMemberV1Response + from .delete_project_v1response import DeleteProjectV1Response + from .eleven_labs_speak_provider import ElevenLabsSpeakProvider + from .eleven_labs_speak_provider_model_id import ElevenLabsSpeakProviderModelId + from .error_response import ErrorResponse + from .error_response_legacy_error import ErrorResponseLegacyError + from .error_response_modern_error import ErrorResponseModernError + from .error_response_text_error import ErrorResponseTextError + from .get_model_v1response import GetModelV1Response + from .get_model_v1response_batch import GetModelV1ResponseBatch + from .get_model_v1response_metadata import GetModelV1ResponseMetadata + from .get_model_v1response_metadata_metadata import GetModelV1ResponseMetadataMetadata + from .get_project_balance_v1response import GetProjectBalanceV1Response + from .get_project_distribution_credentials_v1response import GetProjectDistributionCredentialsV1Response + from .get_project_distribution_credentials_v1response_distribution_credentials import ( + GetProjectDistributionCredentialsV1ResponseDistributionCredentials, + ) + from .get_project_distribution_credentials_v1response_member import ( + GetProjectDistributionCredentialsV1ResponseMember, + ) + from .get_project_key_v1response import GetProjectKeyV1Response + from .get_project_key_v1response_item import GetProjectKeyV1ResponseItem + from .get_project_key_v1response_item_member import GetProjectKeyV1ResponseItemMember + from .get_project_key_v1response_item_member_api_key import GetProjectKeyV1ResponseItemMemberApiKey + from .get_project_request_v1response import GetProjectRequestV1Response + from .get_project_v1response import GetProjectV1Response + from .google import Google + from .google_model import GoogleModel + from .google_version import GoogleVersion + from .grant_v1response import GrantV1Response + from .groq import Groq + from .groq_reasoning_mode import GroqReasoningMode + from .leave_project_v1response import LeaveProjectV1Response + from .list_agent_configurations_v1response import ListAgentConfigurationsV1Response + from .list_agent_variables_v1response import ListAgentVariablesV1Response + from .list_billing_fields_v1response import ListBillingFieldsV1Response + from .list_billing_fields_v1response_deployments_item import ListBillingFieldsV1ResponseDeploymentsItem + from .list_models_v1response import ListModelsV1Response + from .list_models_v1response_stt_models import ListModelsV1ResponseSttModels + from .list_models_v1response_tts_models import ListModelsV1ResponseTtsModels + from .list_models_v1response_tts_models_metadata import ListModelsV1ResponseTtsModelsMetadata + from .list_project_balances_v1response import ListProjectBalancesV1Response + from .list_project_balances_v1response_balances_item import ListProjectBalancesV1ResponseBalancesItem + from .list_project_distribution_credentials_v1response import ListProjectDistributionCredentialsV1Response + from .list_project_distribution_credentials_v1response_distribution_credentials_item import ( + ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItem, + ) + from .list_project_distribution_credentials_v1response_distribution_credentials_item_distribution_credentials import ( + ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemDistributionCredentials, + ) + from .list_project_distribution_credentials_v1response_distribution_credentials_item_member import ( + ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemMember, + ) + from .list_project_invites_v1response import ListProjectInvitesV1Response + from .list_project_invites_v1response_invites_item import ListProjectInvitesV1ResponseInvitesItem + from .list_project_keys_v1response import ListProjectKeysV1Response + from .list_project_keys_v1response_api_keys_item import ListProjectKeysV1ResponseApiKeysItem + from .list_project_keys_v1response_api_keys_item_api_key import ListProjectKeysV1ResponseApiKeysItemApiKey + from .list_project_keys_v1response_api_keys_item_member import ListProjectKeysV1ResponseApiKeysItemMember + from .list_project_member_scopes_v1response import ListProjectMemberScopesV1Response + from .list_project_members_v1response import ListProjectMembersV1Response + from .list_project_members_v1response_members_item import ListProjectMembersV1ResponseMembersItem + from .list_project_purchases_v1response import ListProjectPurchasesV1Response + from .list_project_purchases_v1response_orders_item import ListProjectPurchasesV1ResponseOrdersItem + from .list_project_requests_v1response import ListProjectRequestsV1Response + from .list_projects_v1response import ListProjectsV1Response + from .list_projects_v1response_projects_item import ListProjectsV1ResponseProjectsItem + from .listen_v1accepted_response import ListenV1AcceptedResponse + from .listen_v1callback import ListenV1Callback + from .listen_v1callback_method import ListenV1CallbackMethod + from .listen_v1channels import ListenV1Channels + from .listen_v1detect_entities import ListenV1DetectEntities + from .listen_v1diarize import ListenV1Diarize + from .listen_v1dictation import ListenV1Dictation + from .listen_v1encoding import ListenV1Encoding + from .listen_v1endpointing import ListenV1Endpointing + from .listen_v1extra import ListenV1Extra + from .listen_v1interim_results import ListenV1InterimResults + from .listen_v1keyterm import ListenV1Keyterm + from .listen_v1keywords import ListenV1Keywords + from .listen_v1language import ListenV1Language + from .listen_v1language_hint import ListenV1LanguageHint + from .listen_v1mip_opt_out import ListenV1MipOptOut + from .listen_v1model import ListenV1Model + from .listen_v1multichannel import ListenV1Multichannel + from .listen_v1numerals import ListenV1Numerals + from .listen_v1profanity_filter import ListenV1ProfanityFilter + from .listen_v1punctuate import ListenV1Punctuate + from .listen_v1redact import ListenV1Redact + from .listen_v1redact_usage import ListenV1RedactUsage + from .listen_v1replace import ListenV1Replace + from .listen_v1request_file import ListenV1RequestFile + from .listen_v1response import ListenV1Response + from .listen_v1response_metadata import ListenV1ResponseMetadata + from .listen_v1response_metadata_diarize_info import ListenV1ResponseMetadataDiarizeInfo + from .listen_v1response_metadata_intents_info import ListenV1ResponseMetadataIntentsInfo + from .listen_v1response_metadata_sentiment_info import ListenV1ResponseMetadataSentimentInfo + from .listen_v1response_metadata_summary_info import ListenV1ResponseMetadataSummaryInfo + from .listen_v1response_metadata_topics_info import ListenV1ResponseMetadataTopicsInfo + from .listen_v1response_results import ListenV1ResponseResults + from .listen_v1response_results_channels import ListenV1ResponseResultsChannels + from .listen_v1response_results_channels_item import ListenV1ResponseResultsChannelsItem + from .listen_v1response_results_channels_item_alternatives_item import ( + ListenV1ResponseResultsChannelsItemAlternativesItem, + ) + from .listen_v1response_results_channels_item_alternatives_item_entities_item import ( + ListenV1ResponseResultsChannelsItemAlternativesItemEntitiesItem, + ) + from .listen_v1response_results_channels_item_alternatives_item_paragraphs import ( + ListenV1ResponseResultsChannelsItemAlternativesItemParagraphs, + ) + from .listen_v1response_results_channels_item_alternatives_item_paragraphs_paragraphs_item import ( + ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParagraphsItem, + ) + from .listen_v1response_results_channels_item_alternatives_item_paragraphs_paragraphs_item_sentences_item import ( + ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParagraphsItemSentencesItem, + ) + from .listen_v1response_results_channels_item_alternatives_item_summaries_item import ( + ListenV1ResponseResultsChannelsItemAlternativesItemSummariesItem, + ) + from .listen_v1response_results_channels_item_alternatives_item_topics_item import ( + ListenV1ResponseResultsChannelsItemAlternativesItemTopicsItem, + ) + from .listen_v1response_results_channels_item_alternatives_item_words_item import ( + ListenV1ResponseResultsChannelsItemAlternativesItemWordsItem, + ) + from .listen_v1response_results_channels_item_search_item import ListenV1ResponseResultsChannelsItemSearchItem + from .listen_v1response_results_channels_item_search_item_hits_item import ( + ListenV1ResponseResultsChannelsItemSearchItemHitsItem, + ) + from .listen_v1response_results_summary import ListenV1ResponseResultsSummary + from .listen_v1response_results_utterances import ListenV1ResponseResultsUtterances + from .listen_v1response_results_utterances_item import ListenV1ResponseResultsUtterancesItem + from .listen_v1response_results_utterances_item_words_item import ListenV1ResponseResultsUtterancesItemWordsItem + from .listen_v1sample_rate import ListenV1SampleRate + from .listen_v1search import ListenV1Search + from .listen_v1smart_format import ListenV1SmartFormat + from .listen_v1tag import ListenV1Tag + from .listen_v1utterance_end_ms import ListenV1UtteranceEndMs + from .listen_v1vad_events import ListenV1VadEvents + from .listen_v1version import ListenV1Version + from .listen_v2configure_numerals import ListenV2ConfigureNumerals + from .listen_v2configure_redact_usage import ListenV2ConfigureRedactUsage + from .listen_v2eager_eot_threshold import ListenV2EagerEotThreshold + from .listen_v2encoding import ListenV2Encoding + from .listen_v2eot_threshold import ListenV2EotThreshold + from .listen_v2eot_timeout_ms import ListenV2EotTimeoutMs + from .listen_v2keyterm import ListenV2Keyterm + from .listen_v2language_hint import ListenV2LanguageHint + from .listen_v2mip_opt_out import ListenV2MipOptOut + from .listen_v2model import ListenV2Model + from .listen_v2numerals import ListenV2Numerals + from .listen_v2profanity_filter import ListenV2ProfanityFilter + from .listen_v2redact import ListenV2Redact + from .listen_v2redact_usage import ListenV2RedactUsage + from .listen_v2sample_rate import ListenV2SampleRate + from .listen_v2tag import ListenV2Tag + from .open_ai_speak_provider import OpenAiSpeakProvider + from .open_ai_speak_provider_model import OpenAiSpeakProviderModel + from .open_ai_speak_provider_voice import OpenAiSpeakProviderVoice + from .open_ai_think_provider import OpenAiThinkProvider + from .open_ai_think_provider_model import OpenAiThinkProviderModel + from .open_ai_think_provider_reasoning_mode import OpenAiThinkProviderReasoningMode + from .project_request_response import ProjectRequestResponse + from .read_v1request import ReadV1Request + from .read_v1request_text import ReadV1RequestText + from .read_v1request_url import ReadV1RequestUrl + from .read_v1response import ReadV1Response + from .read_v1response_metadata import ReadV1ResponseMetadata + from .read_v1response_metadata_metadata import ReadV1ResponseMetadataMetadata + from .read_v1response_metadata_metadata_intents_info import ReadV1ResponseMetadataMetadataIntentsInfo + from .read_v1response_metadata_metadata_sentiment_info import ReadV1ResponseMetadataMetadataSentimentInfo + from .read_v1response_metadata_metadata_summary_info import ReadV1ResponseMetadataMetadataSummaryInfo + from .read_v1response_metadata_metadata_topics_info import ReadV1ResponseMetadataMetadataTopicsInfo + from .read_v1response_results import ReadV1ResponseResults + from .read_v1response_results_summary import ReadV1ResponseResultsSummary + from .read_v1response_results_summary_results import ReadV1ResponseResultsSummaryResults + from .read_v1response_results_summary_results_summary import ReadV1ResponseResultsSummaryResultsSummary + from .shared_intents import SharedIntents + from .shared_intents_segments_item import SharedIntentsSegmentsItem + from .shared_intents_segments_item_intents_item import SharedIntentsSegmentsItemIntentsItem + from .shared_sentiments import SharedSentiments + from .shared_sentiments_average import SharedSentimentsAverage + from .shared_sentiments_segments_item import SharedSentimentsSegmentsItem + from .shared_topics import SharedTopics + from .shared_topics_segments_item import SharedTopicsSegmentsItem + from .shared_topics_segments_item_topics_item import SharedTopicsSegmentsItemTopicsItem + from .speak_settings_v1 import SpeakSettingsV1 + from .speak_settings_v1endpoint import SpeakSettingsV1Endpoint + from .speak_settings_v1provider import ( + SpeakSettingsV1Provider, + SpeakSettingsV1Provider_AwsPolly, + SpeakSettingsV1Provider_Cartesia, + SpeakSettingsV1Provider_Deepgram, + SpeakSettingsV1Provider_ElevenLabs, + SpeakSettingsV1Provider_OpenAi, + ) + from .speak_v1encoding import SpeakV1Encoding + from .speak_v1mip_opt_out import SpeakV1MipOptOut + from .speak_v1model import SpeakV1Model + from .speak_v1response import SpeakV1Response + from .speak_v1sample_rate import SpeakV1SampleRate + from .speak_v1speed import SpeakV1Speed + from .speak_v2accepted_response import SpeakV2AcceptedResponse + from .speak_v2encoding import SpeakV2Encoding + from .speak_v2expressivity import SpeakV2Expressivity + from .speak_v2mip_opt_out import SpeakV2MipOptOut + from .speak_v2model import SpeakV2Model + from .speak_v2normalize_volume import SpeakV2NormalizeVolume + from .speak_v2response import SpeakV2Response + from .speak_v2sample_rate import SpeakV2SampleRate + from .speak_v2speed import SpeakV2Speed + from .speak_v2speed_value import SpeakV2SpeedValue + from .speak_v2tag import SpeakV2Tag + from .think_live_settings_v1 import ThinkLiveSettingsV1 + from .think_settings_v1 import ThinkSettingsV1 + from .think_settings_v1context_length import ThinkSettingsV1ContextLength + from .think_settings_v1endpoint import ThinkSettingsV1Endpoint + from .think_settings_v1functions_item import ThinkSettingsV1FunctionsItem + from .think_settings_v1functions_item_endpoint import ThinkSettingsV1FunctionsItemEndpoint + from .think_settings_v1provider import ( + ThinkSettingsV1Provider, + ThinkSettingsV1Provider_Anthropic, + ThinkSettingsV1Provider_AwsBedrock, + ThinkSettingsV1Provider_Deepgram, + ThinkSettingsV1Provider_Google, + ThinkSettingsV1Provider_Groq, + ThinkSettingsV1Provider_OpenAi, + ) + from .update_project_member_scopes_v1response import UpdateProjectMemberScopesV1Response + from .update_project_v1response import UpdateProjectV1Response + from .usage_breakdown_v1response import UsageBreakdownV1Response + from .usage_breakdown_v1response_resolution import UsageBreakdownV1ResponseResolution + from .usage_breakdown_v1response_results_item import UsageBreakdownV1ResponseResultsItem + from .usage_breakdown_v1response_results_item_grouping import UsageBreakdownV1ResponseResultsItemGrouping + from .usage_fields_v1response import UsageFieldsV1Response + from .usage_fields_v1response_models_item import UsageFieldsV1ResponseModelsItem + from .usage_v1response import UsageV1Response + from .usage_v1response_resolution import UsageV1ResponseResolution +_dynamic_imports: typing.Dict[str, str] = { + "AgentConfigurationV1": ".agent_configuration_v1", + "AgentThinkModelsV1Response": ".agent_think_models_v1response", + "AgentThinkModelsV1ResponseModelsItem": ".agent_think_models_v1response_models_item", + "AgentThinkModelsV1ResponseModelsItemId": ".agent_think_models_v1response_models_item_id", + "AgentThinkModelsV1ResponseModelsItemOne": ".agent_think_models_v1response_models_item_one", + "AgentThinkModelsV1ResponseModelsItemOneId": ".agent_think_models_v1response_models_item_one_id", + "AgentThinkModelsV1ResponseModelsItemThree": ".agent_think_models_v1response_models_item_three", + "AgentThinkModelsV1ResponseModelsItemTwo": ".agent_think_models_v1response_models_item_two", + "AgentThinkModelsV1ResponseModelsItemTwoId": ".agent_think_models_v1response_models_item_two_id", + "AgentThinkModelsV1ResponseModelsItemZero": ".agent_think_models_v1response_models_item_zero", + "AgentThinkModelsV1ResponseModelsItemZeroId": ".agent_think_models_v1response_models_item_zero_id", + "AgentVariableV1": ".agent_variable_v1", + "Anthropic": ".anthropic", + "AnthropicModel": ".anthropic_model", + "AwsBedrockThinkProvider": ".aws_bedrock_think_provider", + "AwsBedrockThinkProviderCredentials": ".aws_bedrock_think_provider_credentials", + "AwsBedrockThinkProviderCredentialsType": ".aws_bedrock_think_provider_credentials_type", + "AwsBedrockThinkProviderModel": ".aws_bedrock_think_provider_model", + "AwsPollySpeakProvider": ".aws_polly_speak_provider", + "AwsPollySpeakProviderCredentials": ".aws_polly_speak_provider_credentials", + "AwsPollySpeakProviderCredentialsType": ".aws_polly_speak_provider_credentials_type", + "AwsPollySpeakProviderEngine": ".aws_polly_speak_provider_engine", + "AwsPollySpeakProviderVoice": ".aws_polly_speak_provider_voice", + "BillingBreakdownV1Response": ".billing_breakdown_v1response", + "BillingBreakdownV1ResponseResolution": ".billing_breakdown_v1response_resolution", + "BillingBreakdownV1ResponseResultsItem": ".billing_breakdown_v1response_results_item", + "BillingBreakdownV1ResponseResultsItemGrouping": ".billing_breakdown_v1response_results_item_grouping", + "Cartesia": ".cartesia", + "CartesiaModelId": ".cartesia_model_id", + "CartesiaVoice": ".cartesia_voice", + "CreateAgentConfigurationV1Response": ".create_agent_configuration_v1response", + "CreateKeyV1Request": ".create_key_v1request", + "CreateKeyV1Response": ".create_key_v1response", + "CreateProjectDistributionCredentialsV1Response": ".create_project_distribution_credentials_v1response", + "CreateProjectDistributionCredentialsV1ResponseDistributionCredentials": ".create_project_distribution_credentials_v1response_distribution_credentials", + "CreateProjectDistributionCredentialsV1ResponseMember": ".create_project_distribution_credentials_v1response_member", + "CreateProjectInviteV1Response": ".create_project_invite_v1response", + "Deepgram": ".deepgram", + "DeepgramListenProviderV1": ".deepgram_listen_provider_v1", + "DeepgramListenProviderV2": ".deepgram_listen_provider_v2", + "DeepgramModel": ".deepgram_model", + "DeepgramThinkLiveProviderV1": ".deepgram_think_live_provider_v1", + "DeepgramThinkProvider": ".deepgram_think_provider", + "DeepgramThinkProviderModel": ".deepgram_think_provider_model", + "DeepgramThinkProviderReasoningMode": ".deepgram_think_provider_reasoning_mode", + "DeleteAgentConfigurationV1Response": ".delete_agent_configuration_v1response", + "DeleteAgentVariableV1Response": ".delete_agent_variable_v1response", + "DeleteProjectInviteV1Response": ".delete_project_invite_v1response", + "DeleteProjectKeyV1Response": ".delete_project_key_v1response", + "DeleteProjectMemberV1Response": ".delete_project_member_v1response", + "DeleteProjectV1Response": ".delete_project_v1response", + "ElevenLabsSpeakProvider": ".eleven_labs_speak_provider", + "ElevenLabsSpeakProviderModelId": ".eleven_labs_speak_provider_model_id", + "ErrorResponse": ".error_response", + "ErrorResponseLegacyError": ".error_response_legacy_error", + "ErrorResponseModernError": ".error_response_modern_error", + "ErrorResponseTextError": ".error_response_text_error", + "GetModelV1Response": ".get_model_v1response", + "GetModelV1ResponseBatch": ".get_model_v1response_batch", + "GetModelV1ResponseMetadata": ".get_model_v1response_metadata", + "GetModelV1ResponseMetadataMetadata": ".get_model_v1response_metadata_metadata", + "GetProjectBalanceV1Response": ".get_project_balance_v1response", + "GetProjectDistributionCredentialsV1Response": ".get_project_distribution_credentials_v1response", + "GetProjectDistributionCredentialsV1ResponseDistributionCredentials": ".get_project_distribution_credentials_v1response_distribution_credentials", + "GetProjectDistributionCredentialsV1ResponseMember": ".get_project_distribution_credentials_v1response_member", + "GetProjectKeyV1Response": ".get_project_key_v1response", + "GetProjectKeyV1ResponseItem": ".get_project_key_v1response_item", + "GetProjectKeyV1ResponseItemMember": ".get_project_key_v1response_item_member", + "GetProjectKeyV1ResponseItemMemberApiKey": ".get_project_key_v1response_item_member_api_key", + "GetProjectRequestV1Response": ".get_project_request_v1response", + "GetProjectV1Response": ".get_project_v1response", + "Google": ".google", + "GoogleModel": ".google_model", + "GoogleVersion": ".google_version", + "GrantV1Response": ".grant_v1response", + "Groq": ".groq", + "GroqReasoningMode": ".groq_reasoning_mode", + "LeaveProjectV1Response": ".leave_project_v1response", + "ListAgentConfigurationsV1Response": ".list_agent_configurations_v1response", + "ListAgentVariablesV1Response": ".list_agent_variables_v1response", + "ListBillingFieldsV1Response": ".list_billing_fields_v1response", + "ListBillingFieldsV1ResponseDeploymentsItem": ".list_billing_fields_v1response_deployments_item", + "ListModelsV1Response": ".list_models_v1response", + "ListModelsV1ResponseSttModels": ".list_models_v1response_stt_models", + "ListModelsV1ResponseTtsModels": ".list_models_v1response_tts_models", + "ListModelsV1ResponseTtsModelsMetadata": ".list_models_v1response_tts_models_metadata", + "ListProjectBalancesV1Response": ".list_project_balances_v1response", + "ListProjectBalancesV1ResponseBalancesItem": ".list_project_balances_v1response_balances_item", + "ListProjectDistributionCredentialsV1Response": ".list_project_distribution_credentials_v1response", + "ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItem": ".list_project_distribution_credentials_v1response_distribution_credentials_item", + "ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemDistributionCredentials": ".list_project_distribution_credentials_v1response_distribution_credentials_item_distribution_credentials", + "ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemMember": ".list_project_distribution_credentials_v1response_distribution_credentials_item_member", + "ListProjectInvitesV1Response": ".list_project_invites_v1response", + "ListProjectInvitesV1ResponseInvitesItem": ".list_project_invites_v1response_invites_item", + "ListProjectKeysV1Response": ".list_project_keys_v1response", + "ListProjectKeysV1ResponseApiKeysItem": ".list_project_keys_v1response_api_keys_item", + "ListProjectKeysV1ResponseApiKeysItemApiKey": ".list_project_keys_v1response_api_keys_item_api_key", + "ListProjectKeysV1ResponseApiKeysItemMember": ".list_project_keys_v1response_api_keys_item_member", + "ListProjectMemberScopesV1Response": ".list_project_member_scopes_v1response", + "ListProjectMembersV1Response": ".list_project_members_v1response", + "ListProjectMembersV1ResponseMembersItem": ".list_project_members_v1response_members_item", + "ListProjectPurchasesV1Response": ".list_project_purchases_v1response", + "ListProjectPurchasesV1ResponseOrdersItem": ".list_project_purchases_v1response_orders_item", + "ListProjectRequestsV1Response": ".list_project_requests_v1response", + "ListProjectsV1Response": ".list_projects_v1response", + "ListProjectsV1ResponseProjectsItem": ".list_projects_v1response_projects_item", + "ListenV1AcceptedResponse": ".listen_v1accepted_response", + "ListenV1Callback": ".listen_v1callback", + "ListenV1CallbackMethod": ".listen_v1callback_method", + "ListenV1Channels": ".listen_v1channels", + "ListenV1DetectEntities": ".listen_v1detect_entities", + "ListenV1Diarize": ".listen_v1diarize", + "ListenV1Dictation": ".listen_v1dictation", + "ListenV1Encoding": ".listen_v1encoding", + "ListenV1Endpointing": ".listen_v1endpointing", + "ListenV1Extra": ".listen_v1extra", + "ListenV1InterimResults": ".listen_v1interim_results", + "ListenV1Keyterm": ".listen_v1keyterm", + "ListenV1Keywords": ".listen_v1keywords", + "ListenV1Language": ".listen_v1language", + "ListenV1LanguageHint": ".listen_v1language_hint", + "ListenV1MipOptOut": ".listen_v1mip_opt_out", + "ListenV1Model": ".listen_v1model", + "ListenV1Multichannel": ".listen_v1multichannel", + "ListenV1Numerals": ".listen_v1numerals", + "ListenV1ProfanityFilter": ".listen_v1profanity_filter", + "ListenV1Punctuate": ".listen_v1punctuate", + "ListenV1Redact": ".listen_v1redact", + "ListenV1RedactUsage": ".listen_v1redact_usage", + "ListenV1Replace": ".listen_v1replace", + "ListenV1RequestFile": ".listen_v1request_file", + "ListenV1Response": ".listen_v1response", + "ListenV1ResponseMetadata": ".listen_v1response_metadata", + "ListenV1ResponseMetadataDiarizeInfo": ".listen_v1response_metadata_diarize_info", + "ListenV1ResponseMetadataIntentsInfo": ".listen_v1response_metadata_intents_info", + "ListenV1ResponseMetadataSentimentInfo": ".listen_v1response_metadata_sentiment_info", + "ListenV1ResponseMetadataSummaryInfo": ".listen_v1response_metadata_summary_info", + "ListenV1ResponseMetadataTopicsInfo": ".listen_v1response_metadata_topics_info", + "ListenV1ResponseResults": ".listen_v1response_results", + "ListenV1ResponseResultsChannels": ".listen_v1response_results_channels", + "ListenV1ResponseResultsChannelsItem": ".listen_v1response_results_channels_item", + "ListenV1ResponseResultsChannelsItemAlternativesItem": ".listen_v1response_results_channels_item_alternatives_item", + "ListenV1ResponseResultsChannelsItemAlternativesItemEntitiesItem": ".listen_v1response_results_channels_item_alternatives_item_entities_item", + "ListenV1ResponseResultsChannelsItemAlternativesItemParagraphs": ".listen_v1response_results_channels_item_alternatives_item_paragraphs", + "ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParagraphsItem": ".listen_v1response_results_channels_item_alternatives_item_paragraphs_paragraphs_item", + "ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParagraphsItemSentencesItem": ".listen_v1response_results_channels_item_alternatives_item_paragraphs_paragraphs_item_sentences_item", + "ListenV1ResponseResultsChannelsItemAlternativesItemSummariesItem": ".listen_v1response_results_channels_item_alternatives_item_summaries_item", + "ListenV1ResponseResultsChannelsItemAlternativesItemTopicsItem": ".listen_v1response_results_channels_item_alternatives_item_topics_item", + "ListenV1ResponseResultsChannelsItemAlternativesItemWordsItem": ".listen_v1response_results_channels_item_alternatives_item_words_item", + "ListenV1ResponseResultsChannelsItemSearchItem": ".listen_v1response_results_channels_item_search_item", + "ListenV1ResponseResultsChannelsItemSearchItemHitsItem": ".listen_v1response_results_channels_item_search_item_hits_item", + "ListenV1ResponseResultsSummary": ".listen_v1response_results_summary", + "ListenV1ResponseResultsUtterances": ".listen_v1response_results_utterances", + "ListenV1ResponseResultsUtterancesItem": ".listen_v1response_results_utterances_item", + "ListenV1ResponseResultsUtterancesItemWordsItem": ".listen_v1response_results_utterances_item_words_item", + "ListenV1SampleRate": ".listen_v1sample_rate", + "ListenV1Search": ".listen_v1search", + "ListenV1SmartFormat": ".listen_v1smart_format", + "ListenV1Tag": ".listen_v1tag", + "ListenV1UtteranceEndMs": ".listen_v1utterance_end_ms", + "ListenV1VadEvents": ".listen_v1vad_events", + "ListenV1Version": ".listen_v1version", + "ListenV2ConfigureNumerals": ".listen_v2configure_numerals", + "ListenV2ConfigureRedactUsage": ".listen_v2configure_redact_usage", + "ListenV2EagerEotThreshold": ".listen_v2eager_eot_threshold", + "ListenV2Encoding": ".listen_v2encoding", + "ListenV2EotThreshold": ".listen_v2eot_threshold", + "ListenV2EotTimeoutMs": ".listen_v2eot_timeout_ms", + "ListenV2Keyterm": ".listen_v2keyterm", + "ListenV2LanguageHint": ".listen_v2language_hint", + "ListenV2MipOptOut": ".listen_v2mip_opt_out", + "ListenV2Model": ".listen_v2model", + "ListenV2Numerals": ".listen_v2numerals", + "ListenV2ProfanityFilter": ".listen_v2profanity_filter", + "ListenV2Redact": ".listen_v2redact", + "ListenV2RedactUsage": ".listen_v2redact_usage", + "ListenV2SampleRate": ".listen_v2sample_rate", + "ListenV2Tag": ".listen_v2tag", + "OpenAiSpeakProvider": ".open_ai_speak_provider", + "OpenAiSpeakProviderModel": ".open_ai_speak_provider_model", + "OpenAiSpeakProviderVoice": ".open_ai_speak_provider_voice", + "OpenAiThinkProvider": ".open_ai_think_provider", + "OpenAiThinkProviderModel": ".open_ai_think_provider_model", + "OpenAiThinkProviderReasoningMode": ".open_ai_think_provider_reasoning_mode", + "ProjectRequestResponse": ".project_request_response", + "ReadV1Request": ".read_v1request", + "ReadV1RequestText": ".read_v1request_text", + "ReadV1RequestUrl": ".read_v1request_url", + "ReadV1Response": ".read_v1response", + "ReadV1ResponseMetadata": ".read_v1response_metadata", + "ReadV1ResponseMetadataMetadata": ".read_v1response_metadata_metadata", + "ReadV1ResponseMetadataMetadataIntentsInfo": ".read_v1response_metadata_metadata_intents_info", + "ReadV1ResponseMetadataMetadataSentimentInfo": ".read_v1response_metadata_metadata_sentiment_info", + "ReadV1ResponseMetadataMetadataSummaryInfo": ".read_v1response_metadata_metadata_summary_info", + "ReadV1ResponseMetadataMetadataTopicsInfo": ".read_v1response_metadata_metadata_topics_info", + "ReadV1ResponseResults": ".read_v1response_results", + "ReadV1ResponseResultsSummary": ".read_v1response_results_summary", + "ReadV1ResponseResultsSummaryResults": ".read_v1response_results_summary_results", + "ReadV1ResponseResultsSummaryResultsSummary": ".read_v1response_results_summary_results_summary", + "SharedIntents": ".shared_intents", + "SharedIntentsSegmentsItem": ".shared_intents_segments_item", + "SharedIntentsSegmentsItemIntentsItem": ".shared_intents_segments_item_intents_item", + "SharedSentiments": ".shared_sentiments", + "SharedSentimentsAverage": ".shared_sentiments_average", + "SharedSentimentsSegmentsItem": ".shared_sentiments_segments_item", + "SharedTopics": ".shared_topics", + "SharedTopicsSegmentsItem": ".shared_topics_segments_item", + "SharedTopicsSegmentsItemTopicsItem": ".shared_topics_segments_item_topics_item", + "SpeakSettingsV1": ".speak_settings_v1", + "SpeakSettingsV1Endpoint": ".speak_settings_v1endpoint", + "SpeakSettingsV1Provider": ".speak_settings_v1provider", + "SpeakSettingsV1Provider_AwsPolly": ".speak_settings_v1provider", + "SpeakSettingsV1Provider_Cartesia": ".speak_settings_v1provider", + "SpeakSettingsV1Provider_Deepgram": ".speak_settings_v1provider", + "SpeakSettingsV1Provider_ElevenLabs": ".speak_settings_v1provider", + "SpeakSettingsV1Provider_OpenAi": ".speak_settings_v1provider", + "SpeakV1Encoding": ".speak_v1encoding", + "SpeakV1MipOptOut": ".speak_v1mip_opt_out", + "SpeakV1Model": ".speak_v1model", + "SpeakV1Response": ".speak_v1response", + "SpeakV1SampleRate": ".speak_v1sample_rate", + "SpeakV1Speed": ".speak_v1speed", + "SpeakV2AcceptedResponse": ".speak_v2accepted_response", + "SpeakV2Encoding": ".speak_v2encoding", + "SpeakV2Expressivity": ".speak_v2expressivity", + "SpeakV2MipOptOut": ".speak_v2mip_opt_out", + "SpeakV2Model": ".speak_v2model", + "SpeakV2NormalizeVolume": ".speak_v2normalize_volume", + "SpeakV2Response": ".speak_v2response", + "SpeakV2SampleRate": ".speak_v2sample_rate", + "SpeakV2Speed": ".speak_v2speed", + "SpeakV2SpeedValue": ".speak_v2speed_value", + "SpeakV2Tag": ".speak_v2tag", + "ThinkLiveSettingsV1": ".think_live_settings_v1", + "ThinkSettingsV1": ".think_settings_v1", + "ThinkSettingsV1ContextLength": ".think_settings_v1context_length", + "ThinkSettingsV1Endpoint": ".think_settings_v1endpoint", + "ThinkSettingsV1FunctionsItem": ".think_settings_v1functions_item", + "ThinkSettingsV1FunctionsItemEndpoint": ".think_settings_v1functions_item_endpoint", + "ThinkSettingsV1Provider": ".think_settings_v1provider", + "ThinkSettingsV1Provider_Anthropic": ".think_settings_v1provider", + "ThinkSettingsV1Provider_AwsBedrock": ".think_settings_v1provider", + "ThinkSettingsV1Provider_Deepgram": ".think_settings_v1provider", + "ThinkSettingsV1Provider_Google": ".think_settings_v1provider", + "ThinkSettingsV1Provider_Groq": ".think_settings_v1provider", + "ThinkSettingsV1Provider_OpenAi": ".think_settings_v1provider", + "UpdateProjectMemberScopesV1Response": ".update_project_member_scopes_v1response", + "UpdateProjectV1Response": ".update_project_v1response", + "UsageBreakdownV1Response": ".usage_breakdown_v1response", + "UsageBreakdownV1ResponseResolution": ".usage_breakdown_v1response_resolution", + "UsageBreakdownV1ResponseResultsItem": ".usage_breakdown_v1response_results_item", + "UsageBreakdownV1ResponseResultsItemGrouping": ".usage_breakdown_v1response_results_item_grouping", + "UsageFieldsV1Response": ".usage_fields_v1response", + "UsageFieldsV1ResponseModelsItem": ".usage_fields_v1response_models_item", + "UsageV1Response": ".usage_v1response", + "UsageV1ResponseResolution": ".usage_v1response_resolution", +} + +_dynamic_imports.update( + { + "SharedIntentsResults": ".shared_intents_results", + "SharedIntentsResultsIntents": ".shared_intents_results_intents", + "SharedIntentsResultsIntentsSegmentsItem": ".shared_intents_results_intents_segments_item", + "SharedIntentsResultsIntentsSegmentsItemIntentsItem": ".shared_intents_results_intents_segments_item_intents_item", + "SharedTopicsResults": ".shared_topics_results", + "SharedTopicsResultsTopics": ".shared_topics_results_topics", + "SharedTopicsResultsTopicsSegmentsItem": ".shared_topics_results_topics_segments_item", + "SharedTopicsResultsTopicsSegmentsItemTopicsItem": ".shared_topics_results_topics_segments_item_topics_item", + "AnthropicThinkProviderModel": ".anthropic_think_provider_model", + "CartesiaSpeakProviderModelId": ".cartesia_speak_provider_model_id", + "CartesiaSpeakProviderVoice": ".cartesia_speak_provider_voice", + "CreateKeyV1RequestOne": ".create_key_v1request_one", + "DeepgramListenProviderV2LanguageHint": ".deepgram_listen_provider_v2language_hint", + "DeepgramSpeakProviderModel": ".deepgram_speak_provider_model", + "GoogleThinkProviderModel": ".google_think_provider_model", + "GoogleThinkProviderVersion": ".google_think_provider_version", + "GroqThinkProviderReasoningMode": ".groq_think_provider_reasoning_mode", + } +) + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = [ + "AgentConfigurationV1", + "AgentThinkModelsV1Response", + "AgentThinkModelsV1ResponseModelsItem", + "AgentThinkModelsV1ResponseModelsItemId", + "AgentThinkModelsV1ResponseModelsItemOne", + "AgentThinkModelsV1ResponseModelsItemOneId", + "AgentThinkModelsV1ResponseModelsItemThree", + "AgentThinkModelsV1ResponseModelsItemTwo", + "AgentThinkModelsV1ResponseModelsItemTwoId", + "AgentThinkModelsV1ResponseModelsItemZero", + "AgentThinkModelsV1ResponseModelsItemZeroId", + "AgentVariableV1", + "Anthropic", + "AnthropicModel", + "AwsBedrockThinkProvider", + "AwsBedrockThinkProviderCredentials", + "AwsBedrockThinkProviderCredentialsType", + "AwsBedrockThinkProviderModel", + "AwsPollySpeakProvider", + "AwsPollySpeakProviderCredentials", + "AwsPollySpeakProviderCredentialsType", + "AwsPollySpeakProviderEngine", + "AwsPollySpeakProviderVoice", + "BillingBreakdownV1Response", + "BillingBreakdownV1ResponseResolution", + "BillingBreakdownV1ResponseResultsItem", + "BillingBreakdownV1ResponseResultsItemGrouping", + "Cartesia", + "CartesiaModelId", + "CartesiaVoice", + "CreateAgentConfigurationV1Response", + "CreateKeyV1Request", + "CreateKeyV1Response", + "CreateProjectDistributionCredentialsV1Response", + "CreateProjectDistributionCredentialsV1ResponseDistributionCredentials", + "CreateProjectDistributionCredentialsV1ResponseMember", + "CreateProjectInviteV1Response", + "Deepgram", + "DeepgramListenProviderV1", + "DeepgramListenProviderV2", + "DeepgramModel", + "DeepgramThinkLiveProviderV1", + "DeepgramThinkProvider", + "DeepgramThinkProviderModel", + "DeepgramThinkProviderReasoningMode", + "DeleteAgentConfigurationV1Response", + "DeleteAgentVariableV1Response", + "DeleteProjectInviteV1Response", + "DeleteProjectKeyV1Response", + "DeleteProjectMemberV1Response", + "DeleteProjectV1Response", + "ElevenLabsSpeakProvider", + "ElevenLabsSpeakProviderModelId", + "ErrorResponse", + "ErrorResponseLegacyError", + "ErrorResponseModernError", + "ErrorResponseTextError", + "GetModelV1Response", + "GetModelV1ResponseBatch", + "GetModelV1ResponseMetadata", + "GetModelV1ResponseMetadataMetadata", + "GetProjectBalanceV1Response", + "GetProjectDistributionCredentialsV1Response", + "GetProjectDistributionCredentialsV1ResponseDistributionCredentials", + "GetProjectDistributionCredentialsV1ResponseMember", + "GetProjectKeyV1Response", + "GetProjectKeyV1ResponseItem", + "GetProjectKeyV1ResponseItemMember", + "GetProjectKeyV1ResponseItemMemberApiKey", + "GetProjectRequestV1Response", + "GetProjectV1Response", + "Google", + "GoogleModel", + "GoogleVersion", + "GrantV1Response", + "Groq", + "GroqReasoningMode", + "LeaveProjectV1Response", + "ListAgentConfigurationsV1Response", + "ListAgentVariablesV1Response", + "ListBillingFieldsV1Response", + "ListBillingFieldsV1ResponseDeploymentsItem", + "ListModelsV1Response", + "ListModelsV1ResponseSttModels", + "ListModelsV1ResponseTtsModels", + "ListModelsV1ResponseTtsModelsMetadata", + "ListProjectBalancesV1Response", + "ListProjectBalancesV1ResponseBalancesItem", + "ListProjectDistributionCredentialsV1Response", + "ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItem", + "ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemDistributionCredentials", + "ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemMember", + "ListProjectInvitesV1Response", + "ListProjectInvitesV1ResponseInvitesItem", + "ListProjectKeysV1Response", + "ListProjectKeysV1ResponseApiKeysItem", + "ListProjectKeysV1ResponseApiKeysItemApiKey", + "ListProjectKeysV1ResponseApiKeysItemMember", + "ListProjectMemberScopesV1Response", + "ListProjectMembersV1Response", + "ListProjectMembersV1ResponseMembersItem", + "ListProjectPurchasesV1Response", + "ListProjectPurchasesV1ResponseOrdersItem", + "ListProjectRequestsV1Response", + "ListProjectsV1Response", + "ListProjectsV1ResponseProjectsItem", + "ListenV1AcceptedResponse", + "ListenV1Callback", + "ListenV1CallbackMethod", + "ListenV1Channels", + "ListenV1DetectEntities", + "ListenV1Diarize", + "ListenV1Dictation", + "ListenV1Encoding", + "ListenV1Endpointing", + "ListenV1Extra", + "ListenV1InterimResults", + "ListenV1Keyterm", + "ListenV1Keywords", + "ListenV1Language", + "ListenV1LanguageHint", + "ListenV1MipOptOut", + "ListenV1Model", + "ListenV1Multichannel", + "ListenV1Numerals", + "ListenV1ProfanityFilter", + "ListenV1Punctuate", + "ListenV1Redact", + "ListenV1RedactUsage", + "ListenV1Replace", + "ListenV1RequestFile", + "ListenV1Response", + "ListenV1ResponseMetadata", + "ListenV1ResponseMetadataDiarizeInfo", + "ListenV1ResponseMetadataIntentsInfo", + "ListenV1ResponseMetadataSentimentInfo", + "ListenV1ResponseMetadataSummaryInfo", + "ListenV1ResponseMetadataTopicsInfo", + "ListenV1ResponseResults", + "ListenV1ResponseResultsChannels", + "ListenV1ResponseResultsChannelsItem", + "ListenV1ResponseResultsChannelsItemAlternativesItem", + "ListenV1ResponseResultsChannelsItemAlternativesItemEntitiesItem", + "ListenV1ResponseResultsChannelsItemAlternativesItemParagraphs", + "ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParagraphsItem", + "ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParagraphsItemSentencesItem", + "ListenV1ResponseResultsChannelsItemAlternativesItemSummariesItem", + "ListenV1ResponseResultsChannelsItemAlternativesItemTopicsItem", + "ListenV1ResponseResultsChannelsItemAlternativesItemWordsItem", + "ListenV1ResponseResultsChannelsItemSearchItem", + "ListenV1ResponseResultsChannelsItemSearchItemHitsItem", + "ListenV1ResponseResultsSummary", + "ListenV1ResponseResultsUtterances", + "ListenV1ResponseResultsUtterancesItem", + "ListenV1ResponseResultsUtterancesItemWordsItem", + "ListenV1SampleRate", + "ListenV1Search", + "ListenV1SmartFormat", + "ListenV1Tag", + "ListenV1UtteranceEndMs", + "ListenV1VadEvents", + "ListenV1Version", + "ListenV2ConfigureNumerals", + "ListenV2ConfigureRedactUsage", + "ListenV2EagerEotThreshold", + "ListenV2Encoding", + "ListenV2EotThreshold", + "ListenV2EotTimeoutMs", + "ListenV2Keyterm", + "ListenV2LanguageHint", + "ListenV2MipOptOut", + "ListenV2Model", + "ListenV2Numerals", + "ListenV2ProfanityFilter", + "ListenV2Redact", + "ListenV2RedactUsage", + "ListenV2SampleRate", + "ListenV2Tag", + "OpenAiSpeakProvider", + "OpenAiSpeakProviderModel", + "OpenAiSpeakProviderVoice", + "OpenAiThinkProvider", + "OpenAiThinkProviderModel", + "OpenAiThinkProviderReasoningMode", + "ProjectRequestResponse", + "ReadV1Request", + "ReadV1RequestText", + "ReadV1RequestUrl", + "ReadV1Response", + "ReadV1ResponseMetadata", + "ReadV1ResponseMetadataMetadata", + "ReadV1ResponseMetadataMetadataIntentsInfo", + "ReadV1ResponseMetadataMetadataSentimentInfo", + "ReadV1ResponseMetadataMetadataSummaryInfo", + "ReadV1ResponseMetadataMetadataTopicsInfo", + "ReadV1ResponseResults", + "ReadV1ResponseResultsSummary", + "ReadV1ResponseResultsSummaryResults", + "ReadV1ResponseResultsSummaryResultsSummary", + "SharedIntents", + "SharedIntentsSegmentsItem", + "SharedIntentsSegmentsItemIntentsItem", + "SharedSentiments", + "SharedSentimentsAverage", + "SharedSentimentsSegmentsItem", + "SharedTopics", + "SharedTopicsSegmentsItem", + "SharedTopicsSegmentsItemTopicsItem", + "SpeakSettingsV1", + "SpeakSettingsV1Endpoint", + "SpeakSettingsV1Provider", + "SpeakSettingsV1Provider_AwsPolly", + "SpeakSettingsV1Provider_Cartesia", + "SpeakSettingsV1Provider_Deepgram", + "SpeakSettingsV1Provider_ElevenLabs", + "SpeakSettingsV1Provider_OpenAi", + "SpeakV1Encoding", + "SpeakV1MipOptOut", + "SpeakV1Model", + "SpeakV1Response", + "SpeakV1SampleRate", + "SpeakV1Speed", + "SpeakV2AcceptedResponse", + "SpeakV2Encoding", + "SpeakV2Expressivity", + "SpeakV2MipOptOut", + "SpeakV2Model", + "SpeakV2NormalizeVolume", + "SpeakV2Response", + "SpeakV2SampleRate", + "SpeakV2Speed", + "SpeakV2SpeedValue", + "SpeakV2Tag", + "ThinkLiveSettingsV1", + "ThinkSettingsV1", + "ThinkSettingsV1ContextLength", + "ThinkSettingsV1Endpoint", + "ThinkSettingsV1FunctionsItem", + "ThinkSettingsV1FunctionsItemEndpoint", + "ThinkSettingsV1Provider", + "ThinkSettingsV1Provider_Anthropic", + "ThinkSettingsV1Provider_AwsBedrock", + "ThinkSettingsV1Provider_Deepgram", + "ThinkSettingsV1Provider_Google", + "ThinkSettingsV1Provider_Groq", + "ThinkSettingsV1Provider_OpenAi", + "UpdateProjectMemberScopesV1Response", + "UpdateProjectV1Response", + "UsageBreakdownV1Response", + "UsageBreakdownV1ResponseResolution", + "UsageBreakdownV1ResponseResultsItem", + "UsageBreakdownV1ResponseResultsItemGrouping", + "UsageFieldsV1Response", + "UsageFieldsV1ResponseModelsItem", + "UsageV1Response", + "UsageV1ResponseResolution", +] + +__all__.extend( + [ + "SharedIntentsResults", + "SharedIntentsResultsIntents", + "SharedIntentsResultsIntentsSegmentsItem", + "SharedIntentsResultsIntentsSegmentsItemIntentsItem", + "SharedTopicsResults", + "SharedTopicsResultsTopics", + "SharedTopicsResultsTopicsSegmentsItem", + "SharedTopicsResultsTopicsSegmentsItemTopicsItem", + "AnthropicThinkProviderModel", + "CartesiaSpeakProviderModelId", + "CartesiaSpeakProviderVoice", + "CreateKeyV1RequestOne", + "DeepgramListenProviderV2LanguageHint", + "DeepgramSpeakProviderModel", + "GoogleThinkProviderModel", + "GoogleThinkProviderVersion", + "GroqThinkProviderReasoningMode", + ] +) diff --git a/src/deepgram/types/deepgram.py.bak b/src/deepgram/types/deepgram.py.bak new file mode 100644 index 00000000..994f7a2c --- /dev/null +++ b/src/deepgram/types/deepgram.py.bak @@ -0,0 +1,44 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.unchecked_base_model import UncheckedBaseModel +from .deepgram_model import DeepgramModel + + +class Deepgram(UncheckedBaseModel): + """ + Deepgram text-to-speech provider. Aura models use version v1 (default); Flux TTS uses version v2 and a flux-* model. Flux TTS is the default when agent.speak is omitted, using the flux-kit-en voice. + """ + + type: typing.Literal["deepgram"] = "deepgram" + version: typing.Optional[str] = pydantic.Field(default=None) + """ + The Deepgram text-to-speech model family. Accepted values: `v1` (Aura, the default) and `v2` (Flux TTS). Use `v1` with an aura-* model and `v2` with a flux-* model. Defaults to `v1` when omitted. + """ + + model: DeepgramModel = pydantic.Field() + """ + Deepgram TTS model. Aura models (version v1) use the aura-* voices; Flux TTS (version v2) uses the flux-{voice}-{language} voices (e.g. flux-alexis-en). Defaults to flux-kit-en when agent.speak is omitted. + """ + + speed: typing.Optional[float] = pydantic.Field(default=None) + """ + Speaking rate multiplier that adjusts the pace of generated speech while preserving natural prosody and voice quality. Aura (version v1) accepts any value from 0.7 to 1.5. Flux TTS (version v2) accepts values from 0.5 to 1.5 in 0.05 increments; a value the family does not accept ends the session with FAILED_TO_SPEAK. Not yet supported in all languages. + """ + + expressivity: typing.Optional[pydantic.StrictInt] = pydantic.Field(default=None) + """ + Delivery register of the generated speech, on a calm-to-animated axis. Flux TTS (version v2) only, on every Flux voice. Accepts the whole numbers -2 to 2, where 0 (the default) is the voice's tuned delivery and the only value validated for production, -2 the calm end of the range and 2 the animated end. Fixed for the session. Beta: behavior may change in future model versions, and non-default values increase the risk of hallucinations and pronunciation errors. See [Expressivity](/docs/tts-expressivity). + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/deepgram/types/deepgram_listen_provider_v2.py.bak b/src/deepgram/types/deepgram_listen_provider_v2.py.bak new file mode 100644 index 00000000..d24729a0 --- /dev/null +++ b/src/deepgram/types/deepgram_listen_provider_v2.py.bak @@ -0,0 +1,86 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.unchecked_base_model import UncheckedBaseModel + + +class DeepgramListenProviderV2(UncheckedBaseModel): + type: typing.Literal["deepgram"] = pydantic.Field(default="deepgram") + """ + Provider type for speech-to-text + """ + + version: typing.Optional[typing.Literal["v2"]] = pydantic.Field(default=None) + """ + Specifies usage of the V2 Deepgram speech-to-text API (e.g. Flux) + """ + + model: str = pydantic.Field() + """ + Model to use for speech to text using the V2 API (e.g. flux-general-en, flux-general-multi) + """ + + language_hints: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + An array of one or more BCP-47 language codes to bias the model toward specific languages. Only supported when model is flux-general-multi. Without hints, the model auto-detects the spoken language. See the Language Prompting guide for details. + """ + + language_hint: typing.Optional[typing.Union[str, typing.List[str]]] = pydantic.Field(default=None, exclude=True) + """ + Deprecated. Use `language_hints`. Accepted for backward compatibility and + remapped before serialization so the singular field never reaches the API. + """ + + eot_threshold: typing.Optional[float] = pydantic.Field(default=None) + """ + End-of-turn confidence required to finish a turn. Valid range: 0.5 - 1.0. Defaults to 0.7. Set to 1.0 to fully suppress confidence-based end-of-turn detection. `eot_timeout_ms` still ends idle turns; increase it when using ForceEndTurn for full manual turn control. + """ + + eager_eot_threshold: typing.Optional[float] = pydantic.Field(default=None) + """ + End-of-turn confidence required to fire an eager end-of-turn event. When set, enables EagerEndOfTurn and TurnResumed events. Valid range: 0.3 - 0.9. + """ + + eot_timeout_ms: typing.Optional[int] = pydantic.Field(default=None) + """ + A turn will be finished when this much time in milliseconds has passed after speech, regardless of EOT confidence. Defaults to 5000. + """ + + keyterms: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + Prompt keyterm recognition to improve Keyword Recall Rate + """ + + if IS_PYDANTIC_V2: + + @pydantic.model_validator(mode="before") + @classmethod + def _migrate_language_hint(cls, values: typing.Any) -> typing.Any: + if not isinstance(values, dict) or "language_hint" not in values: + return values + values = dict(values) + hint = values.pop("language_hint") + if hint is not None and values.get("language_hints") is None: + values["language_hints"] = [hint] if isinstance(hint, str) else list(hint) + return values + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + @pydantic.root_validator(pre=True) # type: ignore[deprecated] + def _migrate_language_hint(cls, values: typing.Any) -> typing.Any: # type: ignore[no-redef] + if not isinstance(values, dict) or "language_hint" not in values: + return values + values = dict(values) + hint = values.pop("language_hint") + if hint is not None and values.get("language_hints") is None: + values["language_hints"] = [hint] if isinstance(hint, str) else list(hint) + return values + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/deepgram/types/shared_intents.py.bak b/src/deepgram/types/shared_intents.py.bak new file mode 100644 index 00000000..ad991bcf --- /dev/null +++ b/src/deepgram/types/shared_intents.py.bak @@ -0,0 +1,62 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.unchecked_base_model import UncheckedBaseModel +from .shared_intents_results import SharedIntentsResults +from .shared_intents_results_intents import SharedIntentsResultsIntents +from .shared_intents_segments_item import SharedIntentsSegmentsItem + + +class SharedIntents(UncheckedBaseModel): + """ + Output whenever `intents=true` is used + """ + + segments: typing.Optional[typing.List[SharedIntentsSegmentsItem]] = None + + @property + def results(self) -> typing.Optional[SharedIntentsResults]: + """Deprecated facade for the pre-7.12 ``results.intents.segments`` path.""" + if self.segments is None: + return None + return SharedIntentsResults(intents=SharedIntentsResultsIntents(segments=self.segments)) + + if IS_PYDANTIC_V2: + + @pydantic.model_validator(mode="before") + @classmethod + def _migrate_legacy_results(cls, values: typing.Any) -> typing.Any: + if not isinstance(values, dict) or "results" not in values: + return values + values = dict(values) + results = values.pop("results") + if "segments" in values: + return values + intents = results.get("intents") if isinstance(results, dict) else getattr(results, "intents", None) + if intents is not None: + values["segments"] = intents.get("segments") if isinstance(intents, dict) else intents.segments + return values + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + @pydantic.root_validator(pre=True) # type: ignore[deprecated] + def _migrate_legacy_results(cls, values: typing.Any) -> typing.Any: # type: ignore[no-redef] + if not isinstance(values, dict) or "results" not in values: + return values + values = dict(values) + results = values.pop("results") + if "segments" in values: + return values + intents = results.get("intents") if isinstance(results, dict) else getattr(results, "intents", None) + if intents is not None: + values["segments"] = intents.get("segments") if isinstance(intents, dict) else intents.segments + return values + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/deepgram/types/shared_topics.py.bak b/src/deepgram/types/shared_topics.py.bak new file mode 100644 index 00000000..4f26c3b7 --- /dev/null +++ b/src/deepgram/types/shared_topics.py.bak @@ -0,0 +1,62 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.unchecked_base_model import UncheckedBaseModel +from .shared_topics_results import SharedTopicsResults +from .shared_topics_results_topics import SharedTopicsResultsTopics +from .shared_topics_segments_item import SharedTopicsSegmentsItem + + +class SharedTopics(UncheckedBaseModel): + """ + Output whenever `topics=true` is used + """ + + segments: typing.Optional[typing.List[SharedTopicsSegmentsItem]] = None + + @property + def results(self) -> typing.Optional[SharedTopicsResults]: + """Deprecated facade for the pre-7.12 ``results.topics.segments`` path.""" + if self.segments is None: + return None + return SharedTopicsResults(topics=SharedTopicsResultsTopics(segments=self.segments)) + + if IS_PYDANTIC_V2: + + @pydantic.model_validator(mode="before") + @classmethod + def _migrate_legacy_results(cls, values: typing.Any) -> typing.Any: + if not isinstance(values, dict) or "results" not in values: + return values + values = dict(values) + results = values.pop("results") + if "segments" in values: + return values + topics = results.get("topics") if isinstance(results, dict) else getattr(results, "topics", None) + if topics is not None: + values["segments"] = topics.get("segments") if isinstance(topics, dict) else topics.segments + return values + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + @pydantic.root_validator(pre=True) # type: ignore[deprecated] + def _migrate_legacy_results(cls, values: typing.Any) -> typing.Any: # type: ignore[no-redef] + if not isinstance(values, dict) or "results" not in values: + return values + values = dict(values) + results = values.pop("results") + if "segments" in values: + return values + topics = results.get("topics") if isinstance(results, dict) else getattr(results, "topics", None) + if topics is not None: + values["segments"] = topics.get("segments") if isinstance(topics, dict) else topics.segments + return values + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/deepgram/types/speak_settings_v1provider.py.bak b/src/deepgram/types/speak_settings_v1provider.py.bak new file mode 100644 index 00000000..3fbef168 --- /dev/null +++ b/src/deepgram/types/speak_settings_v1provider.py.bak @@ -0,0 +1,117 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata +from .aws_polly_speak_provider_credentials import AwsPollySpeakProviderCredentials +from .aws_polly_speak_provider_engine import AwsPollySpeakProviderEngine +from .aws_polly_speak_provider_voice import AwsPollySpeakProviderVoice +from .cartesia_model_id import CartesiaModelId +from .cartesia_voice import CartesiaVoice +from .deepgram_model import DeepgramModel +from .eleven_labs_speak_provider_model_id import ElevenLabsSpeakProviderModelId +from .open_ai_speak_provider_model import OpenAiSpeakProviderModel +from .open_ai_speak_provider_voice import OpenAiSpeakProviderVoice + + +class SpeakSettingsV1Provider_Deepgram(UncheckedBaseModel): + type: typing.Literal["deepgram"] = "deepgram" + version: typing.Optional[str] = None + model: DeepgramModel + speed: typing.Optional[float] = None + expressivity: typing.Optional[pydantic.StrictInt] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class SpeakSettingsV1Provider_ElevenLabs(UncheckedBaseModel): + type: typing.Literal["eleven_labs"] = "eleven_labs" + version: typing.Optional[typing.Literal["v1"]] = None + model_id: ElevenLabsSpeakProviderModelId + language: typing.Optional[str] = None + language_code: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class SpeakSettingsV1Provider_Cartesia(UncheckedBaseModel): + type: typing.Literal["cartesia"] = "cartesia" + version: typing.Optional[typing.Literal["2025-03-17"]] = None + model_id: CartesiaModelId + voice: CartesiaVoice + language: typing.Optional[str] = None + volume: typing.Optional[float] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class SpeakSettingsV1Provider_OpenAi(UncheckedBaseModel): + type: typing.Literal["open_ai"] = "open_ai" + version: typing.Optional[typing.Literal["v1"]] = None + model: OpenAiSpeakProviderModel + voice: OpenAiSpeakProviderVoice + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class SpeakSettingsV1Provider_AwsPolly(UncheckedBaseModel): + type: typing.Literal["aws_polly"] = "aws_polly" + voice: AwsPollySpeakProviderVoice + language: str + language_code: typing.Optional[str] = None + engine: AwsPollySpeakProviderEngine + credentials: AwsPollySpeakProviderCredentials + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +SpeakSettingsV1Provider = typing_extensions.Annotated[ + typing.Union[ + SpeakSettingsV1Provider_Deepgram, + SpeakSettingsV1Provider_ElevenLabs, + SpeakSettingsV1Provider_Cartesia, + SpeakSettingsV1Provider_OpenAi, + SpeakSettingsV1Provider_AwsPolly, + ], + UnionMetadata(discriminant="type"), +] diff --git a/tests/wire/test_listen_v1_media.py.bak b/tests/wire/test_listen_v1_media.py.bak new file mode 100644 index 00000000..9998a387 --- /dev/null +++ b/tests/wire/test_listen_v1_media.py.bak @@ -0,0 +1,105 @@ +from .conftest import get_client, verify_request_count + + +def test_listen_v1_media_transcribe_url() -> None: + """Test transcribeUrl endpoint with WireMock""" + test_id = "listen.v1.media.transcribe_url.0" + client = get_client(test_id) + client.listen.v1.media.transcribe_url( + url="https://dpgr.am/spacewalk.wav", + ) + verify_request_count(test_id, "POST", "/v1/listen", None, 1) + + +def test_listen_v1_media_transcribe_url_serializes_all_query_params() -> None: + test_id = "listen.v1.media.transcribe_url.query_params" + client = get_client(test_id) + client.listen.v1.media.transcribe_url( + callback="callback", + callback_method="POST", + extra=["extra"], + sentiment=True, + summarize="v2", + tag=["tag"], + topics=True, + custom_topic=["custom_topic"], + custom_topic_mode="extended", + intents=True, + custom_intent=["custom_intent"], + custom_intent_mode="extended", + detect_entities=True, + detect_language=True, + diarize=True, + diarize_model="latest", + dictation=True, + encoding="linear16", + filler_words=True, + keyterm=["keyterm"], + keywords=["keywords"], + language="multi", + language_hint=["en", "es"], + measurements=True, + model="nova-3", + multichannel=True, + numerals=True, + paragraphs=True, + profanity_filter=True, + punctuate=True, + redact="redact", + redact_usage=True, + replace=["replace"], + search=["search"], + smart_format=True, + utterances=True, + utt_split=1.1, + version="latest", + mip_opt_out=True, + url="https://dpgr.am/spacewalk.wav", + ) + verify_request_count( + test_id, + "POST", + "/v1/listen", + { + "callback": "callback", + "callback_method": "POST", + "extra": "extra", + "sentiment": "true", + "summarize": "v2", + "tag": "tag", + "topics": "true", + "custom_topic": "custom_topic", + "custom_topic_mode": "extended", + "intents": "true", + "custom_intent": "custom_intent", + "custom_intent_mode": "extended", + "detect_entities": "true", + "detect_language": "true", + "diarize": "true", + "diarize_model": "latest", + "dictation": "true", + "encoding": "linear16", + "filler_words": "true", + "keyterm": "keyterm", + "keywords": "keywords", + "language": "multi", + "language_hint": ["en", "es"], + "measurements": "true", + "model": "nova-3", + "multichannel": "true", + "numerals": "true", + "paragraphs": "true", + "profanity_filter": "true", + "punctuate": "true", + "redact": "redact", + "redact_usage": "true", + "replace": "replace", + "search": "search", + "smart_format": "true", + "utterances": "true", + "utt_split": "1.1", + "version": "latest", + "mip_opt_out": "true", + }, + 1, + ) diff --git a/tests/wire/test_manage_v1_projects_keys.py.bak b/tests/wire/test_manage_v1_projects_keys.py.bak new file mode 100644 index 00000000..4b7a8100 --- /dev/null +++ b/tests/wire/test_manage_v1_projects_keys.py.bak @@ -0,0 +1,59 @@ +from .conftest import get_client, verify_request_count + +from deepgram.requests import CreateKeyV1RequestOneParams + + +def test_manage_v1_projects_keys_list_() -> None: + """Test list endpoint with WireMock""" + test_id = "manage.v1.projects.keys.list_.0" + client = get_client(test_id) + client.manage.v1.projects.keys.list( + project_id="123456-7890-1234-5678-901234", + status="active", + ) + verify_request_count(test_id, "GET", "/v1/projects/123456-7890-1234-5678-901234/keys", {"status": "active"}, 1) + + +def test_manage_v1_projects_keys_create() -> None: + """Test create endpoint with WireMock""" + test_id = "manage.v1.projects.keys.create.0" + client = get_client(test_id) + client.manage.v1.projects.keys.create( + project_id="project_id", + request={"key": "value"}, + ) + verify_request_count(test_id, "POST", "/v1/projects/project_id/keys", None, 1) + + +def test_manage_v1_projects_keys_create_with_old_request_alias() -> None: + test_id = "manage.v1.projects.keys.create.compat" + client = get_client(test_id) + request: CreateKeyV1RequestOneParams = {"key": "value"} + client.manage.v1.projects.keys.create(project_id="project_id", request=request) + verify_request_count(test_id, "POST", "/v1/projects/project_id/keys", None, 1) + + +def test_manage_v1_projects_keys_get() -> None: + """Test get endpoint with WireMock""" + test_id = "manage.v1.projects.keys.get.0" + client = get_client(test_id) + client.manage.v1.projects.keys.get( + project_id="123456-7890-1234-5678-901234", + key_id="123456789012345678901234", + ) + verify_request_count( + test_id, "GET", "/v1/projects/123456-7890-1234-5678-901234/keys/123456789012345678901234", None, 1 + ) + + +def test_manage_v1_projects_keys_delete() -> None: + """Test delete endpoint with WireMock""" + test_id = "manage.v1.projects.keys.delete.0" + client = get_client(test_id) + client.manage.v1.projects.keys.delete( + project_id="123456-7890-1234-5678-901234", + key_id="123456789012345678901234", + ) + verify_request_count( + test_id, "DELETE", "/v1/projects/123456-7890-1234-5678-901234/keys/123456789012345678901234", None, 1 + ) diff --git a/tests/wire/test_manage_v1_projects_requests.py.bak b/tests/wire/test_manage_v1_projects_requests.py.bak new file mode 100644 index 00000000..daccaba9 --- /dev/null +++ b/tests/wire/test_manage_v1_projects_requests.py.bak @@ -0,0 +1,66 @@ +import datetime + +from .conftest import get_client, verify_request_count + + +def test_manage_v1_projects_requests_list_() -> None: + """Test list endpoint with WireMock""" + test_id = "manage.v1.projects.requests.list_.0" + client = get_client(test_id) + client.manage.v1.projects.requests.list( + project_id="12345678-90ab-cdef-1234-567890abcdef", + ) + verify_request_count(test_id, "GET", "/v1/projects/12345678-90ab-cdef-1234-567890abcdef/requests", None, 1) + + +def test_manage_v1_projects_requests_list_serializes_all_query_params() -> None: + test_id = "manage.v1.projects.requests.list_.query_params" + client = get_client(test_id) + client.manage.v1.projects.requests.list( + project_id="12345678-90ab-cdef-1234-567890abcdef", + start=datetime.datetime.fromisoformat("2024-01-15T09:30:00+00:00"), + end=datetime.datetime.fromisoformat("2024-01-15T09:30:00+00:00"), + limit=1.1, + page=1.1, + accessor="12345678-1234-1234-1234-123456789012", + request_id="12345678-1234-1234-1234-123456789012", + deployment="hosted", + endpoint="listen", + method="sync", + status="succeeded", + ) + verify_request_count( + test_id, + "GET", + "/v1/projects/12345678-90ab-cdef-1234-567890abcdef/requests", + { + "start": "2024-01-15T09:30:00Z", + "end": "2024-01-15T09:30:00Z", + "limit": "1.1", + "page": "1.1", + "accessor": "12345678-1234-1234-1234-123456789012", + "request_id": "12345678-1234-1234-1234-123456789012", + "deployment": "hosted", + "endpoint": "listen", + "method": "sync", + "status": "succeeded", + }, + 1, + ) + + +def test_manage_v1_projects_requests_get() -> None: + """Test get endpoint with WireMock""" + test_id = "manage.v1.projects.requests.get.0" + client = get_client(test_id) + client.manage.v1.projects.requests.get( + project_id="12345678-90ab-cdef-1234-567890abcdef", + request_id="a3f1c9d2-4b7e-4f9a-8c3d-2e5f7b9a1c0d", + ) + verify_request_count( + test_id, + "GET", + "/v1/projects/12345678-90ab-cdef-1234-567890abcdef/requests/a3f1c9d2-4b7e-4f9a-8c3d-2e5f7b9a1c0d", + None, + 1, + ) From 28ff36907e6ca6b59ede65c0eee8ca4dd3349864 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 1 Dec 2026 13:05:55 +0000 Subject: [PATCH 3/6] SDK regeneration --- .fern/metadata.json | 8 +- .gitignore | 3 - poetry.lock | 678 +++++++++--------- pyproject.toml | 2 +- src/deepgram/__init__.py | 85 +-- src/deepgram/agent/__init__.py | 68 -- src/deepgram/agent/v1/__init__.py | 68 -- src/deepgram/agent/v1/requests/__init__.py | 38 - .../v1/requests/agent_v1conversation_text.py | 2 +- .../agent_v1inject_dynamic_agent_message.py | 2 +- .../agent/v1/requests/agent_v1settings.py | 3 +- .../v1/requests/agent_v1settings_agent.py | 17 +- .../agent_v1settings_agent_context.py | 4 - .../v1/requests/agent_v1update_prompt.py | 2 +- src/deepgram/agent/v1/socket_client.py | 47 +- src/deepgram/agent/v1/types/__init__.py | 42 -- .../v1/types/agent_v1conversation_text.py | 4 +- .../agent_v1inject_dynamic_agent_message.py | 2 +- .../agent/v1/types/agent_v1settings.py | 3 +- .../agent/v1/types/agent_v1settings_agent.py | 53 +- .../types/agent_v1settings_agent_context.py | 21 - ...1settings_agent_context_listen_provider.py | 23 - .../agent_v1settings_agent_listen_provider.py | 23 - .../v1/types/agent_v1update_listen_listen.py | 36 - .../agent/v1/types/agent_v1update_prompt.py | 2 +- src/deepgram/core/api_error.py | 4 +- src/deepgram/core/client_wrapper.py | 2 +- src/deepgram/core/parse_error.py | 4 +- src/deepgram/core/query_encoder.py | 15 +- src/deepgram/listen/__init__.py | 4 - .../v1/requests/listen_v1configure_failure.py | 2 +- src/deepgram/listen/v1/socket_client.py | 32 +- .../v1/types/listen_v1configure_failure.py | 2 +- src/deepgram/listen/v2/__init__.py | 4 - src/deepgram/listen/v2/socket_client.py | 38 +- src/deepgram/listen/v2/types/__init__.py | 4 - .../v2/types/listen_v2configure_failure.py | 4 +- .../v2/types/listen_v2configure_success.py | 4 +- .../listen_v2configure_success_thresholds.py | 4 +- .../listen/v2/types/listen_v2connected.py | 4 +- .../listen/v2/types/listen_v2fatal_error.py | 4 +- .../listen/v2/types/listen_v2turn_info.py | 4 +- .../v2/types/listen_v2turn_info_words_item.py | 4 +- .../listen/v2/types/listen_v2warning.py | 4 +- .../manage/v1/projects/keys/client.py | 64 +- .../manage/v1/projects/keys/raw_client.py | 61 +- src/deepgram/requests/__init__.py | 41 +- src/deepgram/requests/create_key_v1request.py | 5 - src/deepgram/requests/nvidia.py | 29 + src/deepgram/requests/shared_intents.py | 2 - src/deepgram/requests/shared_topics.py | 2 - src/deepgram/requests/think_settings_v1.py | 2 +- .../requests/think_settings_v1endpoint.py | 2 +- .../requests/think_settings_v1provider.py | 10 + src/deepgram/speak/v1/socket_client.py | 34 +- .../speak/v2/requests/speak_v2warning.py | 8 +- src/deepgram/speak/v2/socket_client.py | 31 +- .../speak/v2/types/speak_v2warning.py | 8 +- src/deepgram/types/__init__.py | 56 +- src/deepgram/types/create_key_v1request.py | 5 - src/deepgram/types/deepgram.py | 2 +- .../types/deepgram_listen_provider_v2.py | 28 - src/deepgram/types/nvidia.py | 40 ++ src/deepgram/types/nvidia_reasoning_mode.py | 5 + src/deepgram/types/shared_intents.py | 37 - src/deepgram/types/shared_topics.py | 37 - .../types/speak_settings_v1provider.py | 2 +- src/deepgram/types/think_settings_v1.py | 2 +- .../types/think_settings_v1endpoint.py | 2 +- .../types/think_settings_v1provider.py | 19 + tests/wire/test_listen_v1_media.py | 94 --- tests/wire/test_manage_v1_projects_keys.py | 17 +- .../wire/test_manage_v1_projects_requests.py | 38 - wiremock/wiremock-mappings.json | 4 +- 74 files changed, 716 insertions(+), 1350 deletions(-) delete mode 100644 src/deepgram/requests/create_key_v1request.py create mode 100644 src/deepgram/requests/nvidia.py delete mode 100644 src/deepgram/types/create_key_v1request.py create mode 100644 src/deepgram/types/nvidia.py create mode 100644 src/deepgram/types/nvidia_reasoning_mode.py diff --git a/.fern/metadata.json b/.fern/metadata.json index c9cac64b..ba89ddc7 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -1,5 +1,5 @@ { - "cliVersion": "5.95.1", + "cliVersion": "5.216.0", "generatorName": "fernapi/fern-python-sdk", "generatorVersion": "5.39.3", "generatorConfig": { @@ -21,8 +21,8 @@ "skip_validation": true } }, - "originGitCommit": "229defd4c32f220af07902c24efca5e94b4c47a4", + "originGitCommit": "a70c45e45ad40df616f6103f8bd5e54fee0bff2a", "originGitCommitIsDirty": true, "invokedBy": "manual", - "sdkVersion": "7.20.0" -} + "sdkVersion": "7.20.1" +} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 765eb109..d2e4ca80 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,3 @@ __pycache__/ dist/ poetry.toml -.coverage -htmlcov/ -coverage.xml diff --git a/poetry.lock b/poetry.lock index bbc6a71f..d3bd4bec 100644 --- a/poetry.lock +++ b/poetry.lock @@ -289,196 +289,196 @@ files = [ [[package]] name = "certifi" -version = "2026.10.23" +version = "2026.11.20" description = "Python package for providing Mozilla's CA Bundle." optional = false python-versions = ">=3.7" groups = ["main", "dev"] files = [ - {file = "certifi-2026.10.23-py3-none-any.whl", hash = "sha256:e9b54de76e530bb6cf0ccd036787103acb58fd42ba930ea8bf948ddbaa2f61d1"}, - {file = "certifi-2026.10.23.tar.gz", hash = "sha256:a9895e6e2758b371e0545e321a3a8fd1fcfd9829ada8824a936dfb16aaaf36cd"}, + {file = "certifi-2026.11.20-py3-none-any.whl", hash = "sha256:7422df25243767b9877031a2248cb14d09ddac9beee846f4cef3d5c9191d488f"}, + {file = "certifi-2026.11.20.tar.gz", hash = "sha256:af1cb240a8133f105aa52684a3a3258339d7f2fd0bd4e2812698ff5cf5588c4e"}, ] [[package]] name = "charset-normalizer" -version = "3.5.2" +version = "3.5.3" description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." optional = false python-versions = ">=3.7" groups = ["dev"] files = [ - {file = "charset_normalizer-3.5.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:195c26fb65950f8fce54e26349852b7bdd7c5f120aeefbcc440b8a20faaed4a3"}, - {file = "charset_normalizer-3.5.2-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9373ad13ef0d2c0fb761e04e55bfdee5a08b52cef2c882c8fbe9935b1517152e"}, - {file = "charset_normalizer-3.5.2-cp310-cp310-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:ddf19c062bea7a0cc80f519243d2c01dd091be0cf952a0750d4ad576709559f5"}, - {file = "charset_normalizer-3.5.2-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:3d14b50de6bf4d0edf857a9386836846f982b8f524e188e2e68b96d702bcf4aa"}, - {file = "charset_normalizer-3.5.2-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:28a15fdad492a99b6eccfaaed66ef3f74050680545ea61ec8b2f4c538f1f1320"}, - {file = "charset_normalizer-3.5.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8a893cc101149f80a653f82062ebc95b34525a2614382e1da5458fe7c6997249"}, - {file = "charset_normalizer-3.5.2-cp310-cp310-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:619799369eeef6366ed3e8755a5670f4f2f0fb6b30a0fd7264dc0fdc2357058e"}, - {file = "charset_normalizer-3.5.2-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:447441e76ec720b15e64418d32e092297340387053047c7c694f579efb0ee1d9"}, - {file = "charset_normalizer-3.5.2-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:62588a277bfb59def052abd940703fa35107152bf479781a878617d60faf8fb5"}, - {file = "charset_normalizer-3.5.2-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:44bd4fbb29dfbeba60e7d2bd000c59e4b21ddb3cc53912b14048d37092706d7c"}, - {file = "charset_normalizer-3.5.2-cp310-cp310-musllinux_1_2_riscv64.whl", hash = "sha256:30fcd120b732aa79317f08dee04d7de0847822e4cf7ee0e9f445bb958832252c"}, - {file = "charset_normalizer-3.5.2-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:50e3adfb96fc189eb27b1cf62d3b598b89b4bb0420d93a3d3e42e137409011be"}, - {file = "charset_normalizer-3.5.2-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:b736353c0a625bbd5fcec108576e2385db3496f4f771f785ff32e108d3c3bc45"}, - {file = "charset_normalizer-3.5.2-cp310-cp310-win32.whl", hash = "sha256:f5833ad231be5eb6553de524a70f48d71b2c8563101750531e0b80184e175cd4"}, - {file = "charset_normalizer-3.5.2-cp310-cp310-win_amd64.whl", hash = "sha256:1461ac396c4fdb983a675f20aa555624f0ee18ac83d832b9244ffff3d8055275"}, - {file = "charset_normalizer-3.5.2-cp310-cp310-win_arm64.whl", hash = "sha256:c6708715abcf3c73b99508253e961a9967f02fe536532834149574eda6de0d1c"}, - {file = "charset_normalizer-3.5.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:3d21b8b13c7592db2ac5e544a6d83187b995257472b0c9e8351b6d507ae37ed6"}, - {file = "charset_normalizer-3.5.2-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d760fe2a4d7c3b226cb9026d6a842868d52a7901bd98420e1baf14e80da85cf5"}, - {file = "charset_normalizer-3.5.2-cp311-cp311-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:c9790464842f85f437dbbb54417eda1e0e6bfc52dd8d22d6fd1c994b73b2dc74"}, - {file = "charset_normalizer-3.5.2-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:4685902cf26edf013ed7a3da0f426ebba7a00ebb9541386d835afbf002c11cab"}, - {file = "charset_normalizer-3.5.2-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:4495c5002a7b28557e7e222e77e0b661183e432b7d6d2e788101e3f240e05b8c"}, - {file = "charset_normalizer-3.5.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:211d5a3eb6af8f513b8d4ca19a8c1b7accab1b5f0d3175f9826b03c1a920dc1f"}, - {file = "charset_normalizer-3.5.2-cp311-cp311-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:ef4fcbf3327382cd4c9f540babd61248208af7b93eec4de397b4d5f58a09e288"}, - {file = "charset_normalizer-3.5.2-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:bd16aabe4a02a297c23417aa17ac6299dbd8c49f673bcd645b4929b11f5a4400"}, - {file = "charset_normalizer-3.5.2-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:fb9e68df06293761f9fe66ade60a9bc6d0f5e42b8acf2939a9158af86ab0e5bd"}, - {file = "charset_normalizer-3.5.2-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:59f63901b0031c3136cf64704dcb21de0bbae62ce2c9529bc39d27665463de37"}, - {file = "charset_normalizer-3.5.2-cp311-cp311-musllinux_1_2_riscv64.whl", hash = "sha256:304d5463e65a35d7bb0850550e0780395395f6fcf452f04db7d5ca7cecc425ac"}, - {file = "charset_normalizer-3.5.2-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:9cf9b1a857e25c4baceeb3624e92a56df3668f398c4acba74e174d81fb4d1d3a"}, - {file = "charset_normalizer-3.5.2-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:114e4d0c92d618409ed82a99e22b5c5e768fe995f2973f78265f4524f49d4640"}, - {file = "charset_normalizer-3.5.2-cp311-cp311-win32.whl", hash = "sha256:2625388c6c754520c37abaf3b41eb34d1cc4a373f457898f08606c8e362b891d"}, - {file = "charset_normalizer-3.5.2-cp311-cp311-win_amd64.whl", hash = "sha256:87e50a3e7cb90af586b6c5faf23e302a970415ac73bd7bd90a515a04b427ef96"}, - {file = "charset_normalizer-3.5.2-cp311-cp311-win_arm64.whl", hash = "sha256:254eb48b9fa5ee9898a3c445825a1f340fe53712a098904b39b0bddba8ea3cb1"}, - {file = "charset_normalizer-3.5.2-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:ed2a239c0ea213acc1908150a3037257083c7c083128f1a4cec2ec4b97dca491"}, - {file = "charset_normalizer-3.5.2-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b91363207bd9dc966a691e959bb47f64b30f7ac4b072be9968b366982f7db77c"}, - {file = "charset_normalizer-3.5.2-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:38a873987f3be698494da8b2e3085e29da02da7b633dce73e79c699a113d7bf0"}, - {file = "charset_normalizer-3.5.2-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:355ad8011081dec5412240c087a9a0c9d4d5039f3ed11a3f13e18c2b29b56c51"}, - {file = "charset_normalizer-3.5.2-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:ee21e28f0430bd6dc9086c6e525d5e818a44a5ad19720c8a0ef766792f3eb5e5"}, - {file = "charset_normalizer-3.5.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:3d31298449090ab8d47b7b1b2a555ff73cac7ed438a08b7ac160980c7ebed649"}, - {file = "charset_normalizer-3.5.2-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:5cde776b7cc66e4f6c99612cea4aa7269aa65863f7a15841b2c264f103822f4e"}, - {file = "charset_normalizer-3.5.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:ae4f5fea5b8b8ccff88238cc8569303e5ee95efae67fa62922a311397a71f346"}, - {file = "charset_normalizer-3.5.2-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:f7d486c83842422badd511868fd8a9a20e9407ace71564b6af47ce7e60a336c1"}, - {file = "charset_normalizer-3.5.2-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:11a4d68a6ecda3292cb1e50239e111543ba5d709bb62a6b4ea1afcfa729d8875"}, - {file = "charset_normalizer-3.5.2-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:d6734d2ef8a50fbf8445c139477da401f50d62a0606bf00e20ec6d87773fefb1"}, - {file = "charset_normalizer-3.5.2-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:a815775b6c38d4e0ff7bcffbeba67feded90202bb6a226b8dd35f1c855217413"}, - {file = "charset_normalizer-3.5.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:23851fb4e1b85ed3f6c2a27b777cdfe2e19fb5b38429a8faf38c7542b7665869"}, - {file = "charset_normalizer-3.5.2-cp312-cp312-win32.whl", hash = "sha256:db19d07e2e0129e974a0e65d0064fc222a446cd5122c2fd4184d2af9fc734a9e"}, - {file = "charset_normalizer-3.5.2-cp312-cp312-win_amd64.whl", hash = "sha256:780fbe7cab297b81dad9fb8dc5eb003c0468ffb0d9e5f65068c53a34661a96bc"}, - {file = "charset_normalizer-3.5.2-cp312-cp312-win_arm64.whl", hash = "sha256:e2af3aad578aa6bd1384bcf4750fc285e5a9de53f40b7d41e5a0bf748edeb2b3"}, - {file = "charset_normalizer-3.5.2-cp313-cp313-android_24_arm64_v8a.whl", hash = "sha256:ed905975ab14056a2e5eb1c376cb2e1ebc5396baf84163939c518556fccde9f5"}, - {file = "charset_normalizer-3.5.2-cp313-cp313-android_24_x86_64.whl", hash = "sha256:a66c3bc5ab1f0ff2164fc9965ddd611ff0802173f4b9d24554c563f6ab7e1d6e"}, - {file = "charset_normalizer-3.5.2-cp313-cp313-ios_13_0_arm64_iphoneos.whl", hash = "sha256:d2374b62878abb00cd8309b32af6c0b715cd02dec0ca74ef12e5069bdc64144a"}, - {file = "charset_normalizer-3.5.2-cp313-cp313-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:d376bbd28b3a8999db1a103b3b388aee6f1ddeb3e51bc2172993efdcd86e064d"}, - {file = "charset_normalizer-3.5.2-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:6045373d5a89a5ec71afde535db987ca28e76dfa276c2d4c818265b375d4b055"}, - {file = "charset_normalizer-3.5.2-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:849df64e889b2e17230d58410a03dba311a65b163508fd33679b2b737d4b7858"}, - {file = "charset_normalizer-3.5.2-cp313-cp313-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:15c44f7edfd477b06f517a5cc317fc1707edb9de2c865f43d4b6513907473234"}, - {file = "charset_normalizer-3.5.2-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:a89012d6d5476ee112d20d998570ed58df2260a852afb1758809cd6900411d21"}, - {file = "charset_normalizer-3.5.2-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:0c951d5e6dd9c2ff60609476752bee49da4206adde960ebc247766937f72e718"}, - {file = "charset_normalizer-3.5.2-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7218e8f32b0956cfcd048fd42d9d5779809745ca1d86113ca56f66e7ae1549c4"}, - {file = "charset_normalizer-3.5.2-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:a19a731138fc27d5682277d3b9df22855cea1239bce7fcec5f78f42ef2d1f3c3"}, - {file = "charset_normalizer-3.5.2-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:62603db9a7caa0802eaa28c1c46fecd7b3a263a774069c24c3c28c302448721c"}, - {file = "charset_normalizer-3.5.2-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:b6856554c4f44d79fc2307d5768854310a8f0096e501c75637542c82292b0429"}, - {file = "charset_normalizer-3.5.2-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:1bc0baf5ef96b6ede57d47f4b8fe4d9d84019c3bfcbeb20a41edc6a6ee341f1f"}, - {file = "charset_normalizer-3.5.2-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:56bc200a365efb37383b7852e4cc5898d3b2da5987289b543956cf8cad71018a"}, - {file = "charset_normalizer-3.5.2-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:2c9ad19a6cfcd5ea5c0d41161d22f9df1dcc277e9bef2751391334546a314c00"}, - {file = "charset_normalizer-3.5.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:e243bd13217235fc7290c621941c3f5cc8b66e4872495be821d7436ba2fb838d"}, - {file = "charset_normalizer-3.5.2-cp313-cp313-pyemscripten_2025_0_wasm32.whl", hash = "sha256:a090bb2c68df85450502e3e20d665e3a5af9c65a84d6508ed477badd49166fd3"}, - {file = "charset_normalizer-3.5.2-cp313-cp313-win32.whl", hash = "sha256:2b7b3bbfb4fe8ef40600792d762fbaa9057559f9d3fad209525b7a22b99e91fd"}, - {file = "charset_normalizer-3.5.2-cp313-cp313-win_amd64.whl", hash = "sha256:78456a747de8dc58360ffa581f30a002baf5aa28cb262536545e91f113ed7639"}, - {file = "charset_normalizer-3.5.2-cp313-cp313-win_arm64.whl", hash = "sha256:11912e4bb14baae7c5d8791aa55ba0a3a03ec6729073307b0f57270abaa713d3"}, - {file = "charset_normalizer-3.5.2-cp314-cp314-android_24_arm64_v8a.whl", hash = "sha256:1afb975bd5d68d5ce9f6b6d44fdf2f7e34b895a35e95708a7a91b20a3b51d187"}, - {file = "charset_normalizer-3.5.2-cp314-cp314-android_24_x86_64.whl", hash = "sha256:bbbfc8e28816f19d7c0f1816664980c0a9875d01b27cdf8eedddb639d9e108ad"}, - {file = "charset_normalizer-3.5.2-cp314-cp314-ios_13_0_arm64_iphoneos.whl", hash = "sha256:7967d08cf06dee78443b874f98c98036f624f3a4e73e11f9f64f5be4d25393cf"}, - {file = "charset_normalizer-3.5.2-cp314-cp314-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:4c2b5031f63e331e3839b40aed2dd6f191e9c07edbde303e7876846ea1946995"}, - {file = "charset_normalizer-3.5.2-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:fcff63213e8e6e47770541a4607175404f47cbb3ebea7b6058cc82d524a0e424"}, - {file = "charset_normalizer-3.5.2-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8d86d6fc60743dc916eb79e2eb1ec4818e21e427731543af40a3021851174a13"}, - {file = "charset_normalizer-3.5.2-cp314-cp314-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:7a881931aa470808df94a8c380eed2bbbc76cd9dc622310f99665658c821eb6d"}, - {file = "charset_normalizer-3.5.2-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:8024d00c3faf3fc0c16e07a69f4405e8eac7cc0ab15f65fe6cf43827c4cf72b4"}, - {file = "charset_normalizer-3.5.2-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:4d48f2d08b9de5864e2c8744d4461b862fb149a18274abc8b698c45975573438"}, - {file = "charset_normalizer-3.5.2-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:34276fd796040bf0993ab33a369aa572e6979c7aab225a88893667ad8eac8f7a"}, - {file = "charset_normalizer-3.5.2-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:0521c5665880b33d603717defa76c094048900010897909952397feb3039da56"}, - {file = "charset_normalizer-3.5.2-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:eff0ac9dbe711a4aee69bf04a83896aa9b85f19641264053a9f6d48573abb7dd"}, - {file = "charset_normalizer-3.5.2-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:1503bccbeb36d5527790c3930327704c39af22de3112f1b1666a9f3ce15ee204"}, - {file = "charset_normalizer-3.5.2-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:52aa6992700996af31f375de0c6bacd402b0097fe40b53c426b9f51a90ebabc7"}, - {file = "charset_normalizer-3.5.2-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:e09a3942ecbdee5cce73ea9d42da82b81b72ac1bf031ce069b93b5adf4eac8cd"}, - {file = "charset_normalizer-3.5.2-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:c7c9ab723cde841fefb34efbad91e87f00a674b1fe1cd0784fde742bf2c154dc"}, - {file = "charset_normalizer-3.5.2-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:ddc7dacc8ece3a182e7f15cb862d1fd616b46d076cb1ae9dd232b2c38b655874"}, - {file = "charset_normalizer-3.5.2-cp314-cp314-pyemscripten_2026_0_wasm32.whl", hash = "sha256:ee43c17b173d46a3212baa6ead3ae258eeabdae48c263a01ccf0218c366dd655"}, - {file = "charset_normalizer-3.5.2-cp314-cp314-win32.whl", hash = "sha256:4f87960d57feabfb618e4e0af6e7371645fa26a277860739d6e5d6e0012c92f0"}, - {file = "charset_normalizer-3.5.2-cp314-cp314-win_amd64.whl", hash = "sha256:e4e81e09c1578b8df602e3db08b0b3ea0a6947ad612f52bf8dc5ea8d47691f0c"}, - {file = "charset_normalizer-3.5.2-cp314-cp314-win_arm64.whl", hash = "sha256:80d02b6f04e92601a081dd97b23d3128033098bff5d35d392ddcc0476ea11253"}, - {file = "charset_normalizer-3.5.2-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:dca9ab98072a5a54ebacebdc45f53e645336b320c667410b061be1ca588ae709"}, - {file = "charset_normalizer-3.5.2-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f0aa869112ef88429ae17820d99c3dd9504c9e9c671d3c246f3d7442cb051084"}, - {file = "charset_normalizer-3.5.2-cp314-cp314t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:c0afc6800ba57ccc350374c5bd6150419915d95ce93cdbab2d783d75eaf30ecb"}, - {file = "charset_normalizer-3.5.2-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:7dcd882da75ef9adf94903b1e3b9419e8aa8fb4c7396822b834b9ef7fb96954f"}, - {file = "charset_normalizer-3.5.2-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:2e06a3a98f916dd41d27f3105e02e7a40181c98c94b9158733d03a6f80506c09"}, - {file = "charset_normalizer-3.5.2-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6bd128f206a7752ae1f2ab6c61bf8a24ba28913a10df8b14c2637b973ff97a80"}, - {file = "charset_normalizer-3.5.2-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:c8f3d67aeaf55f017982b73683f0e7342ba2f6635a78f69ce89ebb26aa411e5c"}, - {file = "charset_normalizer-3.5.2-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:fe9753dfee015c570d73df76f899f18444d41388bffcde097deba51c4fadbb9f"}, - {file = "charset_normalizer-3.5.2-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:92888bb3187c5ba50500b00b3b310c9f2c651709d28036077680cb5255450a03"}, - {file = "charset_normalizer-3.5.2-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:d008d90a7f2471519aef0c90dfbe73b3e6e4d5e66ac48e19154c17e89e98b604"}, - {file = "charset_normalizer-3.5.2-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:31f3930700408d211f13378ccbe1c40845d8da54bd0681fac3a9b5aae81c7aa8"}, - {file = "charset_normalizer-3.5.2-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:2a925889534b3748302dae5dead07cc13480de1dac3aea80a941b729b471ef93"}, - {file = "charset_normalizer-3.5.2-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:f5ec61164adcec446f8969a3358ec3f9b26bbda3b9213e5586d219afa8df2915"}, - {file = "charset_normalizer-3.5.2-cp314-cp314t-win32.whl", hash = "sha256:598a11a2c7ebaa5334bf698bf29568c9c390abac6a154d8170fedecd1cea38c5"}, - {file = "charset_normalizer-3.5.2-cp314-cp314t-win_amd64.whl", hash = "sha256:7fdde2c9fd9e3eca40631e024664cf2584272cc8f96308cbe5fdfc930f51d8bc"}, - {file = "charset_normalizer-3.5.2-cp314-cp314t-win_arm64.whl", hash = "sha256:d1befeed746d247c81127bb14de9dc3d30edb6e5976d34f83f86ed262b1d9105"}, - {file = "charset_normalizer-3.5.2-cp315-cp315-macosx_10_15_universal2.whl", hash = "sha256:87475fabc8d9996fd9c27debb395e642e8c838d78a00b6e932227a0e06b81e26"}, - {file = "charset_normalizer-3.5.2-cp315-cp315-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9409a8bf35cf78353942504b24a57de3d75b708997a1e4bd8db71ac8633ce364"}, - {file = "charset_normalizer-3.5.2-cp315-cp315-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:498dc3188ca05a68231ac3fdbfc7f57eb67e1343c30e0fea17f8218c1599b253"}, - {file = "charset_normalizer-3.5.2-cp315-cp315-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:e242bb1c5e76e97dfa9e7f209a71e93a01d7f19ffdd5cfbb2e2d55b4f08f8ab0"}, - {file = "charset_normalizer-3.5.2-cp315-cp315-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:def79fa35ef0cef8d2accec024f4fdc7ead3012ff02f5215c783f39f03ef8cfc"}, - {file = "charset_normalizer-3.5.2-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:3df041de8887954562c9b261cba85ca0e9ded74048daf125f45edcfaa4832229"}, - {file = "charset_normalizer-3.5.2-cp315-cp315-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:04851f73ae72b8413dddadb16a49dfee95263553741fd42d546f7d66907e6be5"}, - {file = "charset_normalizer-3.5.2-cp315-cp315-musllinux_1_2_aarch64.whl", hash = "sha256:183b88127acdb4fabe59d951ab424faf1af7b63cdbb5f776186c1ea2ffcaed98"}, - {file = "charset_normalizer-3.5.2-cp315-cp315-musllinux_1_2_armv7l.whl", hash = "sha256:16fa0eccf81304b79c5cd87f9271c3b85dd9dd99245e4422ae9c0dd45e0f99d3"}, - {file = "charset_normalizer-3.5.2-cp315-cp315-musllinux_1_2_ppc64le.whl", hash = "sha256:7441d755b7ab94f8d4eb3e43ec05482d760842fd263d003a99102d742cd835e2"}, - {file = "charset_normalizer-3.5.2-cp315-cp315-musllinux_1_2_riscv64.whl", hash = "sha256:ca403d7e4798f525fdfc78e258820419cbbd0f0ecbab9de7840e3c017cf6b8cf"}, - {file = "charset_normalizer-3.5.2-cp315-cp315-musllinux_1_2_s390x.whl", hash = "sha256:df29a0a7107f7011e77f4eebdddec4c7331e24d787a0b21a46d63bdf7445da95"}, - {file = "charset_normalizer-3.5.2-cp315-cp315-musllinux_1_2_x86_64.whl", hash = "sha256:f3c96f633825733f735c5a9cf21d21a257d8e1edf0b1cee0a064b9c424ca0f7d"}, - {file = "charset_normalizer-3.5.2-cp315-cp315-win32.whl", hash = "sha256:281cb91036248400f4cc957495cccd44c275c2e0c5854f7e45ac5cf7dc193847"}, - {file = "charset_normalizer-3.5.2-cp315-cp315-win_amd64.whl", hash = "sha256:89b53f3cda69831909888e0494f4fa0bcd3537e3e138dabeb620bd6ad946bae8"}, - {file = "charset_normalizer-3.5.2-cp315-cp315-win_arm64.whl", hash = "sha256:6be488a102b8cf28d0391d8c4ba7748938ae28b78ad901f8585520fca33ead1a"}, - {file = "charset_normalizer-3.5.2-cp315-cp315t-macosx_10_15_universal2.whl", hash = "sha256:915563965d418f986e7e145accc592eae9e1a1be3566ff98a05d7a9ec42a76e1"}, - {file = "charset_normalizer-3.5.2-cp315-cp315t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:65cd72beeeca9d3aaea1201e5923859f308f952f9c71de93f06063c79f0f7a3b"}, - {file = "charset_normalizer-3.5.2-cp315-cp315t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:b7fd005a73d9e657273b7a10dc71a9e03c8fb9ee6999798d6918ce095b81ac7f"}, - {file = "charset_normalizer-3.5.2-cp315-cp315t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:e54da4baf05720032d527874d40b65fa4d7e5c6c6a43d0c3adbeffcaf275a2b3"}, - {file = "charset_normalizer-3.5.2-cp315-cp315t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:124fbf1a8ff966d87ae05bb8bd45a71f966055ed8bba320d0c7cf450bc5f4d0e"}, - {file = "charset_normalizer-3.5.2-cp315-cp315t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:28b4f0d66fb834ff90f28209ac7bce77868c45d8c93e26f906709d9b7c2e1af9"}, - {file = "charset_normalizer-3.5.2-cp315-cp315t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:58ca3755ee7ff7f59b57789ec9833c9de9ea275405cdd240eda1f193112e398a"}, - {file = "charset_normalizer-3.5.2-cp315-cp315t-musllinux_1_2_aarch64.whl", hash = "sha256:443eae2bf318abeaf6f15d785138f71fd6de770e99a92158b8b814265e079115"}, - {file = "charset_normalizer-3.5.2-cp315-cp315t-musllinux_1_2_armv7l.whl", hash = "sha256:58f361dcbab699cf8f42db3f47c8e7fd1036f138c23a5d08de9fde5f425a730c"}, - {file = "charset_normalizer-3.5.2-cp315-cp315t-musllinux_1_2_ppc64le.whl", hash = "sha256:1b4cbc7c3491ccb4aa17fcd8165649d01cf39f76de1696da8631b5f71b85401d"}, - {file = "charset_normalizer-3.5.2-cp315-cp315t-musllinux_1_2_riscv64.whl", hash = "sha256:ba0b1d2620edf869789c3879223f52bf2afc5d31b3cb47cc57b3a12c05e2aa9d"}, - {file = "charset_normalizer-3.5.2-cp315-cp315t-musllinux_1_2_s390x.whl", hash = "sha256:5e2b6b57e9733d39f0c9fd3185efa6b8e29652c4cd8fe94180272cf6ed9a78c4"}, - {file = "charset_normalizer-3.5.2-cp315-cp315t-musllinux_1_2_x86_64.whl", hash = "sha256:51cf45226a9b588d0d2b4880c62d686934b63ab0bd79ca23ab0e9762eb27441b"}, - {file = "charset_normalizer-3.5.2-cp315-cp315t-win32.whl", hash = "sha256:5fb29fb8cd1a46c27a1bf9613ad5ec2599310d46b4025d9556404a6b6a292800"}, - {file = "charset_normalizer-3.5.2-cp315-cp315t-win_amd64.whl", hash = "sha256:a192e2c40070d92c3ccf777e3a5c4ff515573cd2bb7ed0c537fdadbbec5bbf21"}, - {file = "charset_normalizer-3.5.2-cp315-cp315t-win_arm64.whl", hash = "sha256:749e97e1b32313717a565abbe321bc2190bc8b35f1a67e4cdbc7c56c8d8ffe58"}, - {file = "charset_normalizer-3.5.2-cp37-abi3-macosx_10_9_universal2.whl", hash = "sha256:4275811936e2f06feff5e598fb42a1b7ae852da8e39605211892b56b81a34efd"}, - {file = "charset_normalizer-3.5.2-cp37-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:1c50fe28bbc2ced33386f298650d91218076c05420e6cbd790b913adc41659e7"}, - {file = "charset_normalizer-3.5.2-cp37-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d19fbd981a488e22cd04883659ca6b08f50b5974f9fd7c95655ef6a043e5893f"}, - {file = "charset_normalizer-3.5.2-cp37-abi3-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:0fed1d06615f022ee3b13caf5e8b180cfea32bb2c5aded8a9d44277afc040f93"}, - {file = "charset_normalizer-3.5.2-cp37-abi3-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:838dcc90063569a0448120554591a1d6c4a4ffe11babf048908793154ab86ade"}, - {file = "charset_normalizer-3.5.2-cp37-abi3-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:2ce45c6627b22c47e390bc91a41c3d13032192e699fa0bea96e9671b373d69b0"}, - {file = "charset_normalizer-3.5.2-cp37-abi3-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:0774bf9bf620249fee3e0b8b9fd3065de213be30f3aa94ce2494b3b638949e26"}, - {file = "charset_normalizer-3.5.2-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:1db38f4c5496827c1a501846d64d14c3b80c7e6714e406cd7dc36a9899fa1011"}, - {file = "charset_normalizer-3.5.2-cp37-abi3-musllinux_1_2_armv7l.whl", hash = "sha256:304d8e4d493af723536393eee0c689eb7813f4a474c8b479dee63f1fdd98f621"}, - {file = "charset_normalizer-3.5.2-cp37-abi3-musllinux_1_2_ppc64le.whl", hash = "sha256:9b7f416ff0978e2f2249330527f0ad6fa02f4932e6199692d3b52da2048c19e4"}, - {file = "charset_normalizer-3.5.2-cp37-abi3-musllinux_1_2_riscv64.whl", hash = "sha256:01077390b03f7988f11d700a2194e69b119741a86b1a638b1db88891e3eced8e"}, - {file = "charset_normalizer-3.5.2-cp37-abi3-musllinux_1_2_s390x.whl", hash = "sha256:7e841fb9010836c992c9f12fcbd43a831de93a5f726fc1ccd8ca1d0268c5014c"}, - {file = "charset_normalizer-3.5.2-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:9cae88599c7219005d879f98e5ed53341e9a122af585e1091200358a3003d2a0"}, - {file = "charset_normalizer-3.5.2-cp37-abi3-win32.whl", hash = "sha256:01b0c0d2262a9e28e8484a278c7e1b5d650e3ac8cf2683d2967e25899f208bdf"}, - {file = "charset_normalizer-3.5.2-cp37-abi3-win_amd64.whl", hash = "sha256:9f56f72050826f63dcee7a7f55b0a77168cb3bfc553fd405e7f8f9ece75a4036"}, - {file = "charset_normalizer-3.5.2-cp37-abi3-win_arm64.whl", hash = "sha256:40ab6bffa02ae10a0581e6c198be7d2d8ca5c2a0c64e4ed3465d766df457573e"}, - {file = "charset_normalizer-3.5.2-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:75a3ceed0724d625d64b86ca20aba182e4df462e04c2414fc941c0f523f06aac"}, - {file = "charset_normalizer-3.5.2-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:0891b9d3903c5571c03771ca669a4b0ec5618ca722a5c957d3d29cd4e5062848"}, - {file = "charset_normalizer-3.5.2-cp39-cp39-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:fc14a032f813bf5fe624d991960ea83e9715adc27e4c1830a2361eb1d02ac341"}, - {file = "charset_normalizer-3.5.2-cp39-cp39-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:8b2bfab86aa71ae13aa41a6a26aab338e0db2b8bc75434b05aea89e011ff35a4"}, - {file = "charset_normalizer-3.5.2-cp39-cp39-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:9bde855991b7e362c146535e3136a50bfaffc0487d38b33ca7e5edefc6e23849"}, - {file = "charset_normalizer-3.5.2-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:55ea99acb17b9325618de155a0cd6a2e8f5d10be008113e1d433bbb58db543b2"}, - {file = "charset_normalizer-3.5.2-cp39-cp39-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:68eb192d85ab8e5f6ec69c2bc6ac0179fbf04a5ac1569d12fbef74883fe102d0"}, - {file = "charset_normalizer-3.5.2-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:d913de495d90407cd859d263bee2e5d1a4ed3eb6573c04e70d9ec619a7cbed7f"}, - {file = "charset_normalizer-3.5.2-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:3ddacd27458c45bdacd6bd6db644bfb730efbf9e830310186e3045c9c5be8fb2"}, - {file = "charset_normalizer-3.5.2-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:588461c2e8384d309bd63e5826019b6977bc66d629b99ac8737bb795d7b2cb5a"}, - {file = "charset_normalizer-3.5.2-cp39-cp39-musllinux_1_2_riscv64.whl", hash = "sha256:e80e6c2f55656b4824d72065abb4ddd6a525c74bd78a0aab5d9fc2cf4fb5af50"}, - {file = "charset_normalizer-3.5.2-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:d4a7319f304a774bed22115bc891618e45f85065ab44ea6acd07d274e750519a"}, - {file = "charset_normalizer-3.5.2-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:fd1fbe0f116b6e55da77aca2c6ddcddcfac2186cbf78bdebf40fc156efca389d"}, - {file = "charset_normalizer-3.5.2-cp39-cp39-win32.whl", hash = "sha256:93223adc95033dd47133a46ccfc316a0139176fd79085762e27202ec56018f03"}, - {file = "charset_normalizer-3.5.2-cp39-cp39-win_amd64.whl", hash = "sha256:15bb4005af6320d259dc7593ca84a38d7fe06a421dbcf7b910ae23979101e787"}, - {file = "charset_normalizer-3.5.2-cp39-cp39-win_arm64.whl", hash = "sha256:2cc961b171b3f3440f410489ab3573e86aea8736134ebbb40ea1338b7f0831bc"}, - {file = "charset_normalizer-3.5.2-py3-none-any.whl", hash = "sha256:b6b751274acb69d77b3323d6b7dbaa3c7fdfc1eb829b7eb61d262f32e1af9685"}, - {file = "charset_normalizer-3.5.2.tar.gz", hash = "sha256:39de2a259fc954455c57274dc94c79d5842774e1247a016aff30bc0efed0f4ef"}, + {file = "charset_normalizer-3.5.3-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:885f202d6e4e2298bea9802ffc6d8c7dc45394199a8dd9e1492f05fe32dce311"}, + {file = "charset_normalizer-3.5.3-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:b6dad86d938104f9d43404029e5fc8392f82762d171933be4f192a6008bffa53"}, + {file = "charset_normalizer-3.5.3-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:92ddc32b6a1508ea145f4f7995e00666db454b8fd3e2cae6c2ecbde4f4d44616"}, + {file = "charset_normalizer-3.5.3-cp310-cp310-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:fc540d1618c5638fcf5aea97060cf011467918b010bf682a84ecc0c9474e6cd0"}, + {file = "charset_normalizer-3.5.3-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:9510da88bdebc903be7844f31523ac8d7b3f63e167db54b6045104a2354afa6a"}, + {file = "charset_normalizer-3.5.3-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:f5a5c311e5de6954c36230a37863b5ca58ce232589bd637ad2881c4056897b12"}, + {file = "charset_normalizer-3.5.3-cp310-cp310-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:4a991dbd7aec868fe10802b02bddbf898173a47ba236f2d6afb4ab1f98243534"}, + {file = "charset_normalizer-3.5.3-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:256b434b2860ef9da1cb6a5fd4ebb5d600936668e50e2035858948b96b068ecd"}, + {file = "charset_normalizer-3.5.3-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:806e72ebaeef54d7faa03414be9e8409eb3dcae49fba089d62063a60c0b5a4e5"}, + {file = "charset_normalizer-3.5.3-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:326a7a0e3715c3ac24c21e7a3b831d6799cc795bff260aa49c23b69025852f99"}, + {file = "charset_normalizer-3.5.3-cp310-cp310-musllinux_1_2_riscv64.whl", hash = "sha256:d57f1b6affc3581fbf0bc6d783cc60e7c9957adfd9c7b89f8a9f3573ad1cd49a"}, + {file = "charset_normalizer-3.5.3-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:73b4ddf1230df56c9e7017a16e3f5171b6ef0e4ff554a418a370d7ac7245bd84"}, + {file = "charset_normalizer-3.5.3-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:2b7797a5b0cb197f118fd13b41c14c5a3c38dd625a87c1da58a3066cf53254fd"}, + {file = "charset_normalizer-3.5.3-cp310-cp310-win32.whl", hash = "sha256:277b72183b96879887f0c3aa0bdac1fee08a6c7e67bad53145c4fd416d99dfd3"}, + {file = "charset_normalizer-3.5.3-cp310-cp310-win_amd64.whl", hash = "sha256:2246873913d7db43ed5a3d98ace398b989b2ae20b77c8d761a7bef5fdb9bed42"}, + {file = "charset_normalizer-3.5.3-cp310-cp310-win_arm64.whl", hash = "sha256:5970d148182b6b7c22b8290a81f02fb521c4e7aee6747743b3e645db58d5001a"}, + {file = "charset_normalizer-3.5.3-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:01b35bec964b92b89bdf94adf931d2e80a15f1c7b93bf850b4430cca23f7a2a2"}, + {file = "charset_normalizer-3.5.3-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:2a6f937e0b70133d1f826d0a253331b6fe1a4c874808cc12e16f2fb8177042f4"}, + {file = "charset_normalizer-3.5.3-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:90b1ff6cb9c7a204a3b79b1b0ed6ac8a1d8fed3b6dc69e50ae5de0f358ee81d4"}, + {file = "charset_normalizer-3.5.3-cp311-cp311-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:139aeb8ca63946dc79364c37f2c9cfe5c1b7f3882f2c47484d0e54bf14b921b0"}, + {file = "charset_normalizer-3.5.3-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:f7a841170fde40b0e1345884bee09ceca7db49a9291fa340089bec66a366c243"}, + {file = "charset_normalizer-3.5.3-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:56405211fa124c393eea14b3aeacf5b90de72b1f69b0a60c9bc40b01dfe71a42"}, + {file = "charset_normalizer-3.5.3-cp311-cp311-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:0cf4cb8d75090a8da3bd30c0963b2c6c6114e791c6fc060c3cef8971497b1f04"}, + {file = "charset_normalizer-3.5.3-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:0ca2da4a505fae7ef95922f8d48235b2e49ff8f10f4edcc0481e5f6526ba3841"}, + {file = "charset_normalizer-3.5.3-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:09833ba78c91f0d1fd06387c69dae9f079428b77ea05eaaf1553eecead31fb68"}, + {file = "charset_normalizer-3.5.3-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:28d954a437bfa5fcdfe7ad8902cf4347a8486f34a86c5f39003bc1288eb67d72"}, + {file = "charset_normalizer-3.5.3-cp311-cp311-musllinux_1_2_riscv64.whl", hash = "sha256:00edb7682962c596f774bfa126e6b6f885b7af2319f448d327591c284a482de8"}, + {file = "charset_normalizer-3.5.3-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:a43831574e14423103d69fb1357e76e4f2347041c98e8357ab88ef21812e80d9"}, + {file = "charset_normalizer-3.5.3-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:96387278c3b17bc1170f80693398d0babac7b41df128ced8e27588a7155d95b2"}, + {file = "charset_normalizer-3.5.3-cp311-cp311-win32.whl", hash = "sha256:6eea31136fd924ecbb4e7c4f3df4b18230409629a22b3896f38a6754d5857794"}, + {file = "charset_normalizer-3.5.3-cp311-cp311-win_amd64.whl", hash = "sha256:cd5422fd4f8a7859846c9289e310dd95c0d1890c31819667942753e510f88f69"}, + {file = "charset_normalizer-3.5.3-cp311-cp311-win_arm64.whl", hash = "sha256:d3c9d5284d64f4c1015d95b751577b260fd6d14e3f8edf21710f4436e7ac4c49"}, + {file = "charset_normalizer-3.5.3-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:92bf85ecec3ad6374ae50d870bd1deb34de12bc1158b5fd09036d4c435c6f58c"}, + {file = "charset_normalizer-3.5.3-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:e5e4785d8a0adeadfbdf75f4efc357911842674651cbafd7e97f69b11ec3cbc6"}, + {file = "charset_normalizer-3.5.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:70f65dd0c2ed79ea2d9776096e9c7d25e398c2c03eb31877753598d201d91784"}, + {file = "charset_normalizer-3.5.3-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:6b702d36c565f6c650f4b479488f475b2982132ab8d0840d42b1442462c21056"}, + {file = "charset_normalizer-3.5.3-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:dbdd407104ebf2360464ce02c7933c6ffac58bd5b64cdf6ef7dc0e787e782aaf"}, + {file = "charset_normalizer-3.5.3-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:61f3258f700412c68fde407e7c749ed6930e795ea8f5ead9a40afddefbec12c4"}, + {file = "charset_normalizer-3.5.3-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:aa2476abf8669be493689634bdb79f468a6fe57b005a5126db7e9f61d1954fe2"}, + {file = "charset_normalizer-3.5.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:1b2704f4651539eab50ba104a975b96c3cd5246011aa0755d2dd71ac12546644"}, + {file = "charset_normalizer-3.5.3-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:2c4e0050b732ee3dca3676a5f5cf7fbd0c131761c194f1bb1d24c055fad071cf"}, + {file = "charset_normalizer-3.5.3-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:f06e257ee0cc85a7e4ec44f171ae2595fd901c34212f3c9e7ab8fd8621401e99"}, + {file = "charset_normalizer-3.5.3-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:396fdf2d4367674531a7c8d54ecabbc8e5131e3a1a06270285eb99f3140143df"}, + {file = "charset_normalizer-3.5.3-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:b6ea5bf7e3c39f6e56957d82274ac7cfab469590085883fdbc86e754cde76b11"}, + {file = "charset_normalizer-3.5.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:366f5efe95a6149ecbcebf779c2594a6a4ff6fc116402826c72ed0eccd6aabe9"}, + {file = "charset_normalizer-3.5.3-cp312-cp312-win32.whl", hash = "sha256:020cabbb90926b2d8b022a5e057ab349f28844b61f34117323fc08c2971915e3"}, + {file = "charset_normalizer-3.5.3-cp312-cp312-win_amd64.whl", hash = "sha256:40b2ba91f0851aa864994b3c7022e4d96d09026717e6a72e44410d6fb3a74a13"}, + {file = "charset_normalizer-3.5.3-cp312-cp312-win_arm64.whl", hash = "sha256:948fb3649416a70bcdbb267d79c7048e8aa16e989ab9da09f416e67cdd3d6b8c"}, + {file = "charset_normalizer-3.5.3-cp313-cp313-android_24_arm64_v8a.whl", hash = "sha256:7fd816f466883dcaac196ac77271d0292eee4a81f4db1191b95d15328f335937"}, + {file = "charset_normalizer-3.5.3-cp313-cp313-android_24_x86_64.whl", hash = "sha256:af217012cfdaf6ea5dc0c538aac29b7bd030eb865056cc60f1d973b982b7917b"}, + {file = "charset_normalizer-3.5.3-cp313-cp313-ios_13_0_arm64_iphoneos.whl", hash = "sha256:d12571adb9ceeb9ba0640db46433430062f5f1dec89e39713a2a5a8ce3016c37"}, + {file = "charset_normalizer-3.5.3-cp313-cp313-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:183aee7e84789391e547ec1609f8269332b9b123d21e97f7ef79eaa474c47e08"}, + {file = "charset_normalizer-3.5.3-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:499e4bbeb1e79b14756311a1d12cb88112f244423e152d80981d9bcaff3279fa"}, + {file = "charset_normalizer-3.5.3-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:656b9744bac4493561d28b56d7d646afd7a8471254ef7004d849aa8368020037"}, + {file = "charset_normalizer-3.5.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:fd0341b9dea133d187d7c5a2cd7e21ae6449a7b68ea8c2454f9cf77def11ec1b"}, + {file = "charset_normalizer-3.5.3-cp313-cp313-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:c9d1f467d121b33b06865c94ed5ed8388a9ef76f5e1acc1c8a854ac653493f5d"}, + {file = "charset_normalizer-3.5.3-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:0810592b80dc5a97f8103443460264b588f31c6baa8a20abae7c683435d8117a"}, + {file = "charset_normalizer-3.5.3-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:db2eedef732424346f98d0aba5c6ad688b648bc79847f4cc70dfca830130b1e6"}, + {file = "charset_normalizer-3.5.3-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:caefc441edff6070a9f9749ca880a22731a1715d9e74b24304a546eec44bfc16"}, + {file = "charset_normalizer-3.5.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:3ce4e4587e451ebc7d9899a7a1f539ea30a3c712d7bc8e0d256923c697fd5dcc"}, + {file = "charset_normalizer-3.5.3-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:0b3fc6f7dd9db4a7782e65dc98eb80b2a91a854cf54a03dd93649be2f7ca638d"}, + {file = "charset_normalizer-3.5.3-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:bed05639ae1bc23df7996a4fd13ea5064ddf60dc7dabd754f8badf060daec63f"}, + {file = "charset_normalizer-3.5.3-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:a36bba41dc7fd263417688c4daf95a1091f93e1f6957c0f71ad7798907c5a10c"}, + {file = "charset_normalizer-3.5.3-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:b013417037c931583578639cab2523d5a2efc35a584c192d07f4c909b133f6b0"}, + {file = "charset_normalizer-3.5.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:8baddc6349faf49edae4d1322f12b681b9e86acacd01874457c997437ef4ccaa"}, + {file = "charset_normalizer-3.5.3-cp313-cp313-pyemscripten_2025_0_wasm32.whl", hash = "sha256:6dde7edd9ba5005389bc7c0ab461411f281dbacb2b06e52bd23592eba42bb503"}, + {file = "charset_normalizer-3.5.3-cp313-cp313-win32.whl", hash = "sha256:b30e5496e453ac971bb17f5e096b84fbaae16d09e2613f6148ff528c08a54a0c"}, + {file = "charset_normalizer-3.5.3-cp313-cp313-win_amd64.whl", hash = "sha256:cb18428af7399e0a6f7e3b45f110d57a1a47cf07fd4b3ce50e2366d99a38959a"}, + {file = "charset_normalizer-3.5.3-cp313-cp313-win_arm64.whl", hash = "sha256:8b969f0309de905101bc3d2471c112e9ccbba711a7590b12d51f372b4163688a"}, + {file = "charset_normalizer-3.5.3-cp314-cp314-android_24_arm64_v8a.whl", hash = "sha256:c39a4fe28a16e8fa667c55c154f62c6c3cd9ca2491cca9f16330dd7360d05b76"}, + {file = "charset_normalizer-3.5.3-cp314-cp314-android_24_x86_64.whl", hash = "sha256:9c1bd8321a840729a6b2620774cf4000fafe66c54cac9064972a10c4f607794b"}, + {file = "charset_normalizer-3.5.3-cp314-cp314-ios_13_0_arm64_iphoneos.whl", hash = "sha256:5f86753952f7de3abc7ce871f8239ce4e0d32a91c84d22f3a667e669907c3897"}, + {file = "charset_normalizer-3.5.3-cp314-cp314-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:581d6e7df9b58d34147e21efde42a480b5087fe54f31e42550c26321566ba1e4"}, + {file = "charset_normalizer-3.5.3-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:8231365b03b702b516aad35c9515694177ac31c9dc6240326f07308a4c45c708"}, + {file = "charset_normalizer-3.5.3-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:ee9de080e8d6221bbe4ba2667367b1cee0f47a53f60ffc5e431b698cd2f2b214"}, + {file = "charset_normalizer-3.5.3-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:61e32fdbf56f4cd25a1efa451c8b5fe886fc5e00143ccaacafdf21f301fad059"}, + {file = "charset_normalizer-3.5.3-cp314-cp314-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:826d82356907350f345cf0aa744d43a69ac7948bd60f460f997cde86928beadf"}, + {file = "charset_normalizer-3.5.3-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:a312fedd182357f2c22f066d17dcd7413b6a205ee3d063d36950e94e3019d3de"}, + {file = "charset_normalizer-3.5.3-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:249bf0b6f43985c33c83adbbab0ca71246ec24c82d960fa00c4ddb2cfed25db9"}, + {file = "charset_normalizer-3.5.3-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:ea880ae1a692ae694c11bca7be74864614ff1a58bdfff4605f36d1956b4b1588"}, + {file = "charset_normalizer-3.5.3-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:e34f591669498a03cd70993b0a79b9f0ef40c4e6f8232466bac33c42f0c15742"}, + {file = "charset_normalizer-3.5.3-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:ddea089587432e3df6771a4a405ef249cc9727f7becb1de3f00ab571b2432002"}, + {file = "charset_normalizer-3.5.3-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:f160f03e15bd1e3c35db9bfc20c42ff83155d37f9b0c79806cb10051ca725f13"}, + {file = "charset_normalizer-3.5.3-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:6651fecdac146ecfa52700e02a5fa3b3677bddf5fced4983b43e904244de3f6a"}, + {file = "charset_normalizer-3.5.3-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:45aa4ccf5a6caba138dd0f8bf36fa3e26654585d534881b62ce5e4fea2487772"}, + {file = "charset_normalizer-3.5.3-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:9eba4613d45b49196af04a5cbadfc5e9379ba94aac85184b72cb1107ad31af0d"}, + {file = "charset_normalizer-3.5.3-cp314-cp314-pyemscripten_2026_0_wasm32.whl", hash = "sha256:2e7fbd98443f28a5ed8004f0b058edcc4720a3d344adf007c0b7f1adbff2f59f"}, + {file = "charset_normalizer-3.5.3-cp314-cp314-win32.whl", hash = "sha256:d8f85e019c9f08ec134648a378ddd3f6f073c1e4b5ce9bdacd9a9e7b60749cd2"}, + {file = "charset_normalizer-3.5.3-cp314-cp314-win_amd64.whl", hash = "sha256:b66a0e045cf859d7418f26a554509b65f21ebb6d90a95152460781939e8264f4"}, + {file = "charset_normalizer-3.5.3-cp314-cp314-win_arm64.whl", hash = "sha256:b8fc4fe56992b089d6177021fe6db641321bb2bc2fc7a1abf815c29a80ca2137"}, + {file = "charset_normalizer-3.5.3-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:6c80b4e83e2fbddd25fe27804cdfc45ef71bb387522caa575af42118d72dc970"}, + {file = "charset_normalizer-3.5.3-cp314-cp314t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:7a7e5bb8974842ad747d4a2b9fb928f84c3cdbe2c2fd7e405197fc1a1badaeaa"}, + {file = "charset_normalizer-3.5.3-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:28ba8e6361e0f319641707484994096ceb77e05c29eaad2919756218c0c89001"}, + {file = "charset_normalizer-3.5.3-cp314-cp314t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:e405cce4170de1fe520d9a92de9d7ececc23dfcf6888c62ab608a21be50838eb"}, + {file = "charset_normalizer-3.5.3-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:81132eaffa984f0a399233df4cd383caad18e8cadc6c24c568cf9324732a9768"}, + {file = "charset_normalizer-3.5.3-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:c43d9737c3b85ccd16b1862b1e7aa5c4bf30a6033068403713c0a2bba5bda979"}, + {file = "charset_normalizer-3.5.3-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:94c9d5d91c16554f6397b823d9e47181ba100d830ab16b5d720adc229e17b2e2"}, + {file = "charset_normalizer-3.5.3-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:0c0fe07631dce6dae788a59c20ed927adc6feeb2d9ed440747eb367d89822a45"}, + {file = "charset_normalizer-3.5.3-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:0ca25f1b1167e9fb94d93d3708df0b631de241bf8440947b0cb9f8c4cb66fed0"}, + {file = "charset_normalizer-3.5.3-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:fcb17f1d40c38912a2cdb56ea47aadac3527cd0b06fe24f3a0c4896febbea063"}, + {file = "charset_normalizer-3.5.3-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:39e019884c8f857393df954d35f42bf99c5ab85af226fe74d1410188c6fec31f"}, + {file = "charset_normalizer-3.5.3-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:e282983b8def5ada758fa1f18bf9060bb8ce6cdd73be32f62a2de59820d3286d"}, + {file = "charset_normalizer-3.5.3-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:cbd09b22b340f846671e79e8d832167fac60c1884be4c71fd667211486a3b58e"}, + {file = "charset_normalizer-3.5.3-cp314-cp314t-win32.whl", hash = "sha256:a8f92cc9080bff47555c79b88e7fb8655438ce3bcf29c5f01ed2ed5efdf174a4"}, + {file = "charset_normalizer-3.5.3-cp314-cp314t-win_amd64.whl", hash = "sha256:1a34385837db59d5de814c9f1e0f4157b571f9ce0eabdaeace410aa93bf5df62"}, + {file = "charset_normalizer-3.5.3-cp314-cp314t-win_arm64.whl", hash = "sha256:a094178c51530c9ebd1775e72d160af0eac4be244fb06ff1b6f182128c71903c"}, + {file = "charset_normalizer-3.5.3-cp315-cp315-macosx_10_15_universal2.whl", hash = "sha256:f7fb9a3275f1a1528e542a0f5a3d2c89fcaf68e797fc5c6530434cbd92a852c4"}, + {file = "charset_normalizer-3.5.3-cp315-cp315-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:ef8b925f2b331a1f17d6fb32625e09fd571cf41844f578379f934dab0067cf0d"}, + {file = "charset_normalizer-3.5.3-cp315-cp315-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:390ef7c7e018c0abb8c0ec2d28ee137567ff50c3706facf6d115cac832ac993b"}, + {file = "charset_normalizer-3.5.3-cp315-cp315-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:106b9d0438e2ff0a0e8ebd869273fcb3640af28323bba8651c714c57efb38e51"}, + {file = "charset_normalizer-3.5.3-cp315-cp315-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:6bfbbb9414dd0f5b81c259deb7e50b4b44e65e05879eee482351bdabed49d7f4"}, + {file = "charset_normalizer-3.5.3-cp315-cp315-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:11ad35a0b856ad8bbd0c9e900c069461a4661694714aa17b6e6e2e8621e1c373"}, + {file = "charset_normalizer-3.5.3-cp315-cp315-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:6118055f4ad0d94e016eadbb86caed9caf2c9033631ed70964ba631c1336984f"}, + {file = "charset_normalizer-3.5.3-cp315-cp315-musllinux_1_2_aarch64.whl", hash = "sha256:a09ca76391f6e17b12d55c1068b4b5f8f6c9b44b432d936075372fa12782292d"}, + {file = "charset_normalizer-3.5.3-cp315-cp315-musllinux_1_2_armv7l.whl", hash = "sha256:acaa0e100f39287dc5d13de96e33ba0786f1cdfb5b4ca28918913ab0eec3af72"}, + {file = "charset_normalizer-3.5.3-cp315-cp315-musllinux_1_2_ppc64le.whl", hash = "sha256:a3f4044dd5d2f7b958be6b9903cb432e6a0fd944d673707ca5cab68137d0592c"}, + {file = "charset_normalizer-3.5.3-cp315-cp315-musllinux_1_2_riscv64.whl", hash = "sha256:d1b7a3fe4cf679eb3870b91b86b8ce12cacd5cf4d74bc114864a5cd65319ddac"}, + {file = "charset_normalizer-3.5.3-cp315-cp315-musllinux_1_2_s390x.whl", hash = "sha256:323d5cf6df3ea724afcc3bfb07c73be06d2e8200a8b6b37979a300ae1e7836d0"}, + {file = "charset_normalizer-3.5.3-cp315-cp315-musllinux_1_2_x86_64.whl", hash = "sha256:67bb767a8de7a2b1164c74fdbe5cdc32b9c15d7142efd9a6dc77ff63da94e846"}, + {file = "charset_normalizer-3.5.3-cp315-cp315-win32.whl", hash = "sha256:d93403a13c8f6f2d027185d90ab695e81d95e3ebd000f0078e201a1c3159d4d1"}, + {file = "charset_normalizer-3.5.3-cp315-cp315-win_amd64.whl", hash = "sha256:2978c799237eb66619d8951d2ab7efd317414cb6682160e05614ce1c8b5c905f"}, + {file = "charset_normalizer-3.5.3-cp315-cp315-win_arm64.whl", hash = "sha256:9a6b95b1737f9b5942c35676c52db0c302d60fa806efde3fc2d9f54247ecf4be"}, + {file = "charset_normalizer-3.5.3-cp315-cp315t-macosx_10_15_universal2.whl", hash = "sha256:06d07272f70d9880fba32d4876e966ae4dc9961134bc989066a0901509dfd8cf"}, + {file = "charset_normalizer-3.5.3-cp315-cp315t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:da606e3015dbd4b9a31c0468898a0c4c998846197ddfda78308821dc8c9e9be3"}, + {file = "charset_normalizer-3.5.3-cp315-cp315t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6423accb6ecd1456bf824bbac98ba919398523a69ee5f1680dd1da88769de866"}, + {file = "charset_normalizer-3.5.3-cp315-cp315t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:ad1becd776f5a41a4d91cb9ee51778f4fd687ef15e4919779e00a33c6cff6948"}, + {file = "charset_normalizer-3.5.3-cp315-cp315t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:7fdd11094a0b07bce306b359fa7311c71d93466d967b3b345f2e9f03d8b2c959"}, + {file = "charset_normalizer-3.5.3-cp315-cp315t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:87d5a237d6531c654e7b9b319be9ba7e368665c466e02a03cfd4d3d77730782e"}, + {file = "charset_normalizer-3.5.3-cp315-cp315t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:e4a0f2adf29a69dd8fe58e42bb191f3c87067b05fcc63279983e8c9ce5092abd"}, + {file = "charset_normalizer-3.5.3-cp315-cp315t-musllinux_1_2_aarch64.whl", hash = "sha256:643724071b01cc0369026e259850791212cc187c6031d0e930abcd253f128e0c"}, + {file = "charset_normalizer-3.5.3-cp315-cp315t-musllinux_1_2_armv7l.whl", hash = "sha256:94b595e64bc2927f679774de50df340b7828dc1c07c99149ba7c2d0828dd8bf3"}, + {file = "charset_normalizer-3.5.3-cp315-cp315t-musllinux_1_2_ppc64le.whl", hash = "sha256:e86a27ab632d2e888c22b79263864eaff8b7dea9e87328a9bb0ea04eff24786f"}, + {file = "charset_normalizer-3.5.3-cp315-cp315t-musllinux_1_2_riscv64.whl", hash = "sha256:48f7c7f537246bb3af2b3139f44716a30b21e78c2fd1cff0f3e392fbd55d8044"}, + {file = "charset_normalizer-3.5.3-cp315-cp315t-musllinux_1_2_s390x.whl", hash = "sha256:085a5d1f49eaf96596d79494fcab18d9a32db6e345da15d6debfc90110b20679"}, + {file = "charset_normalizer-3.5.3-cp315-cp315t-musllinux_1_2_x86_64.whl", hash = "sha256:6c8abe7d59bbc891e5080b8b142c36db93154f840c4baf7c83ad6273a1a15397"}, + {file = "charset_normalizer-3.5.3-cp315-cp315t-win32.whl", hash = "sha256:02b1abf64742b2d0782172cd2542616e462c201c829c23aff833390babe2967f"}, + {file = "charset_normalizer-3.5.3-cp315-cp315t-win_amd64.whl", hash = "sha256:dfbde696fb427301ec40cd82b8eec0b528e44c6af8239f33ede2b2552d9a085a"}, + {file = "charset_normalizer-3.5.3-cp315-cp315t-win_arm64.whl", hash = "sha256:aa9390d89822dd06f9920ae3038819cb121643a72f4753b2eee1a79b2f1215f8"}, + {file = "charset_normalizer-3.5.3-cp37-abi3-macosx_10_9_universal2.whl", hash = "sha256:84356c7b7ddf090e3e4692cb99fc820e6189b5f6662ca7e8589f41095cc8efca"}, + {file = "charset_normalizer-3.5.3-cp37-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:26c6ad87bb79628954b52f8f7b9e18ab5cd9667546712ded9689fb7677e630d6"}, + {file = "charset_normalizer-3.5.3-cp37-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d4e7ecaa25f0dae672ac783c2e5aa9054a62e011749d64ff47b887af360a3e82"}, + {file = "charset_normalizer-3.5.3-cp37-abi3-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:ba26e4d073a4f7f2594676f2ff20ab80a7f03332b81c3f9964e9e53bf2305329"}, + {file = "charset_normalizer-3.5.3-cp37-abi3-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:4831fb33e98e92140fa17d4d673a9f49f9c0ddd056115b722858793e4b86b0c5"}, + {file = "charset_normalizer-3.5.3-cp37-abi3-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:1714ff1ba001da5241a585fbd17a7742a61ad34efb4be8404aca5679f51e53ea"}, + {file = "charset_normalizer-3.5.3-cp37-abi3-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:8c4dfcd3269f13dff7f29f9c332d54a4a21f17be818b49e769e111befd4d39e6"}, + {file = "charset_normalizer-3.5.3-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:87f7d6c595465a25d33fa3d5215a571a98c4cad00ead3ad18ebfb62adb3d3e6e"}, + {file = "charset_normalizer-3.5.3-cp37-abi3-musllinux_1_2_armv7l.whl", hash = "sha256:7c313b46730b4a68bb31450973467313b2c496fefa42ae316b86c186cba74613"}, + {file = "charset_normalizer-3.5.3-cp37-abi3-musllinux_1_2_ppc64le.whl", hash = "sha256:d313494077f849d8199f36166947785da1eeb36335fda15fde2e8f801ef271b6"}, + {file = "charset_normalizer-3.5.3-cp37-abi3-musllinux_1_2_riscv64.whl", hash = "sha256:c08e06fc69750827d7ccebba63ebc97a85e479cd5c9dbdb80f5e08a77b774fdb"}, + {file = "charset_normalizer-3.5.3-cp37-abi3-musllinux_1_2_s390x.whl", hash = "sha256:29ac44f5878142128ffe4fa7e041ddc4cc5fafe43983245b9a141908c40b515d"}, + {file = "charset_normalizer-3.5.3-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:3e8da696ef1935a019c10ec16555a062183ddf6d5901e296edeca4b2a8f84e1d"}, + {file = "charset_normalizer-3.5.3-cp37-abi3-win32.whl", hash = "sha256:4ff5e27478681ef1b13b036baaf9beaf9b4c6990e903c752ad3b8764692c6d6c"}, + {file = "charset_normalizer-3.5.3-cp37-abi3-win_amd64.whl", hash = "sha256:a5a7e0326566759f9a7bc44f4b9a179cc40a297e09e759b0bc7c848c06347527"}, + {file = "charset_normalizer-3.5.3-cp37-abi3-win_arm64.whl", hash = "sha256:e4f85c34f9be32ec5568a0668fb8bc029d3e729285fb8fccc38695e185379a9b"}, + {file = "charset_normalizer-3.5.3-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:34054580168b04e90e6c7c0f6c80173fa2d4f72c4db91c9095598454f96d6389"}, + {file = "charset_normalizer-3.5.3-cp39-cp39-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:39229c222445415db07a0be4dff8ad1addc3126644d7aa72d73f1575b637d69e"}, + {file = "charset_normalizer-3.5.3-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:2f2d973d3c79fbd1066d63d1bafb2ade66934c0840ed149f6fac13c3fdf80793"}, + {file = "charset_normalizer-3.5.3-cp39-cp39-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:9902e80096a94cf70fb72d12ae40e3b187b40e96fa722873d4d62afcd0333c46"}, + {file = "charset_normalizer-3.5.3-cp39-cp39-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:a6eba94fc00d899f8d268712772c8dcafc40215aa9b51701a397afc9426e012b"}, + {file = "charset_normalizer-3.5.3-cp39-cp39-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:aa8be1f24fbc03a07cfe002b70ba0716effc6b3011fd9e5560ca399d3d0605ad"}, + {file = "charset_normalizer-3.5.3-cp39-cp39-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:f1b357340e4cd29011683bd81226175611ad835fec22e5b7df83b96701571226"}, + {file = "charset_normalizer-3.5.3-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:b0aa6b81bc632af7cac7b270c933298cb5ee858506dcf344e0da006667e0c351"}, + {file = "charset_normalizer-3.5.3-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:c437ed8775d201d37206f37d233f547506e3aef60b9711584c65444c686b4905"}, + {file = "charset_normalizer-3.5.3-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:e1cdbde56f9fa6d426b78941c381e2ba160c1214809baa47e02c1d0d8881d598"}, + {file = "charset_normalizer-3.5.3-cp39-cp39-musllinux_1_2_riscv64.whl", hash = "sha256:f39290a0c2e3f4196563189bb45e6ef5d5badf50864e1bfaafa9003f0595573f"}, + {file = "charset_normalizer-3.5.3-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:a491d4afb361aba32d55d7df7ccde766a3aa9a34c002d2c32c2743bf6e77c13c"}, + {file = "charset_normalizer-3.5.3-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:f1214052966421a88ed526ba93e4463b39346862fa4721be5306434b33dae795"}, + {file = "charset_normalizer-3.5.3-cp39-cp39-win32.whl", hash = "sha256:9b887e8a7103ae2171dccbab00a4bb2bf1560f5c10c28227e5513bc90a608cad"}, + {file = "charset_normalizer-3.5.3-cp39-cp39-win_amd64.whl", hash = "sha256:747e83d415939612284afdc99f15295382639c0d3fc69a73aeb84b380d1f4af3"}, + {file = "charset_normalizer-3.5.3-cp39-cp39-win_arm64.whl", hash = "sha256:cb4c25a9d3410262216b5c7447e51bfd2de0efae0a7640772dc6d2a8741590de"}, + {file = "charset_normalizer-3.5.3-py3-none-any.whl", hash = "sha256:96e268b0cbda016ac519513294fcd17032264085b600abaac58b93049477e132"}, + {file = "charset_normalizer-3.5.3.tar.gz", hash = "sha256:a250888753faa289e2997962fbb17c4960cbdb58575533ca6fceee68c224bdff"}, ] [[package]] @@ -633,15 +633,15 @@ toml = ["tomli ; python_full_version <= \"3.11.0a6\""] [[package]] name = "exceptiongroup" -version = "1.3.1" +version = "1.3.2" description = "Backport of PEP 654 (exception groups)" optional = false python-versions = ">=3.7" groups = ["main", "dev"] markers = "python_version == \"3.10\"" files = [ - {file = "exceptiongroup-1.3.1-py3-none-any.whl", hash = "sha256:a7a39a3bd276781e98394987d3a5701d0c4edffb633bb7a5144577f82c773598"}, - {file = "exceptiongroup-1.3.1.tar.gz", hash = "sha256:8b412432c6055b0b7d14c310000ae93352ed6754f70fa8f7c34141f91c4e3219"}, + {file = "exceptiongroup-1.3.2-py3-none-any.whl", hash = "sha256:41c6a70dfec22050d3d8b43386b059a4dc0bca3f3d40a40971cb206fff1785af"}, + {file = "exceptiongroup-1.3.2.tar.gz", hash = "sha256:ca82e69f0cb535fbde934885744b67669a3efddd50fe7bc00d3398839fcaddec"}, ] [package.dependencies] @@ -842,14 +842,14 @@ trio = ["trio (>=0.22.0,<1.0)"] [[package]] name = "httpx" -version = "0.28.1" +version = "0.29.0" description = "The next generation HTTP client." optional = false -python-versions = ">=3.8" +python-versions = ">=3.10" groups = ["main", "dev"] files = [ - {file = "httpx-0.28.1-py3-none-any.whl", hash = "sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad"}, - {file = "httpx-0.28.1.tar.gz", hash = "sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc"}, + {file = "httpx-0.29.0-py3-none-any.whl", hash = "sha256:6734dcf742ced6e8018e45d3f9f7728975b6b3e1085a24f3e2c056069d858bd1"}, + {file = "httpx-0.29.0.tar.gz", hash = "sha256:700928ee6c1f4213795e67c47eba8f8553639069fea89199f71d654e38edc593"}, ] [package.dependencies] @@ -860,7 +860,7 @@ idna = "*" [package.extras] brotli = ["brotli ; platform_python_implementation == \"CPython\"", "brotlicffi ; platform_python_implementation != \"CPython\""] -cli = ["click (==8.*)", "pygments (==2.*)", "rich (>=10,<14)"] +cli = ["click (==8.*)", "pygments (==2.*)", "rich (>=10,<15)"] http2 = ["h2 (>=3,<5)"] socks = ["socksio (==1.*)"] zstd = ["zstandard (>=0.18.0)"] @@ -1162,14 +1162,14 @@ files = [ [[package]] name = "packaging" -version = "26.3" +version = "26.4" description = "Core utilities for Python packages" optional = false -python-versions = ">=3.9" +python-versions = ">=3.10" groups = ["dev"] files = [ - {file = "packaging-26.3-py3-none-any.whl", hash = "sha256:d7193f7c8e4e93f444fde0262bf90af30e16fa0ad0ad44cb553c87339b23cd1c"}, - {file = "packaging-26.3.tar.gz", hash = "sha256:94edc256424af38762eb31306eed28beb9f0efc50a8837492c9d6fd6004aed79"}, + {file = "packaging-26.4-py3-none-any.whl", hash = "sha256:81383611a09c1bc0b08b76e0fd5829d7c6824c65b27a6aee339da133f4233ea2"}, + {file = "packaging-26.4.tar.gz", hash = "sha256:c4b671c41ddb9bf26e543c37723610d28fb6bf7affc4da17cf048d419d2c062a"}, ] [[package]] @@ -1335,19 +1335,19 @@ files = [ [[package]] name = "pydantic" -version = "2.14.3" +version = "2.14.4" description = "Data validation using Python type hints" optional = false python-versions = ">=3.10" groups = ["main"] files = [ - {file = "pydantic-2.14.3-py3-none-any.whl", hash = "sha256:3f7b347782ab7e4cf4c798496ae3a82787d9f21ec12676a9c564355eeef8daa8"}, - {file = "pydantic-2.14.3.tar.gz", hash = "sha256:1054f237f4d4733e5a30e1e2333bd33a2004ab9ab1510bd053a9a31bb48e232d"}, + {file = "pydantic-2.14.4-py3-none-any.whl", hash = "sha256:653a2ad9f6d8858529c77c72717d0ea991d6c6837fe683246b2f4b2bbfc3fadc"}, + {file = "pydantic-2.14.4.tar.gz", hash = "sha256:7c19f1d46f8accf55a4617a6116e1ade64840870f397b846a2c53fb9019414ba"}, ] [package.dependencies] annotated-types = ">=0.6.0" -pydantic-core = "2.50.4" +pydantic-core = "2.50.5" typing-extensions = ">=4.16.0" typing-inspection = ">=0.4.4" @@ -1357,152 +1357,152 @@ timezone = ["tzdata ; platform_system == \"Windows\""] [[package]] name = "pydantic-core" -version = "2.50.4" +version = "2.50.5" description = "Core functionality for Pydantic validation and serialization" optional = false python-versions = ">=3.10" groups = ["main"] files = [ - {file = "pydantic_core-2.50.4-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:83d2beac85b757bfc404c5c0612df51c4ef33bbb7be65cf4a96b4da7cbc4ff4f"}, - {file = "pydantic_core-2.50.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:76e0065998159244ff4c097a6c05ff08019c6fbb6e597a85846e73044f0215b3"}, - {file = "pydantic_core-2.50.4-cp310-cp310-manylinux1_i686.manylinux_2_5_i686.whl", hash = "sha256:25e7e1080f9f7ce7cd9d114b31470ce912771bd02f38c824721d3c35d312abff"}, - {file = "pydantic_core-2.50.4-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:c4c5a1770ecfe8bdb6c6f09f8d81ea4de04f7efb012fac1efa4ad315dccc1fd1"}, - {file = "pydantic_core-2.50.4-cp310-cp310-manylinux2014_armv7l.manylinux_2_17_armv7l.whl", hash = "sha256:2f6767122b37c780bb756a720a4eef2bc6a050a0a1143428834b3cbc89448bd2"}, - {file = "pydantic_core-2.50.4-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:86c7c4615634b5c57a79770f5b738354e45ae219a89949aeae84f19169a05283"}, - {file = "pydantic_core-2.50.4-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:6c7d7b0b596319e9ce79ef96ce57a14054a2eac629c0588a0539187a218be799"}, - {file = "pydantic_core-2.50.4-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:ed9c0b6f236648dbf30d57e9f57e1f74878caafa04833a19f529b5ba5164b7a8"}, - {file = "pydantic_core-2.50.4-cp310-cp310-manylinux_2_31_riscv64.whl", hash = "sha256:dfcf6e51000b34f7026322cd9ea9bc340d745637e27e0bbc22f504b4f6b967ee"}, - {file = "pydantic_core-2.50.4-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:bd46bcc28ed85d3cf71581b42d90b4ebd1f2062f81879519fed209f8a4d1cfc6"}, - {file = "pydantic_core-2.50.4-cp310-cp310-musllinux_1_1_armv7l.whl", hash = "sha256:696613a0c0e7b2b35356e389ba4195ce20cfe7a2fc2e992c87d974d973eabec7"}, - {file = "pydantic_core-2.50.4-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:2980a701be88f9128a7470189fa3bcda5387f76c298a6f8e000fc29eb2a6f4e7"}, - {file = "pydantic_core-2.50.4-cp310-cp310-win32.whl", hash = "sha256:dd8bed00731a21e3106e5dd6bbffb6c775a2c0bbc7c0c9face534d830057bdc9"}, - {file = "pydantic_core-2.50.4-cp310-cp310-win_amd64.whl", hash = "sha256:e512c75ec5cf4475c1aa50ad975ecdf253f4963b06e152e1a11edd6de4010753"}, - {file = "pydantic_core-2.50.4-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:3e547ceec1da7382f01f9e13963023e53367a71802c88778b21b9645a077cbdf"}, - {file = "pydantic_core-2.50.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:c813ada7a651193acda85b6bc1cf12abd4b37cd25c7c6a75d7183512cc374969"}, - {file = "pydantic_core-2.50.4-cp311-cp311-manylinux1_i686.manylinux_2_5_i686.whl", hash = "sha256:57fa0a9490785139f1a4e4f43891830d55dfe4408845c0c9cb5eff4aeaf75f69"}, - {file = "pydantic_core-2.50.4-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:30d4dc35bc0eea52202a90b3820445ee0072c820241bfa710a623a078c9b267b"}, - {file = "pydantic_core-2.50.4-cp311-cp311-manylinux2014_armv7l.manylinux_2_17_armv7l.whl", hash = "sha256:789f88dea57841cdebef392b5d6e90444d767117e9ff2e0d9172df5c9de6690c"}, - {file = "pydantic_core-2.50.4-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:d690121e80ab16e623415351ab24713534d4e500b3cadff216409cb6826063d4"}, - {file = "pydantic_core-2.50.4-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:b42f64825f5d750228f08318a9bf4d723b7ecb4c472aedcb3013c3ec2dc1f949"}, - {file = "pydantic_core-2.50.4-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:0574866e05f6adeecc520d87e87dd06210c0a51706341f6ef8421572f5a64444"}, - {file = "pydantic_core-2.50.4-cp311-cp311-manylinux_2_31_riscv64.whl", hash = "sha256:dcf2c7eaaa4cafe8e49b017e5bb49e76e084ab6f0cd712ee4019c812b5cf68b8"}, - {file = "pydantic_core-2.50.4-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:3b8ee2589a082739c522c1fe4be227412fcf108b903abb6672ae2f5570558882"}, - {file = "pydantic_core-2.50.4-cp311-cp311-musllinux_1_1_armv7l.whl", hash = "sha256:aec3c2d741a8e3ee993de7f95f37afb51e31b169c95dbd29da4cf6688f340914"}, - {file = "pydantic_core-2.50.4-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:8923fcd49f875e8a0448d7223d1fdf1a9973ae2d1f20d4158753ceb8909facd2"}, - {file = "pydantic_core-2.50.4-cp311-cp311-win32.whl", hash = "sha256:fc04affef30be98c1f36f0c422a4061ef618fdc1dde79f5ad5458dd496fecffa"}, - {file = "pydantic_core-2.50.4-cp311-cp311-win_amd64.whl", hash = "sha256:15bece43a02ad543c621c8305e67dedb5f27d378c5ba741e5a2c36523f8ef37f"}, - {file = "pydantic_core-2.50.4-cp311-cp311-win_arm64.whl", hash = "sha256:e498900bfbf7ddddd862f810440c09e9b81674739e8a11d619b40906dccd4a9a"}, - {file = "pydantic_core-2.50.4-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:32a991aebd165f227b7c7c60bb9d66c2c7de9c24308552da264c9938fde0f8d6"}, - {file = "pydantic_core-2.50.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:1e20cbde2b6deb33a51d08cd168454dd9044ec7d4474056f4d98d63f51578783"}, - {file = "pydantic_core-2.50.4-cp312-cp312-manylinux1_i686.manylinux_2_5_i686.whl", hash = "sha256:8cceae48ae7f94990c2f4e36291e9ec9868735e8b0f19e4489a17b0422338466"}, - {file = "pydantic_core-2.50.4-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:16902a147b3da4840612164a5e67947104d63e978f7a57c395877a5e26690b9c"}, - {file = "pydantic_core-2.50.4-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.whl", hash = "sha256:d6e3485a5e5c01fb5339c1ee3d4b9e21e2135a2a9d44caafb71acd994487ee7c"}, - {file = "pydantic_core-2.50.4-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:629eae995185540406e3635df5d5cf1d44f19ea240840b835d3f44541ff694d8"}, - {file = "pydantic_core-2.50.4-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:41b2cd8b29dbb5a4c9828a70f50d1abfc92011115c813213d3a91205c6f731b3"}, - {file = "pydantic_core-2.50.4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:c81d98e27d9d9261909dcccab1ba5d6ea1c98b0bb9470e368604614fd1d36ddd"}, - {file = "pydantic_core-2.50.4-cp312-cp312-manylinux_2_31_riscv64.whl", hash = "sha256:ca83a32b2b41653d89f09a3d22b770bca96da72273bef8f7a68136bdd1e8b823"}, - {file = "pydantic_core-2.50.4-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:817953730e4a73a09008b010c4a42396cefe799616a22df2ac21d3927b3080cf"}, - {file = "pydantic_core-2.50.4-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:664e74848c2f5fc27db8505fe24e1ecd3ac669412913bf73d176916f86cc08e2"}, - {file = "pydantic_core-2.50.4-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:219114f8dcdcbe4720d82ef016b1287ce5a0a67d7c69ca61524eb72e82aac344"}, - {file = "pydantic_core-2.50.4-cp312-cp312-win32.whl", hash = "sha256:67f7cc397e1d5556a801d1cba74de0d27d827eb242e6c036c0ca273c745414f1"}, - {file = "pydantic_core-2.50.4-cp312-cp312-win_amd64.whl", hash = "sha256:ea2f61b0bc12f3592288503961b764579dea0658852d96a0b3d823614d808821"}, - {file = "pydantic_core-2.50.4-cp312-cp312-win_arm64.whl", hash = "sha256:32d6dda86383645ec428ea64dfc277036f5cbc60a72238eab28b91a3fdb9a113"}, - {file = "pydantic_core-2.50.4-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:0f87ae9db5ba8d8de40dcb93982cf8dd544e6552a80d3345af51941cc2146b80"}, - {file = "pydantic_core-2.50.4-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:1239daaf063e62213ca1f34d96663900bd7510c42a786e843fd328af70e46445"}, - {file = "pydantic_core-2.50.4-cp313-cp313-manylinux1_i686.manylinux_2_5_i686.whl", hash = "sha256:1afefe44ec042fbabfb4483ea258c04cf75ff4ff328d754f09b321fdaa232aca"}, - {file = "pydantic_core-2.50.4-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:a9ee990bf2cfbd81574c5d4f9f6c9d480a14b5b43d2c4f2ca13f4c6f48089394"}, - {file = "pydantic_core-2.50.4-cp313-cp313-manylinux2014_armv7l.manylinux_2_17_armv7l.whl", hash = "sha256:ab2822bcdcefb54d1e8ca29f5e3ec3afe160fb794bb3a3a73b09d11ed2671104"}, - {file = "pydantic_core-2.50.4-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:0001d6920e3a5d92758cda460d6dc9f918a78ad6d5d092f1c8b5395e6b775356"}, - {file = "pydantic_core-2.50.4-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:ad92d255a165cde5f9882ff69699eaf5495e0a1f32e97566bbbb80f11e46781f"}, - {file = "pydantic_core-2.50.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:fb2bb5b557080da398b866408117d98fe9731a12334afd0cdff221b458cdc5dc"}, - {file = "pydantic_core-2.50.4-cp313-cp313-manylinux_2_31_riscv64.whl", hash = "sha256:92f8f63df729061bb14558ed740e7a222f6e2aa6c2e6a5bcfb4e706676562049"}, - {file = "pydantic_core-2.50.4-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:2a60ec2a57ac3ef3767e526e9bf706ec75aa3d79c4ea134d9d4fcf7c62a297a7"}, - {file = "pydantic_core-2.50.4-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:a2f8716344bbbd10443391be0b1f2003b34949e3c4e6883005c2bc498ab6b64b"}, - {file = "pydantic_core-2.50.4-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:b300a30304c4c6aeab03ed06809819d9eceacdd58441d3c7dffe41edfd006091"}, - {file = "pydantic_core-2.50.4-cp313-cp313-win32.whl", hash = "sha256:ef8a9ddb2e2a4eae4abb72dc0710eca6c2726779b0664bd10c3ce9fcfaed8c4e"}, - {file = "pydantic_core-2.50.4-cp313-cp313-win_amd64.whl", hash = "sha256:4c29b8f2d6417069bb1f257e6b9113f5d64dc2f554cc200ea90b4fe2c5cdb733"}, - {file = "pydantic_core-2.50.4-cp313-cp313-win_arm64.whl", hash = "sha256:a0c5210d038418a115e7cf8706bfa611bd14add2f5787274dba45aadca3155e0"}, - {file = "pydantic_core-2.50.4-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:5c074454dc6d4f6f4ba6561a56bf33a14db7651d882a5a5321ba3ae8868e082d"}, - {file = "pydantic_core-2.50.4-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:a4bb174bd65f795c39ad6642d9d5bdc43351b306b7d0a654ab0d0abb38be245f"}, - {file = "pydantic_core-2.50.4-cp314-cp314-manylinux1_i686.manylinux_2_5_i686.whl", hash = "sha256:0ec20aca2b067369913716847f7dfe5f4dddf16a46965b7a70bbad5defaaba86"}, - {file = "pydantic_core-2.50.4-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:70dbc9f83c41f37a4faa62dae5203853847223a891da446f48ef2efcfd5df806"}, - {file = "pydantic_core-2.50.4-cp314-cp314-manylinux2014_armv7l.manylinux_2_17_armv7l.whl", hash = "sha256:3de6c2a4df2af0ac9ab4dc1488746fe8b1a90e27955d870d9edda3187d20092b"}, - {file = "pydantic_core-2.50.4-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:3a48a5254d15a0ad050318bfc7a9566d4ec740118187e8f303e47a6840287eb7"}, - {file = "pydantic_core-2.50.4-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:0af56dbf8822ba9f4efcbbfdc15478f8b6fb08f1609860cb50aa2cc8476b3c34"}, - {file = "pydantic_core-2.50.4-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:f1d62fb172db35c6478c9323da34ff37d1f3d37d7d44337a9d94ba8c583e5730"}, - {file = "pydantic_core-2.50.4-cp314-cp314-manylinux_2_31_riscv64.whl", hash = "sha256:5c1013647be741647895c102831dcf79c34209662dbb683df9efb864417ed7d5"}, - {file = "pydantic_core-2.50.4-cp314-cp314-musllinux_1_1_aarch64.whl", hash = "sha256:aeb2e123cbf978a905e9f55155c1b8316fbbfa7cf64d04521fe174bab302d100"}, - {file = "pydantic_core-2.50.4-cp314-cp314-musllinux_1_1_armv7l.whl", hash = "sha256:523466eba8ee10f7480f3c2057563145978011c583130d2cc01fb1e7af808e25"}, - {file = "pydantic_core-2.50.4-cp314-cp314-musllinux_1_1_x86_64.whl", hash = "sha256:c9e70012926e97069cdd09221861aff412aa94e4cac2e019055cdb79485b150c"}, - {file = "pydantic_core-2.50.4-cp314-cp314-pyemscripten_2026_0_wasm32.whl", hash = "sha256:e6da138a1ecc1341c8b788a5ee822670b03788e1f5decf7af9d461de6e508b8e"}, - {file = "pydantic_core-2.50.4-cp314-cp314-win32.whl", hash = "sha256:13b6dd62b5279f5b9d72f3bf918a35443ee8bd549241d9dc52d79a2c3b6d7016"}, - {file = "pydantic_core-2.50.4-cp314-cp314-win_amd64.whl", hash = "sha256:b0cdb655fbd1562c2dfc9986f9103a106f7058cd0915afc6e656d4b1d73f3387"}, - {file = "pydantic_core-2.50.4-cp314-cp314-win_arm64.whl", hash = "sha256:df1c174796cd63eb6b139f7daf783affe1f3ed659605850e843b24764c21bfc5"}, - {file = "pydantic_core-2.50.4-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:edbca8789fd10f0de534b660a6b4c71f1fd18039679c918dad392ab044bb37e4"}, - {file = "pydantic_core-2.50.4-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:33b21f69540a12c2053cd1d95766d8bd9667a3897f7c712a642de8aa37eb0865"}, - {file = "pydantic_core-2.50.4-cp314-cp314t-manylinux1_i686.manylinux_2_5_i686.whl", hash = "sha256:ffb616d8d55965839670301dc3bae3abacff560a7e137a89056058a8a9da4d96"}, - {file = "pydantic_core-2.50.4-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:6c5687b59b6ba0f663c4f2f15470f68507d6b45ccd3a19ee6d224f95cbee70d8"}, - {file = "pydantic_core-2.50.4-cp314-cp314t-manylinux2014_armv7l.manylinux_2_17_armv7l.whl", hash = "sha256:c733087ecf7dde06b1d071679bfd5f3ba03266ba77814c1c7253bc48c9adedd9"}, - {file = "pydantic_core-2.50.4-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:94733cb447c37b0ce6f71b39ca1288d5f966a084023a5617b4cc35a852586859"}, - {file = "pydantic_core-2.50.4-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:b26f39a5be3cd91a2035818be3d0ffdf5282c3e1f5f53d3b80b7024021acee52"}, - {file = "pydantic_core-2.50.4-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:c856e439a9d54d514e81a7131229ba151cdf81df7c408e0f6c89340e5003dfe2"}, - {file = "pydantic_core-2.50.4-cp314-cp314t-manylinux_2_31_riscv64.whl", hash = "sha256:cbf0777d54672990b10cb8ca9b0523499e182d7e2ea39f86b138519a902aa601"}, - {file = "pydantic_core-2.50.4-cp314-cp314t-musllinux_1_1_aarch64.whl", hash = "sha256:edc17549ab592e33cfcaf285f047bb75fcd98f608aa9309af1187fd736ce9641"}, - {file = "pydantic_core-2.50.4-cp314-cp314t-musllinux_1_1_armv7l.whl", hash = "sha256:23a9ba564b2db709ff16eca990992ba95a19069972b34bff87c81d4b473cd755"}, - {file = "pydantic_core-2.50.4-cp314-cp314t-musllinux_1_1_x86_64.whl", hash = "sha256:41f4f8ae714e4fea1d635880f8a1af715ecf080eed4d13c5b04a0f3210f9c61a"}, - {file = "pydantic_core-2.50.4-cp314-cp314t-win32.whl", hash = "sha256:601fce6cea9ddeaa85329e12e7f351def38d233075f42a3012b9c48071b02941"}, - {file = "pydantic_core-2.50.4-cp314-cp314t-win_amd64.whl", hash = "sha256:22e874666bdbd96d6bf629d32cd8ab376fedf1fd62585b52a42b9fa9fa6c20b6"}, - {file = "pydantic_core-2.50.4-cp314-cp314t-win_arm64.whl", hash = "sha256:71395a43da5584bb70556f380387e15f845c0dcf76373c1afbfa0025737576ac"}, - {file = "pydantic_core-2.50.4-cp315-cp315-macosx_10_12_x86_64.whl", hash = "sha256:7ac2769a7ddd661e07e26c12220adc31b17014c48234b2a5a88993b8d4109e09"}, - {file = "pydantic_core-2.50.4-cp315-cp315-macosx_11_0_arm64.whl", hash = "sha256:930ad463d3fb7a340d323bcc496ec32dae469ec9974c29ff569f19806b6b03b4"}, - {file = "pydantic_core-2.50.4-cp315-cp315-manylinux1_i686.manylinux_2_5_i686.whl", hash = "sha256:b867f9fd183d76977f810c626d539265183c25b2284762893a31e8d6cacc81c0"}, - {file = "pydantic_core-2.50.4-cp315-cp315-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:49eb1241a969a5994db6880c18c012b6cbe2340343d8f529721571806583e500"}, - {file = "pydantic_core-2.50.4-cp315-cp315-manylinux2014_armv7l.manylinux_2_17_armv7l.whl", hash = "sha256:477af785d1846e4e96bf56983b92ea7553aaeccdeb8acdaa55c7cee9eda0ae32"}, - {file = "pydantic_core-2.50.4-cp315-cp315-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:29358a8ca74e7d81158d14e2b10c904bd18773293ae3788716c0626fe0342347"}, - {file = "pydantic_core-2.50.4-cp315-cp315-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:300753f71c73302e218124baf995f00058e085cd01869bd9610bcbd0bd4500c1"}, - {file = "pydantic_core-2.50.4-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:26cb012c4b8ca9f847bd0ac15978bd3d0f55b050bfbe6c47355edfc7e945029b"}, - {file = "pydantic_core-2.50.4-cp315-cp315-manylinux_2_31_riscv64.whl", hash = "sha256:9be1cfe715ecaa060ffd5d599ef410b94ef2697a0eed4cee562f788a2aa2175b"}, - {file = "pydantic_core-2.50.4-cp315-cp315-musllinux_1_1_aarch64.whl", hash = "sha256:c81e35862aced259177a537ce1a6264c3a97bae1ced184ca9dc10ea754563688"}, - {file = "pydantic_core-2.50.4-cp315-cp315-musllinux_1_1_armv7l.whl", hash = "sha256:b2f2d13239487cecaae98c9f4d5904ad0737643cdf8873c88ec6a78b12214f20"}, - {file = "pydantic_core-2.50.4-cp315-cp315-musllinux_1_1_x86_64.whl", hash = "sha256:e6b4b08d09054310a4dc389fa61ee22a7a5a292cb23ab8a985136ca8828bf924"}, - {file = "pydantic_core-2.50.4-cp315-cp315-win32.whl", hash = "sha256:6619d49a89a15cd04334f76fec530c155923bfc60da74ff5d815a52629e1aa6c"}, - {file = "pydantic_core-2.50.4-cp315-cp315-win_amd64.whl", hash = "sha256:e5bd109d095aaae989a0463d5ef0fcc43e9ddd5de125e656d3c119a79e466380"}, - {file = "pydantic_core-2.50.4-cp315-cp315-win_arm64.whl", hash = "sha256:6118e5a5550e36582e19bac1a403711a748f9f18251b054c326d3db02aaa7a18"}, - {file = "pydantic_core-2.50.4-cp315-cp315t-macosx_10_12_x86_64.whl", hash = "sha256:d8201c9f9035520cdcc7dcad383b039ec8123969b87e01cf27c3dd883c02313b"}, - {file = "pydantic_core-2.50.4-cp315-cp315t-macosx_11_0_arm64.whl", hash = "sha256:1de7be9a66fc8536770481ab64a05aae5067c725f2b29a09543af00e6a417b97"}, - {file = "pydantic_core-2.50.4-cp315-cp315t-manylinux1_i686.manylinux_2_5_i686.whl", hash = "sha256:789a6453e5ffd18a7ab6b8c3a0dd8403053829197ec258ecb90c604c21ffcc99"}, - {file = "pydantic_core-2.50.4-cp315-cp315t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:6348ad12fa741bcc9c2f173e99fbf27cbc038826d8c31a4a7d836eca27878ba2"}, - {file = "pydantic_core-2.50.4-cp315-cp315t-manylinux2014_armv7l.manylinux_2_17_armv7l.whl", hash = "sha256:d49127f137f871cde3c5650af33bbbdcee02679dae76e020902fa106f522b8ae"}, - {file = "pydantic_core-2.50.4-cp315-cp315t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:2f5cc5bcb94063fbbdfd285a2b302da34af07491337c10bb35de1d5220fa1583"}, - {file = "pydantic_core-2.50.4-cp315-cp315t-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:b99bed995ed7c41515c11fe2beb86f8a6cc298e5537cae2f736de2f982f74ef0"}, - {file = "pydantic_core-2.50.4-cp315-cp315t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:faa4e96385c820ce9d7f7a623486e23d4134ae3c9ba2071e44e0ab5a5a5002c4"}, - {file = "pydantic_core-2.50.4-cp315-cp315t-manylinux_2_31_riscv64.whl", hash = "sha256:d6a166978f22f10cb91413f70519861605219346decf65bc79008f9257c94afe"}, - {file = "pydantic_core-2.50.4-cp315-cp315t-musllinux_1_1_aarch64.whl", hash = "sha256:a70d5effebd81ebd8e15a8aabdc7980832367b2b00c36543bac378977004cc80"}, - {file = "pydantic_core-2.50.4-cp315-cp315t-musllinux_1_1_armv7l.whl", hash = "sha256:f8fd23653a252cefabea11cd041efd7b80bdf403e43a36dea53f9cb0aaa21f0f"}, - {file = "pydantic_core-2.50.4-cp315-cp315t-musllinux_1_1_x86_64.whl", hash = "sha256:7646353a5a7c553c04167aca628e2550b538f492765b03ccf34321a560acc43c"}, - {file = "pydantic_core-2.50.4-cp315-cp315t-win32.whl", hash = "sha256:65376dbe1ab4dbc768ca2b72b7c13993562c035f5925fd3bc7ff9c8c585c515d"}, - {file = "pydantic_core-2.50.4-cp315-cp315t-win_amd64.whl", hash = "sha256:f08ee8248aad2d054e5bc4c73554d4505464698f6d754f16198dbc5764e9821d"}, - {file = "pydantic_core-2.50.4-cp315-cp315t-win_arm64.whl", hash = "sha256:da779ae50b46f3f7d1e1b5f362fdc0ad376a49fd55f6f3122dc2b6149936cdf7"}, - {file = "pydantic_core-2.50.4-graalpy312-graalpy250_312_native-macosx_10_12_x86_64.whl", hash = "sha256:c04e9d920e2674f54651fd260a15c5d2843526c73d5242ee4311325ddc9573b3"}, - {file = "pydantic_core-2.50.4-graalpy312-graalpy250_312_native-macosx_11_0_arm64.whl", hash = "sha256:5bc1811ef2b4d4ba63e8e452f6e332b6374bd1d2cbbfdf66826c8cb1f71dd10d"}, - {file = "pydantic_core-2.50.4-graalpy312-graalpy250_312_native-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:0b059a7968b1911be5a2d9a8234827ab0bef9d1e465d4b42da525894143550e8"}, - {file = "pydantic_core-2.50.4-graalpy312-graalpy250_312_native-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:bee28aab5a580eec673f7b68dfa8dece3dd37bd207ef8d22fafe23a8e9837296"}, - {file = "pydantic_core-2.50.4-graalpy313-graalpy253_313_native-macosx_11_0_arm64.whl", hash = "sha256:71e03d2ea1a221d020cfc5b6cc8bbbedef23a06704c70fcf4d0afb42965b22d1"}, - {file = "pydantic_core-2.50.4-graalpy313-graalpy253_313_native-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:09450778e3ab58d3f565899fcfbf6c82926e31af29e28e799d1d50941316e0cb"}, - {file = "pydantic_core-2.50.4-graalpy313-graalpy253_313_native-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:4eb15be588407148ef5937dc8d9256a71f6b115e6cddadb7aa20b6ee384680dc"}, - {file = "pydantic_core-2.50.4-pp311-pypy311_pp73-macosx_10_12_x86_64.whl", hash = "sha256:39f489ce31272073e6e146f6781690f9c1ee8c126836e6403361ef91154d89fe"}, - {file = "pydantic_core-2.50.4-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:5b26e5f1793b96cdc60242bf38da86ff24a27a708aa396214cac9b534bf571c7"}, - {file = "pydantic_core-2.50.4-pp311-pypy311_pp73-manylinux1_i686.manylinux_2_5_i686.whl", hash = "sha256:7210398a1607ad607dc73196e575b3148b00a333cbb602ddbe1b60ba54554f43"}, - {file = "pydantic_core-2.50.4-pp311-pypy311_pp73-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:2f42584e5785385f681163a42506cab0d51295e17599a648396c52a7046c1372"}, - {file = "pydantic_core-2.50.4-pp311-pypy311_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:2039e323acee9abfec1fb5f661776e8965fe5928f3b7f8431900a774cba5c317"}, - {file = "pydantic_core-2.50.4-pp311-pypy311_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:71ade6d2e445839350d589ff99bbddfde16f3f32db28da5c894a09f99c8b2a03"}, - {file = "pydantic_core-2.50.4-pp311-pypy311_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:d7d406709ae924cf0b08b8282ca2f0e1c90526911d93bc040557cbc83b74c55f"}, - {file = "pydantic_core-2.50.4-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:7472c39480ccc11dda69a196d1b7c7a6b48eb6594b77f05d945599d3e47f731c"}, - {file = "pydantic_core-2.50.4-pp311-pypy311_pp80-macosx_10_12_x86_64.whl", hash = "sha256:b67d38e8bb0ade7e6e84575e4bb153fab35b122458077273aeb08fdf12be9d2c"}, - {file = "pydantic_core-2.50.4-pp311-pypy311_pp80-macosx_11_0_arm64.whl", hash = "sha256:4eda7e3fdef382b7d4492745988a5baaf6953923a337f8b9dde5f76fa8afde20"}, - {file = "pydantic_core-2.50.4-pp311-pypy311_pp80-manylinux_2_28_x86_64.whl", hash = "sha256:474f7e598c7902165662a5d5160d3fce31037890a2975a9871ebf7c05862300b"}, - {file = "pydantic_core-2.50.4-pp311-pypy311_pp80-win_amd64.whl", hash = "sha256:3e0b395648c6cb871bceb2906907f255dc876ec425f2d5b024e129985cea8519"}, - {file = "pydantic_core-2.50.4.tar.gz", hash = "sha256:aead3b74b68396bf0feab5d57e050b730ded7df55853c1e048a87e00aaf033c6"}, + {file = "pydantic_core-2.50.5-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:302517f9f5589e07ead02d38fbb443947a211461b39b18f46948b20941fa8d98"}, + {file = "pydantic_core-2.50.5-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:55e0d60384a9b14641749d2ba6721f82409248288f066b95d555c6dd484273d2"}, + {file = "pydantic_core-2.50.5-cp310-cp310-manylinux1_i686.manylinux_2_5_i686.whl", hash = "sha256:93a10c0b967c0dc6c2253d3a82b9117d2a841b8e344c637edc0a14220852b115"}, + {file = "pydantic_core-2.50.5-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:252ce30d79b47954cc3a49f8a0d812ac24a356627391fcec90a68733c755707e"}, + {file = "pydantic_core-2.50.5-cp310-cp310-manylinux2014_armv7l.manylinux_2_17_armv7l.whl", hash = "sha256:5da0e7da9d7cdc39df85d1b927b77d40218cf40acbfc523048c95ce44d33abb9"}, + {file = "pydantic_core-2.50.5-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:bb103c150e1a0f1b8b2710a66ce1f741c7922b22ef07a290aea0e6cf702d8bbf"}, + {file = "pydantic_core-2.50.5-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:6e01a2033691ea2cbd91e499d6b6573f446dc926ccdfc670ed576991cef85cdb"}, + {file = "pydantic_core-2.50.5-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:92c0ebab606f982730aaaa741a30cd5e0f68dc7c005a5baa9b332fc182232c61"}, + {file = "pydantic_core-2.50.5-cp310-cp310-manylinux_2_31_riscv64.whl", hash = "sha256:706c75cd9f8bd1798367f463ea81df52eff5fb2e4c4ef83997dd4ae538adc109"}, + {file = "pydantic_core-2.50.5-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:d84b427c6badf48adc2586be1dc5c8677fc2f22a09da50e5d3f342d3daf3b2b4"}, + {file = "pydantic_core-2.50.5-cp310-cp310-musllinux_1_1_armv7l.whl", hash = "sha256:5eafde2cd1d97b7f60efc423d8504b22defd9d2fb9c4a358ffd1230e5fe65311"}, + {file = "pydantic_core-2.50.5-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:dc5717ed8981efdbbafc15a2533a690703cf80e96b886a158c61c9ec9bafcc28"}, + {file = "pydantic_core-2.50.5-cp310-cp310-win32.whl", hash = "sha256:15124b48e0acb6d24664690e052d50be51901286886bc124090960f1df869f30"}, + {file = "pydantic_core-2.50.5-cp310-cp310-win_amd64.whl", hash = "sha256:b7e6a76b77513cd633a08addfda8409623ad884a4d91ee3664fb05cf094b2c35"}, + {file = "pydantic_core-2.50.5-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:bcc830e4f48499fd30a870f07c30752273ae2ddccce34d65d51c9fc880c380ab"}, + {file = "pydantic_core-2.50.5-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:40d5da89a632e6c6c938f93fdf54c534882d258a80f51ccfe1650cdedc12e82c"}, + {file = "pydantic_core-2.50.5-cp311-cp311-manylinux1_i686.manylinux_2_5_i686.whl", hash = "sha256:f7509c6f8a0f9d9eac58340dd567f0eb71ce2f762df09f0d51280e30da3fe687"}, + {file = "pydantic_core-2.50.5-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:ba2b34529984a8e3cb1bc62a7687617722695a2cb4e57958de32a0eba128a07a"}, + {file = "pydantic_core-2.50.5-cp311-cp311-manylinux2014_armv7l.manylinux_2_17_armv7l.whl", hash = "sha256:f8dc2008577c5e02eaa1eb3fbfa8fe0eba9af27ff6a740e9f1dae6661e88efcb"}, + {file = "pydantic_core-2.50.5-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:4dcf7b2cdfb9c59c1d377de318f3c8462121f32db939299999484ea0b1eadf18"}, + {file = "pydantic_core-2.50.5-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:ed4a01922af0d41b2a3b9433818cbb73b6b28e8dea344c90917c1fdcceb9960f"}, + {file = "pydantic_core-2.50.5-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:488319076ec92908b91fc6265ce761f1d78748f69f85518564fd16bf333e1b70"}, + {file = "pydantic_core-2.50.5-cp311-cp311-manylinux_2_31_riscv64.whl", hash = "sha256:50d12ba7cab98b355ba65d65655e969f66934ab7a3d2d0c8abd61ae2282efce5"}, + {file = "pydantic_core-2.50.5-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:be4615d4b5f90c65dce2295dcf32eff7f05ea5d0d3a82421c03c572785cb9bf8"}, + {file = "pydantic_core-2.50.5-cp311-cp311-musllinux_1_1_armv7l.whl", hash = "sha256:65b0f52abcd06dbb53961db9cc3610929f4f6518c3726d965a9babdaf7bd79c9"}, + {file = "pydantic_core-2.50.5-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:05815bbe2c7bec58d1ce456cc0a98f368e6ef9345b1d9311f42b814d34ad7086"}, + {file = "pydantic_core-2.50.5-cp311-cp311-win32.whl", hash = "sha256:e65f78eb3d930ac30ff3557fc74a0771300096fb002f588a6fe8d946e83f14ad"}, + {file = "pydantic_core-2.50.5-cp311-cp311-win_amd64.whl", hash = "sha256:d4ebf349b1b60049e80df5d9ea6725b1b7e434a7d006474b0f664fa72a6b3c75"}, + {file = "pydantic_core-2.50.5-cp311-cp311-win_arm64.whl", hash = "sha256:736782cfbca37b4d81e6f3c7a3414de25db045dcdb7a05e55b64191a33c5ac45"}, + {file = "pydantic_core-2.50.5-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:24d23de96195ff9637e5940a7fbde3bea6a355b26fb5f491737dd803aa5d5a93"}, + {file = "pydantic_core-2.50.5-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:a9bcf23628860d5a90cacdc188ee3b7d0547a38eb985214f03e7002a6ca0e558"}, + {file = "pydantic_core-2.50.5-cp312-cp312-manylinux1_i686.manylinux_2_5_i686.whl", hash = "sha256:30988977d38909df645183a9869a9d12211485639ac4757de18585f0ccb6f3dc"}, + {file = "pydantic_core-2.50.5-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:07a62d44515d674d750cfd86b7ce1dd93111be870f378d7c27b37aeb78d0cb4a"}, + {file = "pydantic_core-2.50.5-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.whl", hash = "sha256:7dfc0431e94659ae8449303ca4fb1588dc1e00282d6636d00d72bb4bd6459b4d"}, + {file = "pydantic_core-2.50.5-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:004c784d4642bd1112a9fa9a022543aa17793fd32004f7e903ee97df2086bad4"}, + {file = "pydantic_core-2.50.5-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:fa66340c6d3e08a276803812e7665312dfc75dd24eedfa8e09f18a0f8e3e0e8f"}, + {file = "pydantic_core-2.50.5-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:470bbc2495367f60d3ca849a8039e4c164701d10637e7743f4427d92651bdb6d"}, + {file = "pydantic_core-2.50.5-cp312-cp312-manylinux_2_31_riscv64.whl", hash = "sha256:43a6eaee9eeac4a54f2ff6567e1b0ec51651b37a40d862cab2e6fd16109e6528"}, + {file = "pydantic_core-2.50.5-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:b66f2434c895652ac21c030d5a3a92c7811f0f9b98af41bf35be899c2d34aa4c"}, + {file = "pydantic_core-2.50.5-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:2cb80e0323b31d4669c4d72a466d99c885e13deb06205aa079ea6594e7ad1ef8"}, + {file = "pydantic_core-2.50.5-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:3cf575867ecaf89aca440e5a4253d2facf1ca37bab30a4e8c205ec611228126a"}, + {file = "pydantic_core-2.50.5-cp312-cp312-win32.whl", hash = "sha256:57d4350167130c9c136b7efa35e6e7ee9539779698755b01007834d32c7a1f7d"}, + {file = "pydantic_core-2.50.5-cp312-cp312-win_amd64.whl", hash = "sha256:baa107902f8e38011a5f79836d905eb6bfaac1d4b0bd09fc86509b711d0b09c8"}, + {file = "pydantic_core-2.50.5-cp312-cp312-win_arm64.whl", hash = "sha256:2d785ae9ff0ac485567f27f4fc53712268916e04be4a590160e5bf55b096225a"}, + {file = "pydantic_core-2.50.5-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:e5d5d77a9446f44688a5ef420d92c9facac0865ef5565215db54be184ab7906f"}, + {file = "pydantic_core-2.50.5-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:639a51931869c0594d8723b2f529c547db1aa33dc9571d001dc205d896170c08"}, + {file = "pydantic_core-2.50.5-cp313-cp313-manylinux1_i686.manylinux_2_5_i686.whl", hash = "sha256:c69eb2e09d2830949e6e8f395d4eb8c714ba083213ccff64932ded681fe69a4e"}, + {file = "pydantic_core-2.50.5-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:8bbe282e79dc71b24ba7be284eacf27c8ddff8f26911e2030a0dd123c6aed326"}, + {file = "pydantic_core-2.50.5-cp313-cp313-manylinux2014_armv7l.manylinux_2_17_armv7l.whl", hash = "sha256:43917f090dfda561575a72f75814f76a0680964b70d7b44c84e44d217bdeade7"}, + {file = "pydantic_core-2.50.5-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:93ee3b4f9c64fb1c39892413c4196d0a84790a7e0e5d72b463882c432c1ffafe"}, + {file = "pydantic_core-2.50.5-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:57b79401d870c9df395799c596d81875b647ecf3030129d86659a54f6bfcc0db"}, + {file = "pydantic_core-2.50.5-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:cbfde3ad127786f1dea1a6cd89a5eb824a16203f24743ad2b4e07506f43bc844"}, + {file = "pydantic_core-2.50.5-cp313-cp313-manylinux_2_31_riscv64.whl", hash = "sha256:1793ec63c8f247131aa4dfc8c4da645b9c5872cf26b53ce240f143f59ad116e4"}, + {file = "pydantic_core-2.50.5-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:5027c263fbceb821cfb4b385d36d485e19efca1d9adcc4e5bec69c04ca3cdc83"}, + {file = "pydantic_core-2.50.5-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:dac78f91e263c4c9a4d587b9d97b3b5b2561293b33247452cc3cfe5b500e8cfb"}, + {file = "pydantic_core-2.50.5-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:b9348cfd798b8199d34da5258becf2fc8f5e4e7a3b51da30c34b81b996a07b34"}, + {file = "pydantic_core-2.50.5-cp313-cp313-win32.whl", hash = "sha256:22f5f0c37251611191a55e801a5150aa21f348fa10eac8eac9fa43c29937a7b1"}, + {file = "pydantic_core-2.50.5-cp313-cp313-win_amd64.whl", hash = "sha256:d34c0d4dd4a318f2be788a60a972c3a1ed5da0155a7c06d6dd810dc5d60ad704"}, + {file = "pydantic_core-2.50.5-cp313-cp313-win_arm64.whl", hash = "sha256:cbec4aad328be58961c738b83fc2c7bd993242d2366f949d914e8c09266dee0e"}, + {file = "pydantic_core-2.50.5-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:00598ae680c6e4a17cda01910e49c0da8ce15610505e6c57cec3f15d83daef88"}, + {file = "pydantic_core-2.50.5-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:e8fe516a4b3b06e4ff83b9adee4a786d28a617e5fb5fe90bda49fb6f52a5ac19"}, + {file = "pydantic_core-2.50.5-cp314-cp314-manylinux1_i686.manylinux_2_5_i686.whl", hash = "sha256:63a0ba0d7ccf37c8c724bb7ed13c3aa0aa4c743f4f5f376c92c47e584844c7b1"}, + {file = "pydantic_core-2.50.5-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:27bc22dc8d50335bc62296261a7dc4c2572149910ba7c274ef0f945b5be0d570"}, + {file = "pydantic_core-2.50.5-cp314-cp314-manylinux2014_armv7l.manylinux_2_17_armv7l.whl", hash = "sha256:2f6a8c9b8647378c0dc128805e6b98da39d36019a0e7cac134badeaedb14f849"}, + {file = "pydantic_core-2.50.5-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:feb8c87dbc4684777ddafbf37c922d9e2748272ba61e362ebf85db73ebda6234"}, + {file = "pydantic_core-2.50.5-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:e0a7ae307b4e1eff195cd23a757da07f70a115e45175039caf5f3979a20c7edb"}, + {file = "pydantic_core-2.50.5-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:88b543705849d0c59343f97c38296dbf59eb7b3c9565bd4fe1ed638ba38da5ed"}, + {file = "pydantic_core-2.50.5-cp314-cp314-manylinux_2_31_riscv64.whl", hash = "sha256:4ae5c9f84dfa43643d10328a212f709c7602c5e70df376d217ae5770d374ccd9"}, + {file = "pydantic_core-2.50.5-cp314-cp314-musllinux_1_1_aarch64.whl", hash = "sha256:922455cc5baddb0f2c82b7ba649e57e89183442b32fe512670db6ebb9b66b251"}, + {file = "pydantic_core-2.50.5-cp314-cp314-musllinux_1_1_armv7l.whl", hash = "sha256:aa69eaeed433cfe5de809fb84c95536a5aed991b28290d0db059fe6766c69274"}, + {file = "pydantic_core-2.50.5-cp314-cp314-musllinux_1_1_x86_64.whl", hash = "sha256:9f2bf218dbc93363fe3e31cc53d36db8d6ff4122179406bec05f33bb79c0e2c1"}, + {file = "pydantic_core-2.50.5-cp314-cp314-pyemscripten_2026_0_wasm32.whl", hash = "sha256:b2910ec0fa5aeb9bef70156f2b79f4783978fdcfaa7b2f1b5d1814458d2e79a1"}, + {file = "pydantic_core-2.50.5-cp314-cp314-win32.whl", hash = "sha256:1deb966176b1b66be4281c83f10a0b6b1cecedeb25f53ee894bf27b22376facd"}, + {file = "pydantic_core-2.50.5-cp314-cp314-win_amd64.whl", hash = "sha256:887424ba7c2145e97f131bc2cc73383a8c464d7bcd56eb98bbd941afb6868b95"}, + {file = "pydantic_core-2.50.5-cp314-cp314-win_arm64.whl", hash = "sha256:e7dd59f498ef42077f22db607571249db41997227018cb84644ba0059f8b5719"}, + {file = "pydantic_core-2.50.5-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:372f4ab3e67b2387871950cfa27d94d644c3475e650836ea52e25c2e4fbd7975"}, + {file = "pydantic_core-2.50.5-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:0c9f0002e4ec37db931e4ee8b7dafab2c7288ef66354e74fe16484e60eac6616"}, + {file = "pydantic_core-2.50.5-cp314-cp314t-manylinux1_i686.manylinux_2_5_i686.whl", hash = "sha256:d16cb794449c2bc0e5cb0ab0022813419bf5283266f2a7ff1fc54e5c6e27dcee"}, + {file = "pydantic_core-2.50.5-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:71633f82d51d4796a48026bd6eca5ec83e4a0edbe6187d59bbc45ace1111ebae"}, + {file = "pydantic_core-2.50.5-cp314-cp314t-manylinux2014_armv7l.manylinux_2_17_armv7l.whl", hash = "sha256:f20c692c599ebac7f04f3a0102b969f3f9d6667ffe1e72629fc7fbf8b6375234"}, + {file = "pydantic_core-2.50.5-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:2f0a86887c644247eff4cc7b9e609042a49833dcd72f84574e7b8beea89729ab"}, + {file = "pydantic_core-2.50.5-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:655d0cc2ddbc3fb1f4f8a8e3724552ee2ba6b8561289e9e6e06186982b27bceb"}, + {file = "pydantic_core-2.50.5-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:1d53befcfd415bd9212e685372c825e62f29b83820db78512c9d3659f13d29e9"}, + {file = "pydantic_core-2.50.5-cp314-cp314t-manylinux_2_31_riscv64.whl", hash = "sha256:5f33c92da4aa5714fb6fcb086358274598e8ff62b6607afd132a38657aa64f02"}, + {file = "pydantic_core-2.50.5-cp314-cp314t-musllinux_1_1_aarch64.whl", hash = "sha256:3129b52ee2861d0270db8bd140fc9b53ee9821247ca47fda2613a899ce9a1ea3"}, + {file = "pydantic_core-2.50.5-cp314-cp314t-musllinux_1_1_armv7l.whl", hash = "sha256:041f4730fa7a8bf975e88436d439bdc72f3f16e584a470ffbe47392628d99de6"}, + {file = "pydantic_core-2.50.5-cp314-cp314t-musllinux_1_1_x86_64.whl", hash = "sha256:48b5deaaee4f1b99603173cd291127523e43ee9f51db58c7ff98d16dc5c6fc93"}, + {file = "pydantic_core-2.50.5-cp314-cp314t-win32.whl", hash = "sha256:8c7244134b93ce028e9166c1b5d3e4537349307ccf3e65d746b4c6b1bbed8c89"}, + {file = "pydantic_core-2.50.5-cp314-cp314t-win_amd64.whl", hash = "sha256:159f6bc1b616e0ca0938eb568d87ca03c633d6f06306ac47b9c3e5dd8c14d39a"}, + {file = "pydantic_core-2.50.5-cp314-cp314t-win_arm64.whl", hash = "sha256:5274f8314ce3be1df07ae8ebceeb97a73b8409d842fd7677c5d0a85a68793ec1"}, + {file = "pydantic_core-2.50.5-cp315-cp315-macosx_10_12_x86_64.whl", hash = "sha256:c4c4313dc66f45822b3d7f39aa74e59e7987cf7572b3309005b26d956a0098a9"}, + {file = "pydantic_core-2.50.5-cp315-cp315-macosx_11_0_arm64.whl", hash = "sha256:e93587aaa5660536b9188686e8fe0544b577ec57d896d424b5b2118b151a6845"}, + {file = "pydantic_core-2.50.5-cp315-cp315-manylinux1_i686.manylinux_2_5_i686.whl", hash = "sha256:0a7d599d0c5afbab98c0e4441f5b76163c6fcfd2ecf73dd6418e468a7ac452b8"}, + {file = "pydantic_core-2.50.5-cp315-cp315-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:568e928322f0b6b94671fc1a4dbc867627af74695b0c060ac6d4f25b6a7425d8"}, + {file = "pydantic_core-2.50.5-cp315-cp315-manylinux2014_armv7l.manylinux_2_17_armv7l.whl", hash = "sha256:bdafd6b05bf012772b7d7325a98d26f19b7918e21dabdd5970c885262245aae3"}, + {file = "pydantic_core-2.50.5-cp315-cp315-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:008de9d97f2b0c8e596fb5d93d49b63be158e8be5ac35856903b338cbcfd21f3"}, + {file = "pydantic_core-2.50.5-cp315-cp315-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:f8fd7e9c44bb4c9214d41c3bef79cba5a513b29c3bcbfdaaf0440ca6f5fb65ea"}, + {file = "pydantic_core-2.50.5-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:0d6e614776c8c99495dcfc6ce8f826277fb4388a5e5cbee23c199cbe39e6dcb3"}, + {file = "pydantic_core-2.50.5-cp315-cp315-manylinux_2_31_riscv64.whl", hash = "sha256:bcd9d9b38e61dfd43e00f621ce00da2ffed35047fad532c4afcadf4f9ca0d672"}, + {file = "pydantic_core-2.50.5-cp315-cp315-musllinux_1_1_aarch64.whl", hash = "sha256:4888829471cd8d85c096ef0e1f41a066c7d76e88309a4fbff4069f70d07673be"}, + {file = "pydantic_core-2.50.5-cp315-cp315-musllinux_1_1_armv7l.whl", hash = "sha256:ad0e0221deec2a2385300d76b9259da7036c0ed784502c154ae237dafd67605f"}, + {file = "pydantic_core-2.50.5-cp315-cp315-musllinux_1_1_x86_64.whl", hash = "sha256:20337f547d79911457cd4739bb6699213a53089f946af87633a48fad3f74f5e1"}, + {file = "pydantic_core-2.50.5-cp315-cp315-win32.whl", hash = "sha256:09c732c097816c89d46ddb70f89d72e853e3a1bbac6475961c60a88aad9fe612"}, + {file = "pydantic_core-2.50.5-cp315-cp315-win_amd64.whl", hash = "sha256:0d4edc3350e21e0ef773ef9395227ca072832f05e484cadcf4d8663b63a231c0"}, + {file = "pydantic_core-2.50.5-cp315-cp315-win_arm64.whl", hash = "sha256:af453c0c20372ca8acf3c46de2a89b242491853dc61d0171ba24608d33310e09"}, + {file = "pydantic_core-2.50.5-cp315-cp315t-macosx_10_12_x86_64.whl", hash = "sha256:9e255e7c32d9c2f396d3daa833e7d8d701eec7bf8e13ca092b4b83ce7d9487fd"}, + {file = "pydantic_core-2.50.5-cp315-cp315t-macosx_11_0_arm64.whl", hash = "sha256:c334b8759496f9e597b68e1309b2fb3d824fd24a29e562afa86b61005eb9d54d"}, + {file = "pydantic_core-2.50.5-cp315-cp315t-manylinux1_i686.manylinux_2_5_i686.whl", hash = "sha256:90dabbf4f38f37de1663ce932d37c6f694a005f6470ae2f0d97755d9e3f90ffd"}, + {file = "pydantic_core-2.50.5-cp315-cp315t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:5ec2e8caf5eadea7be683fc7025d60563e920f1f52fe18ae46c49558e67b8cd0"}, + {file = "pydantic_core-2.50.5-cp315-cp315t-manylinux2014_armv7l.manylinux_2_17_armv7l.whl", hash = "sha256:44e6c35bf3a9b6785db0c083df8a6929343f9c8fc27186991d21653242c77c19"}, + {file = "pydantic_core-2.50.5-cp315-cp315t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:f33be114a0ee27870cffd31057ed60bf5a0cd522dcbdc1dda0bdad70f8302cb0"}, + {file = "pydantic_core-2.50.5-cp315-cp315t-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:12178e58af383bd4c32b2fe141188bc7e540c5eb33ad550856fa5863b4c31bd5"}, + {file = "pydantic_core-2.50.5-cp315-cp315t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:679f15dd3bd2a82bde350ec8c94c0f8f05f05dba39fb3464cd4136a724da9844"}, + {file = "pydantic_core-2.50.5-cp315-cp315t-manylinux_2_31_riscv64.whl", hash = "sha256:11806d9b4888f1645d74fc24237f21dad559b42fb8930481b3df414997be6ee5"}, + {file = "pydantic_core-2.50.5-cp315-cp315t-musllinux_1_1_aarch64.whl", hash = "sha256:b43115385de7db83bd2fe7a08dea8580bce3acc3f54200c4f4fe32a4a49688d4"}, + {file = "pydantic_core-2.50.5-cp315-cp315t-musllinux_1_1_armv7l.whl", hash = "sha256:86bd5aad5ccbaced98139d08b4314f253c086897830f4bcf9c1d1f02f740683d"}, + {file = "pydantic_core-2.50.5-cp315-cp315t-musllinux_1_1_x86_64.whl", hash = "sha256:90ff55049623eccbfa997332e2b91358dc2c4c30ca6e664b45438723cbe181df"}, + {file = "pydantic_core-2.50.5-cp315-cp315t-win32.whl", hash = "sha256:7c3faea08d44b4a7b57b30f1113e6404e6aa62a4f3489a22359fb27d6003d8b1"}, + {file = "pydantic_core-2.50.5-cp315-cp315t-win_amd64.whl", hash = "sha256:b2b64d3204f9c33f03ed3111eb754902ea76ca5aa61ab4b2bdf9f767a4a1f279"}, + {file = "pydantic_core-2.50.5-cp315-cp315t-win_arm64.whl", hash = "sha256:8ba2dcbeea0ab8836e804c54e905075125c702cf78e592d998eecf2764b64144"}, + {file = "pydantic_core-2.50.5-graalpy312-graalpy250_312_native-macosx_10_12_x86_64.whl", hash = "sha256:68334f281460fb2a85bbb9e2545438bf2fd2c9a166823a60b84541a3c8f2d2e0"}, + {file = "pydantic_core-2.50.5-graalpy312-graalpy250_312_native-macosx_11_0_arm64.whl", hash = "sha256:851a78a30265bb203186fd0e19712c1a4431083eb5a1e1715f758a029cd8aa6e"}, + {file = "pydantic_core-2.50.5-graalpy312-graalpy250_312_native-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:47f4d79fe4876feace216a5b2263c40d792476b4a6508c38d66a2facd3f1f4cc"}, + {file = "pydantic_core-2.50.5-graalpy312-graalpy250_312_native-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:98b92dad690e6578cc0b504eda53d53adaa4f34bd09c97a547a957e419544eb7"}, + {file = "pydantic_core-2.50.5-graalpy313-graalpy253_313_native-macosx_11_0_arm64.whl", hash = "sha256:d7826407ed74ff8e6cc6e6df7ffbf180e9b449ab1516f28eb5f6e2a489bc5129"}, + {file = "pydantic_core-2.50.5-graalpy313-graalpy253_313_native-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:c415a8da7c89a3dd32d988a9117bf0a52371769b77b0943bcfd50b281ecefb8d"}, + {file = "pydantic_core-2.50.5-graalpy313-graalpy253_313_native-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:ea7429e3adb2f2fd81e2d6e8942e5c1cd760a6e6be5b7574d2ee5499b5e19e67"}, + {file = "pydantic_core-2.50.5-pp311-pypy311_pp73-macosx_10_12_x86_64.whl", hash = "sha256:ea215f7f5d2df866e3b5448c0bbb4a35285086ac6ab18687796704cbd5f2c5a3"}, + {file = "pydantic_core-2.50.5-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:4ac243e358837f62d085f07b98625fa3831abdb28e8f77196934345bbff0fb0b"}, + {file = "pydantic_core-2.50.5-pp311-pypy311_pp73-manylinux1_i686.manylinux_2_5_i686.whl", hash = "sha256:d3ada66d0601feeeba504a6daac73e47ed164357e46930366f135c4121594d53"}, + {file = "pydantic_core-2.50.5-pp311-pypy311_pp73-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:0dd037d96e98f6db8b69a44ab7d5c20a07fb0a2051775746a9e1b5fc8f52867f"}, + {file = "pydantic_core-2.50.5-pp311-pypy311_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:3f800fc0f304f3b0e09d07d4287f9f0bc9bfe5319d1d7cabeaf265737c516083"}, + {file = "pydantic_core-2.50.5-pp311-pypy311_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:a5f6622451fa3cd71c8ff15df24307cb3f8b5dc35a723de281646c34872d7179"}, + {file = "pydantic_core-2.50.5-pp311-pypy311_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:2f5f29ff80ce0cf93102198cddebdbb3411881de177359c770e5c9c99495a6b3"}, + {file = "pydantic_core-2.50.5-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:6a069ceeca397bd8da2e8ef6383595c63ea17de37d5f2d5cde729bdc0dfe6774"}, + {file = "pydantic_core-2.50.5-pp311-pypy311_pp80-macosx_10_12_x86_64.whl", hash = "sha256:e8faa73de2e9231f604cfa44c471d0986e7e9c45129d7888839a34196e46a7df"}, + {file = "pydantic_core-2.50.5-pp311-pypy311_pp80-macosx_11_0_arm64.whl", hash = "sha256:ef461e9299ae665fab67c6f054847178b8fd510da10b4ef745a074b922efbf0a"}, + {file = "pydantic_core-2.50.5-pp311-pypy311_pp80-manylinux_2_28_x86_64.whl", hash = "sha256:1f22c36d952f33bac936273ca0be115693a1d7c1c9496ca7d699e6a338656d6e"}, + {file = "pydantic_core-2.50.5-pp311-pypy311_pp80-win_amd64.whl", hash = "sha256:b6f48c4bf1c77ace644b125f168418438fbc9b8e4c3b290915cc7d055d83c8b1"}, + {file = "pydantic_core-2.50.5.tar.gz", hash = "sha256:1e740886083ff95530d694e6a3f09ed914bcf92a496d16acd307c6c3484fc36d"}, ] [package.dependencies] @@ -1549,14 +1549,14 @@ dev = ["argcomplete", "asynctest ; python_version < \"3.11\"", "attrs (>=23.1)", [[package]] name = "pytest-asyncio" -version = "1.4.1.post1" +version = "1.5.0" description = "Pytest support for asyncio" optional = false python-versions = ">=3.10" groups = ["dev"] files = [ - {file = "pytest_asyncio-1.4.1.post1-py3-none-any.whl", hash = "sha256:0755e488cc0a2b9bd2eab7292cc6390d4cbb8390f1020745647bae5a708e0165"}, - {file = "pytest_asyncio-1.4.1.post1.tar.gz", hash = "sha256:f582d9ea4a1c082195abe8bd29a1fe106aeb1cd435e3dad2d3bc2749935c36a2"}, + {file = "pytest_asyncio-1.5.0-py3-none-any.whl", hash = "sha256:557f255ee03cc84f84a8d5f438bc9c6e0f714bf86970ae743c7ecb5a38d7e07d"}, + {file = "pytest_asyncio-1.5.0.tar.gz", hash = "sha256:92c8fa83ca419fd0d4bd6a34df6520dae435841d3733c319343249492adf37f7"}, ] [package.dependencies] @@ -1779,14 +1779,14 @@ files = [ [[package]] name = "types-python-dateutil" -version = "2.9.0.20261104" +version = "2.9.0.20261122" description = "Typing stubs for python-dateutil" optional = false python-versions = ">=3.10" groups = ["dev"] files = [ - {file = "types_python_dateutil-2.9.0.20261104-py3-none-any.whl", hash = "sha256:f6ee76c91c547716b4795373a53d4c07e8e06cf98384ecb89fcf134d212de2ad"}, - {file = "types_python_dateutil-2.9.0.20261104.tar.gz", hash = "sha256:5d0495702a5f7343741f5d842c531bcd1c941da8b4a85307d52ef43ba80252db"}, + {file = "types_python_dateutil-2.9.0.20261122-py3-none-any.whl", hash = "sha256:c2c257d7ce04f8ede622bb2452223461ee3016872f59d2351522723073e226ff"}, + {file = "types_python_dateutil-2.9.0.20261122.tar.gz", hash = "sha256:1db0012e9e63028891e36fd8a9f685dc4e8cf89353fbefcf6b1eb55538e9f7ed"}, ] [[package]] diff --git a/pyproject.toml b/pyproject.toml index ff6af3d6..9a1ca563 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ license-files = ["LICENSE"] [tool.poetry] name = "deepgram-sdk" -version = "7.20.0" +version = "7.20.1" description = "" readme = "README.md" authors = [] diff --git a/src/deepgram/__init__.py b/src/deepgram/__init__.py index 9fade4cd..16405c51 100644 --- a/src/deepgram/__init__.py +++ b/src/deepgram/__init__.py @@ -38,7 +38,6 @@ CartesiaModelId, CartesiaVoice, CreateAgentConfigurationV1Response, - CreateKeyV1Request, CreateKeyV1Response, CreateProjectDistributionCredentialsV1Response, CreateProjectDistributionCredentialsV1ResponseDistributionCredentials, @@ -185,6 +184,8 @@ ListenV2RedactUsage, ListenV2SampleRate, ListenV2Tag, + Nvidia, + NvidiaReasoningMode, OpenAiSpeakProvider, OpenAiSpeakProviderModel, OpenAiSpeakProviderVoice, @@ -252,6 +253,7 @@ ThinkSettingsV1Provider_Deepgram, ThinkSettingsV1Provider_Google, ThinkSettingsV1Provider_Groq, + ThinkSettingsV1Provider_Nvidia, ThinkSettingsV1Provider_OpenAi, UpdateProjectMemberScopesV1Response, UpdateProjectV1Response, @@ -291,7 +293,6 @@ CartesiaParams, CartesiaVoiceParams, CreateAgentConfigurationV1ResponseParams, - CreateKeyV1RequestParams, CreateKeyV1ResponseParams, CreateProjectDistributionCredentialsV1ResponseDistributionCredentialsParams, CreateProjectDistributionCredentialsV1ResponseMemberParams, @@ -383,6 +384,7 @@ ListenV1ResponseResultsUtterancesParams, ListenV2KeytermParams, ListenV2LanguageHintParams, + NvidiaParams, OpenAiSpeakProviderParams, OpenAiThinkProviderParams, ProjectRequestResponseParams, @@ -430,6 +432,7 @@ ThinkSettingsV1Provider_DeepgramParams, ThinkSettingsV1Provider_GoogleParams, ThinkSettingsV1Provider_GroqParams, + ThinkSettingsV1Provider_NvidiaParams, ThinkSettingsV1Provider_OpenAiParams, UpdateProjectMemberScopesV1ResponseParams, UpdateProjectV1ResponseParams, @@ -498,8 +501,6 @@ "CartesiaVoiceParams": ".requests", "CreateAgentConfigurationV1Response": ".types", "CreateAgentConfigurationV1ResponseParams": ".requests", - "CreateKeyV1Request": ".types", - "CreateKeyV1RequestParams": ".requests", "CreateKeyV1Response": ".types", "CreateKeyV1ResponseParams": ".requests", "CreateProjectDistributionCredentialsV1Response": ".types", @@ -741,6 +742,9 @@ "ListenV2RedactUsage": ".types", "ListenV2SampleRate": ".types", "ListenV2Tag": ".types", + "Nvidia": ".types", + "NvidiaParams": ".requests", + "NvidiaReasoningMode": ".types", "OpenAiSpeakProvider": ".types", "OpenAiSpeakProviderModel": ".types", "OpenAiSpeakProviderParams": ".requests", @@ -855,6 +859,8 @@ "ThinkSettingsV1Provider_GoogleParams": ".requests", "ThinkSettingsV1Provider_Groq": ".types", "ThinkSettingsV1Provider_GroqParams": ".requests", + "ThinkSettingsV1Provider_Nvidia": ".types", + "ThinkSettingsV1Provider_NvidiaParams": ".requests", "ThinkSettingsV1Provider_OpenAi": ".types", "ThinkSettingsV1Provider_OpenAiParams": ".requests", "UpdateProjectMemberScopesV1Response": ".types", @@ -888,38 +894,6 @@ "voice_agent": ".voice_agent", } -_dynamic_imports.update( - { - "SharedIntentsResults": ".types", - "SharedIntentsResultsIntents": ".types", - "SharedIntentsResultsIntentsParams": ".requests", - "SharedIntentsResultsIntentsSegmentsItem": ".types", - "SharedIntentsResultsIntentsSegmentsItemIntentsItem": ".types", - "SharedIntentsResultsIntentsSegmentsItemIntentsItemParams": ".requests", - "SharedIntentsResultsIntentsSegmentsItemParams": ".requests", - "SharedIntentsResultsParams": ".requests", - "SharedTopicsResults": ".types", - "SharedTopicsResultsParams": ".requests", - "SharedTopicsResultsTopics": ".types", - "SharedTopicsResultsTopicsParams": ".requests", - "SharedTopicsResultsTopicsSegmentsItem": ".types", - "SharedTopicsResultsTopicsSegmentsItemParams": ".requests", - "SharedTopicsResultsTopicsSegmentsItemTopicsItem": ".types", - "SharedTopicsResultsTopicsSegmentsItemTopicsItemParams": ".requests", - "AnthropicThinkProviderModel": ".types", - "CartesiaSpeakProviderModelId": ".types", - "CartesiaSpeakProviderVoice": ".types", - "CartesiaSpeakProviderVoiceParams": ".requests", - "CreateKeyV1RequestOne": ".types", - "DeepgramListenProviderV2LanguageHint": ".types", - "DeepgramListenProviderV2LanguageHintParams": ".requests", - "DeepgramSpeakProviderModel": ".types", - "GoogleThinkProviderModel": ".types", - "GoogleThinkProviderVersion": ".types", - "GroqThinkProviderReasoningMode": ".types", - } -) - def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) @@ -997,8 +971,6 @@ def __dir__(): "CartesiaVoiceParams", "CreateAgentConfigurationV1Response", "CreateAgentConfigurationV1ResponseParams", - "CreateKeyV1Request", - "CreateKeyV1RequestParams", "CreateKeyV1Response", "CreateKeyV1ResponseParams", "CreateProjectDistributionCredentialsV1Response", @@ -1240,6 +1212,9 @@ def __dir__(): "ListenV2RedactUsage", "ListenV2SampleRate", "ListenV2Tag", + "Nvidia", + "NvidiaParams", + "NvidiaReasoningMode", "OpenAiSpeakProvider", "OpenAiSpeakProviderModel", "OpenAiSpeakProviderParams", @@ -1354,6 +1329,8 @@ def __dir__(): "ThinkSettingsV1Provider_GoogleParams", "ThinkSettingsV1Provider_Groq", "ThinkSettingsV1Provider_GroqParams", + "ThinkSettingsV1Provider_Nvidia", + "ThinkSettingsV1Provider_NvidiaParams", "ThinkSettingsV1Provider_OpenAi", "ThinkSettingsV1Provider_OpenAiParams", "UpdateProjectMemberScopesV1Response", @@ -1386,35 +1363,3 @@ def __dir__(): "speak", "voice_agent", ] - -__all__.extend( - [ - "SharedIntentsResults", - "SharedIntentsResultsIntents", - "SharedIntentsResultsIntentsParams", - "SharedIntentsResultsIntentsSegmentsItem", - "SharedIntentsResultsIntentsSegmentsItemIntentsItem", - "SharedIntentsResultsIntentsSegmentsItemIntentsItemParams", - "SharedIntentsResultsIntentsSegmentsItemParams", - "SharedIntentsResultsParams", - "SharedTopicsResults", - "SharedTopicsResultsParams", - "SharedTopicsResultsTopics", - "SharedTopicsResultsTopicsParams", - "SharedTopicsResultsTopicsSegmentsItem", - "SharedTopicsResultsTopicsSegmentsItemParams", - "SharedTopicsResultsTopicsSegmentsItemTopicsItem", - "SharedTopicsResultsTopicsSegmentsItemTopicsItemParams", - "AnthropicThinkProviderModel", - "CartesiaSpeakProviderModelId", - "CartesiaSpeakProviderVoice", - "CartesiaSpeakProviderVoiceParams", - "CreateKeyV1RequestOne", - "DeepgramListenProviderV2LanguageHint", - "DeepgramListenProviderV2LanguageHintParams", - "DeepgramSpeakProviderModel", - "GoogleThinkProviderModel", - "GoogleThinkProviderVersion", - "GroqThinkProviderReasoningMode", - ] -) diff --git a/src/deepgram/agent/__init__.py b/src/deepgram/agent/__init__.py index 23f670de..a9248312 100644 --- a/src/deepgram/agent/__init__.py +++ b/src/deepgram/agent/__init__.py @@ -293,40 +293,6 @@ "v1": ".v1", } -_dynamic_imports.update( - { - "AgentV1HistoryContent": ".v1", - "AgentV1HistoryContentParams": ".v1", - "AgentV1HistoryContentRole": ".v1", - "AgentV1HistoryFunctionCalls": ".v1", - "AgentV1HistoryFunctionCallsFunctionCallsItem": ".v1", - "AgentV1HistoryFunctionCallsFunctionCallsItemParams": ".v1", - "AgentV1HistoryFunctionCallsParams": ".v1", - "AgentV1SettingsAgentContextContextMessagesItemContentRole": ".v1", - "AgentV1SettingsAgentContextContextMessagesItemFunctionCallsFunctionCallsItem": ".v1", - "AgentV1SettingsAgentContextContextMessagesItemFunctionCallsFunctionCallsItemParams": ".v1", - "AgentV1SettingsAgentContextListenProviderV1": ".v1", - "AgentV1SettingsAgentContextListenProviderV1Params": ".v1", - "AgentV1SettingsAgentContextListenProviderV2": ".v1", - "AgentV1SettingsAgentContextListenProviderV2LanguageHint": ".v1", - "AgentV1SettingsAgentContextListenProviderV2LanguageHintParams": ".v1", - "AgentV1SettingsAgentContextListenProviderV2Params": ".v1", - "AgentV1SettingsAgentContextMessagesItem": ".v1", - "AgentV1SettingsAgentContextMessagesItemContent": ".v1", - "AgentV1SettingsAgentContextMessagesItemContentParams": ".v1", - "AgentV1SettingsAgentContextMessagesItemContentRole": ".v1", - "AgentV1SettingsAgentContextMessagesItemFunctionCalls": ".v1", - "AgentV1SettingsAgentContextMessagesItemFunctionCallsFunctionCallsItem": ".v1", - "AgentV1SettingsAgentContextMessagesItemFunctionCallsFunctionCallsItemParams": ".v1", - "AgentV1SettingsAgentContextMessagesItemFunctionCallsParams": ".v1", - "AgentV1SettingsAgentContextMessagesItemParams": ".v1", - "AgentV1SettingsAgentListenProviderV1": ".v1", - "AgentV1SettingsAgentListenProviderV1Params": ".v1", - "AgentV1SettingsAgentListenProviderV2": ".v1", - "AgentV1SettingsAgentListenProviderV2Params": ".v1", - } -) - def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) @@ -492,37 +458,3 @@ def __dir__(): "FunctionCallHistoryMessageParams", "v1", ] - -__all__.extend( - [ - "AgentV1HistoryContent", - "AgentV1HistoryContentParams", - "AgentV1HistoryContentRole", - "AgentV1HistoryFunctionCalls", - "AgentV1HistoryFunctionCallsFunctionCallsItem", - "AgentV1HistoryFunctionCallsFunctionCallsItemParams", - "AgentV1HistoryFunctionCallsParams", - "AgentV1SettingsAgentContextContextMessagesItemContentRole", - "AgentV1SettingsAgentContextContextMessagesItemFunctionCallsFunctionCallsItem", - "AgentV1SettingsAgentContextContextMessagesItemFunctionCallsFunctionCallsItemParams", - "AgentV1SettingsAgentContextListenProviderV1", - "AgentV1SettingsAgentContextListenProviderV1Params", - "AgentV1SettingsAgentContextListenProviderV2", - "AgentV1SettingsAgentContextListenProviderV2LanguageHint", - "AgentV1SettingsAgentContextListenProviderV2LanguageHintParams", - "AgentV1SettingsAgentContextListenProviderV2Params", - "AgentV1SettingsAgentContextMessagesItem", - "AgentV1SettingsAgentContextMessagesItemContent", - "AgentV1SettingsAgentContextMessagesItemContentParams", - "AgentV1SettingsAgentContextMessagesItemContentRole", - "AgentV1SettingsAgentContextMessagesItemFunctionCalls", - "AgentV1SettingsAgentContextMessagesItemFunctionCallsFunctionCallsItem", - "AgentV1SettingsAgentContextMessagesItemFunctionCallsFunctionCallsItemParams", - "AgentV1SettingsAgentContextMessagesItemFunctionCallsParams", - "AgentV1SettingsAgentContextMessagesItemParams", - "AgentV1SettingsAgentListenProviderV1", - "AgentV1SettingsAgentListenProviderV1Params", - "AgentV1SettingsAgentListenProviderV2", - "AgentV1SettingsAgentListenProviderV2Params", - ] -) diff --git a/src/deepgram/agent/v1/__init__.py b/src/deepgram/agent/v1/__init__.py index 205d398c..f58a4a70 100644 --- a/src/deepgram/agent/v1/__init__.py +++ b/src/deepgram/agent/v1/__init__.py @@ -295,40 +295,6 @@ "settings": ".settings", } -_dynamic_imports.update( - { - "AgentV1HistoryContent": ".types", - "AgentV1HistoryContentParams": ".requests", - "AgentV1HistoryContentRole": ".types", - "AgentV1HistoryFunctionCalls": ".types", - "AgentV1HistoryFunctionCallsFunctionCallsItem": ".types", - "AgentV1HistoryFunctionCallsFunctionCallsItemParams": ".requests", - "AgentV1HistoryFunctionCallsParams": ".requests", - "AgentV1SettingsAgentContextContextMessagesItemContentRole": ".types", - "AgentV1SettingsAgentContextContextMessagesItemFunctionCallsFunctionCallsItem": ".types", - "AgentV1SettingsAgentContextContextMessagesItemFunctionCallsFunctionCallsItemParams": ".requests", - "AgentV1SettingsAgentContextListenProviderV1": ".types", - "AgentV1SettingsAgentContextListenProviderV1Params": ".requests", - "AgentV1SettingsAgentContextListenProviderV2": ".types", - "AgentV1SettingsAgentContextListenProviderV2LanguageHint": ".types", - "AgentV1SettingsAgentContextListenProviderV2LanguageHintParams": ".requests", - "AgentV1SettingsAgentContextListenProviderV2Params": ".requests", - "AgentV1SettingsAgentContextMessagesItem": ".types", - "AgentV1SettingsAgentContextMessagesItemContent": ".types", - "AgentV1SettingsAgentContextMessagesItemContentParams": ".requests", - "AgentV1SettingsAgentContextMessagesItemContentRole": ".types", - "AgentV1SettingsAgentContextMessagesItemFunctionCalls": ".types", - "AgentV1SettingsAgentContextMessagesItemFunctionCallsFunctionCallsItem": ".types", - "AgentV1SettingsAgentContextMessagesItemFunctionCallsFunctionCallsItemParams": ".requests", - "AgentV1SettingsAgentContextMessagesItemFunctionCallsParams": ".requests", - "AgentV1SettingsAgentContextMessagesItemParams": ".requests", - "AgentV1SettingsAgentListenProviderV1": ".types", - "AgentV1SettingsAgentListenProviderV1Params": ".requests", - "AgentV1SettingsAgentListenProviderV2": ".types", - "AgentV1SettingsAgentListenProviderV2Params": ".requests", - } -) - def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) @@ -494,37 +460,3 @@ def __dir__(): "FunctionCallHistoryMessageParams", "settings", ] - -__all__.extend( - [ - "AgentV1HistoryContent", - "AgentV1HistoryContentParams", - "AgentV1HistoryContentRole", - "AgentV1HistoryFunctionCalls", - "AgentV1HistoryFunctionCallsFunctionCallsItem", - "AgentV1HistoryFunctionCallsFunctionCallsItemParams", - "AgentV1HistoryFunctionCallsParams", - "AgentV1SettingsAgentContextContextMessagesItemContentRole", - "AgentV1SettingsAgentContextContextMessagesItemFunctionCallsFunctionCallsItem", - "AgentV1SettingsAgentContextContextMessagesItemFunctionCallsFunctionCallsItemParams", - "AgentV1SettingsAgentContextListenProviderV1", - "AgentV1SettingsAgentContextListenProviderV1Params", - "AgentV1SettingsAgentContextListenProviderV2", - "AgentV1SettingsAgentContextListenProviderV2LanguageHint", - "AgentV1SettingsAgentContextListenProviderV2LanguageHintParams", - "AgentV1SettingsAgentContextListenProviderV2Params", - "AgentV1SettingsAgentContextMessagesItem", - "AgentV1SettingsAgentContextMessagesItemContent", - "AgentV1SettingsAgentContextMessagesItemContentParams", - "AgentV1SettingsAgentContextMessagesItemContentRole", - "AgentV1SettingsAgentContextMessagesItemFunctionCalls", - "AgentV1SettingsAgentContextMessagesItemFunctionCallsFunctionCallsItem", - "AgentV1SettingsAgentContextMessagesItemFunctionCallsFunctionCallsItemParams", - "AgentV1SettingsAgentContextMessagesItemFunctionCallsParams", - "AgentV1SettingsAgentContextMessagesItemParams", - "AgentV1SettingsAgentListenProviderV1", - "AgentV1SettingsAgentListenProviderV1Params", - "AgentV1SettingsAgentListenProviderV2", - "AgentV1SettingsAgentListenProviderV2Params", - ] -) diff --git a/src/deepgram/agent/v1/requests/__init__.py b/src/deepgram/agent/v1/requests/__init__.py index 766d9807..f57784b8 100644 --- a/src/deepgram/agent/v1/requests/__init__.py +++ b/src/deepgram/agent/v1/requests/__init__.py @@ -20,8 +20,6 @@ from .agent_v1function_call_request import AgentV1FunctionCallRequestParams from .agent_v1function_call_request_functions_item import AgentV1FunctionCallRequestFunctionsItemParams from .agent_v1history import AgentV1HistoryParams - from .agent_v1history_content import AgentV1HistoryContentParams # noqa: F401 - from .agent_v1history_function_calls import AgentV1HistoryFunctionCallsParams # noqa: F401 from .agent_v1inject_agent_message import AgentV1InjectAgentMessageParams from .agent_v1inject_dynamic_agent_message import AgentV1InjectDynamicAgentMessageParams from .agent_v1inject_user_message import AgentV1InjectUserMessageParams @@ -151,24 +149,6 @@ "FunctionCallHistoryMessageParams": ".function_call_history_message", } -_dynamic_imports.update( - { - "AgentV1HistoryContentParams": ".agent_v1history_content", - "AgentV1HistoryFunctionCallsParams": ".agent_v1history_function_calls", - "AgentV1HistoryFunctionCallsFunctionCallsItemParams": ".agent_v1history_function_calls_function_calls_item", - "AgentV1SettingsAgentContextContextMessagesItemFunctionCallsFunctionCallsItemParams": ".agent_v1settings_agent_context_context_messages_item_function_calls_function_calls_item", - "AgentV1SettingsAgentContextListenProviderV1Params": ".agent_v1settings_agent_context_listen_provider_v1", - "AgentV1SettingsAgentContextListenProviderV2Params": ".agent_v1settings_agent_context_listen_provider_v2", - "AgentV1SettingsAgentContextListenProviderV2LanguageHintParams": ".agent_v1settings_agent_context_listen_provider_v2language_hint", - "AgentV1SettingsAgentContextMessagesItemParams": ".agent_v1settings_agent_context_messages_item", - "AgentV1SettingsAgentContextMessagesItemContentParams": ".agent_v1settings_agent_context_messages_item_content", - "AgentV1SettingsAgentContextMessagesItemFunctionCallsParams": ".agent_v1settings_agent_context_messages_item_function_calls", - "AgentV1SettingsAgentContextMessagesItemFunctionCallsFunctionCallsItemParams": ".agent_v1settings_agent_context_messages_item_function_calls_function_calls_item", - "AgentV1SettingsAgentListenProviderV1Params": ".agent_v1settings_agent_listen_provider_v1", - "AgentV1SettingsAgentListenProviderV2Params": ".agent_v1settings_agent_listen_provider_v2", - } -) - def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) @@ -259,21 +239,3 @@ def __dir__(): "FunctionCallHistoryMessageFunctionCallsItemParams", "FunctionCallHistoryMessageParams", ] - -__all__.extend( - [ - "AgentV1HistoryContentParams", - "AgentV1HistoryFunctionCallsParams", - "AgentV1HistoryFunctionCallsFunctionCallsItemParams", - "AgentV1SettingsAgentContextContextMessagesItemFunctionCallsFunctionCallsItemParams", - "AgentV1SettingsAgentContextListenProviderV1Params", - "AgentV1SettingsAgentContextListenProviderV2Params", - "AgentV1SettingsAgentContextListenProviderV2LanguageHintParams", - "AgentV1SettingsAgentContextMessagesItemParams", - "AgentV1SettingsAgentContextMessagesItemContentParams", - "AgentV1SettingsAgentContextMessagesItemFunctionCallsParams", - "AgentV1SettingsAgentContextMessagesItemFunctionCallsFunctionCallsItemParams", - "AgentV1SettingsAgentListenProviderV1Params", - "AgentV1SettingsAgentListenProviderV2Params", - ] -) diff --git a/src/deepgram/agent/v1/requests/agent_v1conversation_text.py b/src/deepgram/agent/v1/requests/agent_v1conversation_text.py index 059f094a..ee6f97cf 100644 --- a/src/deepgram/agent/v1/requests/agent_v1conversation_text.py +++ b/src/deepgram/agent/v1/requests/agent_v1conversation_text.py @@ -23,7 +23,7 @@ class AgentV1ConversationTextParams(typing_extensions.TypedDict): The actual statement that was spoken """ - conversational_behavior: typing_extensions.NotRequired[AgentV1ConversationTextConversationalBehavior] + conversational_behavior: AgentV1ConversationTextConversationalBehavior """ Annotates what kind of utterance the message represents: `default` (a standard turn), `backchannel` (a short acknowledgement while the user held the floor), `presence_check` (a prompt after extended silence), or `filler` (a line covering a wait on a function call or a dynamic InjectAgentMessage). Always sent; it is `default` for every message while Think Live is off """ diff --git a/src/deepgram/agent/v1/requests/agent_v1inject_dynamic_agent_message.py b/src/deepgram/agent/v1/requests/agent_v1inject_dynamic_agent_message.py index 1d912428..c6d114de 100644 --- a/src/deepgram/agent/v1/requests/agent_v1inject_dynamic_agent_message.py +++ b/src/deepgram/agent/v1/requests/agent_v1inject_dynamic_agent_message.py @@ -20,7 +20,7 @@ class AgentV1InjectDynamicAgentMessageParams(typing_extensions.TypedDict): behavior: typing_extensions.NotRequired[AgentV1InjectDynamicAgentMessageBehavior] """ Controls how the injection interacts with any in-progress user or agent turn. - + * `default` — The agent speaks only if neither the user nor the agent is mid-turn. If a turn is in progress, the server replies with `InjectionRefused`. * `queue` — The message is appended after any already-queued `ConversationText` without interrupting the current agent turn or think response. If nothing is queued, the message plays immediately. * `interrupt` — The agent immediately speaks. If the agent was already speaking, it interrupts the current speech and replaces it with the new message. If the user is speaking, the agent interrupts with the new message, but the user's continued speech triggers `UserStartedSpeaking`, which quickly interrupts the agent. diff --git a/src/deepgram/agent/v1/requests/agent_v1settings.py b/src/deepgram/agent/v1/requests/agent_v1settings.py index 5ada0975..2f748dcd 100644 --- a/src/deepgram/agent/v1/requests/agent_v1settings.py +++ b/src/deepgram/agent/v1/requests/agent_v1settings.py @@ -4,7 +4,6 @@ import typing_extensions from .agent_v1settings_agent import AgentV1SettingsAgentParams -from .agent_v1settings_agent_context import AgentV1SettingsAgentContextParams from .agent_v1settings_audio import AgentV1SettingsAudioParams from .agent_v1settings_flags import AgentV1SettingsFlagsParams @@ -28,4 +27,4 @@ class AgentV1SettingsParams(typing_extensions.TypedDict): """ audio: AgentV1SettingsAudioParams - agent: typing.Union[AgentV1SettingsAgentParams, AgentV1SettingsAgentContextParams, str] + agent: AgentV1SettingsAgentParams diff --git a/src/deepgram/agent/v1/requests/agent_v1settings_agent.py b/src/deepgram/agent/v1/requests/agent_v1settings_agent.py index 4a2bcf8c..0da4b0f3 100644 --- a/src/deepgram/agent/v1/requests/agent_v1settings_agent.py +++ b/src/deepgram/agent/v1/requests/agent_v1settings_agent.py @@ -1,18 +1,7 @@ # This file was auto-generated by Fern from our API Definition. -import typing_extensions -from ....requests.think_live_settings_v1 import ThinkLiveSettingsV1Params -from .agent_v1settings_agent_context import AgentV1SettingsAgentContextParams -from .agent_v1settings_agent_listen import AgentV1SettingsAgentListenParams -from .agent_v1settings_agent_speak import AgentV1SettingsAgentSpeakParams -from .agent_v1settings_agent_think import AgentV1SettingsAgentThinkParams +import typing +from .agent_v1settings_agent_context import AgentV1SettingsAgentContextParams -class AgentV1SettingsAgentParams(typing_extensions.TypedDict): - language: typing_extensions.NotRequired[str] - context: typing_extensions.NotRequired[AgentV1SettingsAgentContextParams] - listen: typing_extensions.NotRequired[AgentV1SettingsAgentListenParams] - think: typing_extensions.NotRequired[AgentV1SettingsAgentThinkParams] - think_live: typing_extensions.NotRequired[ThinkLiveSettingsV1Params] - speak: typing_extensions.NotRequired[AgentV1SettingsAgentSpeakParams] - greeting: typing_extensions.NotRequired[str] +AgentV1SettingsAgentParams = typing.Union[AgentV1SettingsAgentContextParams, str] diff --git a/src/deepgram/agent/v1/requests/agent_v1settings_agent_context.py b/src/deepgram/agent/v1/requests/agent_v1settings_agent_context.py index 19503b6f..3dbb6e72 100644 --- a/src/deepgram/agent/v1/requests/agent_v1settings_agent_context.py +++ b/src/deepgram/agent/v1/requests/agent_v1settings_agent_context.py @@ -1,12 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -import typing - import typing_extensions from ....requests.think_live_settings_v1 import ThinkLiveSettingsV1Params from .agent_v1settings_agent_context_context import AgentV1SettingsAgentContextContextParams from .agent_v1settings_agent_context_listen import AgentV1SettingsAgentContextListenParams -from .agent_v1settings_agent_context_messages_item import AgentV1SettingsAgentContextMessagesItemParams from .agent_v1settings_agent_context_speak import AgentV1SettingsAgentContextSpeakParams from .agent_v1settings_agent_context_think import AgentV1SettingsAgentContextThinkParams @@ -17,7 +14,6 @@ class AgentV1SettingsAgentContextParams(typing_extensions.TypedDict): Deprecated. Use `listen.provider.language` and `speak.provider.language` fields instead. """ - messages: typing_extensions.NotRequired[typing.Sequence[AgentV1SettingsAgentContextMessagesItemParams]] context: typing_extensions.NotRequired[AgentV1SettingsAgentContextContextParams] """ Conversation context including the history of messages and function calls diff --git a/src/deepgram/agent/v1/requests/agent_v1update_prompt.py b/src/deepgram/agent/v1/requests/agent_v1update_prompt.py index 8f363a56..4fbd10c3 100644 --- a/src/deepgram/agent/v1/requests/agent_v1update_prompt.py +++ b/src/deepgram/agent/v1/requests/agent_v1update_prompt.py @@ -13,5 +13,5 @@ class AgentV1UpdatePromptParams(typing_extensions.TypedDict): prompt: str """ - The new system prompt to be used by the agent + Text appended to the current system prompt """ diff --git a/src/deepgram/agent/v1/socket_client.py b/src/deepgram/agent/v1/socket_client.py index 44ffcaed..35ebd833 100644 --- a/src/deepgram/agent/v1/socket_client.py +++ b/src/deepgram/agent/v1/socket_client.py @@ -3,7 +3,9 @@ import json import logging import typing +from json.decoder import JSONDecodeError +import websockets import websockets.sync.connection as websockets_sync_connection from ...core.events import EventEmitterMixin, EventType from ...core.unchecked_base_model import construct_type @@ -48,18 +50,6 @@ except ImportError: from websockets import WebSocketClientProtocol # type: ignore - -def _sanitize_numeric_types(obj: typing.Any) -> typing.Any: - """Convert whole-number floats to integers for wire-compatible JSON.""" - if isinstance(obj, dict): - return {key: _sanitize_numeric_types(value) for key, value in obj.items()} - if isinstance(obj, list): - return [_sanitize_numeric_types(item) for item in obj] - if isinstance(obj, float) and obj.is_integer(): - return int(obj) - return obj - - _logger = logging.getLogger(__name__) V1SocketClientResponse = typing.Union[ AgentV1ListenUpdated, @@ -85,7 +75,6 @@ def _sanitize_numeric_types(obj: typing.Any) -> typing.Any: AgentV1Warning, AgentV1History, bytes, - typing.Dict[str, typing.Any], ] @@ -132,7 +121,7 @@ async def start_listening(self): ) continue await self._emit_async(EventType.MESSAGE, parsed) - except Exception as exc: + except (websockets.WebSocketException, JSONDecodeError) as exc: await self._emit_async(EventType.ERROR, exc) finally: await self._emit_async(EventType.CLOSE, None) @@ -200,12 +189,12 @@ async def send_function_call_response(self, message: AgentV1SendFunctionCallResp """ await self._send_model(message) - async def send_keep_alive(self, message: typing.Optional[AgentV1KeepAlive] = None) -> None: + async def send_keep_alive(self, message: AgentV1KeepAlive) -> None: """ Send a message to the websocket connection. The message will be sent as a AgentV1KeepAlive. """ - await self._send_model(message or AgentV1KeepAlive(type="KeepAlive")) + await self._send_model(message) async def send_update_prompt(self, message: AgentV1UpdatePrompt) -> None: """ @@ -214,12 +203,12 @@ async def send_update_prompt(self, message: AgentV1UpdatePrompt) -> None: """ await self._send_model(message) - async def send_force_end_turn(self, message: typing.Optional[AgentV1ForceEndTurn] = None) -> None: + async def send_force_end_turn(self, message: AgentV1ForceEndTurn) -> None: """ Send a message to the websocket connection. The message will be sent as a AgentV1ForceEndTurn. """ - await self._send_model(message or AgentV1ForceEndTurn(type="ForceEndTurn")) + await self._send_model(message) async def send_custom_to_think_provider(self, message: AgentV1CustomToThinkProvider) -> None: """ @@ -228,10 +217,6 @@ async def send_custom_to_think_provider(self, message: AgentV1CustomToThinkProvi """ await self._send_model(message) - async def send_raw(self, message: typing.Union[typing.Dict[str, typing.Any], str]) -> None: - """Send a JSON control frame without model validation.""" - await self._send(message) - async def send_media(self, message: bytes) -> None: """ Send a message to the websocket connection. @@ -265,7 +250,7 @@ async def _send_model(self, data: typing.Any) -> None: """ Send a Pydantic model to the websocket connection. """ - await self._send(_sanitize_numeric_types(data.dict())) + await self._send(data.dict()) class V1SocketClient(EventEmitterMixin): @@ -311,7 +296,7 @@ def start_listening(self): ) continue self._emit(EventType.MESSAGE, parsed) - except Exception as exc: + except (websockets.WebSocketException, JSONDecodeError) as exc: self._emit(EventType.ERROR, exc) finally: self._emit(EventType.CLOSE, None) @@ -379,12 +364,12 @@ def send_function_call_response(self, message: AgentV1SendFunctionCallResponse) """ self._send_model(message) - def send_keep_alive(self, message: typing.Optional[AgentV1KeepAlive] = None) -> None: + def send_keep_alive(self, message: AgentV1KeepAlive) -> None: """ Send a message to the websocket connection. The message will be sent as a AgentV1KeepAlive. """ - self._send_model(message or AgentV1KeepAlive(type="KeepAlive")) + self._send_model(message) def send_update_prompt(self, message: AgentV1UpdatePrompt) -> None: """ @@ -393,12 +378,12 @@ def send_update_prompt(self, message: AgentV1UpdatePrompt) -> None: """ self._send_model(message) - def send_force_end_turn(self, message: typing.Optional[AgentV1ForceEndTurn] = None) -> None: + def send_force_end_turn(self, message: AgentV1ForceEndTurn) -> None: """ Send a message to the websocket connection. The message will be sent as a AgentV1ForceEndTurn. """ - self._send_model(message or AgentV1ForceEndTurn(type="ForceEndTurn")) + self._send_model(message) def send_custom_to_think_provider(self, message: AgentV1CustomToThinkProvider) -> None: """ @@ -407,10 +392,6 @@ def send_custom_to_think_provider(self, message: AgentV1CustomToThinkProvider) - """ self._send_model(message) - def send_raw(self, message: typing.Union[typing.Dict[str, typing.Any], str]) -> None: - """Send a JSON control frame without model validation.""" - self._send(message) - def send_media(self, message: bytes) -> None: """ Send a message to the websocket connection. @@ -444,4 +425,4 @@ def _send_model(self, data: typing.Any) -> None: """ Send a Pydantic model to the websocket connection. """ - self._send(_sanitize_numeric_types(data.dict())) + self._send(data.dict()) diff --git a/src/deepgram/agent/v1/types/__init__.py b/src/deepgram/agent/v1/types/__init__.py index e6a3fdc7..232c2180 100644 --- a/src/deepgram/agent/v1/types/__init__.py +++ b/src/deepgram/agent/v1/types/__init__.py @@ -163,27 +163,6 @@ "FunctionCallHistoryMessageFunctionCallsItem": ".function_call_history_message_function_calls_item", } -_dynamic_imports.update( - { - "AgentV1HistoryContent": ".agent_v1history_content", - "AgentV1HistoryContentRole": ".agent_v1history_content_role", - "AgentV1HistoryFunctionCalls": ".agent_v1history_function_calls", - "AgentV1HistoryFunctionCallsFunctionCallsItem": ".agent_v1history_function_calls_function_calls_item", - "AgentV1SettingsAgentContextContextMessagesItemContentRole": ".agent_v1settings_agent_context_context_messages_item_content_role", - "AgentV1SettingsAgentContextContextMessagesItemFunctionCallsFunctionCallsItem": ".agent_v1settings_agent_context_context_messages_item_function_calls_function_calls_item", - "AgentV1SettingsAgentContextListenProviderV1": ".agent_v1settings_agent_context_listen_provider_v1", - "AgentV1SettingsAgentContextListenProviderV2": ".agent_v1settings_agent_context_listen_provider_v2", - "AgentV1SettingsAgentContextListenProviderV2LanguageHint": ".agent_v1settings_agent_context_listen_provider_v2language_hint", - "AgentV1SettingsAgentContextMessagesItem": ".agent_v1settings_agent_context_messages_item", - "AgentV1SettingsAgentContextMessagesItemContent": ".agent_v1settings_agent_context_messages_item_content", - "AgentV1SettingsAgentContextMessagesItemContentRole": ".agent_v1settings_agent_context_messages_item_content_role", - "AgentV1SettingsAgentContextMessagesItemFunctionCalls": ".agent_v1settings_agent_context_messages_item_function_calls", - "AgentV1SettingsAgentContextMessagesItemFunctionCallsFunctionCallsItem": ".agent_v1settings_agent_context_messages_item_function_calls_function_calls_item", - "AgentV1SettingsAgentListenProviderV1": ".agent_v1settings_agent_listen_provider_v1", - "AgentV1SettingsAgentListenProviderV2": ".agent_v1settings_agent_listen_provider_v2", - } -) - def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) @@ -282,24 +261,3 @@ def __dir__(): "FunctionCallHistoryMessage", "FunctionCallHistoryMessageFunctionCallsItem", ] - -__all__.extend( - [ - "AgentV1HistoryContent", - "AgentV1HistoryContentRole", - "AgentV1HistoryFunctionCalls", - "AgentV1HistoryFunctionCallsFunctionCallsItem", - "AgentV1SettingsAgentContextContextMessagesItemContentRole", - "AgentV1SettingsAgentContextContextMessagesItemFunctionCallsFunctionCallsItem", - "AgentV1SettingsAgentContextListenProviderV1", - "AgentV1SettingsAgentContextListenProviderV2", - "AgentV1SettingsAgentContextListenProviderV2LanguageHint", - "AgentV1SettingsAgentContextMessagesItem", - "AgentV1SettingsAgentContextMessagesItemContent", - "AgentV1SettingsAgentContextMessagesItemContentRole", - "AgentV1SettingsAgentContextMessagesItemFunctionCalls", - "AgentV1SettingsAgentContextMessagesItemFunctionCallsFunctionCallsItem", - "AgentV1SettingsAgentListenProviderV1", - "AgentV1SettingsAgentListenProviderV2", - ] -) diff --git a/src/deepgram/agent/v1/types/agent_v1conversation_text.py b/src/deepgram/agent/v1/types/agent_v1conversation_text.py index eb33f9f0..1e85d656 100644 --- a/src/deepgram/agent/v1/types/agent_v1conversation_text.py +++ b/src/deepgram/agent/v1/types/agent_v1conversation_text.py @@ -25,9 +25,9 @@ class AgentV1ConversationText(UncheckedBaseModel): The actual statement that was spoken """ - conversational_behavior: AgentV1ConversationTextConversationalBehavior = pydantic.Field(default="default") + conversational_behavior: AgentV1ConversationTextConversationalBehavior = pydantic.Field() """ - Annotates what kind of utterance the message represents: `default` (a standard turn), `backchannel` (a short acknowledgement while the user held the floor), `presence_check` (a prompt after extended silence), or `filler` (a line covering a wait on a function call or a dynamic InjectAgentMessage). Always sent; it is `default` for every message while Think Live is off. Defaults to `default` when an older or self-hosted server omits it. + Annotates what kind of utterance the message represents: `default` (a standard turn), `backchannel` (a short acknowledgement while the user held the floor), `presence_check` (a prompt after extended silence), or `filler` (a line covering a wait on a function call or a dynamic InjectAgentMessage). Always sent; it is `default` for every message while Think Live is off """ languages_hinted: typing.Optional[typing.List[str]] = pydantic.Field(default=None) diff --git a/src/deepgram/agent/v1/types/agent_v1inject_dynamic_agent_message.py b/src/deepgram/agent/v1/types/agent_v1inject_dynamic_agent_message.py index 471d6f61..aefd967d 100644 --- a/src/deepgram/agent/v1/types/agent_v1inject_dynamic_agent_message.py +++ b/src/deepgram/agent/v1/types/agent_v1inject_dynamic_agent_message.py @@ -22,7 +22,7 @@ class AgentV1InjectDynamicAgentMessage(UncheckedBaseModel): behavior: typing.Optional[AgentV1InjectDynamicAgentMessageBehavior] = pydantic.Field(default=None) """ Controls how the injection interacts with any in-progress user or agent turn. - + * `default` — The agent speaks only if neither the user nor the agent is mid-turn. If a turn is in progress, the server replies with `InjectionRefused`. * `queue` — The message is appended after any already-queued `ConversationText` without interrupting the current agent turn or think response. If nothing is queued, the message plays immediately. * `interrupt` — The agent immediately speaks. If the agent was already speaking, it interrupts the current speech and replaces it with the new message. If the user is speaking, the agent interrupts with the new message, but the user's continued speech triggers `UserStartedSpeaking`, which quickly interrupts the agent. diff --git a/src/deepgram/agent/v1/types/agent_v1settings.py b/src/deepgram/agent/v1/types/agent_v1settings.py index ff58da13..11601dfc 100644 --- a/src/deepgram/agent/v1/types/agent_v1settings.py +++ b/src/deepgram/agent/v1/types/agent_v1settings.py @@ -6,7 +6,6 @@ from ....core.pydantic_utilities import IS_PYDANTIC_V2 from ....core.unchecked_base_model import UncheckedBaseModel from .agent_v1settings_agent import AgentV1SettingsAgent -from .agent_v1settings_agent_context import AgentV1SettingsAgentContext from .agent_v1settings_audio import AgentV1SettingsAudio from .agent_v1settings_flags import AgentV1SettingsFlags @@ -30,7 +29,7 @@ class AgentV1Settings(UncheckedBaseModel): """ audio: AgentV1SettingsAudio - agent: typing.Union[AgentV1SettingsAgent, AgentV1SettingsAgentContext, str] + agent: AgentV1SettingsAgent if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/deepgram/agent/v1/types/agent_v1settings_agent.py b/src/deepgram/agent/v1/types/agent_v1settings_agent.py index 1a4d67fd..c1483c35 100644 --- a/src/deepgram/agent/v1/types/agent_v1settings_agent.py +++ b/src/deepgram/agent/v1/types/agent_v1settings_agent.py @@ -2,57 +2,6 @@ import typing -import pydantic -from ....core.pydantic_utilities import IS_PYDANTIC_V2 from .agent_v1settings_agent_context import AgentV1SettingsAgentContext -from .agent_v1settings_agent_listen import AgentV1SettingsAgentListen - -class AgentV1SettingsAgent(AgentV1SettingsAgentContext): - if IS_PYDANTIC_V2: - - @pydantic.model_validator(mode="before") - @classmethod - def _migrate_legacy_nested_context(cls, values: typing.Any) -> typing.Any: - if not isinstance(values, dict): - return values - context = values.get("context") - if isinstance(context, AgentV1SettingsAgentContext) and ( - context.context is not None - and context.language is None - and context.listen is None - and context.think is None - and context.think_live is None - and context.speak is None - and context.greeting is None - ): - values = dict(values) - values["context"] = context.context - listen = values.get("listen") - if isinstance(listen, AgentV1SettingsAgentListen): - values = dict(values) - values["listen"] = listen.dict() - return values - else: - - @pydantic.root_validator(pre=True) # type: ignore[deprecated] - def _migrate_legacy_nested_context(cls, values: typing.Any) -> typing.Any: # type: ignore[no-redef] - if not isinstance(values, dict): - return values - context = values.get("context") - if isinstance(context, AgentV1SettingsAgentContext) and ( - context.context is not None - and context.language is None - and context.listen is None - and context.think is None - and context.think_live is None - and context.speak is None - and context.greeting is None - ): - values = dict(values) - values["context"] = context.context - listen = values.get("listen") - if isinstance(listen, AgentV1SettingsAgentListen): - values = dict(values) - values["listen"] = listen.dict() - return values +AgentV1SettingsAgent = typing.Union[AgentV1SettingsAgentContext, str] diff --git a/src/deepgram/agent/v1/types/agent_v1settings_agent_context.py b/src/deepgram/agent/v1/types/agent_v1settings_agent_context.py index 181472b4..d32ebcaa 100644 --- a/src/deepgram/agent/v1/types/agent_v1settings_agent_context.py +++ b/src/deepgram/agent/v1/types/agent_v1settings_agent_context.py @@ -8,7 +8,6 @@ from ....types.think_live_settings_v1 import ThinkLiveSettingsV1 from .agent_v1settings_agent_context_context import AgentV1SettingsAgentContextContext from .agent_v1settings_agent_context_listen import AgentV1SettingsAgentContextListen -from .agent_v1settings_agent_context_messages_item import AgentV1SettingsAgentContextMessagesItem from .agent_v1settings_agent_context_speak import AgentV1SettingsAgentContextSpeak from .agent_v1settings_agent_context_think import AgentV1SettingsAgentContextThink @@ -38,30 +37,10 @@ class AgentV1SettingsAgentContext(UncheckedBaseModel): """ if IS_PYDANTIC_V2: - - @pydantic.model_validator(mode="before") - @classmethod - def _migrate_legacy_messages_to_context(cls, values: typing.Any) -> typing.Any: - if isinstance(values, dict) and "messages" in values and "context" not in values: - values = dict(values) - values["context"] = {"messages": values.pop("messages")} - return values - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: - @pydantic.root_validator(pre=True) # type: ignore[deprecated] - def _migrate_legacy_messages_to_context(cls, values: typing.Any) -> typing.Any: # type: ignore[no-redef] - if isinstance(values, dict) and "messages" in values and "context" not in values: - values = dict(values) - values["context"] = {"messages": values.pop("messages")} - return values - class Config: frozen = True smart_union = True extra = pydantic.Extra.allow - - @property - def messages(self) -> typing.Optional[typing.List[AgentV1SettingsAgentContextMessagesItem]]: - return None if self.context is None else self.context.messages diff --git a/src/deepgram/agent/v1/types/agent_v1settings_agent_context_listen_provider.py b/src/deepgram/agent/v1/types/agent_v1settings_agent_context_listen_provider.py index 222c18a3..b806f202 100644 --- a/src/deepgram/agent/v1/types/agent_v1settings_agent_context_listen_provider.py +++ b/src/deepgram/agent/v1/types/agent_v1settings_agent_context_listen_provider.py @@ -33,38 +33,15 @@ class AgentV1SettingsAgentContextListenProvider_V2(UncheckedBaseModel): type: typing.Literal["deepgram"] = "deepgram" model: str language_hints: typing.Optional[typing.List[str]] = None - language_hint: typing.Optional[typing.Union[str, typing.List[str]]] = pydantic.Field(default=None, exclude=True) eot_threshold: typing.Optional[float] = None eager_eot_threshold: typing.Optional[float] = None eot_timeout_ms: typing.Optional[int] = None keyterms: typing.Optional[typing.List[str]] = None if IS_PYDANTIC_V2: - - @pydantic.model_validator(mode="before") - @classmethod - def _migrate_language_hint(cls, values: typing.Any) -> typing.Any: - if not isinstance(values, dict) or "language_hint" not in values: - return values - values = dict(values) - hint = values.pop("language_hint") - if hint is not None and values.get("language_hints") is None: - values["language_hints"] = [hint] if isinstance(hint, str) else list(hint) - return values - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: - @pydantic.root_validator(pre=True) # type: ignore[deprecated] - def _migrate_language_hint(cls, values: typing.Any) -> typing.Any: # type: ignore[no-redef] - if not isinstance(values, dict) or "language_hint" not in values: - return values - values = dict(values) - hint = values.pop("language_hint") - if hint is not None and values.get("language_hints") is None: - values["language_hints"] = [hint] if isinstance(hint, str) else list(hint) - return values - class Config: frozen = True smart_union = True diff --git a/src/deepgram/agent/v1/types/agent_v1settings_agent_listen_provider.py b/src/deepgram/agent/v1/types/agent_v1settings_agent_listen_provider.py index d225e261..d053b2b9 100644 --- a/src/deepgram/agent/v1/types/agent_v1settings_agent_listen_provider.py +++ b/src/deepgram/agent/v1/types/agent_v1settings_agent_listen_provider.py @@ -33,38 +33,15 @@ class AgentV1SettingsAgentListenProvider_V2(UncheckedBaseModel): type: typing.Literal["deepgram"] = "deepgram" model: str language_hints: typing.Optional[typing.List[str]] = None - language_hint: typing.Optional[typing.Union[str, typing.List[str]]] = pydantic.Field(default=None, exclude=True) eot_threshold: typing.Optional[float] = None eager_eot_threshold: typing.Optional[float] = None eot_timeout_ms: typing.Optional[int] = None keyterms: typing.Optional[typing.List[str]] = None if IS_PYDANTIC_V2: - - @pydantic.model_validator(mode="before") - @classmethod - def _migrate_language_hint(cls, values: typing.Any) -> typing.Any: - if not isinstance(values, dict) or "language_hint" not in values: - return values - values = dict(values) - hint = values.pop("language_hint") - if hint is not None and values.get("language_hints") is None: - values["language_hints"] = [hint] if isinstance(hint, str) else list(hint) - return values - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: - @pydantic.root_validator(pre=True) # type: ignore[deprecated] - def _migrate_language_hint(cls, values: typing.Any) -> typing.Any: # type: ignore[no-redef] - if not isinstance(values, dict) or "language_hint" not in values: - return values - values = dict(values) - hint = values.pop("language_hint") - if hint is not None and values.get("language_hints") is None: - values["language_hints"] = [hint] if isinstance(hint, str) else list(hint) - return values - class Config: frozen = True smart_union = True diff --git a/src/deepgram/agent/v1/types/agent_v1update_listen_listen.py b/src/deepgram/agent/v1/types/agent_v1update_listen_listen.py index d7ed4fab..f345904c 100644 --- a/src/deepgram/agent/v1/types/agent_v1update_listen_listen.py +++ b/src/deepgram/agent/v1/types/agent_v1update_listen_listen.py @@ -5,34 +5,8 @@ import pydantic from ....core.pydantic_utilities import IS_PYDANTIC_V2 from ....core.unchecked_base_model import UncheckedBaseModel -from ....types.deepgram_listen_provider_v1 import DeepgramListenProviderV1 -from ....types.deepgram_listen_provider_v2 import DeepgramListenProviderV2 from .agent_v1update_listen_listen_provider import AgentV1UpdateListenListenProvider -_V1_ONLY_KEYS = frozenset({"language", "smart_format"}) - - -def _coerce_legacy_update_listen_provider(values: typing.Any) -> typing.Any: - if not isinstance(values, dict): - return values - provider = values.get("provider") - if isinstance(provider, DeepgramListenProviderV2): - values = dict(values) - values["provider"] = {**provider.dict(), "version": "v2"} - elif isinstance(provider, DeepgramListenProviderV1): - values = dict(values) - values["provider"] = {**provider.dict(), "version": "v1"} - elif isinstance(provider, dict) and "version" not in provider: - values = dict(values) - version = "v1" if _V1_ONLY_KEYS & provider.keys() else "v2" - provider_cls = DeepgramListenProviderV1 if version == "v1" else DeepgramListenProviderV2 - try: - coerced = provider_cls(**provider).dict() - except Exception: - coerced = dict(provider) - values["provider"] = {**coerced, "version": version} - return values - class AgentV1UpdateListenListen(UncheckedBaseModel): """ @@ -42,19 +16,9 @@ class AgentV1UpdateListenListen(UncheckedBaseModel): provider: AgentV1UpdateListenListenProvider if IS_PYDANTIC_V2: - - @pydantic.model_validator(mode="before") - @classmethod - def _migrate_legacy_provider(cls, values: typing.Any) -> typing.Any: - return _coerce_legacy_update_listen_provider(values) - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: - @pydantic.root_validator(pre=True) # type: ignore[deprecated] - def _migrate_legacy_provider(cls, values: typing.Any) -> typing.Any: # type: ignore[no-redef] - return _coerce_legacy_update_listen_provider(values) - class Config: frozen = True smart_union = True diff --git a/src/deepgram/agent/v1/types/agent_v1update_prompt.py b/src/deepgram/agent/v1/types/agent_v1update_prompt.py index 8cbada41..9d7690da 100644 --- a/src/deepgram/agent/v1/types/agent_v1update_prompt.py +++ b/src/deepgram/agent/v1/types/agent_v1update_prompt.py @@ -15,7 +15,7 @@ class AgentV1UpdatePrompt(UncheckedBaseModel): prompt: str = pydantic.Field() """ - The new system prompt to be used by the agent + Text appended to the current system prompt """ if IS_PYDANTIC_V2: diff --git a/src/deepgram/core/api_error.py b/src/deepgram/core/api_error.py index 2aa93914..6f850a60 100644 --- a/src/deepgram/core/api_error.py +++ b/src/deepgram/core/api_error.py @@ -2,8 +2,6 @@ from typing import Any, Dict, Optional -from .._secure_logging import redact_sensitive_headers - class ApiError(Exception): headers: Optional[Dict[str, str]] @@ -17,7 +15,7 @@ def __init__( status_code: Optional[int] = None, body: Any = None, ) -> None: - self.headers = redact_sensitive_headers(headers) + self.headers = headers self.status_code = status_code self.body = body diff --git a/src/deepgram/core/client_wrapper.py b/src/deepgram/core/client_wrapper.py index f8afc3bb..b55f2802 100644 --- a/src/deepgram/core/client_wrapper.py +++ b/src/deepgram/core/client_wrapper.py @@ -37,7 +37,7 @@ def get_headers(self) -> typing.Dict[str, str]: try: _sdk_version = _fern_importlib_metadata.version("deepgram-sdk") except _fern_importlib_metadata.PackageNotFoundError: - _sdk_version = "7.20.0" # x-release-please-version + _sdk_version = "7.20.1" headers: typing.Dict[str, str] = { "User-Agent": "deepgram-sdk/" + _sdk_version, diff --git a/src/deepgram/core/parse_error.py b/src/deepgram/core/parse_error.py index c510c0e8..4527c6a8 100644 --- a/src/deepgram/core/parse_error.py +++ b/src/deepgram/core/parse_error.py @@ -2,8 +2,6 @@ from typing import Any, Dict, Optional -from .._secure_logging import redact_sensitive_headers - class ParsingError(Exception): """ @@ -25,7 +23,7 @@ def __init__( body: Any = None, cause: Optional[Exception] = None, ) -> None: - self.headers = redact_sensitive_headers(headers) + self.headers = headers self.status_code = status_code self.body = body self.cause = cause diff --git a/src/deepgram/core/query_encoder.py b/src/deepgram/core/query_encoder.py index 58088258..3183001d 100644 --- a/src/deepgram/core/query_encoder.py +++ b/src/deepgram/core/query_encoder.py @@ -5,13 +5,6 @@ import pydantic -def _coerce_query_value(value: Any) -> Any: - # urllib.parse.urlencode would otherwise turn bools into "True"/"False". - if isinstance(value, bool): - return "true" if value else "false" - return value - - # Flattens dicts to be of the form {"key[subkey][subkey2]": value} where value is not a dict def traverse_query_dict(dict_flat: Dict[str, Any], key_prefix: Optional[str] = None) -> List[Tuple[str, Any]]: result = [] @@ -24,9 +17,9 @@ def traverse_query_dict(dict_flat: Dict[str, Any], key_prefix: Optional[str] = N if isinstance(arr_v, dict): result.extend(traverse_query_dict(arr_v, key)) else: - result.append((key, _coerce_query_value(arr_v))) + result.append((key, arr_v)) else: - result.append((key, _coerce_query_value(v))) + result.append((key, v)) return result @@ -48,11 +41,11 @@ def single_query_encoder(query_key: str, query_value: Any) -> List[Tuple[str, An encoded_values.extend(single_query_encoder(query_key, obj_dict)) else: - encoded_values.append((query_key, _coerce_query_value(value))) + encoded_values.append((query_key, value)) return encoded_values - return [(query_key, _coerce_query_value(query_value))] + return [(query_key, query_value)] def encode_query(query: Optional[Dict[str, Any]]) -> Optional[List[Tuple[str, Any]]]: diff --git a/src/deepgram/listen/__init__.py b/src/deepgram/listen/__init__.py index d2b6487e..79d16232 100644 --- a/src/deepgram/listen/__init__.py +++ b/src/deepgram/listen/__init__.py @@ -148,8 +148,6 @@ "v2": ".v2", } -_dynamic_imports["ListenV2CloseStreamType"] = ".v2" - def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) @@ -242,5 +240,3 @@ def __dir__(): "v1", "v2", ] - -__all__.append("ListenV2CloseStreamType") diff --git a/src/deepgram/listen/v1/requests/listen_v1configure_failure.py b/src/deepgram/listen/v1/requests/listen_v1configure_failure.py index af007f39..410201ed 100644 --- a/src/deepgram/listen/v1/requests/listen_v1configure_failure.py +++ b/src/deepgram/listen/v1/requests/listen_v1configure_failure.py @@ -20,7 +20,7 @@ class ListenV1ConfigureFailureParams(typing_extensions.TypedDict): code: ListenV1ConfigureFailureCode """ Identifies why the `Configure` was rejected. - + - `CONFIGURE_KEYTERMS_NOT_SUPPORTED`: the stream's model does not support mid-stream keyterm updates. Only Nova-3 models do. - `CONFIGURE_KEYTERM_LIMIT_EXCEEDED`: the keyterms exceed the 500-token keyterm limit. diff --git a/src/deepgram/listen/v1/socket_client.py b/src/deepgram/listen/v1/socket_client.py index 20d466f4..5666ff3a 100644 --- a/src/deepgram/listen/v1/socket_client.py +++ b/src/deepgram/listen/v1/socket_client.py @@ -3,7 +3,9 @@ import json import logging import typing +from json.decoder import JSONDecodeError +import websockets import websockets.sync.connection as websockets_sync_connection from ...core.events import EventEmitterMixin, EventType from ...core.unchecked_base_model import construct_type @@ -26,7 +28,6 @@ _logger = logging.getLogger(__name__) V1SocketClientResponse = typing.Union[ - bytes, ListenV1ConfigureSuccess, ListenV1ConfigureFailure, ListenV1Results, @@ -34,7 +35,6 @@ ListenV1UtteranceEnd, ListenV1SpeechStarted, ListenV1Error, - typing.Dict[str, typing.Any], ] @@ -81,7 +81,7 @@ async def start_listening(self): ) continue await self._emit_async(EventType.MESSAGE, parsed) - except Exception as exc: + except (websockets.WebSocketException, JSONDecodeError) as exc: await self._emit_async(EventType.ERROR, exc) finally: await self._emit_async(EventType.CLOSE, None) @@ -93,26 +93,26 @@ async def send_media(self, message: bytes) -> None: """ await self._send(message) - async def send_finalize(self, message: typing.Optional[ListenV1Finalize] = None) -> None: + async def send_finalize(self, message: ListenV1Finalize) -> None: """ Send a message to the websocket connection. The message will be sent as a ListenV1Finalize. """ - await self._send_model(message or ListenV1Finalize(type="Finalize")) + await self._send_model(message) - async def send_close_stream(self, message: typing.Optional[ListenV1CloseStream] = None) -> None: + async def send_close_stream(self, message: ListenV1CloseStream) -> None: """ Send a message to the websocket connection. The message will be sent as a ListenV1CloseStream. """ - await self._send_model(message or ListenV1CloseStream(type="CloseStream")) + await self._send_model(message) - async def send_keep_alive(self, message: typing.Optional[ListenV1KeepAlive] = None) -> None: + async def send_keep_alive(self, message: ListenV1KeepAlive) -> None: """ Send a message to the websocket connection. The message will be sent as a ListenV1KeepAlive. """ - await self._send_model(message or ListenV1KeepAlive(type="KeepAlive")) + await self._send_model(message) async def send_configure(self, message: ListenV1Configure) -> None: """ @@ -193,7 +193,7 @@ def start_listening(self): ) continue self._emit(EventType.MESSAGE, parsed) - except Exception as exc: + except (websockets.WebSocketException, JSONDecodeError) as exc: self._emit(EventType.ERROR, exc) finally: self._emit(EventType.CLOSE, None) @@ -205,26 +205,26 @@ def send_media(self, message: bytes) -> None: """ self._send(message) - def send_finalize(self, message: typing.Optional[ListenV1Finalize] = None) -> None: + def send_finalize(self, message: ListenV1Finalize) -> None: """ Send a message to the websocket connection. The message will be sent as a ListenV1Finalize. """ - self._send_model(message or ListenV1Finalize(type="Finalize")) + self._send_model(message) - def send_close_stream(self, message: typing.Optional[ListenV1CloseStream] = None) -> None: + def send_close_stream(self, message: ListenV1CloseStream) -> None: """ Send a message to the websocket connection. The message will be sent as a ListenV1CloseStream. """ - self._send_model(message or ListenV1CloseStream(type="CloseStream")) + self._send_model(message) - def send_keep_alive(self, message: typing.Optional[ListenV1KeepAlive] = None) -> None: + def send_keep_alive(self, message: ListenV1KeepAlive) -> None: """ Send a message to the websocket connection. The message will be sent as a ListenV1KeepAlive. """ - self._send_model(message or ListenV1KeepAlive(type="KeepAlive")) + self._send_model(message) def send_configure(self, message: ListenV1Configure) -> None: """ diff --git a/src/deepgram/listen/v1/types/listen_v1configure_failure.py b/src/deepgram/listen/v1/types/listen_v1configure_failure.py index 859a834c..7352f3df 100644 --- a/src/deepgram/listen/v1/types/listen_v1configure_failure.py +++ b/src/deepgram/listen/v1/types/listen_v1configure_failure.py @@ -22,7 +22,7 @@ class ListenV1ConfigureFailure(UncheckedBaseModel): code: ListenV1ConfigureFailureCode = pydantic.Field() """ Identifies why the `Configure` was rejected. - + - `CONFIGURE_KEYTERMS_NOT_SUPPORTED`: the stream's model does not support mid-stream keyterm updates. Only Nova-3 models do. - `CONFIGURE_KEYTERM_LIMIT_EXCEEDED`: the keyterms exceed the 500-token keyterm limit. diff --git a/src/deepgram/listen/v2/__init__.py b/src/deepgram/listen/v2/__init__.py index 7585b5ab..8dea11db 100644 --- a/src/deepgram/listen/v2/__init__.py +++ b/src/deepgram/listen/v2/__init__.py @@ -63,8 +63,6 @@ "ListenV2WarningParams": ".requests", } -_dynamic_imports["ListenV2CloseStreamType"] = ".types" - def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) @@ -114,5 +112,3 @@ def __dir__(): "ListenV2Warning", "ListenV2WarningParams", ] - -__all__.append("ListenV2CloseStreamType") diff --git a/src/deepgram/listen/v2/socket_client.py b/src/deepgram/listen/v2/socket_client.py index 4295e44c..e60bd78a 100644 --- a/src/deepgram/listen/v2/socket_client.py +++ b/src/deepgram/listen/v2/socket_client.py @@ -3,7 +3,9 @@ import json import logging import typing +from json.decoder import JSONDecodeError +import websockets import websockets.sync.connection as websockets_sync_connection from ...core.events import EventEmitterMixin, EventType from ...core.unchecked_base_model import construct_type @@ -24,14 +26,12 @@ _logger = logging.getLogger(__name__) V2SocketClientResponse = typing.Union[ - bytes, ListenV2Connected, ListenV2TurnInfo, ListenV2ConfigureSuccess, ListenV2ConfigureFailure, ListenV2Warning, ListenV2FatalError, - typing.Dict[str, typing.Any], ] @@ -78,7 +78,7 @@ async def start_listening(self): ) continue await self._emit_async(EventType.MESSAGE, parsed) - except Exception as exc: + except (websockets.WebSocketException, JSONDecodeError) as exc: await self._emit_async(EventType.ERROR, exc) finally: await self._emit_async(EventType.CLOSE, None) @@ -90,29 +90,26 @@ async def send_media(self, message: bytes) -> None: """ await self._send(message) - async def send_close_stream(self, message: typing.Optional[ListenV2CloseStream] = None) -> None: + async def send_close_stream(self, message: ListenV2CloseStream) -> None: """ Send a message to the websocket connection. The message will be sent as a ListenV2CloseStream. """ - await self._send_model(message or ListenV2CloseStream(type="CloseStream")) + await self._send_model(message) - async def send_force_end_turn(self, message: typing.Optional[ListenV2ForceEndTurn] = None) -> None: + async def send_force_end_turn(self, message: ListenV2ForceEndTurn) -> None: """ Send a message to the websocket connection. The message will be sent as a ListenV2ForceEndTurn. """ - await self._send_model(message or ListenV2ForceEndTurn(type="ForceEndTurn")) + await self._send_model(message) - async def send_configure(self, message: typing.Union[ListenV2Configure, typing.Dict[str, typing.Any]]) -> None: + async def send_configure(self, message: ListenV2Configure) -> None: """ Send a message to the websocket connection. The message will be sent as a ListenV2Configure. """ - if isinstance(message, dict): - await self._send(message) - else: - await self._send_model(message) + await self._send_model(message) async def recv(self) -> V2SocketClientResponse: """ @@ -186,7 +183,7 @@ def start_listening(self): ) continue self._emit(EventType.MESSAGE, parsed) - except Exception as exc: + except (websockets.WebSocketException, JSONDecodeError) as exc: self._emit(EventType.ERROR, exc) finally: self._emit(EventType.CLOSE, None) @@ -198,29 +195,26 @@ def send_media(self, message: bytes) -> None: """ self._send(message) - def send_close_stream(self, message: typing.Optional[ListenV2CloseStream] = None) -> None: + def send_close_stream(self, message: ListenV2CloseStream) -> None: """ Send a message to the websocket connection. The message will be sent as a ListenV2CloseStream. """ - self._send_model(message or ListenV2CloseStream(type="CloseStream")) + self._send_model(message) - def send_force_end_turn(self, message: typing.Optional[ListenV2ForceEndTurn] = None) -> None: + def send_force_end_turn(self, message: ListenV2ForceEndTurn) -> None: """ Send a message to the websocket connection. The message will be sent as a ListenV2ForceEndTurn. """ - self._send_model(message or ListenV2ForceEndTurn(type="ForceEndTurn")) + self._send_model(message) - def send_configure(self, message: typing.Union[ListenV2Configure, typing.Dict[str, typing.Any]]) -> None: + def send_configure(self, message: ListenV2Configure) -> None: """ Send a message to the websocket connection. The message will be sent as a ListenV2Configure. """ - if isinstance(message, dict): - self._send(message) - else: - self._send_model(message) + self._send_model(message) def recv(self) -> V2SocketClientResponse: """ diff --git a/src/deepgram/listen/v2/types/__init__.py b/src/deepgram/listen/v2/types/__init__.py index 8ec84d29..7f4ffc34 100644 --- a/src/deepgram/listen/v2/types/__init__.py +++ b/src/deepgram/listen/v2/types/__init__.py @@ -35,8 +35,6 @@ "ListenV2Warning": ".listen_v2warning", } -_dynamic_imports["ListenV2CloseStreamType"] = ".listen_v2close_stream_type" - def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) @@ -74,5 +72,3 @@ def __dir__(): "ListenV2TurnInfoWordsItem", "ListenV2Warning", ] - -__all__.append("ListenV2CloseStreamType") diff --git a/src/deepgram/listen/v2/types/listen_v2configure_failure.py b/src/deepgram/listen/v2/types/listen_v2configure_failure.py index 1daf8af6..7b3772d6 100644 --- a/src/deepgram/listen/v2/types/listen_v2configure_failure.py +++ b/src/deepgram/listen/v2/types/listen_v2configure_failure.py @@ -4,10 +4,10 @@ import pydantic from ....core.pydantic_utilities import IS_PYDANTIC_V2 -from ._dict_compat import ListenV2ResponseDictCompatModel +from ....core.unchecked_base_model import UncheckedBaseModel -class ListenV2ConfigureFailure(ListenV2ResponseDictCompatModel): +class ListenV2ConfigureFailure(UncheckedBaseModel): type: typing.Literal["ConfigureFailure"] = pydantic.Field(default="ConfigureFailure") """ Message type identifier diff --git a/src/deepgram/listen/v2/types/listen_v2configure_success.py b/src/deepgram/listen/v2/types/listen_v2configure_success.py index 0faaec9d..d04cce1b 100644 --- a/src/deepgram/listen/v2/types/listen_v2configure_success.py +++ b/src/deepgram/listen/v2/types/listen_v2configure_success.py @@ -4,13 +4,13 @@ import pydantic from ....core.pydantic_utilities import IS_PYDANTIC_V2 +from ....core.unchecked_base_model import UncheckedBaseModel from ....types.listen_v2configure_numerals import ListenV2ConfigureNumerals from ....types.listen_v2keyterm import ListenV2Keyterm -from ._dict_compat import ListenV2ResponseDictCompatModel from .listen_v2configure_success_thresholds import ListenV2ConfigureSuccessThresholds -class ListenV2ConfigureSuccess(ListenV2ResponseDictCompatModel): +class ListenV2ConfigureSuccess(UncheckedBaseModel): type: typing.Literal["ConfigureSuccess"] = pydantic.Field(default="ConfigureSuccess") """ Message type identifier diff --git a/src/deepgram/listen/v2/types/listen_v2configure_success_thresholds.py b/src/deepgram/listen/v2/types/listen_v2configure_success_thresholds.py index e0353ec9..6c719233 100644 --- a/src/deepgram/listen/v2/types/listen_v2configure_success_thresholds.py +++ b/src/deepgram/listen/v2/types/listen_v2configure_success_thresholds.py @@ -4,13 +4,13 @@ import pydantic from ....core.pydantic_utilities import IS_PYDANTIC_V2 +from ....core.unchecked_base_model import UncheckedBaseModel from ....types.listen_v2eager_eot_threshold import ListenV2EagerEotThreshold from ....types.listen_v2eot_threshold import ListenV2EotThreshold from ....types.listen_v2eot_timeout_ms import ListenV2EotTimeoutMs -from ._dict_compat import ListenV2ResponseDictCompatModel -class ListenV2ConfigureSuccessThresholds(ListenV2ResponseDictCompatModel): +class ListenV2ConfigureSuccessThresholds(UncheckedBaseModel): """ Updates each parameter, if it is supplied. If a particular threshold parameter is not supplied, the configuration continues using the currently configured value. diff --git a/src/deepgram/listen/v2/types/listen_v2connected.py b/src/deepgram/listen/v2/types/listen_v2connected.py index b253d86c..cefc0236 100644 --- a/src/deepgram/listen/v2/types/listen_v2connected.py +++ b/src/deepgram/listen/v2/types/listen_v2connected.py @@ -4,10 +4,10 @@ import pydantic from ....core.pydantic_utilities import IS_PYDANTIC_V2 -from ._dict_compat import ListenV2ResponseDictCompatModel +from ....core.unchecked_base_model import UncheckedBaseModel -class ListenV2Connected(ListenV2ResponseDictCompatModel): +class ListenV2Connected(UncheckedBaseModel): type: typing.Literal["Connected"] = pydantic.Field(default="Connected") """ Message type identifier diff --git a/src/deepgram/listen/v2/types/listen_v2fatal_error.py b/src/deepgram/listen/v2/types/listen_v2fatal_error.py index 2202c82e..c5106f07 100644 --- a/src/deepgram/listen/v2/types/listen_v2fatal_error.py +++ b/src/deepgram/listen/v2/types/listen_v2fatal_error.py @@ -4,10 +4,10 @@ import pydantic from ....core.pydantic_utilities import IS_PYDANTIC_V2 -from ._dict_compat import ListenV2ResponseDictCompatModel +from ....core.unchecked_base_model import UncheckedBaseModel -class ListenV2FatalError(ListenV2ResponseDictCompatModel): +class ListenV2FatalError(UncheckedBaseModel): type: typing.Literal["Error"] = pydantic.Field(default="Error") """ Message type identifier diff --git a/src/deepgram/listen/v2/types/listen_v2turn_info.py b/src/deepgram/listen/v2/types/listen_v2turn_info.py index 969d6d0c..d87a1032 100644 --- a/src/deepgram/listen/v2/types/listen_v2turn_info.py +++ b/src/deepgram/listen/v2/types/listen_v2turn_info.py @@ -4,12 +4,12 @@ import pydantic from ....core.pydantic_utilities import IS_PYDANTIC_V2 -from ._dict_compat import ListenV2ResponseDictCompatModel +from ....core.unchecked_base_model import UncheckedBaseModel from .listen_v2turn_info_event import ListenV2TurnInfoEvent from .listen_v2turn_info_words_item import ListenV2TurnInfoWordsItem -class ListenV2TurnInfo(ListenV2ResponseDictCompatModel): +class ListenV2TurnInfo(UncheckedBaseModel): """ Describes the current turn and latest state of the turn """ diff --git a/src/deepgram/listen/v2/types/listen_v2turn_info_words_item.py b/src/deepgram/listen/v2/types/listen_v2turn_info_words_item.py index 88240cd9..07ada673 100644 --- a/src/deepgram/listen/v2/types/listen_v2turn_info_words_item.py +++ b/src/deepgram/listen/v2/types/listen_v2turn_info_words_item.py @@ -4,10 +4,10 @@ import pydantic from ....core.pydantic_utilities import IS_PYDANTIC_V2 -from ._dict_compat import ListenV2ResponseDictCompatModel +from ....core.unchecked_base_model import UncheckedBaseModel -class ListenV2TurnInfoWordsItem(ListenV2ResponseDictCompatModel): +class ListenV2TurnInfoWordsItem(UncheckedBaseModel): word: str = pydantic.Field() """ The individual punctuated, properly-cased word from the transcript diff --git a/src/deepgram/listen/v2/types/listen_v2warning.py b/src/deepgram/listen/v2/types/listen_v2warning.py index 19bfe19a..c392cd25 100644 --- a/src/deepgram/listen/v2/types/listen_v2warning.py +++ b/src/deepgram/listen/v2/types/listen_v2warning.py @@ -4,10 +4,10 @@ import pydantic from ....core.pydantic_utilities import IS_PYDANTIC_V2 -from ._dict_compat import ListenV2ResponseDictCompatModel +from ....core.unchecked_base_model import UncheckedBaseModel -class ListenV2Warning(ListenV2ResponseDictCompatModel): +class ListenV2Warning(UncheckedBaseModel): type: typing.Literal["Warning"] = pydantic.Field(default="Warning") """ Message type identifier diff --git a/src/deepgram/manage/v1/projects/keys/client.py b/src/deepgram/manage/v1/projects/keys/client.py index 0e089c5b..095defaa 100644 --- a/src/deepgram/manage/v1/projects/keys/client.py +++ b/src/deepgram/manage/v1/projects/keys/client.py @@ -1,10 +1,10 @@ # This file was auto-generated by Fern from our API Definition. +import datetime as dt import typing from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from .....core.request_options import RequestOptions -from .....requests.create_key_v1request import CreateKeyV1RequestParams from .....types.create_key_v1response import CreateKeyV1Response from .....types.delete_project_key_v1response import DeleteProjectKeyV1Response from .....types.get_project_key_v1response import GetProjectKeyV1Response @@ -76,7 +76,11 @@ def create( self, project_id: str, *, - request: CreateKeyV1RequestParams, + comment: str, + scopes: typing.Sequence[str], + tags: typing.Optional[typing.Sequence[str]] = OMIT, + expiration_date: typing.Optional[dt.datetime] = OMIT, + time_to_live_in_seconds: typing.Optional[float] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CreateKeyV1Response: """ @@ -87,7 +91,15 @@ def create( project_id : str The unique identifier of the project - request : CreateKeyV1RequestParams + comment : str + + scopes : typing.Sequence[str] + + tags : typing.Optional[typing.Sequence[str]] + + expiration_date : typing.Optional[dt.datetime] + + time_to_live_in_seconds : typing.Optional[float] request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -105,11 +117,20 @@ def create( api_key="YOUR_API_KEY", ) client.manage.v1.projects.keys.create( - project_id="project_id", - request={"key": "value"}, + project_id="123456-7890-1234-5678-901234", + comment="A comment", + scopes=["admin"], ) """ - _response = self._raw_client.create(project_id, request=request, request_options=request_options) + _response = self._raw_client.create( + project_id, + comment=comment, + scopes=scopes, + tags=tags, + expiration_date=expiration_date, + time_to_live_in_seconds=time_to_live_in_seconds, + request_options=request_options, + ) return _response.data def get( @@ -255,7 +276,11 @@ async def create( self, project_id: str, *, - request: CreateKeyV1RequestParams, + comment: str, + scopes: typing.Sequence[str], + tags: typing.Optional[typing.Sequence[str]] = OMIT, + expiration_date: typing.Optional[dt.datetime] = OMIT, + time_to_live_in_seconds: typing.Optional[float] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CreateKeyV1Response: """ @@ -266,7 +291,15 @@ async def create( project_id : str The unique identifier of the project - request : CreateKeyV1RequestParams + comment : str + + scopes : typing.Sequence[str] + + tags : typing.Optional[typing.Sequence[str]] + + expiration_date : typing.Optional[dt.datetime] + + time_to_live_in_seconds : typing.Optional[float] request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -289,14 +322,23 @@ async def create( async def main() -> None: await client.manage.v1.projects.keys.create( - project_id="project_id", - request={"key": "value"}, + project_id="123456-7890-1234-5678-901234", + comment="A comment", + scopes=["admin"], ) asyncio.run(main()) """ - _response = await self._raw_client.create(project_id, request=request, request_options=request_options) + _response = await self._raw_client.create( + project_id, + comment=comment, + scopes=scopes, + tags=tags, + expiration_date=expiration_date, + time_to_live_in_seconds=time_to_live_in_seconds, + request_options=request_options, + ) return _response.data async def get( diff --git a/src/deepgram/manage/v1/projects/keys/raw_client.py b/src/deepgram/manage/v1/projects/keys/raw_client.py index 7b03a892..18fbf804 100644 --- a/src/deepgram/manage/v1/projects/keys/raw_client.py +++ b/src/deepgram/manage/v1/projects/keys/raw_client.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import datetime as dt import typing from json.decoder import JSONDecodeError @@ -9,10 +10,8 @@ from .....core.jsonable_encoder import encode_path_param from .....core.parse_error import ParsingError from .....core.request_options import RequestOptions -from .....core.serialization import convert_and_respect_annotation_metadata from .....core.unchecked_base_model import construct_type from .....errors.bad_request_error import BadRequestError -from .....requests.create_key_v1request import CreateKeyV1RequestParams from .....types.create_key_v1response import CreateKeyV1Response from .....types.delete_project_key_v1response import DeleteProjectKeyV1Response from .....types.get_project_key_v1response import GetProjectKeyV1Response @@ -97,7 +96,11 @@ def create( self, project_id: str, *, - request: CreateKeyV1RequestParams, + comment: str, + scopes: typing.Sequence[str], + tags: typing.Optional[typing.Sequence[str]] = OMIT, + expiration_date: typing.Optional[dt.datetime] = OMIT, + time_to_live_in_seconds: typing.Optional[float] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[CreateKeyV1Response]: """ @@ -108,7 +111,15 @@ def create( project_id : str The unique identifier of the project - request : CreateKeyV1RequestParams + comment : str + + scopes : typing.Sequence[str] + + tags : typing.Optional[typing.Sequence[str]] + + expiration_date : typing.Optional[dt.datetime] + + time_to_live_in_seconds : typing.Optional[float] request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -122,9 +133,16 @@ def create( f"v1/projects/{encode_path_param(project_id)}/keys", base_url=self._client_wrapper.get_environment().base, method="POST", - json=convert_and_respect_annotation_metadata( - object_=request, annotation=CreateKeyV1RequestParams, direction="write" - ), + json={ + "comment": comment, + "scopes": scopes, + "tags": tags, + "expiration_date": expiration_date, + "time_to_live_in_seconds": time_to_live_in_seconds, + }, + headers={ + "content-type": "application/json", + }, request_options=request_options, omit=OMIT, ) @@ -348,7 +366,11 @@ async def create( self, project_id: str, *, - request: CreateKeyV1RequestParams, + comment: str, + scopes: typing.Sequence[str], + tags: typing.Optional[typing.Sequence[str]] = OMIT, + expiration_date: typing.Optional[dt.datetime] = OMIT, + time_to_live_in_seconds: typing.Optional[float] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[CreateKeyV1Response]: """ @@ -359,7 +381,15 @@ async def create( project_id : str The unique identifier of the project - request : CreateKeyV1RequestParams + comment : str + + scopes : typing.Sequence[str] + + tags : typing.Optional[typing.Sequence[str]] + + expiration_date : typing.Optional[dt.datetime] + + time_to_live_in_seconds : typing.Optional[float] request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -373,9 +403,16 @@ async def create( f"v1/projects/{encode_path_param(project_id)}/keys", base_url=self._client_wrapper.get_environment().base, method="POST", - json=convert_and_respect_annotation_metadata( - object_=request, annotation=CreateKeyV1RequestParams, direction="write" - ), + json={ + "comment": comment, + "scopes": scopes, + "tags": tags, + "expiration_date": expiration_date, + "time_to_live_in_seconds": time_to_live_in_seconds, + }, + headers={ + "content-type": "application/json", + }, request_options=request_options, omit=OMIT, ) diff --git a/src/deepgram/requests/__init__.py b/src/deepgram/requests/__init__.py index beb2e2db..c75e91f6 100644 --- a/src/deepgram/requests/__init__.py +++ b/src/deepgram/requests/__init__.py @@ -27,7 +27,6 @@ from .cartesia import CartesiaParams from .cartesia_voice import CartesiaVoiceParams from .create_agent_configuration_v1response import CreateAgentConfigurationV1ResponseParams - from .create_key_v1request import CreateKeyV1RequestParams from .create_key_v1response import CreateKeyV1ResponseParams from .create_project_distribution_credentials_v1response import CreateProjectDistributionCredentialsV1ResponseParams from .create_project_distribution_credentials_v1response_distribution_credentials import ( @@ -153,6 +152,7 @@ ) from .listen_v2keyterm import ListenV2KeytermParams from .listen_v2language_hint import ListenV2LanguageHintParams + from .nvidia import NvidiaParams from .open_ai_speak_provider import OpenAiSpeakProviderParams from .open_ai_think_provider import OpenAiThinkProviderParams from .project_request_response import ProjectRequestResponseParams @@ -203,6 +203,7 @@ ThinkSettingsV1Provider_DeepgramParams, ThinkSettingsV1Provider_GoogleParams, ThinkSettingsV1Provider_GroqParams, + ThinkSettingsV1Provider_NvidiaParams, ThinkSettingsV1Provider_OpenAiParams, ) from .update_project_member_scopes_v1response import UpdateProjectMemberScopesV1ResponseParams @@ -237,7 +238,6 @@ "CartesiaParams": ".cartesia", "CartesiaVoiceParams": ".cartesia_voice", "CreateAgentConfigurationV1ResponseParams": ".create_agent_configuration_v1response", - "CreateKeyV1RequestParams": ".create_key_v1request", "CreateKeyV1ResponseParams": ".create_key_v1response", "CreateProjectDistributionCredentialsV1ResponseDistributionCredentialsParams": ".create_project_distribution_credentials_v1response_distribution_credentials", "CreateProjectDistributionCredentialsV1ResponseMemberParams": ".create_project_distribution_credentials_v1response_member", @@ -329,6 +329,7 @@ "ListenV1ResponseResultsUtterancesParams": ".listen_v1response_results_utterances", "ListenV2KeytermParams": ".listen_v2keyterm", "ListenV2LanguageHintParams": ".listen_v2language_hint", + "NvidiaParams": ".nvidia", "OpenAiSpeakProviderParams": ".open_ai_speak_provider", "OpenAiThinkProviderParams": ".open_ai_think_provider", "ProjectRequestResponseParams": ".project_request_response", @@ -376,6 +377,7 @@ "ThinkSettingsV1Provider_DeepgramParams": ".think_settings_v1provider", "ThinkSettingsV1Provider_GoogleParams": ".think_settings_v1provider", "ThinkSettingsV1Provider_GroqParams": ".think_settings_v1provider", + "ThinkSettingsV1Provider_NvidiaParams": ".think_settings_v1provider", "ThinkSettingsV1Provider_OpenAiParams": ".think_settings_v1provider", "UpdateProjectMemberScopesV1ResponseParams": ".update_project_member_scopes_v1response", "UpdateProjectV1ResponseParams": ".update_project_v1response", @@ -389,22 +391,6 @@ "UsageV1ResponseResolutionParams": ".usage_v1response_resolution", } -_dynamic_imports.update( - { - "SharedIntentsResultsParams": ".shared_intents_results", - "SharedIntentsResultsIntentsParams": ".shared_intents_results_intents", - "SharedIntentsResultsIntentsSegmentsItemParams": ".shared_intents_results_intents_segments_item", - "SharedIntentsResultsIntentsSegmentsItemIntentsItemParams": ".shared_intents_results_intents_segments_item_intents_item", - "SharedTopicsResultsParams": ".shared_topics_results", - "SharedTopicsResultsTopicsParams": ".shared_topics_results_topics", - "SharedTopicsResultsTopicsSegmentsItemParams": ".shared_topics_results_topics_segments_item", - "SharedTopicsResultsTopicsSegmentsItemTopicsItemParams": ".shared_topics_results_topics_segments_item_topics_item", - "CartesiaSpeakProviderVoiceParams": ".cartesia_speak_provider_voice", - "CreateKeyV1RequestOneParams": ".create_key_v1request_one", - "DeepgramListenProviderV2LanguageHintParams": ".deepgram_listen_provider_v2language_hint", - } -) - def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) @@ -449,7 +435,6 @@ def __dir__(): "CartesiaParams", "CartesiaVoiceParams", "CreateAgentConfigurationV1ResponseParams", - "CreateKeyV1RequestParams", "CreateKeyV1ResponseParams", "CreateProjectDistributionCredentialsV1ResponseDistributionCredentialsParams", "CreateProjectDistributionCredentialsV1ResponseMemberParams", @@ -541,6 +526,7 @@ def __dir__(): "ListenV1ResponseResultsUtterancesParams", "ListenV2KeytermParams", "ListenV2LanguageHintParams", + "NvidiaParams", "OpenAiSpeakProviderParams", "OpenAiThinkProviderParams", "ProjectRequestResponseParams", @@ -588,6 +574,7 @@ def __dir__(): "ThinkSettingsV1Provider_DeepgramParams", "ThinkSettingsV1Provider_GoogleParams", "ThinkSettingsV1Provider_GroqParams", + "ThinkSettingsV1Provider_NvidiaParams", "ThinkSettingsV1Provider_OpenAiParams", "UpdateProjectMemberScopesV1ResponseParams", "UpdateProjectV1ResponseParams", @@ -600,19 +587,3 @@ def __dir__(): "UsageV1ResponseParams", "UsageV1ResponseResolutionParams", ] - -__all__.extend( - [ - "SharedIntentsResultsParams", - "SharedIntentsResultsIntentsParams", - "SharedIntentsResultsIntentsSegmentsItemParams", - "SharedIntentsResultsIntentsSegmentsItemIntentsItemParams", - "SharedTopicsResultsParams", - "SharedTopicsResultsTopicsParams", - "SharedTopicsResultsTopicsSegmentsItemParams", - "SharedTopicsResultsTopicsSegmentsItemTopicsItemParams", - "CartesiaSpeakProviderVoiceParams", - "CreateKeyV1RequestOneParams", - "DeepgramListenProviderV2LanguageHintParams", - ] -) diff --git a/src/deepgram/requests/create_key_v1request.py b/src/deepgram/requests/create_key_v1request.py deleted file mode 100644 index 39196158..00000000 --- a/src/deepgram/requests/create_key_v1request.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -CreateKeyV1RequestParams = typing.Union[typing.Any] diff --git a/src/deepgram/requests/nvidia.py b/src/deepgram/requests/nvidia.py new file mode 100644 index 00000000..bf8a7c16 --- /dev/null +++ b/src/deepgram/requests/nvidia.py @@ -0,0 +1,29 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import typing_extensions +from ..types.nvidia_reasoning_mode import NvidiaReasoningMode + + +class NvidiaParams(typing_extensions.TypedDict): + type: typing.Literal["nvidia"] + version: typing_extensions.NotRequired[typing.Literal["v1"]] + """ + The REST API version for NVIDIA's chat completions API (OpenAI-compatible) + """ + + model: str + """ + NVIDIA model to use. The Deepgram-managed model is nvidia/nemotron-3.5-lightning-30b-a3b; GET /v1/agent/settings/think/models lists the public provider and model catalog. With a custom endpoint, use any model that endpoint serves. + """ + + temperature: typing_extensions.NotRequired[float] + """ + NVIDIA temperature (0-2) + """ + + reasoning_mode: typing_extensions.NotRequired[NvidiaReasoningMode] + """ + Sent to the model as reasoning_effort. Use it only with models that support reasoning effort + """ diff --git a/src/deepgram/requests/shared_intents.py b/src/deepgram/requests/shared_intents.py index 8f699d26..7a618c13 100644 --- a/src/deepgram/requests/shared_intents.py +++ b/src/deepgram/requests/shared_intents.py @@ -3,7 +3,6 @@ import typing import typing_extensions -from .shared_intents_results import SharedIntentsResultsParams from .shared_intents_segments_item import SharedIntentsSegmentsItemParams @@ -13,4 +12,3 @@ class SharedIntentsParams(typing_extensions.TypedDict): """ segments: typing_extensions.NotRequired[typing.Sequence[SharedIntentsSegmentsItemParams]] - results: typing_extensions.NotRequired[SharedIntentsResultsParams] diff --git a/src/deepgram/requests/shared_topics.py b/src/deepgram/requests/shared_topics.py index 88c0816d..4965005e 100644 --- a/src/deepgram/requests/shared_topics.py +++ b/src/deepgram/requests/shared_topics.py @@ -3,7 +3,6 @@ import typing import typing_extensions -from .shared_topics_results import SharedTopicsResultsParams from .shared_topics_segments_item import SharedTopicsSegmentsItemParams @@ -13,4 +12,3 @@ class SharedTopicsParams(typing_extensions.TypedDict): """ segments: typing_extensions.NotRequired[typing.Sequence[SharedTopicsSegmentsItemParams]] - results: typing_extensions.NotRequired[SharedTopicsResultsParams] diff --git a/src/deepgram/requests/think_settings_v1.py b/src/deepgram/requests/think_settings_v1.py index 260b488d..211bf0a4 100644 --- a/src/deepgram/requests/think_settings_v1.py +++ b/src/deepgram/requests/think_settings_v1.py @@ -13,7 +13,7 @@ class ThinkSettingsV1Params(typing_extensions.TypedDict): provider: ThinkSettingsV1ProviderParams endpoint: typing_extensions.NotRequired[ThinkSettingsV1EndpointParams] """ - Optional for non-Deepgram LLM providers. When present, must include url field and headers object + Omit for deepgram: a deepgram provider with an endpoint is rejected with INVALID_SETTINGS. Optional for open_ai, anthropic, google, groq, and nvidia, where Deepgram provides managed LLMs. Required for aws_bedrock. When present, must include url; headers is optional """ functions: typing_extensions.NotRequired[typing.Sequence[ThinkSettingsV1FunctionsItemParams]] diff --git a/src/deepgram/requests/think_settings_v1endpoint.py b/src/deepgram/requests/think_settings_v1endpoint.py index 38e2f34a..944c1989 100644 --- a/src/deepgram/requests/think_settings_v1endpoint.py +++ b/src/deepgram/requests/think_settings_v1endpoint.py @@ -7,7 +7,7 @@ class ThinkSettingsV1EndpointParams(typing_extensions.TypedDict): """ - Optional for non-Deepgram LLM providers. When present, must include url field and headers object + Omit for deepgram: a deepgram provider with an endpoint is rejected with INVALID_SETTINGS. Optional for open_ai, anthropic, google, groq, and nvidia, where Deepgram provides managed LLMs. Required for aws_bedrock. When present, must include url; headers is optional """ url: typing_extensions.NotRequired[str] diff --git a/src/deepgram/requests/think_settings_v1provider.py b/src/deepgram/requests/think_settings_v1provider.py index 36bd5207..109a3c73 100644 --- a/src/deepgram/requests/think_settings_v1provider.py +++ b/src/deepgram/requests/think_settings_v1provider.py @@ -12,6 +12,7 @@ from ..types.google_model import GoogleModel from ..types.google_version import GoogleVersion from ..types.groq_reasoning_mode import GroqReasoningMode +from ..types.nvidia_reasoning_mode import NvidiaReasoningMode from ..types.open_ai_think_provider_model import OpenAiThinkProviderModel from ..types.open_ai_think_provider_reasoning_mode import OpenAiThinkProviderReasoningMode from .aws_bedrock_think_provider_credentials import AwsBedrockThinkProviderCredentialsParams @@ -54,6 +55,14 @@ class ThinkSettingsV1Provider_GroqParams(typing_extensions.TypedDict): reasoning_mode: typing_extensions.NotRequired[GroqReasoningMode] +class ThinkSettingsV1Provider_NvidiaParams(typing_extensions.TypedDict): + type: typing.Literal["nvidia"] + version: typing_extensions.NotRequired[typing.Literal["v1"]] + model: str + temperature: typing_extensions.NotRequired[float] + reasoning_mode: typing_extensions.NotRequired[NvidiaReasoningMode] + + class ThinkSettingsV1Provider_DeepgramParams(typing_extensions.TypedDict): type: typing.Literal["deepgram"] model: DeepgramThinkProviderModel @@ -69,5 +78,6 @@ class ThinkSettingsV1Provider_DeepgramParams(typing_extensions.TypedDict): ThinkSettingsV1Provider_AnthropicParams, ThinkSettingsV1Provider_GoogleParams, ThinkSettingsV1Provider_GroqParams, + ThinkSettingsV1Provider_NvidiaParams, ThinkSettingsV1Provider_DeepgramParams, ] diff --git a/src/deepgram/speak/v1/socket_client.py b/src/deepgram/speak/v1/socket_client.py index f268acb4..5de6cd20 100644 --- a/src/deepgram/speak/v1/socket_client.py +++ b/src/deepgram/speak/v1/socket_client.py @@ -3,7 +3,9 @@ import json import logging import typing +from json.decoder import JSONDecodeError +import websockets import websockets.sync.connection as websockets_sync_connection from ...core.events import EventEmitterMixin, EventType from ...core.unchecked_base_model import construct_type @@ -22,9 +24,7 @@ from websockets import WebSocketClientProtocol # type: ignore _logger = logging.getLogger(__name__) -V1SocketClientResponse = typing.Union[ - bytes, SpeakV1Metadata, SpeakV1Flushed, SpeakV1Cleared, SpeakV1Warning, typing.Dict[str, typing.Any] -] +V1SocketClientResponse = typing.Union[bytes, SpeakV1Metadata, SpeakV1Flushed, SpeakV1Cleared, SpeakV1Warning] class AsyncV1SocketClient(EventEmitterMixin): @@ -70,7 +70,7 @@ async def start_listening(self): ) continue await self._emit_async(EventType.MESSAGE, parsed) - except Exception as exc: + except (websockets.WebSocketException, JSONDecodeError) as exc: await self._emit_async(EventType.ERROR, exc) finally: await self._emit_async(EventType.CLOSE, None) @@ -82,26 +82,26 @@ async def send_text(self, message: SpeakV1Text) -> None: """ await self._send_model(message) - async def send_flush(self, message: typing.Optional[SpeakV1Flush] = None) -> None: + async def send_flush(self, message: SpeakV1Flush) -> None: """ Send a message to the websocket connection. The message will be sent as a SpeakV1Flush. """ - await self._send_model(message or SpeakV1Flush(type="Flush")) + await self._send_model(message) - async def send_clear(self, message: typing.Optional[SpeakV1Clear] = None) -> None: + async def send_clear(self, message: SpeakV1Clear) -> None: """ Send a message to the websocket connection. The message will be sent as a SpeakV1Clear. """ - await self._send_model(message or SpeakV1Clear(type="Clear")) + await self._send_model(message) - async def send_close(self, message: typing.Optional[SpeakV1Close] = None) -> None: + async def send_close(self, message: SpeakV1Close) -> None: """ Send a message to the websocket connection. The message will be sent as a SpeakV1Close. """ - await self._send_model(message or SpeakV1Close(type="Close")) + await self._send_model(message) async def recv(self) -> V1SocketClientResponse: """ @@ -175,7 +175,7 @@ def start_listening(self): ) continue self._emit(EventType.MESSAGE, parsed) - except Exception as exc: + except (websockets.WebSocketException, JSONDecodeError) as exc: self._emit(EventType.ERROR, exc) finally: self._emit(EventType.CLOSE, None) @@ -187,26 +187,26 @@ def send_text(self, message: SpeakV1Text) -> None: """ self._send_model(message) - def send_flush(self, message: typing.Optional[SpeakV1Flush] = None) -> None: + def send_flush(self, message: SpeakV1Flush) -> None: """ Send a message to the websocket connection. The message will be sent as a SpeakV1Flush. """ - self._send_model(message or SpeakV1Flush(type="Flush")) + self._send_model(message) - def send_clear(self, message: typing.Optional[SpeakV1Clear] = None) -> None: + def send_clear(self, message: SpeakV1Clear) -> None: """ Send a message to the websocket connection. The message will be sent as a SpeakV1Clear. """ - self._send_model(message or SpeakV1Clear(type="Clear")) + self._send_model(message) - def send_close(self, message: typing.Optional[SpeakV1Close] = None) -> None: + def send_close(self, message: SpeakV1Close) -> None: """ Send a message to the websocket connection. The message will be sent as a SpeakV1Close. """ - self._send_model(message or SpeakV1Close(type="Close")) + self._send_model(message) def recv(self) -> V1SocketClientResponse: """ diff --git a/src/deepgram/speak/v2/requests/speak_v2warning.py b/src/deepgram/speak/v2/requests/speak_v2warning.py index 6686af44..e16df4d6 100644 --- a/src/deepgram/speak/v2/requests/speak_v2warning.py +++ b/src/deepgram/speak/v2/requests/speak_v2warning.py @@ -14,13 +14,13 @@ class SpeakV2WarningParams(typing_extensions.TypedDict): code: str """ Warning code identifying the condition, in `SCREAMING_SNAKE_CASE`. - + Turn-scoped codes: `NO_ACTIVE_SPEECH` (a speech-scoped message arrived with no active turn), `NO_SYNTHESIZABLE_TEXT` (the turn's text was entirely whitespace or punctuation, so it produced no audio and is completed with a zero-duration `SpeechMetadata`), and `SYNTHESIS_RETRYING` (a synthesis request failed and is being retried). - + Pronunciation codes: `PRONUNCIATION_WARNINGS` (a pronunciation override contained invalid IPA; it is still applied best-effort and counted in `pronunciations_applied`), `PRONUNCIATION_TOO_LONG` (an IPA string exceeded the length limit), `PRONUNCIATIONS_LIMIT_EXCEEDED` (too many pronunciation controls in one turn). - + Pause codes (`BREAKS_LIMIT_EXCEEDED`, `BREAK_TOKENS_OUT_OF_RANGE`, `BREAK_TOKENS_WITH_INVALID_INCREMENTS`) are reserved and not emitted: inline pause controls are batch-only, and a pause marker on the WebSocket fails the connection instead. - + Interrupt-scoped codes, each meaning the `Interrupt` was ignored: `NO_AUDIO_GENERATED` (the session has produced no audio yet, so there is nothing to interrupt), `INTERRUPT_IN_PROGRESS` (an earlier `Interrupt` is still being processed — at most one is handled at a time), `INVALID_INTERRUPT_OFFSET` (the `playback_offset` did not advance past the position a prior interrupt established). """ diff --git a/src/deepgram/speak/v2/socket_client.py b/src/deepgram/speak/v2/socket_client.py index 57c5f8ab..9e91bfff 100644 --- a/src/deepgram/speak/v2/socket_client.py +++ b/src/deepgram/speak/v2/socket_client.py @@ -3,7 +3,9 @@ import json import logging import typing +from json.decoder import JSONDecodeError +import websockets import websockets.sync.connection as websockets_sync_connection from ...core.events import EventEmitterMixin, EventType from ...core.unchecked_base_model import construct_type @@ -41,7 +43,6 @@ SpeakV2ConfigureFailure, SpeakV2Warning, SpeakV2Error, - typing.Dict[str, typing.Any], ] @@ -88,7 +89,7 @@ async def start_listening(self): ) continue await self._emit_async(EventType.MESSAGE, parsed) - except Exception as exc: + except (websockets.WebSocketException, JSONDecodeError) as exc: await self._emit_async(EventType.ERROR, exc) finally: await self._emit_async(EventType.CLOSE, None) @@ -100,19 +101,19 @@ async def send_speak(self, message: SpeakV2Speak) -> None: """ await self._send_model(message) - async def send_flush(self, message: typing.Optional[SpeakV2Flush] = None) -> None: + async def send_flush(self, message: SpeakV2Flush) -> None: """ Send a message to the websocket connection. The message will be sent as a SpeakV2Flush. """ - await self._send_model(message or SpeakV2Flush(type="Flush")) + await self._send_model(message) - async def send_interrupt(self, message: typing.Optional[SpeakV2Interrupt] = None) -> None: + async def send_interrupt(self, message: SpeakV2Interrupt) -> None: """ Send a message to the websocket connection. The message will be sent as a SpeakV2Interrupt. """ - await self._send_model(message or SpeakV2Interrupt(type="Interrupt")) + await self._send_model(message) async def send_configure(self, message: SpeakV2Configure) -> None: """ @@ -121,12 +122,12 @@ async def send_configure(self, message: SpeakV2Configure) -> None: """ await self._send_model(message) - async def send_close(self, message: typing.Optional[SpeakV2Close] = None) -> None: + async def send_close(self, message: SpeakV2Close) -> None: """ Send a message to the websocket connection. The message will be sent as a SpeakV2Close. """ - await self._send_model(message or SpeakV2Close(type="Close")) + await self._send_model(message) async def recv(self) -> V2SocketClientResponse: """ @@ -200,7 +201,7 @@ def start_listening(self): ) continue self._emit(EventType.MESSAGE, parsed) - except Exception as exc: + except (websockets.WebSocketException, JSONDecodeError) as exc: self._emit(EventType.ERROR, exc) finally: self._emit(EventType.CLOSE, None) @@ -212,19 +213,19 @@ def send_speak(self, message: SpeakV2Speak) -> None: """ self._send_model(message) - def send_flush(self, message: typing.Optional[SpeakV2Flush] = None) -> None: + def send_flush(self, message: SpeakV2Flush) -> None: """ Send a message to the websocket connection. The message will be sent as a SpeakV2Flush. """ - self._send_model(message or SpeakV2Flush(type="Flush")) + self._send_model(message) - def send_interrupt(self, message: typing.Optional[SpeakV2Interrupt] = None) -> None: + def send_interrupt(self, message: SpeakV2Interrupt) -> None: """ Send a message to the websocket connection. The message will be sent as a SpeakV2Interrupt. """ - self._send_model(message or SpeakV2Interrupt(type="Interrupt")) + self._send_model(message) def send_configure(self, message: SpeakV2Configure) -> None: """ @@ -233,12 +234,12 @@ def send_configure(self, message: SpeakV2Configure) -> None: """ self._send_model(message) - def send_close(self, message: typing.Optional[SpeakV2Close] = None) -> None: + def send_close(self, message: SpeakV2Close) -> None: """ Send a message to the websocket connection. The message will be sent as a SpeakV2Close. """ - self._send_model(message or SpeakV2Close(type="Close")) + self._send_model(message) def recv(self) -> V2SocketClientResponse: """ diff --git a/src/deepgram/speak/v2/types/speak_v2warning.py b/src/deepgram/speak/v2/types/speak_v2warning.py index ac771641..e142f323 100644 --- a/src/deepgram/speak/v2/types/speak_v2warning.py +++ b/src/deepgram/speak/v2/types/speak_v2warning.py @@ -16,13 +16,13 @@ class SpeakV2Warning(UncheckedBaseModel): code: str = pydantic.Field() """ Warning code identifying the condition, in `SCREAMING_SNAKE_CASE`. - + Turn-scoped codes: `NO_ACTIVE_SPEECH` (a speech-scoped message arrived with no active turn), `NO_SYNTHESIZABLE_TEXT` (the turn's text was entirely whitespace or punctuation, so it produced no audio and is completed with a zero-duration `SpeechMetadata`), and `SYNTHESIS_RETRYING` (a synthesis request failed and is being retried). - + Pronunciation codes: `PRONUNCIATION_WARNINGS` (a pronunciation override contained invalid IPA; it is still applied best-effort and counted in `pronunciations_applied`), `PRONUNCIATION_TOO_LONG` (an IPA string exceeded the length limit), `PRONUNCIATIONS_LIMIT_EXCEEDED` (too many pronunciation controls in one turn). - + Pause codes (`BREAKS_LIMIT_EXCEEDED`, `BREAK_TOKENS_OUT_OF_RANGE`, `BREAK_TOKENS_WITH_INVALID_INCREMENTS`) are reserved and not emitted: inline pause controls are batch-only, and a pause marker on the WebSocket fails the connection instead. - + Interrupt-scoped codes, each meaning the `Interrupt` was ignored: `NO_AUDIO_GENERATED` (the session has produced no audio yet, so there is nothing to interrupt), `INTERRUPT_IN_PROGRESS` (an earlier `Interrupt` is still being processed — at most one is handled at a time), `INVALID_INTERRUPT_OFFSET` (the `playback_offset` did not advance past the position a prior interrupt established). """ diff --git a/src/deepgram/types/__init__.py b/src/deepgram/types/__init__.py index 3c76081d..31002506 100644 --- a/src/deepgram/types/__init__.py +++ b/src/deepgram/types/__init__.py @@ -37,7 +37,6 @@ from .cartesia_model_id import CartesiaModelId from .cartesia_voice import CartesiaVoice from .create_agent_configuration_v1response import CreateAgentConfigurationV1Response - from .create_key_v1request import CreateKeyV1Request from .create_key_v1response import CreateKeyV1Response from .create_project_distribution_credentials_v1response import CreateProjectDistributionCredentialsV1Response from .create_project_distribution_credentials_v1response_distribution_credentials import ( @@ -216,6 +215,8 @@ from .listen_v2redact_usage import ListenV2RedactUsage from .listen_v2sample_rate import ListenV2SampleRate from .listen_v2tag import ListenV2Tag + from .nvidia import Nvidia + from .nvidia_reasoning_mode import NvidiaReasoningMode from .open_ai_speak_provider import OpenAiSpeakProvider from .open_ai_speak_provider_model import OpenAiSpeakProviderModel from .open_ai_speak_provider_voice import OpenAiSpeakProviderVoice @@ -286,6 +287,7 @@ ThinkSettingsV1Provider_Deepgram, ThinkSettingsV1Provider_Google, ThinkSettingsV1Provider_Groq, + ThinkSettingsV1Provider_Nvidia, ThinkSettingsV1Provider_OpenAi, ) from .update_project_member_scopes_v1response import UpdateProjectMemberScopesV1Response @@ -330,7 +332,6 @@ "CartesiaModelId": ".cartesia_model_id", "CartesiaVoice": ".cartesia_voice", "CreateAgentConfigurationV1Response": ".create_agent_configuration_v1response", - "CreateKeyV1Request": ".create_key_v1request", "CreateKeyV1Response": ".create_key_v1response", "CreateProjectDistributionCredentialsV1Response": ".create_project_distribution_credentials_v1response", "CreateProjectDistributionCredentialsV1ResponseDistributionCredentials": ".create_project_distribution_credentials_v1response_distribution_credentials", @@ -477,6 +478,8 @@ "ListenV2RedactUsage": ".listen_v2redact_usage", "ListenV2SampleRate": ".listen_v2sample_rate", "ListenV2Tag": ".listen_v2tag", + "Nvidia": ".nvidia", + "NvidiaReasoningMode": ".nvidia_reasoning_mode", "OpenAiSpeakProvider": ".open_ai_speak_provider", "OpenAiSpeakProviderModel": ".open_ai_speak_provider_model", "OpenAiSpeakProviderVoice": ".open_ai_speak_provider_voice", @@ -544,6 +547,7 @@ "ThinkSettingsV1Provider_Deepgram": ".think_settings_v1provider", "ThinkSettingsV1Provider_Google": ".think_settings_v1provider", "ThinkSettingsV1Provider_Groq": ".think_settings_v1provider", + "ThinkSettingsV1Provider_Nvidia": ".think_settings_v1provider", "ThinkSettingsV1Provider_OpenAi": ".think_settings_v1provider", "UpdateProjectMemberScopesV1Response": ".update_project_member_scopes_v1response", "UpdateProjectV1Response": ".update_project_v1response", @@ -557,28 +561,6 @@ "UsageV1ResponseResolution": ".usage_v1response_resolution", } -_dynamic_imports.update( - { - "SharedIntentsResults": ".shared_intents_results", - "SharedIntentsResultsIntents": ".shared_intents_results_intents", - "SharedIntentsResultsIntentsSegmentsItem": ".shared_intents_results_intents_segments_item", - "SharedIntentsResultsIntentsSegmentsItemIntentsItem": ".shared_intents_results_intents_segments_item_intents_item", - "SharedTopicsResults": ".shared_topics_results", - "SharedTopicsResultsTopics": ".shared_topics_results_topics", - "SharedTopicsResultsTopicsSegmentsItem": ".shared_topics_results_topics_segments_item", - "SharedTopicsResultsTopicsSegmentsItemTopicsItem": ".shared_topics_results_topics_segments_item_topics_item", - "AnthropicThinkProviderModel": ".anthropic_think_provider_model", - "CartesiaSpeakProviderModelId": ".cartesia_speak_provider_model_id", - "CartesiaSpeakProviderVoice": ".cartesia_speak_provider_voice", - "CreateKeyV1RequestOne": ".create_key_v1request_one", - "DeepgramListenProviderV2LanguageHint": ".deepgram_listen_provider_v2language_hint", - "DeepgramSpeakProviderModel": ".deepgram_speak_provider_model", - "GoogleThinkProviderModel": ".google_think_provider_model", - "GoogleThinkProviderVersion": ".google_think_provider_version", - "GroqThinkProviderReasoningMode": ".groq_think_provider_reasoning_mode", - } -) - def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) @@ -633,7 +615,6 @@ def __dir__(): "CartesiaModelId", "CartesiaVoice", "CreateAgentConfigurationV1Response", - "CreateKeyV1Request", "CreateKeyV1Response", "CreateProjectDistributionCredentialsV1Response", "CreateProjectDistributionCredentialsV1ResponseDistributionCredentials", @@ -780,6 +761,8 @@ def __dir__(): "ListenV2RedactUsage", "ListenV2SampleRate", "ListenV2Tag", + "Nvidia", + "NvidiaReasoningMode", "OpenAiSpeakProvider", "OpenAiSpeakProviderModel", "OpenAiSpeakProviderVoice", @@ -847,6 +830,7 @@ def __dir__(): "ThinkSettingsV1Provider_Deepgram", "ThinkSettingsV1Provider_Google", "ThinkSettingsV1Provider_Groq", + "ThinkSettingsV1Provider_Nvidia", "ThinkSettingsV1Provider_OpenAi", "UpdateProjectMemberScopesV1Response", "UpdateProjectV1Response", @@ -859,25 +843,3 @@ def __dir__(): "UsageV1Response", "UsageV1ResponseResolution", ] - -__all__.extend( - [ - "SharedIntentsResults", - "SharedIntentsResultsIntents", - "SharedIntentsResultsIntentsSegmentsItem", - "SharedIntentsResultsIntentsSegmentsItemIntentsItem", - "SharedTopicsResults", - "SharedTopicsResultsTopics", - "SharedTopicsResultsTopicsSegmentsItem", - "SharedTopicsResultsTopicsSegmentsItemTopicsItem", - "AnthropicThinkProviderModel", - "CartesiaSpeakProviderModelId", - "CartesiaSpeakProviderVoice", - "CreateKeyV1RequestOne", - "DeepgramListenProviderV2LanguageHint", - "DeepgramSpeakProviderModel", - "GoogleThinkProviderModel", - "GoogleThinkProviderVersion", - "GroqThinkProviderReasoningMode", - ] -) diff --git a/src/deepgram/types/create_key_v1request.py b/src/deepgram/types/create_key_v1request.py deleted file mode 100644 index 6e566877..00000000 --- a/src/deepgram/types/create_key_v1request.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -CreateKeyV1Request = typing.Union[typing.Any] diff --git a/src/deepgram/types/deepgram.py b/src/deepgram/types/deepgram.py index 994f7a2c..ec242762 100644 --- a/src/deepgram/types/deepgram.py +++ b/src/deepgram/types/deepgram.py @@ -29,7 +29,7 @@ class Deepgram(UncheckedBaseModel): Speaking rate multiplier that adjusts the pace of generated speech while preserving natural prosody and voice quality. Aura (version v1) accepts any value from 0.7 to 1.5. Flux TTS (version v2) accepts values from 0.5 to 1.5 in 0.05 increments; a value the family does not accept ends the session with FAILED_TO_SPEAK. Not yet supported in all languages. """ - expressivity: typing.Optional[pydantic.StrictInt] = pydantic.Field(default=None) + expressivity: typing.Optional[int] = pydantic.Field(default=None) """ Delivery register of the generated speech, on a calm-to-animated axis. Flux TTS (version v2) only, on every Flux voice. Accepts the whole numbers -2 to 2, where 0 (the default) is the voice's tuned delivery and the only value validated for production, -2 the calm end of the range and 2 the animated end. Fixed for the session. Beta: behavior may change in future model versions, and non-default values increase the risk of hallucinations and pronunciation errors. See [Expressivity](/docs/tts-expressivity). """ diff --git a/src/deepgram/types/deepgram_listen_provider_v2.py b/src/deepgram/types/deepgram_listen_provider_v2.py index d24729a0..f7a155fb 100644 --- a/src/deepgram/types/deepgram_listen_provider_v2.py +++ b/src/deepgram/types/deepgram_listen_provider_v2.py @@ -28,12 +28,6 @@ class DeepgramListenProviderV2(UncheckedBaseModel): An array of one or more BCP-47 language codes to bias the model toward specific languages. Only supported when model is flux-general-multi. Without hints, the model auto-detects the spoken language. See the Language Prompting guide for details. """ - language_hint: typing.Optional[typing.Union[str, typing.List[str]]] = pydantic.Field(default=None, exclude=True) - """ - Deprecated. Use `language_hints`. Accepted for backward compatibility and - remapped before serialization so the singular field never reaches the API. - """ - eot_threshold: typing.Optional[float] = pydantic.Field(default=None) """ End-of-turn confidence required to finish a turn. Valid range: 0.5 - 1.0. Defaults to 0.7. Set to 1.0 to fully suppress confidence-based end-of-turn detection. `eot_timeout_ms` still ends idle turns; increase it when using ForceEndTurn for full manual turn control. @@ -55,31 +49,9 @@ class DeepgramListenProviderV2(UncheckedBaseModel): """ if IS_PYDANTIC_V2: - - @pydantic.model_validator(mode="before") - @classmethod - def _migrate_language_hint(cls, values: typing.Any) -> typing.Any: - if not isinstance(values, dict) or "language_hint" not in values: - return values - values = dict(values) - hint = values.pop("language_hint") - if hint is not None and values.get("language_hints") is None: - values["language_hints"] = [hint] if isinstance(hint, str) else list(hint) - return values - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: - @pydantic.root_validator(pre=True) # type: ignore[deprecated] - def _migrate_language_hint(cls, values: typing.Any) -> typing.Any: # type: ignore[no-redef] - if not isinstance(values, dict) or "language_hint" not in values: - return values - values = dict(values) - hint = values.pop("language_hint") - if hint is not None and values.get("language_hints") is None: - values["language_hints"] = [hint] if isinstance(hint, str) else list(hint) - return values - class Config: frozen = True smart_union = True diff --git a/src/deepgram/types/nvidia.py b/src/deepgram/types/nvidia.py new file mode 100644 index 00000000..ca983bf8 --- /dev/null +++ b/src/deepgram/types/nvidia.py @@ -0,0 +1,40 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.unchecked_base_model import UncheckedBaseModel +from .nvidia_reasoning_mode import NvidiaReasoningMode + + +class Nvidia(UncheckedBaseModel): + type: typing.Literal["nvidia"] = "nvidia" + version: typing.Optional[typing.Literal["v1"]] = pydantic.Field(default=None) + """ + The REST API version for NVIDIA's chat completions API (OpenAI-compatible) + """ + + model: str = pydantic.Field() + """ + NVIDIA model to use. The Deepgram-managed model is nvidia/nemotron-3.5-lightning-30b-a3b; GET /v1/agent/settings/think/models lists the public provider and model catalog. With a custom endpoint, use any model that endpoint serves. + """ + + temperature: typing.Optional[float] = pydantic.Field(default=None) + """ + NVIDIA temperature (0-2) + """ + + reasoning_mode: typing.Optional[NvidiaReasoningMode] = pydantic.Field(default=None) + """ + Sent to the model as reasoning_effort. Use it only with models that support reasoning effort + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/deepgram/types/nvidia_reasoning_mode.py b/src/deepgram/types/nvidia_reasoning_mode.py new file mode 100644 index 00000000..e785a712 --- /dev/null +++ b/src/deepgram/types/nvidia_reasoning_mode.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +NvidiaReasoningMode = typing.Union[typing.Literal["none", "minimal", "low", "medium", "high"], typing.Any] diff --git a/src/deepgram/types/shared_intents.py b/src/deepgram/types/shared_intents.py index ad991bcf..f03d4225 100644 --- a/src/deepgram/types/shared_intents.py +++ b/src/deepgram/types/shared_intents.py @@ -5,8 +5,6 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel -from .shared_intents_results import SharedIntentsResults -from .shared_intents_results_intents import SharedIntentsResultsIntents from .shared_intents_segments_item import SharedIntentsSegmentsItem @@ -17,45 +15,10 @@ class SharedIntents(UncheckedBaseModel): segments: typing.Optional[typing.List[SharedIntentsSegmentsItem]] = None - @property - def results(self) -> typing.Optional[SharedIntentsResults]: - """Deprecated facade for the pre-7.12 ``results.intents.segments`` path.""" - if self.segments is None: - return None - return SharedIntentsResults(intents=SharedIntentsResultsIntents(segments=self.segments)) - if IS_PYDANTIC_V2: - - @pydantic.model_validator(mode="before") - @classmethod - def _migrate_legacy_results(cls, values: typing.Any) -> typing.Any: - if not isinstance(values, dict) or "results" not in values: - return values - values = dict(values) - results = values.pop("results") - if "segments" in values: - return values - intents = results.get("intents") if isinstance(results, dict) else getattr(results, "intents", None) - if intents is not None: - values["segments"] = intents.get("segments") if isinstance(intents, dict) else intents.segments - return values - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: - @pydantic.root_validator(pre=True) # type: ignore[deprecated] - def _migrate_legacy_results(cls, values: typing.Any) -> typing.Any: # type: ignore[no-redef] - if not isinstance(values, dict) or "results" not in values: - return values - values = dict(values) - results = values.pop("results") - if "segments" in values: - return values - intents = results.get("intents") if isinstance(results, dict) else getattr(results, "intents", None) - if intents is not None: - values["segments"] = intents.get("segments") if isinstance(intents, dict) else intents.segments - return values - class Config: frozen = True smart_union = True diff --git a/src/deepgram/types/shared_topics.py b/src/deepgram/types/shared_topics.py index 4f26c3b7..0f6a4a76 100644 --- a/src/deepgram/types/shared_topics.py +++ b/src/deepgram/types/shared_topics.py @@ -5,8 +5,6 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel -from .shared_topics_results import SharedTopicsResults -from .shared_topics_results_topics import SharedTopicsResultsTopics from .shared_topics_segments_item import SharedTopicsSegmentsItem @@ -17,45 +15,10 @@ class SharedTopics(UncheckedBaseModel): segments: typing.Optional[typing.List[SharedTopicsSegmentsItem]] = None - @property - def results(self) -> typing.Optional[SharedTopicsResults]: - """Deprecated facade for the pre-7.12 ``results.topics.segments`` path.""" - if self.segments is None: - return None - return SharedTopicsResults(topics=SharedTopicsResultsTopics(segments=self.segments)) - if IS_PYDANTIC_V2: - - @pydantic.model_validator(mode="before") - @classmethod - def _migrate_legacy_results(cls, values: typing.Any) -> typing.Any: - if not isinstance(values, dict) or "results" not in values: - return values - values = dict(values) - results = values.pop("results") - if "segments" in values: - return values - topics = results.get("topics") if isinstance(results, dict) else getattr(results, "topics", None) - if topics is not None: - values["segments"] = topics.get("segments") if isinstance(topics, dict) else topics.segments - return values - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: - @pydantic.root_validator(pre=True) # type: ignore[deprecated] - def _migrate_legacy_results(cls, values: typing.Any) -> typing.Any: # type: ignore[no-redef] - if not isinstance(values, dict) or "results" not in values: - return values - values = dict(values) - results = values.pop("results") - if "segments" in values: - return values - topics = results.get("topics") if isinstance(results, dict) else getattr(results, "topics", None) - if topics is not None: - values["segments"] = topics.get("segments") if isinstance(topics, dict) else topics.segments - return values - class Config: frozen = True smart_union = True diff --git a/src/deepgram/types/speak_settings_v1provider.py b/src/deepgram/types/speak_settings_v1provider.py index 3fbef168..305cdba8 100644 --- a/src/deepgram/types/speak_settings_v1provider.py +++ b/src/deepgram/types/speak_settings_v1provider.py @@ -24,7 +24,7 @@ class SpeakSettingsV1Provider_Deepgram(UncheckedBaseModel): version: typing.Optional[str] = None model: DeepgramModel speed: typing.Optional[float] = None - expressivity: typing.Optional[pydantic.StrictInt] = None + expressivity: typing.Optional[int] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/deepgram/types/think_settings_v1.py b/src/deepgram/types/think_settings_v1.py index f74c63d1..cd00af63 100644 --- a/src/deepgram/types/think_settings_v1.py +++ b/src/deepgram/types/think_settings_v1.py @@ -15,7 +15,7 @@ class ThinkSettingsV1(UncheckedBaseModel): provider: ThinkSettingsV1Provider endpoint: typing.Optional[ThinkSettingsV1Endpoint] = pydantic.Field(default=None) """ - Optional for non-Deepgram LLM providers. When present, must include url field and headers object + Omit for deepgram: a deepgram provider with an endpoint is rejected with INVALID_SETTINGS. Optional for open_ai, anthropic, google, groq, and nvidia, where Deepgram provides managed LLMs. Required for aws_bedrock. When present, must include url; headers is optional """ functions: typing.Optional[typing.List[ThinkSettingsV1FunctionsItem]] = None diff --git a/src/deepgram/types/think_settings_v1endpoint.py b/src/deepgram/types/think_settings_v1endpoint.py index a98942ca..153a41a3 100644 --- a/src/deepgram/types/think_settings_v1endpoint.py +++ b/src/deepgram/types/think_settings_v1endpoint.py @@ -9,7 +9,7 @@ class ThinkSettingsV1Endpoint(UncheckedBaseModel): """ - Optional for non-Deepgram LLM providers. When present, must include url field and headers object + Omit for deepgram: a deepgram provider with an endpoint is rejected with INVALID_SETTINGS. Optional for open_ai, anthropic, google, groq, and nvidia, where Deepgram provides managed LLMs. Required for aws_bedrock. When present, must include url; headers is optional """ url: typing.Optional[str] = pydantic.Field(default=None) diff --git a/src/deepgram/types/think_settings_v1provider.py b/src/deepgram/types/think_settings_v1provider.py index 6187af3c..f5321233 100644 --- a/src/deepgram/types/think_settings_v1provider.py +++ b/src/deepgram/types/think_settings_v1provider.py @@ -16,6 +16,7 @@ from .google_model import GoogleModel from .google_version import GoogleVersion from .groq_reasoning_mode import GroqReasoningMode +from .nvidia_reasoning_mode import NvidiaReasoningMode from .open_ai_think_provider_model import OpenAiThinkProviderModel from .open_ai_think_provider_reasoning_mode import OpenAiThinkProviderReasoningMode @@ -102,6 +103,23 @@ class Config: extra = pydantic.Extra.allow +class ThinkSettingsV1Provider_Nvidia(UncheckedBaseModel): + type: typing.Literal["nvidia"] = "nvidia" + version: typing.Optional[typing.Literal["v1"]] = None + model: str + temperature: typing.Optional[float] = None + reasoning_mode: typing.Optional[NvidiaReasoningMode] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + class ThinkSettingsV1Provider_Deepgram(UncheckedBaseModel): type: typing.Literal["deepgram"] = "deepgram" model: DeepgramThinkProviderModel @@ -127,6 +145,7 @@ class Config: ThinkSettingsV1Provider_Anthropic, ThinkSettingsV1Provider_Google, ThinkSettingsV1Provider_Groq, + ThinkSettingsV1Provider_Nvidia, ThinkSettingsV1Provider_Deepgram, ], UnionMetadata(discriminant="type"), diff --git a/tests/wire/test_listen_v1_media.py b/tests/wire/test_listen_v1_media.py index 9998a387..e4264985 100644 --- a/tests/wire/test_listen_v1_media.py +++ b/tests/wire/test_listen_v1_media.py @@ -9,97 +9,3 @@ def test_listen_v1_media_transcribe_url() -> None: url="https://dpgr.am/spacewalk.wav", ) verify_request_count(test_id, "POST", "/v1/listen", None, 1) - - -def test_listen_v1_media_transcribe_url_serializes_all_query_params() -> None: - test_id = "listen.v1.media.transcribe_url.query_params" - client = get_client(test_id) - client.listen.v1.media.transcribe_url( - callback="callback", - callback_method="POST", - extra=["extra"], - sentiment=True, - summarize="v2", - tag=["tag"], - topics=True, - custom_topic=["custom_topic"], - custom_topic_mode="extended", - intents=True, - custom_intent=["custom_intent"], - custom_intent_mode="extended", - detect_entities=True, - detect_language=True, - diarize=True, - diarize_model="latest", - dictation=True, - encoding="linear16", - filler_words=True, - keyterm=["keyterm"], - keywords=["keywords"], - language="multi", - language_hint=["en", "es"], - measurements=True, - model="nova-3", - multichannel=True, - numerals=True, - paragraphs=True, - profanity_filter=True, - punctuate=True, - redact="redact", - redact_usage=True, - replace=["replace"], - search=["search"], - smart_format=True, - utterances=True, - utt_split=1.1, - version="latest", - mip_opt_out=True, - url="https://dpgr.am/spacewalk.wav", - ) - verify_request_count( - test_id, - "POST", - "/v1/listen", - { - "callback": "callback", - "callback_method": "POST", - "extra": "extra", - "sentiment": "true", - "summarize": "v2", - "tag": "tag", - "topics": "true", - "custom_topic": "custom_topic", - "custom_topic_mode": "extended", - "intents": "true", - "custom_intent": "custom_intent", - "custom_intent_mode": "extended", - "detect_entities": "true", - "detect_language": "true", - "diarize": "true", - "diarize_model": "latest", - "dictation": "true", - "encoding": "linear16", - "filler_words": "true", - "keyterm": "keyterm", - "keywords": "keywords", - "language": "multi", - "language_hint": ["en", "es"], - "measurements": "true", - "model": "nova-3", - "multichannel": "true", - "numerals": "true", - "paragraphs": "true", - "profanity_filter": "true", - "punctuate": "true", - "redact": "redact", - "redact_usage": "true", - "replace": "replace", - "search": "search", - "smart_format": "true", - "utterances": "true", - "utt_split": "1.1", - "version": "latest", - "mip_opt_out": "true", - }, - 1, - ) diff --git a/tests/wire/test_manage_v1_projects_keys.py b/tests/wire/test_manage_v1_projects_keys.py index 4b7a8100..b7d488d9 100644 --- a/tests/wire/test_manage_v1_projects_keys.py +++ b/tests/wire/test_manage_v1_projects_keys.py @@ -1,7 +1,5 @@ from .conftest import get_client, verify_request_count -from deepgram.requests import CreateKeyV1RequestOneParams - def test_manage_v1_projects_keys_list_() -> None: """Test list endpoint with WireMock""" @@ -19,18 +17,11 @@ def test_manage_v1_projects_keys_create() -> None: test_id = "manage.v1.projects.keys.create.0" client = get_client(test_id) client.manage.v1.projects.keys.create( - project_id="project_id", - request={"key": "value"}, + project_id="123456-7890-1234-5678-901234", + comment="A comment", + scopes=["admin"], ) - verify_request_count(test_id, "POST", "/v1/projects/project_id/keys", None, 1) - - -def test_manage_v1_projects_keys_create_with_old_request_alias() -> None: - test_id = "manage.v1.projects.keys.create.compat" - client = get_client(test_id) - request: CreateKeyV1RequestOneParams = {"key": "value"} - client.manage.v1.projects.keys.create(project_id="project_id", request=request) - verify_request_count(test_id, "POST", "/v1/projects/project_id/keys", None, 1) + verify_request_count(test_id, "POST", "/v1/projects/123456-7890-1234-5678-901234/keys", None, 1) def test_manage_v1_projects_keys_get() -> None: diff --git a/tests/wire/test_manage_v1_projects_requests.py b/tests/wire/test_manage_v1_projects_requests.py index daccaba9..71a888c7 100644 --- a/tests/wire/test_manage_v1_projects_requests.py +++ b/tests/wire/test_manage_v1_projects_requests.py @@ -1,5 +1,3 @@ -import datetime - from .conftest import get_client, verify_request_count @@ -13,42 +11,6 @@ def test_manage_v1_projects_requests_list_() -> None: verify_request_count(test_id, "GET", "/v1/projects/12345678-90ab-cdef-1234-567890abcdef/requests", None, 1) -def test_manage_v1_projects_requests_list_serializes_all_query_params() -> None: - test_id = "manage.v1.projects.requests.list_.query_params" - client = get_client(test_id) - client.manage.v1.projects.requests.list( - project_id="12345678-90ab-cdef-1234-567890abcdef", - start=datetime.datetime.fromisoformat("2024-01-15T09:30:00+00:00"), - end=datetime.datetime.fromisoformat("2024-01-15T09:30:00+00:00"), - limit=1.1, - page=1.1, - accessor="12345678-1234-1234-1234-123456789012", - request_id="12345678-1234-1234-1234-123456789012", - deployment="hosted", - endpoint="listen", - method="sync", - status="succeeded", - ) - verify_request_count( - test_id, - "GET", - "/v1/projects/12345678-90ab-cdef-1234-567890abcdef/requests", - { - "start": "2024-01-15T09:30:00Z", - "end": "2024-01-15T09:30:00Z", - "limit": "1.1", - "page": "1.1", - "accessor": "12345678-1234-1234-1234-123456789012", - "request_id": "12345678-1234-1234-1234-123456789012", - "deployment": "hosted", - "endpoint": "listen", - "method": "sync", - "status": "succeeded", - }, - 1, - ) - - def test_manage_v1_projects_requests_get() -> None: """Test get endpoint with WireMock""" test_id = "manage.v1.projects.requests.get.0" diff --git a/wiremock/wiremock-mappings.json b/wiremock/wiremock-mappings.json index 7e097cee..9fda360a 100644 --- a/wiremock/wiremock-mappings.json +++ b/wiremock/wiremock-mappings.json @@ -400,13 +400,13 @@ }, "pathParameters": { "project_id": { - "equalTo": "project_id" + "equalTo": "123456-7890-1234-5678-901234" } } }, "response": { "status": 200, - "body": "{\n \"api_key_id\": \"api_key_id\",\n \"key\": \"key\",\n \"comment\": \"comment\",\n \"scopes\": [\n \"scopes\",\n \"scopes\"\n ],\n \"tags\": [\n \"tags\",\n \"tags\"\n ],\n \"expiration_date\": \"2024-01-15T09:30:00Z\"\n}", + "body": "{\n \"api_key_id\": \"1234567890abcdef1234567890abcdef\",\n \"key\": \"1234567890abcdef1234567890abcdef\",\n \"comment\": \"a comment\",\n \"scopes\": [\n \"member\"\n ],\n \"tags\": [\n \"tag-1\"\n ],\n \"expiration_date\": \"2024-05-01T00:00:00Z\"\n}", "headers": { "Content-Type": "application/json" } From d54d7e89d028ece81e8b561aeabeef1a2ebf89cd Mon Sep 17 00:00:00 2001 From: Greg Holmes Date: Tue, 1 Dec 2026 13:20:19 +0000 Subject: [PATCH 4/6] chore: re-apply manual patches after regen Reconciles the 2026-12-01 Fern output (generator 5.39.3, unchanged; CLI 5.95.1 -> 5.216.0) against the 55 hand patches protected as .bak during prep. The generator caught up on none of them, so all 55 are re-applied: 51 as wholesale restores whose entire diff was the patch being stripped, 3 barrels merged so the new Nvidia exports land alongside the legacy alias tails, and the create-key wire test reworked. Kept from the generator: - NVIDIA Think provider. New Nvidia, NvidiaReasoningMode and ThinkSettingsV1Provider_Nvidia types (plus Params twins), added to the ThinkSettingsV1Provider union. - Two docstring corrections from deepgram-docs #1308. AgentV1UpdatePrompt.prompt now says the text is appended to the current system prompt rather than replacing it, which is the opposite of what it said. ThinkSettingsV1.endpoint now records that a deepgram provider with an endpoint is rejected with INVALID_SETTINGS, that aws_bedrock requires one, and that headers is optional. Reverted from the generator: - manage.v1.projects.keys.create lost its opaque `request` mapping in favour of explicit keyword arguments, and CreateKeyV1Request was deleted outright. That raises TypeError for every existing caller, and the deletion also broke the two permanently frozen create_key_v1request_one.py aliases, which import it. Both modules are recreated by hand with the generator's former definition, and client.py / raw_client.py accept `request` again via _build_create_key_body. The legacy path stays an unvalidated passthrough, because the old argument was typed Any and the server decided what a valid body was; adding validation would reject payloads that used to reach the API. Explicit keyword arguments are applied on top. - The version fields Fern bumped to 7.20.1 are back at 7.20.0 in pyproject.toml, .fern/metadata.json and client_wrapper.py, with the x-release-please-version marker restored. Release Please owns the next bump. - The three coverage lines in .gitignore, and the eroded query-parameter coverage in tests/wire/test_listen_v1_media.py and tests/wire/test_manage_v1_projects_requests.py, which the generator stripped back to bare single-parameter tests again. Verified before committing: each of the 51 wholesale restores is byte-identical to its pre-regen content; the 3 merged barrels differ from that base by 15, 9 and 6 lines, every one a Nvidia addition; .fernignore gained exactly the five new entries and no other change. Gates: - poetry run mypy src/ Success: no issues found in 958 source files - poetry run mypy tests/typecheck Success: no issues found in 1 source file - poetry run pytest -q 1259 passed, 4 skipped, 1 xfailed - ruff check src/ tests/ 55 errors, identical to the pre-regen base measured in a clean worktree. No new violations; CI does not run ruff. --- .fern/metadata.json | 2 +- .fernignore | 130 +- .gitignore | 3 + .gitignore.bak | 8 - AGENTS.md | 3 + pyproject.toml | 2 +- src/deepgram/__init__.py | 70 + src/deepgram/__init__.py.bak | 1420 ----------------- src/deepgram/agent/__init__.py | 68 + src/deepgram/agent/__init__.py.bak | 528 ------ src/deepgram/agent/v1/__init__.py | 68 + src/deepgram/agent/v1/__init__.py.bak | 530 ------ src/deepgram/agent/v1/requests/__init__.py | 38 + .../agent/v1/requests/__init__.py.bak | 279 ---- .../v1/requests/agent_v1conversation_text.py | 2 +- .../requests/agent_v1conversation_text.py.bak | 39 - .../agent_v1inject_dynamic_agent_message.py | 2 +- ...gent_v1inject_dynamic_agent_message.py.bak | 27 - .../agent/v1/requests/agent_v1settings.py | 3 +- .../agent/v1/requests/agent_v1settings.py.bak | 31 - .../v1/requests/agent_v1settings_agent.py | 17 +- .../v1/requests/agent_v1settings_agent.py.bak | 18 - .../agent_v1settings_agent_context.py | 4 + .../agent_v1settings_agent_context.py.bak | 37 - src/deepgram/agent/v1/socket_client.py | 47 +- src/deepgram/agent/v1/socket_client.py.bak | 447 ------ src/deepgram/agent/v1/types/__init__.py | 42 + src/deepgram/agent/v1/types/__init__.py.bak | 305 ---- .../v1/types/agent_v1conversation_text.py | 4 +- .../v1/types/agent_v1conversation_text.py.bak | 50 - .../agent_v1inject_dynamic_agent_message.py | 2 +- ...gent_v1inject_dynamic_agent_message.py.bak | 38 - .../agent/v1/types/agent_v1settings.py | 3 +- .../agent/v1/types/agent_v1settings.py.bak | 42 - .../agent/v1/types/agent_v1settings_agent.py | 53 +- .../v1/types/agent_v1settings_agent.py.bak | 58 - .../types/agent_v1settings_agent_context.py | 21 + .../agent_v1settings_agent_context.py.bak | 67 - ...1settings_agent_context_listen_provider.py | 23 + ...tings_agent_context_listen_provider.py.bak | 77 - .../agent_v1settings_agent_listen_provider.py | 23 + ...nt_v1settings_agent_listen_provider.py.bak | 77 - .../v1/types/agent_v1update_listen_listen.py | 36 + .../types/agent_v1update_listen_listen.py.bak | 61 - src/deepgram/core/api_error.py | 4 +- src/deepgram/core/api_error.py.bak | 25 - src/deepgram/core/client_wrapper.py | 2 +- src/deepgram/core/client_wrapper.py.bak | 146 -- src/deepgram/core/parse_error.py | 4 +- src/deepgram/core/parse_error.py.bak | 38 - src/deepgram/core/query_encoder.py | 15 +- src/deepgram/core/query_encoder.py.bak | 65 - src/deepgram/listen/__init__.py | 4 + src/deepgram/listen/__init__.py.bak | 246 --- .../v1/requests/listen_v1configure_failure.py | 2 +- .../listen_v1configure_failure.py.bak | 34 - src/deepgram/listen/v1/socket_client.py | 32 +- src/deepgram/listen/v1/socket_client.py.bak | 262 --- .../v1/types/listen_v1configure_failure.py | 2 +- .../types/listen_v1configure_failure.py.bak | 45 - src/deepgram/listen/v2/__init__.py | 4 + src/deepgram/listen/v2/__init__.py.bak | 118 -- src/deepgram/listen/v2/socket_client.py | 38 +- src/deepgram/listen/v2/socket_client.py.bak | 251 --- src/deepgram/listen/v2/types/__init__.py | 4 + src/deepgram/listen/v2/types/__init__.py.bak | 78 - .../v2/types/listen_v2configure_failure.py | 4 +- .../types/listen_v2configure_failure.py.bak | 45 - .../v2/types/listen_v2configure_success.py | 4 +- .../types/listen_v2configure_success.py.bak | 60 - .../listen_v2configure_success_thresholds.py | 4 +- ...sten_v2configure_success_thresholds.py.bak | 30 - .../listen/v2/types/listen_v2connected.py | 4 +- .../listen/v2/types/listen_v2connected.py.bak | 35 - .../listen/v2/types/listen_v2fatal_error.py | 4 +- .../v2/types/listen_v2fatal_error.py.bak | 40 - .../listen/v2/types/listen_v2turn_info.py | 4 +- .../listen/v2/types/listen_v2turn_info.py.bak | 102 -- .../v2/types/listen_v2turn_info_words_item.py | 4 +- .../listen_v2turn_info_words_item.py.bak | 38 - .../listen/v2/types/listen_v2warning.py | 4 +- .../listen/v2/types/listen_v2warning.py.bak | 45 - .../manage/v1/projects/keys/client.py | 29 +- .../manage/v1/projects/keys/raw_client.py | 86 +- src/deepgram/requests/__init__.py | 35 + src/deepgram/requests/__init__.py.bak | 618 ------- src/deepgram/requests/create_key_v1request.py | 8 + src/deepgram/requests/shared_intents.py | 2 + src/deepgram/requests/shared_intents.py.bak | 16 - src/deepgram/requests/shared_topics.py | 2 + src/deepgram/requests/shared_topics.py.bak | 16 - src/deepgram/speak/v1/socket_client.py | 34 +- src/deepgram/speak/v1/socket_client.py.bak | 237 --- .../speak/v2/requests/speak_v2warning.py | 8 +- .../speak/v2/requests/speak_v2warning.py.bak | 30 - src/deepgram/speak/v2/socket_client.py | 31 +- src/deepgram/speak/v2/socket_client.py.bak | 269 ---- .../speak/v2/types/speak_v2warning.py | 8 +- .../speak/v2/types/speak_v2warning.py.bak | 41 - src/deepgram/types/__init__.py | 47 + src/deepgram/types/__init__.py.bak | 883 ---------- src/deepgram/types/create_key_v1request.py | 14 + src/deepgram/types/deepgram.py | 2 +- src/deepgram/types/deepgram.py.bak | 44 - .../types/deepgram_listen_provider_v2.py | 28 + .../types/deepgram_listen_provider_v2.py.bak | 86 - src/deepgram/types/shared_intents.py | 37 + src/deepgram/types/shared_intents.py.bak | 62 - src/deepgram/types/shared_topics.py | 37 + src/deepgram/types/shared_topics.py.bak | 62 - .../types/speak_settings_v1provider.py | 2 +- .../types/speak_settings_v1provider.py.bak | 117 -- .../custom/test_create_key_legacy_request.py | 182 +++ tests/wire/test_listen_v1_media.py | 94 ++ tests/wire/test_listen_v1_media.py.bak | 105 -- tests/wire/test_manage_v1_projects_keys.py | 16 + .../wire/test_manage_v1_projects_keys.py.bak | 59 - .../wire/test_manage_v1_projects_requests.py | 38 + .../test_manage_v1_projects_requests.py.bak | 66 - 119 files changed, 1337 insertions(+), 8765 deletions(-) delete mode 100644 .gitignore.bak delete mode 100644 src/deepgram/__init__.py.bak delete mode 100644 src/deepgram/agent/__init__.py.bak delete mode 100644 src/deepgram/agent/v1/__init__.py.bak delete mode 100644 src/deepgram/agent/v1/requests/__init__.py.bak delete mode 100644 src/deepgram/agent/v1/requests/agent_v1conversation_text.py.bak delete mode 100644 src/deepgram/agent/v1/requests/agent_v1inject_dynamic_agent_message.py.bak delete mode 100644 src/deepgram/agent/v1/requests/agent_v1settings.py.bak delete mode 100644 src/deepgram/agent/v1/requests/agent_v1settings_agent.py.bak delete mode 100644 src/deepgram/agent/v1/requests/agent_v1settings_agent_context.py.bak delete mode 100644 src/deepgram/agent/v1/socket_client.py.bak delete mode 100644 src/deepgram/agent/v1/types/__init__.py.bak delete mode 100644 src/deepgram/agent/v1/types/agent_v1conversation_text.py.bak delete mode 100644 src/deepgram/agent/v1/types/agent_v1inject_dynamic_agent_message.py.bak delete mode 100644 src/deepgram/agent/v1/types/agent_v1settings.py.bak delete mode 100644 src/deepgram/agent/v1/types/agent_v1settings_agent.py.bak delete mode 100644 src/deepgram/agent/v1/types/agent_v1settings_agent_context.py.bak delete mode 100644 src/deepgram/agent/v1/types/agent_v1settings_agent_context_listen_provider.py.bak delete mode 100644 src/deepgram/agent/v1/types/agent_v1settings_agent_listen_provider.py.bak delete mode 100644 src/deepgram/agent/v1/types/agent_v1update_listen_listen.py.bak delete mode 100644 src/deepgram/core/api_error.py.bak delete mode 100644 src/deepgram/core/client_wrapper.py.bak delete mode 100644 src/deepgram/core/parse_error.py.bak delete mode 100644 src/deepgram/core/query_encoder.py.bak delete mode 100644 src/deepgram/listen/__init__.py.bak delete mode 100644 src/deepgram/listen/v1/requests/listen_v1configure_failure.py.bak delete mode 100644 src/deepgram/listen/v1/socket_client.py.bak delete mode 100644 src/deepgram/listen/v1/types/listen_v1configure_failure.py.bak delete mode 100644 src/deepgram/listen/v2/__init__.py.bak delete mode 100644 src/deepgram/listen/v2/socket_client.py.bak delete mode 100644 src/deepgram/listen/v2/types/__init__.py.bak delete mode 100644 src/deepgram/listen/v2/types/listen_v2configure_failure.py.bak delete mode 100644 src/deepgram/listen/v2/types/listen_v2configure_success.py.bak delete mode 100644 src/deepgram/listen/v2/types/listen_v2configure_success_thresholds.py.bak delete mode 100644 src/deepgram/listen/v2/types/listen_v2connected.py.bak delete mode 100644 src/deepgram/listen/v2/types/listen_v2fatal_error.py.bak delete mode 100644 src/deepgram/listen/v2/types/listen_v2turn_info.py.bak delete mode 100644 src/deepgram/listen/v2/types/listen_v2turn_info_words_item.py.bak delete mode 100644 src/deepgram/listen/v2/types/listen_v2warning.py.bak delete mode 100644 src/deepgram/requests/__init__.py.bak create mode 100644 src/deepgram/requests/create_key_v1request.py delete mode 100644 src/deepgram/requests/shared_intents.py.bak delete mode 100644 src/deepgram/requests/shared_topics.py.bak delete mode 100644 src/deepgram/speak/v1/socket_client.py.bak delete mode 100644 src/deepgram/speak/v2/requests/speak_v2warning.py.bak delete mode 100644 src/deepgram/speak/v2/socket_client.py.bak delete mode 100644 src/deepgram/speak/v2/types/speak_v2warning.py.bak delete mode 100644 src/deepgram/types/__init__.py.bak create mode 100644 src/deepgram/types/create_key_v1request.py delete mode 100644 src/deepgram/types/deepgram.py.bak delete mode 100644 src/deepgram/types/deepgram_listen_provider_v2.py.bak delete mode 100644 src/deepgram/types/shared_intents.py.bak delete mode 100644 src/deepgram/types/shared_topics.py.bak delete mode 100644 src/deepgram/types/speak_settings_v1provider.py.bak create mode 100644 tests/custom/test_create_key_legacy_request.py delete mode 100644 tests/wire/test_listen_v1_media.py.bak delete mode 100644 tests/wire/test_manage_v1_projects_keys.py.bak delete mode 100644 tests/wire/test_manage_v1_projects_requests.py.bak diff --git a/.fern/metadata.json b/.fern/metadata.json index ba89ddc7..0866c1c9 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -24,5 +24,5 @@ "originGitCommit": "a70c45e45ad40df616f6103f8bd5e54fee0bff2a", "originGitCommitIsDirty": true, "invokedBy": "manual", - "sdkVersion": "7.20.1" + "sdkVersion": "7.20.0" } \ No newline at end of file diff --git a/.fernignore b/.fernignore index db0ec517..f49ef25b 100644 --- a/.fernignore +++ b/.fernignore @@ -45,18 +45,18 @@ src/deepgram/requests/shared_intents_results_intents_segments_item_intents_item. # and Params retain the deprecated ``results`` construction shape and normalize # it to generated ``segments`` while preserving the permanent wrappers above. # [temporarily frozen — remove in the next major after retiring ``results``] -src/deepgram/types/shared_topics.py.bak -src/deepgram/types/shared_intents.py.bak -src/deepgram/requests/shared_topics.py.bak -src/deepgram/requests/shared_intents.py.bak +src/deepgram/types/shared_topics.py +src/deepgram/types/shared_intents.py +src/deepgram/requests/shared_topics.py +src/deepgram/requests/shared_intents.py # Agent Think Live ConversationText gained a required wire field in 2026-10. # The runtime model defaults missing legacy response payloads to `default`, while # the request TypedDict accepts the pre-2026-10 shape for existing typed callers. # SDK-created runtime models still serialize the current wire-required field. # [temporarily frozen — remove after legacy server payloads are retired] -src/deepgram/agent/v1/types/agent_v1conversation_text.py.bak -src/deepgram/agent/v1/requests/agent_v1conversation_text.py.bak +src/deepgram/agent/v1/types/agent_v1conversation_text.py +src/deepgram/agent/v1/requests/agent_v1conversation_text.py # WebSocket socket clients: # - except Exception broad catch (supports custom transports, generator narrows to WebSocketException) @@ -71,17 +71,17 @@ src/deepgram/agent/v1/requests/agent_v1conversation_text.py.bak # - listen response unions include bytes because their iterators and recv methods # already return binary frames # [temporarily frozen — manual patches listed above] -src/deepgram/agent/v1/socket_client.py.bak -src/deepgram/listen/v1/socket_client.py.bak -src/deepgram/listen/v2/socket_client.py.bak -src/deepgram/speak/v1/socket_client.py.bak -src/deepgram/speak/v2/socket_client.py.bak +src/deepgram/agent/v1/socket_client.py +src/deepgram/listen/v1/socket_client.py +src/deepgram/listen/v2/socket_client.py +src/deepgram/speak/v1/socket_client.py +src/deepgram/speak/v2/socket_client.py # Agent TTS provider expressivity must reject fractional values rather than # allowing Pydantic v1 to truncate them before the API sees the request. # [temporarily frozen — remove when Pydantic v1 support is dropped] -src/deepgram/types/speak_settings_v1provider.py.bak -src/deepgram/types/deepgram.py.bak +src/deepgram/types/speak_settings_v1provider.py +src/deepgram/types/deepgram.py # Backward-compat patch: AgentV1SettingsAgentContext schema restructure as of # 2026-05-05. The new schema nests messages under .context.messages; this file @@ -89,12 +89,12 @@ src/deepgram/types/deepgram.py.bak # kwarg and remaps it to `context={"messages": ...}` so existing callers keep # producing the correct wire payload, plus a read-side `.messages` property so # existing attribute access keeps working. -src/deepgram/agent/v1/types/agent_v1settings_agent_context.py.bak -src/deepgram/agent/v1/types/agent_v1settings_agent.py.bak -src/deepgram/agent/v1/types/agent_v1settings.py.bak -src/deepgram/agent/v1/requests/agent_v1settings_agent_context.py.bak -src/deepgram/agent/v1/requests/agent_v1settings_agent.py.bak -src/deepgram/agent/v1/requests/agent_v1settings.py.bak +src/deepgram/agent/v1/types/agent_v1settings_agent_context.py +src/deepgram/agent/v1/types/agent_v1settings_agent.py +src/deepgram/agent/v1/types/agent_v1settings.py +src/deepgram/agent/v1/requests/agent_v1settings_agent_context.py +src/deepgram/agent/v1/requests/agent_v1settings_agent.py +src/deepgram/agent/v1/requests/agent_v1settings.py # Backward-compatibility alias shims for renamed generated public types/params. # These are hand-written wrappers around the current generated names and must not be regenerated. @@ -114,6 +114,25 @@ src/deepgram/agent/v1/requests/agent_v1settings_agent_context_messages_item_func src/deepgram/types/create_key_v1request_one.py src/deepgram/requests/create_key_v1request_one.py +# Hand-written shims recreating CreateKeyV1Request / CreateKeyV1RequestParams, which Fern deleted +# in the 2026-12-01 regen when manage.v1.projects.keys.create moved from a single opaque `request` +# mapping to explicit keyword arguments. They stay on the public import surface, and the +# permanently frozen create_key_v1request_one.py aliases above import them, so Fern must not +# delete them again. Regression coverage in tests/custom/test_compat_aliases.py. +src/deepgram/types/create_key_v1request.py +src/deepgram/requests/create_key_v1request.py + +# Backward-compat patch for the 2026-12-01 create-key signature change. The generated create() +# now takes comment/scopes/tags/expiration_date/time_to_live_in_seconds as keyword arguments, +# which raises TypeError for every caller written against 7.20 and earlier. Both files carry a +# hand-added optional `request` argument plus _unpack_legacy_create_key_request, which folds the +# old mapping into the new arguments; explicit keyword arguments win when both are supplied. +# Wire coverage in tests/wire/test_manage_v1_projects_keys.py. Remove and unfreeze when the +# legacy call shape is retired in a future major. +# [temporarily frozen -- manual patch described above] +src/deepgram/manage/v1/projects/keys/client.py +src/deepgram/manage/v1/projects/keys/raw_client.py + # Backward-compatibility alias shims for the 2026-08-18 regen renames. The generator # dropped the *ThinkProvider*/*SpeakProvider* prefixes from these public model/voice/ # version types (AnthropicThinkProviderModel -> AnthropicModel, CartesiaSpeakProvider* -> @@ -169,9 +188,9 @@ src/deepgram/requests/deepgram_listen_provider_v2language_hint.py # remaps a legacy `language_hint=` kwarg to `language_hints` and drops the dead singular # key. Remove and unfreeze these shims when the singular alias is intentionally retired in a # future major release. -src/deepgram/types/deepgram_listen_provider_v2.py.bak -src/deepgram/agent/v1/types/agent_v1settings_agent_listen_provider.py.bak -src/deepgram/agent/v1/types/agent_v1settings_agent_context_listen_provider.py.bak +src/deepgram/types/deepgram_listen_provider_v2.py +src/deepgram/agent/v1/types/agent_v1settings_agent_listen_provider.py +src/deepgram/agent/v1/types/agent_v1settings_agent_context_listen_provider.py # Backward-compat patch for the 2026-07-31 AgentV1UpdateListen provider retype. The # generated `provider` field is now the required discriminated union @@ -180,7 +199,7 @@ src/deepgram/agent/v1/types/agent_v1settings_agent_context_listen_provider.py.ba # that coerces a legacy DeepgramListenProviderV1/V2 (or a dict lacking the version # discriminant) into the new shape so existing callers keep working. Remove and unfreeze # when the old provider payloads are retired in a future major. -src/deepgram/agent/v1/types/agent_v1update_listen_listen.py.bak +src/deepgram/agent/v1/types/agent_v1update_listen_listen.py # Hand-written compat shim recreating ListenV2CloseStreamType, which Fern removed in the # 2026-06-15 regen (docs #946). The original generated type wrongly allowed @@ -193,17 +212,17 @@ src/deepgram/listen/v2/types/listen_v2close_stream_type.py # Temporarily frozen generated package barrels that carry hand-applied legacy alias # re-exports. Before each regen, swap these originals to .bak paths so Fern can add new # exports; then restore the aliases alongside every genuine generated addition. -src/deepgram/__init__.py.bak -src/deepgram/agent/__init__.py.bak -src/deepgram/agent/v1/__init__.py.bak -src/deepgram/agent/v1/types/__init__.py.bak -src/deepgram/agent/v1/requests/__init__.py.bak -src/deepgram/types/__init__.py.bak -src/deepgram/requests/__init__.py.bak +src/deepgram/__init__.py +src/deepgram/agent/__init__.py +src/deepgram/agent/v1/__init__.py +src/deepgram/agent/v1/types/__init__.py +src/deepgram/agent/v1/requests/__init__.py +src/deepgram/types/__init__.py +src/deepgram/requests/__init__.py # listen __init__.py files re-export the ListenV2CloseStreamType shim above. -src/deepgram/listen/__init__.py.bak -src/deepgram/listen/v2/__init__.py.bak -src/deepgram/listen/v2/types/__init__.py.bak +src/deepgram/listen/__init__.py +src/deepgram/listen/v2/__init__.py +src/deepgram/listen/v2/types/__init__.py # Coerces Python bools to lowercase "true"/"false" before urlencode, which # otherwise stringifies via str() and produces "True"/"False" — rejected by @@ -220,40 +239,40 @@ src/deepgram/listen/v2/types/__init__.py.bak # the websockets DEBUG handshake logs; this is the other path to it. Unfreeze if the # generator starts redacting credentials itself. -src/deepgram/core/api_error.py.bak -src/deepgram/core/parse_error.py.bak +src/deepgram/core/api_error.py +src/deepgram/core/parse_error.py # Pydantic 2.14+ adapter annotations are now generated natively. -src/deepgram/core/query_encoder.py.bak +src/deepgram/core/query_encoder.py # The generated metadata fallback must match the published SDK version in source # checkouts and carries a release-please marker so it is updated on release. # [temporarily frozen — remove when Fern emits a release-managed fallback] -src/deepgram/core/client_wrapper.py.bak +src/deepgram/core/client_wrapper.py # Generated docstrings have a local whitespace cleanup. # [temporarily frozen — remove when Fern emits whitespace-clean docstrings] -src/deepgram/speak/v2/types/speak_v2warning.py.bak -src/deepgram/speak/v2/requests/speak_v2warning.py.bak -src/deepgram/agent/v1/types/agent_v1inject_dynamic_agent_message.py.bak -src/deepgram/agent/v1/requests/agent_v1inject_dynamic_agent_message.py.bak -src/deepgram/listen/v1/types/listen_v1configure_failure.py.bak -src/deepgram/listen/v1/requests/listen_v1configure_failure.py.bak +src/deepgram/speak/v2/types/speak_v2warning.py +src/deepgram/speak/v2/requests/speak_v2warning.py +src/deepgram/agent/v1/types/agent_v1inject_dynamic_agent_message.py +src/deepgram/agent/v1/requests/agent_v1inject_dynamic_agent_message.py +src/deepgram/listen/v1/types/listen_v1configure_failure.py +src/deepgram/listen/v1/requests/listen_v1configure_failure.py # Read-side compatibility for the SDK 7.7 Listen V2 response retype. These # generated response models inherit the hand-written base above so callers can # temporarily use both attribute and read-only subscript access. Remove the custom # inheritance and unfreeze these files in the next major release. # [temporarily frozen -- manual patch described above] -src/deepgram/listen/v2/types/listen_v2connected.py.bak -src/deepgram/listen/v2/types/listen_v2turn_info.py.bak -src/deepgram/listen/v2/types/listen_v2turn_info_words_item.py.bak -src/deepgram/listen/v2/types/listen_v2configure_success.py.bak -src/deepgram/listen/v2/types/listen_v2configure_success_thresholds.py.bak -src/deepgram/listen/v2/types/listen_v2configure_failure.py.bak -src/deepgram/listen/v2/types/listen_v2fatal_error.py.bak -src/deepgram/listen/v2/types/listen_v2warning.py.bak +src/deepgram/listen/v2/types/listen_v2connected.py +src/deepgram/listen/v2/types/listen_v2turn_info.py +src/deepgram/listen/v2/types/listen_v2turn_info_words_item.py +src/deepgram/listen/v2/types/listen_v2configure_success.py +src/deepgram/listen/v2/types/listen_v2configure_success_thresholds.py +src/deepgram/listen/v2/types/listen_v2configure_failure.py +src/deepgram/listen/v2/types/listen_v2fatal_error.py +src/deepgram/listen/v2/types/listen_v2warning.py # Hand-written custom tests tests/custom/test_agent_custom_think_provider.py @@ -267,6 +286,7 @@ tests/custom/test_client_construction_and_helpers.py tests/custom/test_compat_aliases.py tests/custom/test_core_internals_branches.py tests/custom/test_core_utilities_coverage.py +tests/custom/test_create_key_legacy_request.py tests/custom/test_eot_thresholds_feature.py tests/custom/test_http_endpoints_coverage.py tests/custom/test_http_retry_coverage.py @@ -298,14 +318,14 @@ tests/custom/test_voice_agent_force_end_turn_example.py tests/typecheck/compat_aliases.py # Wire test with restored compatibility coverage for legacy create-key request alias -tests/wire/test_manage_v1_projects_keys.py.bak +tests/wire/test_manage_v1_projects_keys.py # Wire test with restored query-parameter coverage for manage.v1.projects.requests.list. # The 2026-08-11 regen simplified the upstream spec *example* for this endpoint, and Fern # derives the wire test from the example, so the generated test dropped all ten optional # query params (including the datetime -> ISO-8601 Z encoding) while the client signature # still forwards them. Frozen so future regens do not silently drop that check again. -tests/wire/test_manage_v1_projects_requests.py.bak +tests/wire/test_manage_v1_projects_requests.py # Wire test with restored query-parameter coverage for listen.v1.media.transcribe_url. # Third instance of the same mechanism as the two entries above: the 2026-08-18 regen @@ -314,7 +334,7 @@ tests/wire/test_manage_v1_projects_requests.py.bak # dropped all 37 optional query params -- including the bool -> lowercase "true"/"false" # assertions -- while the client signature still forwards every one of them. Frozen so # future regens cannot silently drop that check again. -tests/wire/test_listen_v1_media.py.bak +tests/wire/test_listen_v1_media.py # Manual standalone tests tests/manual @@ -364,7 +384,7 @@ AGENTS.md # file before (fdcce88, ad93815, 4bee463) and would strip them. # [temporarily frozen — unfreeze + re-diff before each regen, then re-apply the # three coverage lines] -.gitignore.bak +.gitignore # Folders to ignore .github diff --git a/.gitignore b/.gitignore index d2e4ca80..765eb109 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,6 @@ __pycache__/ dist/ poetry.toml +.coverage +htmlcov/ +coverage.xml diff --git a/.gitignore.bak b/.gitignore.bak deleted file mode 100644 index 765eb109..00000000 --- a/.gitignore.bak +++ /dev/null @@ -1,8 +0,0 @@ -.mypy_cache/ -.ruff_cache/ -__pycache__/ -dist/ -poetry.toml -.coverage -htmlcov/ -coverage.xml diff --git a/AGENTS.md b/AGENTS.md index acd7dc4b..1f0ec87b 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -30,6 +30,7 @@ Current permanently frozen files: - `src/deepgram/agent/v1/types/agent_v1history_content.py`, `src/deepgram/agent/v1/types/agent_v1history_function_calls.py`, `src/deepgram/agent/v1/types/agent_v1settings_agent_context_messages_item.py`, `src/deepgram/agent/v1/types/agent_v1settings_agent_context_messages_item_content.py`, `src/deepgram/agent/v1/types/agent_v1settings_agent_context_messages_item_content_role.py`, `src/deepgram/agent/v1/types/agent_v1settings_agent_context_messages_item_function_calls.py`, `src/deepgram/agent/v1/types/agent_v1settings_agent_context_messages_item_function_calls_function_calls_item.py` — hand-written compatibility aliases preserving old public Agent History type imports after regen renames - `src/deepgram/agent/v1/requests/agent_v1history_content.py`, `src/deepgram/agent/v1/requests/agent_v1history_function_calls.py`, `src/deepgram/agent/v1/requests/agent_v1settings_agent_context_messages_item.py`, `src/deepgram/agent/v1/requests/agent_v1settings_agent_context_messages_item_content.py`, `src/deepgram/agent/v1/requests/agent_v1settings_agent_context_messages_item_function_calls.py`, `src/deepgram/agent/v1/requests/agent_v1settings_agent_context_messages_item_function_calls_function_calls_item.py` — hand-written compatibility aliases preserving old public Agent History request-param imports after regen renames - `src/deepgram/types/create_key_v1request_one.py`, `src/deepgram/requests/create_key_v1request_one.py` — hand-written compatibility aliases preserving the old public create-key request imports after the regen rename to `CreateKeyV1Request` +- `src/deepgram/types/create_key_v1request.py`, `src/deepgram/requests/create_key_v1request.py` — hand-written shims recreating `CreateKeyV1Request` / `CreateKeyV1RequestParams`, which Fern deleted in the 2026-12-01 regen when `manage.v1.projects.keys.create` moved to explicit keyword arguments. They stay on the public import surface and the `create_key_v1request_one.py` aliases above import them, so Fern must not delete them again. Recreated with the generator's former definition so the identity assertions in `tests/custom/test_compat_aliases.py` keep holding - `src/deepgram/types/anthropic_think_provider_model.py`, `src/deepgram/types/cartesia_speak_provider_model_id.py`, `src/deepgram/types/cartesia_speak_provider_voice.py`, `src/deepgram/types/deepgram_speak_provider_model.py`, `src/deepgram/types/google_think_provider_model.py`, `src/deepgram/types/google_think_provider_version.py`, `src/deepgram/types/groq_think_provider_reasoning_mode.py`, `src/deepgram/requests/cartesia_speak_provider_voice.py`, `src/deepgram/agent/v1/types/agent_v1history_content_role.py`, `src/deepgram/agent/v1/types/agent_v1history_function_calls_function_calls_item.py`, `src/deepgram/agent/v1/types/agent_v1settings_agent_context_context_messages_item_content_role.py`, `src/deepgram/agent/v1/types/agent_v1settings_agent_context_context_messages_item_function_calls_function_calls_item.py`, `src/deepgram/agent/v1/requests/agent_v1history_function_calls_function_calls_item.py`, `src/deepgram/agent/v1/requests/agent_v1settings_agent_context_context_messages_item_function_calls_function_calls_item.py` — hand-written compatibility aliases for the 2026-08-18 regen renames. The generator dropped the `*ThinkProvider*`/`*SpeakProvider*` prefixes from the public model/voice/version types (`AnthropicThinkProviderModel`→`AnthropicModel`, `CartesiaSpeakProvider*`→`Cartesia*`, `DeepgramSpeakProviderModel`→`DeepgramModel`, `GoogleThinkProvider*`→`Google*`, `GroqThinkProviderReasoningMode`→`GroqReasoningMode`), renamed the agent conversation-history subtypes (`AgentV1HistoryContentRole`→`ConversationHistoryMessageRole`, `AgentV1HistoryFunctionCallsFunctionCallsItem`→`FunctionCallHistoryMessageFunctionCallsItem`), and deleted the doubled `AgentV1SettingsAgentContextContextMessagesItem*` leaf modules. These aliases preserve every old public import path. (The parallel single-`Context` `agent_v1settings_agent_context_messages_item_content_role.py` / `..._function_calls_function_calls_item.py` shims, already listed in this permanently-frozen block above, were also re-pointed to the new targets in the same regen.) Regression coverage in `tests/custom/test_compat_aliases.py`. - `src/deepgram/agent/v1/types/agent_v1settings_agent_context_listen_provider_v1.py`, `src/deepgram/agent/v1/types/agent_v1settings_agent_context_listen_provider_v2.py`, `src/deepgram/agent/v1/types/agent_v1settings_agent_context_listen_provider_v2language_hint.py`, `src/deepgram/agent/v1/types/agent_v1settings_agent_listen_provider_v1.py`, `src/deepgram/agent/v1/types/agent_v1settings_agent_listen_provider_v2.py`, `src/deepgram/agent/v1/requests/agent_v1settings_agent_context_listen_provider_v1.py`, `src/deepgram/agent/v1/requests/agent_v1settings_agent_context_listen_provider_v2.py`, `src/deepgram/agent/v1/requests/agent_v1settings_agent_context_listen_provider_v2language_hint.py`, `src/deepgram/agent/v1/requests/agent_v1settings_agent_listen_provider_v1.py`, `src/deepgram/agent/v1/requests/agent_v1settings_agent_listen_provider_v2.py` — hand-written compatibility aliases for the 2026-05-14 spec dedup that consolidated `AgentV1SettingsAgent[Context]ListenProviderV{1,2,V2LanguageHint}` into top-level `DeepgramListenProvider*` types - `src/deepgram/types/deepgram_listen_provider_v2language_hint.py`, `src/deepgram/requests/deepgram_listen_provider_v2language_hint.py` — hand-written shims recreating the top-level `DeepgramListenProviderV2LanguageHint`/`...Params` type (`Union[str, List[str]]`) that Fern removed in the 2026-06-15 regen. The `*V2LanguageHint` listen-provider aliases above import from these and they remain part of the public import surface, so they are recreated by hand and frozen so Fern won't delete them again @@ -40,6 +41,7 @@ Current permanently frozen files: - `tests/custom/test_agent_history.py` — hand-written regression test for Agent History websocket payload parsing - `tests/custom/test_api_key_env_resolution.py` — hand-written regression test that `DEEPGRAM_API_KEY` is resolved when the client is constructed rather than when the module is imported. The generated base client takes `os.getenv(...)` as a default argument, which Python evaluates once at import, so `load_dotenv()` placed below the imports left the default captured as `None` (issue #734). `client.py` re-reads the variable; this pins that, plus explicit-key and `access_token` precedence and the no-key-anywhere error - `tests/custom/test_compat_aliases.py` — hand-written regression test for backward-compatible alias imports after regen renames +- `tests/custom/test_create_key_legacy_request.py` — hand-written regression coverage for the deprecated `request` mapping on `manage.v1.projects.keys.create`. The 2026-12-01 regen replaced that single opaque argument with explicit keyword arguments and deleted `CreateKeyV1Request`; `_build_create_key_body` in the temporarily frozen `keys/raw_client.py` keeps the old shape working. This pins the parts a future regen could quietly drop: the legacy mapping is forwarded verbatim rather than validated (unknown keys included, no required fields), explicit keyword arguments override it, and both shapes agree on sync, async and `with_raw_response` surfaces - `tests/custom/test_listen_v1_configure.py` — hand-written regression coverage for Listen V1 Configure message serialization and typed Error response parsing on both synchronous and asynchronous websocket clients - `tests/custom/test_model_dict_compat.py` — hand-written regression coverage for the read-only subscript compatibility shim on typed Listen V2 response models, including sync/async parsing, every response variant, nested objects, unknown fields, omitted-key behavior, and scope isolation from unrelated generated models - `tests/custom/test_query_encoder.py` — hand-written regression test that `core/query_encoder.py` coerces Python bools to lowercase `"true"`/`"false"` before `urlencode` so websocket query strings stay wire-correct @@ -83,6 +85,7 @@ Current temporarily frozen files: - `src/deepgram/types/shared_topics.py`, `src/deepgram/types/shared_intents.py`, `src/deepgram/requests/shared_topics.py`, `src/deepgram/requests/shared_intents.py`, and the generated root/type/request barrels — direct Topics and Intents segments plus their generated exports remain Fern-owned, but carry the v7 deprecated `results` construction facade and Params shape for the hand-written wrappers above. The models normalize legacy `results.{topics,intents}.segments` input to direct `segments` while preserving direct fields and deprecated read facades. Freeze these generated files during the parent reconciliation; retain all direct generated segments and exports alongside the compatibility surface. - `src/deepgram/core/client_wrapper.py` — Fern's `runtime_version: true` wrapper correctly uses installed package metadata, but its `PackageNotFoundError` fallback must remain the latest published version for source checkouts, vendored copies, zipapps, and frozen bundles. The retained `7.16.0` fallback carries `# x-release-please-version`, and `.github/release-please-config.json` includes the file as a generic extra file so Release Please updates it with `pyproject.toml` and `.fern/metadata.json`. Unfreeze when Fern emits a release-managed fallback. - `src/deepgram/speak/v2/types/speak_v2warning.py`, `src/deepgram/speak/v2/requests/speak_v2warning.py`, `src/deepgram/agent/v1/types/agent_v1inject_dynamic_agent_message.py`, `src/deepgram/agent/v1/requests/agent_v1inject_dynamic_agent_message.py`, `src/deepgram/listen/v1/types/listen_v1configure_failure.py`, `src/deepgram/listen/v1/requests/listen_v1configure_failure.py` — whitespace cleanup for generated docstrings. Unfreeze when Fern emits whitespace-clean output. +- `src/deepgram/manage/v1/projects/keys/client.py`, `src/deepgram/manage/v1/projects/keys/raw_client.py` — backward-compat patch for the 2026-12-01 create-key signature change. The generated `create()` now takes `comment`/`scopes`/`tags`/`expiration_date`/`time_to_live_in_seconds` as keyword arguments, which raises `TypeError` for every caller written against 7.20 or earlier. Both files carry a hand-added optional `request` argument, and `raw_client.py` carries `_build_create_key_body`, which forwards the legacy mapping verbatim (it was typed `Any` and never validated) with explicit keyword arguments applied on top. `comment` and `scopes` had to be widened to optional to accept the legacy form, so a runtime `TypeError` replaces mypy's missing-argument check when neither shape supplies them. Coverage in `tests/custom/test_create_key_legacy_request.py` and `tests/wire/test_manage_v1_projects_keys.py`. Remove and unfreeze when the legacy call shape is retired in a future major. - `src/deepgram/agent/v1/types/agent_v1update_listen_listen.py` — backward-compat patch for the 2026-07-31 `AgentV1UpdateListen` provider retype. The `provider` field changed from a bare `DeepgramListenProviderV2` to the required discriminated union `AgentV1UpdateListenListenProvider` (`_V1`/`_V2`, discriminant `version`). Carries a hand-added `model_validator(mode='before')` / `root_validator(pre=True)` that coerces a legacy `DeepgramListenProviderV1`/`V2` (or a dict lacking the `version` discriminant) into the new shape so existing callers keep working. Remove and unfreeze when the old provider payloads are retired in a future major. NOTE: this patch was silently lost once (it was absent from `.fernignore`, so a regen overwrote it) — keep it frozen. - `src/deepgram/agent/v1/types/agent_v1conversation_text.py`, `src/deepgram/agent/v1/requests/agent_v1conversation_text.py` — compatibility for the 2026-10 Think Live schema update that made `conversational_behavior` required. The runtime response model defaults an omitted field to `"default"` so older/self-hosted server payloads continue to parse, while the request TypedDict accepts the pre-update shape for typed callers. SDK-created runtime models still serialize the current wire-required field. Remove and unfreeze when those legacy payloads are retired. - `tests/wire/test_manage_v1_projects_keys.py` — restored wire coverage for the legacy `CreateKeyV1RequestOneParams` request alias so future regens do not silently drop that compatibility check diff --git a/pyproject.toml b/pyproject.toml index 9a1ca563..ff6af3d6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ license-files = ["LICENSE"] [tool.poetry] name = "deepgram-sdk" -version = "7.20.1" +version = "7.20.0" description = "" readme = "README.md" authors = [] diff --git a/src/deepgram/__init__.py b/src/deepgram/__init__.py index 16405c51..ed946a84 100644 --- a/src/deepgram/__init__.py +++ b/src/deepgram/__init__.py @@ -38,6 +38,7 @@ CartesiaModelId, CartesiaVoice, CreateAgentConfigurationV1Response, + CreateKeyV1Request, CreateKeyV1Response, CreateProjectDistributionCredentialsV1Response, CreateProjectDistributionCredentialsV1ResponseDistributionCredentials, @@ -293,6 +294,7 @@ CartesiaParams, CartesiaVoiceParams, CreateAgentConfigurationV1ResponseParams, + CreateKeyV1RequestParams, CreateKeyV1ResponseParams, CreateProjectDistributionCredentialsV1ResponseDistributionCredentialsParams, CreateProjectDistributionCredentialsV1ResponseMemberParams, @@ -501,6 +503,8 @@ "CartesiaVoiceParams": ".requests", "CreateAgentConfigurationV1Response": ".types", "CreateAgentConfigurationV1ResponseParams": ".requests", + "CreateKeyV1Request": ".types", + "CreateKeyV1RequestParams": ".requests", "CreateKeyV1Response": ".types", "CreateKeyV1ResponseParams": ".requests", "CreateProjectDistributionCredentialsV1Response": ".types", @@ -894,6 +898,38 @@ "voice_agent": ".voice_agent", } +_dynamic_imports.update( + { + "SharedIntentsResults": ".types", + "SharedIntentsResultsIntents": ".types", + "SharedIntentsResultsIntentsParams": ".requests", + "SharedIntentsResultsIntentsSegmentsItem": ".types", + "SharedIntentsResultsIntentsSegmentsItemIntentsItem": ".types", + "SharedIntentsResultsIntentsSegmentsItemIntentsItemParams": ".requests", + "SharedIntentsResultsIntentsSegmentsItemParams": ".requests", + "SharedIntentsResultsParams": ".requests", + "SharedTopicsResults": ".types", + "SharedTopicsResultsParams": ".requests", + "SharedTopicsResultsTopics": ".types", + "SharedTopicsResultsTopicsParams": ".requests", + "SharedTopicsResultsTopicsSegmentsItem": ".types", + "SharedTopicsResultsTopicsSegmentsItemParams": ".requests", + "SharedTopicsResultsTopicsSegmentsItemTopicsItem": ".types", + "SharedTopicsResultsTopicsSegmentsItemTopicsItemParams": ".requests", + "AnthropicThinkProviderModel": ".types", + "CartesiaSpeakProviderModelId": ".types", + "CartesiaSpeakProviderVoice": ".types", + "CartesiaSpeakProviderVoiceParams": ".requests", + "CreateKeyV1RequestOne": ".types", + "DeepgramListenProviderV2LanguageHint": ".types", + "DeepgramListenProviderV2LanguageHintParams": ".requests", + "DeepgramSpeakProviderModel": ".types", + "GoogleThinkProviderModel": ".types", + "GoogleThinkProviderVersion": ".types", + "GroqThinkProviderReasoningMode": ".types", + } +) + def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) @@ -971,6 +1007,8 @@ def __dir__(): "CartesiaVoiceParams", "CreateAgentConfigurationV1Response", "CreateAgentConfigurationV1ResponseParams", + "CreateKeyV1Request", + "CreateKeyV1RequestParams", "CreateKeyV1Response", "CreateKeyV1ResponseParams", "CreateProjectDistributionCredentialsV1Response", @@ -1363,3 +1401,35 @@ def __dir__(): "speak", "voice_agent", ] + +__all__.extend( + [ + "SharedIntentsResults", + "SharedIntentsResultsIntents", + "SharedIntentsResultsIntentsParams", + "SharedIntentsResultsIntentsSegmentsItem", + "SharedIntentsResultsIntentsSegmentsItemIntentsItem", + "SharedIntentsResultsIntentsSegmentsItemIntentsItemParams", + "SharedIntentsResultsIntentsSegmentsItemParams", + "SharedIntentsResultsParams", + "SharedTopicsResults", + "SharedTopicsResultsParams", + "SharedTopicsResultsTopics", + "SharedTopicsResultsTopicsParams", + "SharedTopicsResultsTopicsSegmentsItem", + "SharedTopicsResultsTopicsSegmentsItemParams", + "SharedTopicsResultsTopicsSegmentsItemTopicsItem", + "SharedTopicsResultsTopicsSegmentsItemTopicsItemParams", + "AnthropicThinkProviderModel", + "CartesiaSpeakProviderModelId", + "CartesiaSpeakProviderVoice", + "CartesiaSpeakProviderVoiceParams", + "CreateKeyV1RequestOne", + "DeepgramListenProviderV2LanguageHint", + "DeepgramListenProviderV2LanguageHintParams", + "DeepgramSpeakProviderModel", + "GoogleThinkProviderModel", + "GoogleThinkProviderVersion", + "GroqThinkProviderReasoningMode", + ] +) diff --git a/src/deepgram/__init__.py.bak b/src/deepgram/__init__.py.bak deleted file mode 100644 index 9fade4cd..00000000 --- a/src/deepgram/__init__.py.bak +++ /dev/null @@ -1,1420 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# isort: skip_file - -import typing -from importlib import import_module - -if typing.TYPE_CHECKING: - from .types import ( - AgentConfigurationV1, - AgentThinkModelsV1Response, - AgentThinkModelsV1ResponseModelsItem, - AgentThinkModelsV1ResponseModelsItemId, - AgentThinkModelsV1ResponseModelsItemOne, - AgentThinkModelsV1ResponseModelsItemOneId, - AgentThinkModelsV1ResponseModelsItemThree, - AgentThinkModelsV1ResponseModelsItemTwo, - AgentThinkModelsV1ResponseModelsItemTwoId, - AgentThinkModelsV1ResponseModelsItemZero, - AgentThinkModelsV1ResponseModelsItemZeroId, - AgentVariableV1, - Anthropic, - AnthropicModel, - AwsBedrockThinkProvider, - AwsBedrockThinkProviderCredentials, - AwsBedrockThinkProviderCredentialsType, - AwsBedrockThinkProviderModel, - AwsPollySpeakProvider, - AwsPollySpeakProviderCredentials, - AwsPollySpeakProviderCredentialsType, - AwsPollySpeakProviderEngine, - AwsPollySpeakProviderVoice, - BillingBreakdownV1Response, - BillingBreakdownV1ResponseResolution, - BillingBreakdownV1ResponseResultsItem, - BillingBreakdownV1ResponseResultsItemGrouping, - Cartesia, - CartesiaModelId, - CartesiaVoice, - CreateAgentConfigurationV1Response, - CreateKeyV1Request, - CreateKeyV1Response, - CreateProjectDistributionCredentialsV1Response, - CreateProjectDistributionCredentialsV1ResponseDistributionCredentials, - CreateProjectDistributionCredentialsV1ResponseMember, - CreateProjectInviteV1Response, - Deepgram, - DeepgramListenProviderV1, - DeepgramListenProviderV2, - DeepgramModel, - DeepgramThinkLiveProviderV1, - DeepgramThinkProvider, - DeepgramThinkProviderModel, - DeepgramThinkProviderReasoningMode, - DeleteAgentConfigurationV1Response, - DeleteAgentVariableV1Response, - DeleteProjectInviteV1Response, - DeleteProjectKeyV1Response, - DeleteProjectMemberV1Response, - DeleteProjectV1Response, - ElevenLabsSpeakProvider, - ElevenLabsSpeakProviderModelId, - ErrorResponse, - ErrorResponseLegacyError, - ErrorResponseModernError, - ErrorResponseTextError, - GetModelV1Response, - GetModelV1ResponseBatch, - GetModelV1ResponseMetadata, - GetModelV1ResponseMetadataMetadata, - GetProjectBalanceV1Response, - GetProjectDistributionCredentialsV1Response, - GetProjectDistributionCredentialsV1ResponseDistributionCredentials, - GetProjectDistributionCredentialsV1ResponseMember, - GetProjectKeyV1Response, - GetProjectKeyV1ResponseItem, - GetProjectKeyV1ResponseItemMember, - GetProjectKeyV1ResponseItemMemberApiKey, - GetProjectRequestV1Response, - GetProjectV1Response, - Google, - GoogleModel, - GoogleVersion, - GrantV1Response, - Groq, - GroqReasoningMode, - LeaveProjectV1Response, - ListAgentConfigurationsV1Response, - ListAgentVariablesV1Response, - ListBillingFieldsV1Response, - ListBillingFieldsV1ResponseDeploymentsItem, - ListModelsV1Response, - ListModelsV1ResponseSttModels, - ListModelsV1ResponseTtsModels, - ListModelsV1ResponseTtsModelsMetadata, - ListProjectBalancesV1Response, - ListProjectBalancesV1ResponseBalancesItem, - ListProjectDistributionCredentialsV1Response, - ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItem, - ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemDistributionCredentials, - ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemMember, - ListProjectInvitesV1Response, - ListProjectInvitesV1ResponseInvitesItem, - ListProjectKeysV1Response, - ListProjectKeysV1ResponseApiKeysItem, - ListProjectKeysV1ResponseApiKeysItemApiKey, - ListProjectKeysV1ResponseApiKeysItemMember, - ListProjectMemberScopesV1Response, - ListProjectMembersV1Response, - ListProjectMembersV1ResponseMembersItem, - ListProjectPurchasesV1Response, - ListProjectPurchasesV1ResponseOrdersItem, - ListProjectRequestsV1Response, - ListProjectsV1Response, - ListProjectsV1ResponseProjectsItem, - ListenV1AcceptedResponse, - ListenV1Callback, - ListenV1CallbackMethod, - ListenV1Channels, - ListenV1DetectEntities, - ListenV1Diarize, - ListenV1Dictation, - ListenV1Encoding, - ListenV1Endpointing, - ListenV1Extra, - ListenV1InterimResults, - ListenV1Keyterm, - ListenV1Keywords, - ListenV1Language, - ListenV1LanguageHint, - ListenV1MipOptOut, - ListenV1Model, - ListenV1Multichannel, - ListenV1Numerals, - ListenV1ProfanityFilter, - ListenV1Punctuate, - ListenV1Redact, - ListenV1RedactUsage, - ListenV1Replace, - ListenV1RequestFile, - ListenV1Response, - ListenV1ResponseMetadata, - ListenV1ResponseMetadataDiarizeInfo, - ListenV1ResponseMetadataIntentsInfo, - ListenV1ResponseMetadataSentimentInfo, - ListenV1ResponseMetadataSummaryInfo, - ListenV1ResponseMetadataTopicsInfo, - ListenV1ResponseResults, - ListenV1ResponseResultsChannels, - ListenV1ResponseResultsChannelsItem, - ListenV1ResponseResultsChannelsItemAlternativesItem, - ListenV1ResponseResultsChannelsItemAlternativesItemEntitiesItem, - ListenV1ResponseResultsChannelsItemAlternativesItemParagraphs, - ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParagraphsItem, - ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParagraphsItemSentencesItem, - ListenV1ResponseResultsChannelsItemAlternativesItemSummariesItem, - ListenV1ResponseResultsChannelsItemAlternativesItemTopicsItem, - ListenV1ResponseResultsChannelsItemAlternativesItemWordsItem, - ListenV1ResponseResultsChannelsItemSearchItem, - ListenV1ResponseResultsChannelsItemSearchItemHitsItem, - ListenV1ResponseResultsSummary, - ListenV1ResponseResultsUtterances, - ListenV1ResponseResultsUtterancesItem, - ListenV1ResponseResultsUtterancesItemWordsItem, - ListenV1SampleRate, - ListenV1Search, - ListenV1SmartFormat, - ListenV1Tag, - ListenV1UtteranceEndMs, - ListenV1VadEvents, - ListenV1Version, - ListenV2ConfigureNumerals, - ListenV2ConfigureRedactUsage, - ListenV2EagerEotThreshold, - ListenV2Encoding, - ListenV2EotThreshold, - ListenV2EotTimeoutMs, - ListenV2Keyterm, - ListenV2LanguageHint, - ListenV2MipOptOut, - ListenV2Model, - ListenV2Numerals, - ListenV2ProfanityFilter, - ListenV2Redact, - ListenV2RedactUsage, - ListenV2SampleRate, - ListenV2Tag, - OpenAiSpeakProvider, - OpenAiSpeakProviderModel, - OpenAiSpeakProviderVoice, - OpenAiThinkProvider, - OpenAiThinkProviderModel, - OpenAiThinkProviderReasoningMode, - ProjectRequestResponse, - ReadV1Request, - ReadV1RequestText, - ReadV1RequestUrl, - ReadV1Response, - ReadV1ResponseMetadata, - ReadV1ResponseMetadataMetadata, - ReadV1ResponseMetadataMetadataIntentsInfo, - ReadV1ResponseMetadataMetadataSentimentInfo, - ReadV1ResponseMetadataMetadataSummaryInfo, - ReadV1ResponseMetadataMetadataTopicsInfo, - ReadV1ResponseResults, - ReadV1ResponseResultsSummary, - ReadV1ResponseResultsSummaryResults, - ReadV1ResponseResultsSummaryResultsSummary, - SharedIntents, - SharedIntentsSegmentsItem, - SharedIntentsSegmentsItemIntentsItem, - SharedSentiments, - SharedSentimentsAverage, - SharedSentimentsSegmentsItem, - SharedTopics, - SharedTopicsSegmentsItem, - SharedTopicsSegmentsItemTopicsItem, - SpeakSettingsV1, - SpeakSettingsV1Endpoint, - SpeakSettingsV1Provider, - SpeakSettingsV1Provider_AwsPolly, - SpeakSettingsV1Provider_Cartesia, - SpeakSettingsV1Provider_Deepgram, - SpeakSettingsV1Provider_ElevenLabs, - SpeakSettingsV1Provider_OpenAi, - SpeakV1Encoding, - SpeakV1MipOptOut, - SpeakV1Model, - SpeakV1Response, - SpeakV1SampleRate, - SpeakV1Speed, - SpeakV2AcceptedResponse, - SpeakV2Encoding, - SpeakV2Expressivity, - SpeakV2MipOptOut, - SpeakV2Model, - SpeakV2NormalizeVolume, - SpeakV2Response, - SpeakV2SampleRate, - SpeakV2Speed, - SpeakV2SpeedValue, - SpeakV2Tag, - ThinkLiveSettingsV1, - ThinkSettingsV1, - ThinkSettingsV1ContextLength, - ThinkSettingsV1Endpoint, - ThinkSettingsV1FunctionsItem, - ThinkSettingsV1FunctionsItemEndpoint, - ThinkSettingsV1Provider, - ThinkSettingsV1Provider_Anthropic, - ThinkSettingsV1Provider_AwsBedrock, - ThinkSettingsV1Provider_Deepgram, - ThinkSettingsV1Provider_Google, - ThinkSettingsV1Provider_Groq, - ThinkSettingsV1Provider_OpenAi, - UpdateProjectMemberScopesV1Response, - UpdateProjectV1Response, - UsageBreakdownV1Response, - UsageBreakdownV1ResponseResolution, - UsageBreakdownV1ResponseResultsItem, - UsageBreakdownV1ResponseResultsItemGrouping, - UsageFieldsV1Response, - UsageFieldsV1ResponseModelsItem, - UsageV1Response, - UsageV1ResponseResolution, - ) - from .errors import BadRequestError - from . import agent, auth, listen, manage, read, self_hosted, speak, voice_agent - from ._default_clients import DefaultAioHttpClient, DefaultAsyncHttpxClient - from .client import AsyncDeepgramClient, DeepgramClient - from .environment import DeepgramClientEnvironment - from .requests import ( - AgentConfigurationV1Params, - AgentThinkModelsV1ResponseModelsItemIdParams, - AgentThinkModelsV1ResponseModelsItemOneParams, - AgentThinkModelsV1ResponseModelsItemParams, - AgentThinkModelsV1ResponseModelsItemThreeParams, - AgentThinkModelsV1ResponseModelsItemTwoParams, - AgentThinkModelsV1ResponseModelsItemZeroParams, - AgentThinkModelsV1ResponseParams, - AgentVariableV1Params, - AnthropicParams, - AwsBedrockThinkProviderCredentialsParams, - AwsBedrockThinkProviderParams, - AwsPollySpeakProviderCredentialsParams, - AwsPollySpeakProviderParams, - BillingBreakdownV1ResponseParams, - BillingBreakdownV1ResponseResolutionParams, - BillingBreakdownV1ResponseResultsItemGroupingParams, - BillingBreakdownV1ResponseResultsItemParams, - CartesiaParams, - CartesiaVoiceParams, - CreateAgentConfigurationV1ResponseParams, - CreateKeyV1RequestParams, - CreateKeyV1ResponseParams, - CreateProjectDistributionCredentialsV1ResponseDistributionCredentialsParams, - CreateProjectDistributionCredentialsV1ResponseMemberParams, - CreateProjectDistributionCredentialsV1ResponseParams, - CreateProjectInviteV1ResponseParams, - DeepgramListenProviderV1Params, - DeepgramListenProviderV2Params, - DeepgramParams, - DeepgramThinkLiveProviderV1Params, - DeepgramThinkProviderParams, - DeleteProjectInviteV1ResponseParams, - DeleteProjectKeyV1ResponseParams, - DeleteProjectMemberV1ResponseParams, - DeleteProjectV1ResponseParams, - ElevenLabsSpeakProviderParams, - ErrorResponseLegacyErrorParams, - ErrorResponseModernErrorParams, - ErrorResponseParams, - GetModelV1ResponseBatchParams, - GetModelV1ResponseMetadataMetadataParams, - GetModelV1ResponseMetadataParams, - GetModelV1ResponseParams, - GetProjectBalanceV1ResponseParams, - GetProjectDistributionCredentialsV1ResponseDistributionCredentialsParams, - GetProjectDistributionCredentialsV1ResponseMemberParams, - GetProjectDistributionCredentialsV1ResponseParams, - GetProjectKeyV1ResponseItemMemberApiKeyParams, - GetProjectKeyV1ResponseItemMemberParams, - GetProjectKeyV1ResponseItemParams, - GetProjectKeyV1ResponseParams, - GetProjectRequestV1ResponseParams, - GetProjectV1ResponseParams, - GoogleParams, - GrantV1ResponseParams, - GroqParams, - LeaveProjectV1ResponseParams, - ListAgentConfigurationsV1ResponseParams, - ListAgentVariablesV1ResponseParams, - ListBillingFieldsV1ResponseParams, - ListModelsV1ResponseParams, - ListModelsV1ResponseSttModelsParams, - ListModelsV1ResponseTtsModelsMetadataParams, - ListModelsV1ResponseTtsModelsParams, - ListProjectBalancesV1ResponseBalancesItemParams, - ListProjectBalancesV1ResponseParams, - ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemDistributionCredentialsParams, - ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemMemberParams, - ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemParams, - ListProjectDistributionCredentialsV1ResponseParams, - ListProjectInvitesV1ResponseInvitesItemParams, - ListProjectInvitesV1ResponseParams, - ListProjectKeysV1ResponseApiKeysItemApiKeyParams, - ListProjectKeysV1ResponseApiKeysItemMemberParams, - ListProjectKeysV1ResponseApiKeysItemParams, - ListProjectKeysV1ResponseParams, - ListProjectMemberScopesV1ResponseParams, - ListProjectMembersV1ResponseMembersItemParams, - ListProjectMembersV1ResponseParams, - ListProjectPurchasesV1ResponseOrdersItemParams, - ListProjectPurchasesV1ResponseParams, - ListProjectRequestsV1ResponseParams, - ListProjectsV1ResponseParams, - ListProjectsV1ResponseProjectsItemParams, - ListenV1AcceptedResponseParams, - ListenV1LanguageHintParams, - ListenV1ResponseMetadataDiarizeInfoParams, - ListenV1ResponseMetadataIntentsInfoParams, - ListenV1ResponseMetadataParams, - ListenV1ResponseMetadataSentimentInfoParams, - ListenV1ResponseMetadataSummaryInfoParams, - ListenV1ResponseMetadataTopicsInfoParams, - ListenV1ResponseParams, - ListenV1ResponseResultsChannelsItemAlternativesItemEntitiesItemParams, - ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParagraphsItemParams, - ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParagraphsItemSentencesItemParams, - ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParams, - ListenV1ResponseResultsChannelsItemAlternativesItemParams, - ListenV1ResponseResultsChannelsItemAlternativesItemSummariesItemParams, - ListenV1ResponseResultsChannelsItemAlternativesItemTopicsItemParams, - ListenV1ResponseResultsChannelsItemAlternativesItemWordsItemParams, - ListenV1ResponseResultsChannelsItemParams, - ListenV1ResponseResultsChannelsItemSearchItemHitsItemParams, - ListenV1ResponseResultsChannelsItemSearchItemParams, - ListenV1ResponseResultsChannelsParams, - ListenV1ResponseResultsParams, - ListenV1ResponseResultsSummaryParams, - ListenV1ResponseResultsUtterancesItemParams, - ListenV1ResponseResultsUtterancesItemWordsItemParams, - ListenV1ResponseResultsUtterancesParams, - ListenV2KeytermParams, - ListenV2LanguageHintParams, - OpenAiSpeakProviderParams, - OpenAiThinkProviderParams, - ProjectRequestResponseParams, - ReadV1RequestParams, - ReadV1RequestTextParams, - ReadV1RequestUrlParams, - ReadV1ResponseMetadataMetadataIntentsInfoParams, - ReadV1ResponseMetadataMetadataParams, - ReadV1ResponseMetadataMetadataSentimentInfoParams, - ReadV1ResponseMetadataMetadataSummaryInfoParams, - ReadV1ResponseMetadataMetadataTopicsInfoParams, - ReadV1ResponseMetadataParams, - ReadV1ResponseParams, - ReadV1ResponseResultsParams, - ReadV1ResponseResultsSummaryParams, - ReadV1ResponseResultsSummaryResultsParams, - ReadV1ResponseResultsSummaryResultsSummaryParams, - SharedIntentsParams, - SharedIntentsSegmentsItemIntentsItemParams, - SharedIntentsSegmentsItemParams, - SharedSentimentsAverageParams, - SharedSentimentsParams, - SharedSentimentsSegmentsItemParams, - SharedTopicsParams, - SharedTopicsSegmentsItemParams, - SharedTopicsSegmentsItemTopicsItemParams, - SpeakSettingsV1EndpointParams, - SpeakSettingsV1Params, - SpeakSettingsV1ProviderParams, - SpeakSettingsV1Provider_AwsPollyParams, - SpeakSettingsV1Provider_CartesiaParams, - SpeakSettingsV1Provider_DeepgramParams, - SpeakSettingsV1Provider_ElevenLabsParams, - SpeakSettingsV1Provider_OpenAiParams, - SpeakV2AcceptedResponseParams, - ThinkLiveSettingsV1Params, - ThinkSettingsV1ContextLengthParams, - ThinkSettingsV1EndpointParams, - ThinkSettingsV1FunctionsItemEndpointParams, - ThinkSettingsV1FunctionsItemParams, - ThinkSettingsV1Params, - ThinkSettingsV1ProviderParams, - ThinkSettingsV1Provider_AnthropicParams, - ThinkSettingsV1Provider_AwsBedrockParams, - ThinkSettingsV1Provider_DeepgramParams, - ThinkSettingsV1Provider_GoogleParams, - ThinkSettingsV1Provider_GroqParams, - ThinkSettingsV1Provider_OpenAiParams, - UpdateProjectMemberScopesV1ResponseParams, - UpdateProjectV1ResponseParams, - UsageBreakdownV1ResponseParams, - UsageBreakdownV1ResponseResolutionParams, - UsageBreakdownV1ResponseResultsItemGroupingParams, - UsageBreakdownV1ResponseResultsItemParams, - UsageFieldsV1ResponseModelsItemParams, - UsageFieldsV1ResponseParams, - UsageV1ResponseParams, - UsageV1ResponseResolutionParams, - ) - from .version import __version__ -_dynamic_imports: typing.Dict[str, str] = { - "AgentConfigurationV1": ".types", - "AgentConfigurationV1Params": ".requests", - "AgentThinkModelsV1Response": ".types", - "AgentThinkModelsV1ResponseModelsItem": ".types", - "AgentThinkModelsV1ResponseModelsItemId": ".types", - "AgentThinkModelsV1ResponseModelsItemIdParams": ".requests", - "AgentThinkModelsV1ResponseModelsItemOne": ".types", - "AgentThinkModelsV1ResponseModelsItemOneId": ".types", - "AgentThinkModelsV1ResponseModelsItemOneParams": ".requests", - "AgentThinkModelsV1ResponseModelsItemParams": ".requests", - "AgentThinkModelsV1ResponseModelsItemThree": ".types", - "AgentThinkModelsV1ResponseModelsItemThreeParams": ".requests", - "AgentThinkModelsV1ResponseModelsItemTwo": ".types", - "AgentThinkModelsV1ResponseModelsItemTwoId": ".types", - "AgentThinkModelsV1ResponseModelsItemTwoParams": ".requests", - "AgentThinkModelsV1ResponseModelsItemZero": ".types", - "AgentThinkModelsV1ResponseModelsItemZeroId": ".types", - "AgentThinkModelsV1ResponseModelsItemZeroParams": ".requests", - "AgentThinkModelsV1ResponseParams": ".requests", - "AgentVariableV1": ".types", - "AgentVariableV1Params": ".requests", - "Anthropic": ".types", - "AnthropicModel": ".types", - "AnthropicParams": ".requests", - "AsyncDeepgramClient": ".client", - "AwsBedrockThinkProvider": ".types", - "AwsBedrockThinkProviderCredentials": ".types", - "AwsBedrockThinkProviderCredentialsParams": ".requests", - "AwsBedrockThinkProviderCredentialsType": ".types", - "AwsBedrockThinkProviderModel": ".types", - "AwsBedrockThinkProviderParams": ".requests", - "AwsPollySpeakProvider": ".types", - "AwsPollySpeakProviderCredentials": ".types", - "AwsPollySpeakProviderCredentialsParams": ".requests", - "AwsPollySpeakProviderCredentialsType": ".types", - "AwsPollySpeakProviderEngine": ".types", - "AwsPollySpeakProviderParams": ".requests", - "AwsPollySpeakProviderVoice": ".types", - "BadRequestError": ".errors", - "BillingBreakdownV1Response": ".types", - "BillingBreakdownV1ResponseParams": ".requests", - "BillingBreakdownV1ResponseResolution": ".types", - "BillingBreakdownV1ResponseResolutionParams": ".requests", - "BillingBreakdownV1ResponseResultsItem": ".types", - "BillingBreakdownV1ResponseResultsItemGrouping": ".types", - "BillingBreakdownV1ResponseResultsItemGroupingParams": ".requests", - "BillingBreakdownV1ResponseResultsItemParams": ".requests", - "Cartesia": ".types", - "CartesiaModelId": ".types", - "CartesiaParams": ".requests", - "CartesiaVoice": ".types", - "CartesiaVoiceParams": ".requests", - "CreateAgentConfigurationV1Response": ".types", - "CreateAgentConfigurationV1ResponseParams": ".requests", - "CreateKeyV1Request": ".types", - "CreateKeyV1RequestParams": ".requests", - "CreateKeyV1Response": ".types", - "CreateKeyV1ResponseParams": ".requests", - "CreateProjectDistributionCredentialsV1Response": ".types", - "CreateProjectDistributionCredentialsV1ResponseDistributionCredentials": ".types", - "CreateProjectDistributionCredentialsV1ResponseDistributionCredentialsParams": ".requests", - "CreateProjectDistributionCredentialsV1ResponseMember": ".types", - "CreateProjectDistributionCredentialsV1ResponseMemberParams": ".requests", - "CreateProjectDistributionCredentialsV1ResponseParams": ".requests", - "CreateProjectInviteV1Response": ".types", - "CreateProjectInviteV1ResponseParams": ".requests", - "Deepgram": ".types", - "DeepgramClient": ".client", - "DeepgramClientEnvironment": ".environment", - "DeepgramListenProviderV1": ".types", - "DeepgramListenProviderV1Params": ".requests", - "DeepgramListenProviderV2": ".types", - "DeepgramListenProviderV2Params": ".requests", - "DeepgramModel": ".types", - "DeepgramParams": ".requests", - "DeepgramThinkLiveProviderV1": ".types", - "DeepgramThinkLiveProviderV1Params": ".requests", - "DeepgramThinkProvider": ".types", - "DeepgramThinkProviderModel": ".types", - "DeepgramThinkProviderParams": ".requests", - "DeepgramThinkProviderReasoningMode": ".types", - "DefaultAioHttpClient": "._default_clients", - "DefaultAsyncHttpxClient": "._default_clients", - "DeleteAgentConfigurationV1Response": ".types", - "DeleteAgentVariableV1Response": ".types", - "DeleteProjectInviteV1Response": ".types", - "DeleteProjectInviteV1ResponseParams": ".requests", - "DeleteProjectKeyV1Response": ".types", - "DeleteProjectKeyV1ResponseParams": ".requests", - "DeleteProjectMemberV1Response": ".types", - "DeleteProjectMemberV1ResponseParams": ".requests", - "DeleteProjectV1Response": ".types", - "DeleteProjectV1ResponseParams": ".requests", - "ElevenLabsSpeakProvider": ".types", - "ElevenLabsSpeakProviderModelId": ".types", - "ElevenLabsSpeakProviderParams": ".requests", - "ErrorResponse": ".types", - "ErrorResponseLegacyError": ".types", - "ErrorResponseLegacyErrorParams": ".requests", - "ErrorResponseModernError": ".types", - "ErrorResponseModernErrorParams": ".requests", - "ErrorResponseParams": ".requests", - "ErrorResponseTextError": ".types", - "GetModelV1Response": ".types", - "GetModelV1ResponseBatch": ".types", - "GetModelV1ResponseBatchParams": ".requests", - "GetModelV1ResponseMetadata": ".types", - "GetModelV1ResponseMetadataMetadata": ".types", - "GetModelV1ResponseMetadataMetadataParams": ".requests", - "GetModelV1ResponseMetadataParams": ".requests", - "GetModelV1ResponseParams": ".requests", - "GetProjectBalanceV1Response": ".types", - "GetProjectBalanceV1ResponseParams": ".requests", - "GetProjectDistributionCredentialsV1Response": ".types", - "GetProjectDistributionCredentialsV1ResponseDistributionCredentials": ".types", - "GetProjectDistributionCredentialsV1ResponseDistributionCredentialsParams": ".requests", - "GetProjectDistributionCredentialsV1ResponseMember": ".types", - "GetProjectDistributionCredentialsV1ResponseMemberParams": ".requests", - "GetProjectDistributionCredentialsV1ResponseParams": ".requests", - "GetProjectKeyV1Response": ".types", - "GetProjectKeyV1ResponseItem": ".types", - "GetProjectKeyV1ResponseItemMember": ".types", - "GetProjectKeyV1ResponseItemMemberApiKey": ".types", - "GetProjectKeyV1ResponseItemMemberApiKeyParams": ".requests", - "GetProjectKeyV1ResponseItemMemberParams": ".requests", - "GetProjectKeyV1ResponseItemParams": ".requests", - "GetProjectKeyV1ResponseParams": ".requests", - "GetProjectRequestV1Response": ".types", - "GetProjectRequestV1ResponseParams": ".requests", - "GetProjectV1Response": ".types", - "GetProjectV1ResponseParams": ".requests", - "Google": ".types", - "GoogleModel": ".types", - "GoogleParams": ".requests", - "GoogleVersion": ".types", - "GrantV1Response": ".types", - "GrantV1ResponseParams": ".requests", - "Groq": ".types", - "GroqParams": ".requests", - "GroqReasoningMode": ".types", - "LeaveProjectV1Response": ".types", - "LeaveProjectV1ResponseParams": ".requests", - "ListAgentConfigurationsV1Response": ".types", - "ListAgentConfigurationsV1ResponseParams": ".requests", - "ListAgentVariablesV1Response": ".types", - "ListAgentVariablesV1ResponseParams": ".requests", - "ListBillingFieldsV1Response": ".types", - "ListBillingFieldsV1ResponseDeploymentsItem": ".types", - "ListBillingFieldsV1ResponseParams": ".requests", - "ListModelsV1Response": ".types", - "ListModelsV1ResponseParams": ".requests", - "ListModelsV1ResponseSttModels": ".types", - "ListModelsV1ResponseSttModelsParams": ".requests", - "ListModelsV1ResponseTtsModels": ".types", - "ListModelsV1ResponseTtsModelsMetadata": ".types", - "ListModelsV1ResponseTtsModelsMetadataParams": ".requests", - "ListModelsV1ResponseTtsModelsParams": ".requests", - "ListProjectBalancesV1Response": ".types", - "ListProjectBalancesV1ResponseBalancesItem": ".types", - "ListProjectBalancesV1ResponseBalancesItemParams": ".requests", - "ListProjectBalancesV1ResponseParams": ".requests", - "ListProjectDistributionCredentialsV1Response": ".types", - "ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItem": ".types", - "ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemDistributionCredentials": ".types", - "ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemDistributionCredentialsParams": ".requests", - "ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemMember": ".types", - "ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemMemberParams": ".requests", - "ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemParams": ".requests", - "ListProjectDistributionCredentialsV1ResponseParams": ".requests", - "ListProjectInvitesV1Response": ".types", - "ListProjectInvitesV1ResponseInvitesItem": ".types", - "ListProjectInvitesV1ResponseInvitesItemParams": ".requests", - "ListProjectInvitesV1ResponseParams": ".requests", - "ListProjectKeysV1Response": ".types", - "ListProjectKeysV1ResponseApiKeysItem": ".types", - "ListProjectKeysV1ResponseApiKeysItemApiKey": ".types", - "ListProjectKeysV1ResponseApiKeysItemApiKeyParams": ".requests", - "ListProjectKeysV1ResponseApiKeysItemMember": ".types", - "ListProjectKeysV1ResponseApiKeysItemMemberParams": ".requests", - "ListProjectKeysV1ResponseApiKeysItemParams": ".requests", - "ListProjectKeysV1ResponseParams": ".requests", - "ListProjectMemberScopesV1Response": ".types", - "ListProjectMemberScopesV1ResponseParams": ".requests", - "ListProjectMembersV1Response": ".types", - "ListProjectMembersV1ResponseMembersItem": ".types", - "ListProjectMembersV1ResponseMembersItemParams": ".requests", - "ListProjectMembersV1ResponseParams": ".requests", - "ListProjectPurchasesV1Response": ".types", - "ListProjectPurchasesV1ResponseOrdersItem": ".types", - "ListProjectPurchasesV1ResponseOrdersItemParams": ".requests", - "ListProjectPurchasesV1ResponseParams": ".requests", - "ListProjectRequestsV1Response": ".types", - "ListProjectRequestsV1ResponseParams": ".requests", - "ListProjectsV1Response": ".types", - "ListProjectsV1ResponseParams": ".requests", - "ListProjectsV1ResponseProjectsItem": ".types", - "ListProjectsV1ResponseProjectsItemParams": ".requests", - "ListenV1AcceptedResponse": ".types", - "ListenV1AcceptedResponseParams": ".requests", - "ListenV1Callback": ".types", - "ListenV1CallbackMethod": ".types", - "ListenV1Channels": ".types", - "ListenV1DetectEntities": ".types", - "ListenV1Diarize": ".types", - "ListenV1Dictation": ".types", - "ListenV1Encoding": ".types", - "ListenV1Endpointing": ".types", - "ListenV1Extra": ".types", - "ListenV1InterimResults": ".types", - "ListenV1Keyterm": ".types", - "ListenV1Keywords": ".types", - "ListenV1Language": ".types", - "ListenV1LanguageHint": ".types", - "ListenV1LanguageHintParams": ".requests", - "ListenV1MipOptOut": ".types", - "ListenV1Model": ".types", - "ListenV1Multichannel": ".types", - "ListenV1Numerals": ".types", - "ListenV1ProfanityFilter": ".types", - "ListenV1Punctuate": ".types", - "ListenV1Redact": ".types", - "ListenV1RedactUsage": ".types", - "ListenV1Replace": ".types", - "ListenV1RequestFile": ".types", - "ListenV1Response": ".types", - "ListenV1ResponseMetadata": ".types", - "ListenV1ResponseMetadataDiarizeInfo": ".types", - "ListenV1ResponseMetadataDiarizeInfoParams": ".requests", - "ListenV1ResponseMetadataIntentsInfo": ".types", - "ListenV1ResponseMetadataIntentsInfoParams": ".requests", - "ListenV1ResponseMetadataParams": ".requests", - "ListenV1ResponseMetadataSentimentInfo": ".types", - "ListenV1ResponseMetadataSentimentInfoParams": ".requests", - "ListenV1ResponseMetadataSummaryInfo": ".types", - "ListenV1ResponseMetadataSummaryInfoParams": ".requests", - "ListenV1ResponseMetadataTopicsInfo": ".types", - "ListenV1ResponseMetadataTopicsInfoParams": ".requests", - "ListenV1ResponseParams": ".requests", - "ListenV1ResponseResults": ".types", - "ListenV1ResponseResultsChannels": ".types", - "ListenV1ResponseResultsChannelsItem": ".types", - "ListenV1ResponseResultsChannelsItemAlternativesItem": ".types", - "ListenV1ResponseResultsChannelsItemAlternativesItemEntitiesItem": ".types", - "ListenV1ResponseResultsChannelsItemAlternativesItemEntitiesItemParams": ".requests", - "ListenV1ResponseResultsChannelsItemAlternativesItemParagraphs": ".types", - "ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParagraphsItem": ".types", - "ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParagraphsItemParams": ".requests", - "ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParagraphsItemSentencesItem": ".types", - "ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParagraphsItemSentencesItemParams": ".requests", - "ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParams": ".requests", - "ListenV1ResponseResultsChannelsItemAlternativesItemParams": ".requests", - "ListenV1ResponseResultsChannelsItemAlternativesItemSummariesItem": ".types", - "ListenV1ResponseResultsChannelsItemAlternativesItemSummariesItemParams": ".requests", - "ListenV1ResponseResultsChannelsItemAlternativesItemTopicsItem": ".types", - "ListenV1ResponseResultsChannelsItemAlternativesItemTopicsItemParams": ".requests", - "ListenV1ResponseResultsChannelsItemAlternativesItemWordsItem": ".types", - "ListenV1ResponseResultsChannelsItemAlternativesItemWordsItemParams": ".requests", - "ListenV1ResponseResultsChannelsItemParams": ".requests", - "ListenV1ResponseResultsChannelsItemSearchItem": ".types", - "ListenV1ResponseResultsChannelsItemSearchItemHitsItem": ".types", - "ListenV1ResponseResultsChannelsItemSearchItemHitsItemParams": ".requests", - "ListenV1ResponseResultsChannelsItemSearchItemParams": ".requests", - "ListenV1ResponseResultsChannelsParams": ".requests", - "ListenV1ResponseResultsParams": ".requests", - "ListenV1ResponseResultsSummary": ".types", - "ListenV1ResponseResultsSummaryParams": ".requests", - "ListenV1ResponseResultsUtterances": ".types", - "ListenV1ResponseResultsUtterancesItem": ".types", - "ListenV1ResponseResultsUtterancesItemParams": ".requests", - "ListenV1ResponseResultsUtterancesItemWordsItem": ".types", - "ListenV1ResponseResultsUtterancesItemWordsItemParams": ".requests", - "ListenV1ResponseResultsUtterancesParams": ".requests", - "ListenV1SampleRate": ".types", - "ListenV1Search": ".types", - "ListenV1SmartFormat": ".types", - "ListenV1Tag": ".types", - "ListenV1UtteranceEndMs": ".types", - "ListenV1VadEvents": ".types", - "ListenV1Version": ".types", - "ListenV2ConfigureNumerals": ".types", - "ListenV2ConfigureRedactUsage": ".types", - "ListenV2EagerEotThreshold": ".types", - "ListenV2Encoding": ".types", - "ListenV2EotThreshold": ".types", - "ListenV2EotTimeoutMs": ".types", - "ListenV2Keyterm": ".types", - "ListenV2KeytermParams": ".requests", - "ListenV2LanguageHint": ".types", - "ListenV2LanguageHintParams": ".requests", - "ListenV2MipOptOut": ".types", - "ListenV2Model": ".types", - "ListenV2Numerals": ".types", - "ListenV2ProfanityFilter": ".types", - "ListenV2Redact": ".types", - "ListenV2RedactUsage": ".types", - "ListenV2SampleRate": ".types", - "ListenV2Tag": ".types", - "OpenAiSpeakProvider": ".types", - "OpenAiSpeakProviderModel": ".types", - "OpenAiSpeakProviderParams": ".requests", - "OpenAiSpeakProviderVoice": ".types", - "OpenAiThinkProvider": ".types", - "OpenAiThinkProviderModel": ".types", - "OpenAiThinkProviderParams": ".requests", - "OpenAiThinkProviderReasoningMode": ".types", - "ProjectRequestResponse": ".types", - "ProjectRequestResponseParams": ".requests", - "ReadV1Request": ".types", - "ReadV1RequestParams": ".requests", - "ReadV1RequestText": ".types", - "ReadV1RequestTextParams": ".requests", - "ReadV1RequestUrl": ".types", - "ReadV1RequestUrlParams": ".requests", - "ReadV1Response": ".types", - "ReadV1ResponseMetadata": ".types", - "ReadV1ResponseMetadataMetadata": ".types", - "ReadV1ResponseMetadataMetadataIntentsInfo": ".types", - "ReadV1ResponseMetadataMetadataIntentsInfoParams": ".requests", - "ReadV1ResponseMetadataMetadataParams": ".requests", - "ReadV1ResponseMetadataMetadataSentimentInfo": ".types", - "ReadV1ResponseMetadataMetadataSentimentInfoParams": ".requests", - "ReadV1ResponseMetadataMetadataSummaryInfo": ".types", - "ReadV1ResponseMetadataMetadataSummaryInfoParams": ".requests", - "ReadV1ResponseMetadataMetadataTopicsInfo": ".types", - "ReadV1ResponseMetadataMetadataTopicsInfoParams": ".requests", - "ReadV1ResponseMetadataParams": ".requests", - "ReadV1ResponseParams": ".requests", - "ReadV1ResponseResults": ".types", - "ReadV1ResponseResultsParams": ".requests", - "ReadV1ResponseResultsSummary": ".types", - "ReadV1ResponseResultsSummaryParams": ".requests", - "ReadV1ResponseResultsSummaryResults": ".types", - "ReadV1ResponseResultsSummaryResultsParams": ".requests", - "ReadV1ResponseResultsSummaryResultsSummary": ".types", - "ReadV1ResponseResultsSummaryResultsSummaryParams": ".requests", - "SharedIntents": ".types", - "SharedIntentsParams": ".requests", - "SharedIntentsSegmentsItem": ".types", - "SharedIntentsSegmentsItemIntentsItem": ".types", - "SharedIntentsSegmentsItemIntentsItemParams": ".requests", - "SharedIntentsSegmentsItemParams": ".requests", - "SharedSentiments": ".types", - "SharedSentimentsAverage": ".types", - "SharedSentimentsAverageParams": ".requests", - "SharedSentimentsParams": ".requests", - "SharedSentimentsSegmentsItem": ".types", - "SharedSentimentsSegmentsItemParams": ".requests", - "SharedTopics": ".types", - "SharedTopicsParams": ".requests", - "SharedTopicsSegmentsItem": ".types", - "SharedTopicsSegmentsItemParams": ".requests", - "SharedTopicsSegmentsItemTopicsItem": ".types", - "SharedTopicsSegmentsItemTopicsItemParams": ".requests", - "SpeakSettingsV1": ".types", - "SpeakSettingsV1Endpoint": ".types", - "SpeakSettingsV1EndpointParams": ".requests", - "SpeakSettingsV1Params": ".requests", - "SpeakSettingsV1Provider": ".types", - "SpeakSettingsV1ProviderParams": ".requests", - "SpeakSettingsV1Provider_AwsPolly": ".types", - "SpeakSettingsV1Provider_AwsPollyParams": ".requests", - "SpeakSettingsV1Provider_Cartesia": ".types", - "SpeakSettingsV1Provider_CartesiaParams": ".requests", - "SpeakSettingsV1Provider_Deepgram": ".types", - "SpeakSettingsV1Provider_DeepgramParams": ".requests", - "SpeakSettingsV1Provider_ElevenLabs": ".types", - "SpeakSettingsV1Provider_ElevenLabsParams": ".requests", - "SpeakSettingsV1Provider_OpenAi": ".types", - "SpeakSettingsV1Provider_OpenAiParams": ".requests", - "SpeakV1Encoding": ".types", - "SpeakV1MipOptOut": ".types", - "SpeakV1Model": ".types", - "SpeakV1Response": ".types", - "SpeakV1SampleRate": ".types", - "SpeakV1Speed": ".types", - "SpeakV2AcceptedResponse": ".types", - "SpeakV2AcceptedResponseParams": ".requests", - "SpeakV2Encoding": ".types", - "SpeakV2Expressivity": ".types", - "SpeakV2MipOptOut": ".types", - "SpeakV2Model": ".types", - "SpeakV2NormalizeVolume": ".types", - "SpeakV2Response": ".types", - "SpeakV2SampleRate": ".types", - "SpeakV2Speed": ".types", - "SpeakV2SpeedValue": ".types", - "SpeakV2Tag": ".types", - "ThinkLiveSettingsV1": ".types", - "ThinkLiveSettingsV1Params": ".requests", - "ThinkSettingsV1": ".types", - "ThinkSettingsV1ContextLength": ".types", - "ThinkSettingsV1ContextLengthParams": ".requests", - "ThinkSettingsV1Endpoint": ".types", - "ThinkSettingsV1EndpointParams": ".requests", - "ThinkSettingsV1FunctionsItem": ".types", - "ThinkSettingsV1FunctionsItemEndpoint": ".types", - "ThinkSettingsV1FunctionsItemEndpointParams": ".requests", - "ThinkSettingsV1FunctionsItemParams": ".requests", - "ThinkSettingsV1Params": ".requests", - "ThinkSettingsV1Provider": ".types", - "ThinkSettingsV1ProviderParams": ".requests", - "ThinkSettingsV1Provider_Anthropic": ".types", - "ThinkSettingsV1Provider_AnthropicParams": ".requests", - "ThinkSettingsV1Provider_AwsBedrock": ".types", - "ThinkSettingsV1Provider_AwsBedrockParams": ".requests", - "ThinkSettingsV1Provider_Deepgram": ".types", - "ThinkSettingsV1Provider_DeepgramParams": ".requests", - "ThinkSettingsV1Provider_Google": ".types", - "ThinkSettingsV1Provider_GoogleParams": ".requests", - "ThinkSettingsV1Provider_Groq": ".types", - "ThinkSettingsV1Provider_GroqParams": ".requests", - "ThinkSettingsV1Provider_OpenAi": ".types", - "ThinkSettingsV1Provider_OpenAiParams": ".requests", - "UpdateProjectMemberScopesV1Response": ".types", - "UpdateProjectMemberScopesV1ResponseParams": ".requests", - "UpdateProjectV1Response": ".types", - "UpdateProjectV1ResponseParams": ".requests", - "UsageBreakdownV1Response": ".types", - "UsageBreakdownV1ResponseParams": ".requests", - "UsageBreakdownV1ResponseResolution": ".types", - "UsageBreakdownV1ResponseResolutionParams": ".requests", - "UsageBreakdownV1ResponseResultsItem": ".types", - "UsageBreakdownV1ResponseResultsItemGrouping": ".types", - "UsageBreakdownV1ResponseResultsItemGroupingParams": ".requests", - "UsageBreakdownV1ResponseResultsItemParams": ".requests", - "UsageFieldsV1Response": ".types", - "UsageFieldsV1ResponseModelsItem": ".types", - "UsageFieldsV1ResponseModelsItemParams": ".requests", - "UsageFieldsV1ResponseParams": ".requests", - "UsageV1Response": ".types", - "UsageV1ResponseParams": ".requests", - "UsageV1ResponseResolution": ".types", - "UsageV1ResponseResolutionParams": ".requests", - "__version__": ".version", - "agent": ".agent", - "auth": ".auth", - "listen": ".listen", - "manage": ".manage", - "read": ".read", - "self_hosted": ".self_hosted", - "speak": ".speak", - "voice_agent": ".voice_agent", -} - -_dynamic_imports.update( - { - "SharedIntentsResults": ".types", - "SharedIntentsResultsIntents": ".types", - "SharedIntentsResultsIntentsParams": ".requests", - "SharedIntentsResultsIntentsSegmentsItem": ".types", - "SharedIntentsResultsIntentsSegmentsItemIntentsItem": ".types", - "SharedIntentsResultsIntentsSegmentsItemIntentsItemParams": ".requests", - "SharedIntentsResultsIntentsSegmentsItemParams": ".requests", - "SharedIntentsResultsParams": ".requests", - "SharedTopicsResults": ".types", - "SharedTopicsResultsParams": ".requests", - "SharedTopicsResultsTopics": ".types", - "SharedTopicsResultsTopicsParams": ".requests", - "SharedTopicsResultsTopicsSegmentsItem": ".types", - "SharedTopicsResultsTopicsSegmentsItemParams": ".requests", - "SharedTopicsResultsTopicsSegmentsItemTopicsItem": ".types", - "SharedTopicsResultsTopicsSegmentsItemTopicsItemParams": ".requests", - "AnthropicThinkProviderModel": ".types", - "CartesiaSpeakProviderModelId": ".types", - "CartesiaSpeakProviderVoice": ".types", - "CartesiaSpeakProviderVoiceParams": ".requests", - "CreateKeyV1RequestOne": ".types", - "DeepgramListenProviderV2LanguageHint": ".types", - "DeepgramListenProviderV2LanguageHintParams": ".requests", - "DeepgramSpeakProviderModel": ".types", - "GoogleThinkProviderModel": ".types", - "GoogleThinkProviderVersion": ".types", - "GroqThinkProviderReasoningMode": ".types", - } -) - - -def __getattr__(attr_name: str) -> typing.Any: - module_name = _dynamic_imports.get(attr_name) - if module_name is None: - raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") - try: - module = import_module(module_name, __package__) - if module_name == f".{attr_name}": - return module - else: - return getattr(module, attr_name) - except ImportError as e: - raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e - except AttributeError as e: - raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e - - -def __dir__(): - lazy_attrs = list(_dynamic_imports.keys()) - return sorted(lazy_attrs) - - -__all__ = [ - "AgentConfigurationV1", - "AgentConfigurationV1Params", - "AgentThinkModelsV1Response", - "AgentThinkModelsV1ResponseModelsItem", - "AgentThinkModelsV1ResponseModelsItemId", - "AgentThinkModelsV1ResponseModelsItemIdParams", - "AgentThinkModelsV1ResponseModelsItemOne", - "AgentThinkModelsV1ResponseModelsItemOneId", - "AgentThinkModelsV1ResponseModelsItemOneParams", - "AgentThinkModelsV1ResponseModelsItemParams", - "AgentThinkModelsV1ResponseModelsItemThree", - "AgentThinkModelsV1ResponseModelsItemThreeParams", - "AgentThinkModelsV1ResponseModelsItemTwo", - "AgentThinkModelsV1ResponseModelsItemTwoId", - "AgentThinkModelsV1ResponseModelsItemTwoParams", - "AgentThinkModelsV1ResponseModelsItemZero", - "AgentThinkModelsV1ResponseModelsItemZeroId", - "AgentThinkModelsV1ResponseModelsItemZeroParams", - "AgentThinkModelsV1ResponseParams", - "AgentVariableV1", - "AgentVariableV1Params", - "Anthropic", - "AnthropicModel", - "AnthropicParams", - "AsyncDeepgramClient", - "AwsBedrockThinkProvider", - "AwsBedrockThinkProviderCredentials", - "AwsBedrockThinkProviderCredentialsParams", - "AwsBedrockThinkProviderCredentialsType", - "AwsBedrockThinkProviderModel", - "AwsBedrockThinkProviderParams", - "AwsPollySpeakProvider", - "AwsPollySpeakProviderCredentials", - "AwsPollySpeakProviderCredentialsParams", - "AwsPollySpeakProviderCredentialsType", - "AwsPollySpeakProviderEngine", - "AwsPollySpeakProviderParams", - "AwsPollySpeakProviderVoice", - "BadRequestError", - "BillingBreakdownV1Response", - "BillingBreakdownV1ResponseParams", - "BillingBreakdownV1ResponseResolution", - "BillingBreakdownV1ResponseResolutionParams", - "BillingBreakdownV1ResponseResultsItem", - "BillingBreakdownV1ResponseResultsItemGrouping", - "BillingBreakdownV1ResponseResultsItemGroupingParams", - "BillingBreakdownV1ResponseResultsItemParams", - "Cartesia", - "CartesiaModelId", - "CartesiaParams", - "CartesiaVoice", - "CartesiaVoiceParams", - "CreateAgentConfigurationV1Response", - "CreateAgentConfigurationV1ResponseParams", - "CreateKeyV1Request", - "CreateKeyV1RequestParams", - "CreateKeyV1Response", - "CreateKeyV1ResponseParams", - "CreateProjectDistributionCredentialsV1Response", - "CreateProjectDistributionCredentialsV1ResponseDistributionCredentials", - "CreateProjectDistributionCredentialsV1ResponseDistributionCredentialsParams", - "CreateProjectDistributionCredentialsV1ResponseMember", - "CreateProjectDistributionCredentialsV1ResponseMemberParams", - "CreateProjectDistributionCredentialsV1ResponseParams", - "CreateProjectInviteV1Response", - "CreateProjectInviteV1ResponseParams", - "Deepgram", - "DeepgramClient", - "DeepgramClientEnvironment", - "DeepgramListenProviderV1", - "DeepgramListenProviderV1Params", - "DeepgramListenProviderV2", - "DeepgramListenProviderV2Params", - "DeepgramModel", - "DeepgramParams", - "DeepgramThinkLiveProviderV1", - "DeepgramThinkLiveProviderV1Params", - "DeepgramThinkProvider", - "DeepgramThinkProviderModel", - "DeepgramThinkProviderParams", - "DeepgramThinkProviderReasoningMode", - "DefaultAioHttpClient", - "DefaultAsyncHttpxClient", - "DeleteAgentConfigurationV1Response", - "DeleteAgentVariableV1Response", - "DeleteProjectInviteV1Response", - "DeleteProjectInviteV1ResponseParams", - "DeleteProjectKeyV1Response", - "DeleteProjectKeyV1ResponseParams", - "DeleteProjectMemberV1Response", - "DeleteProjectMemberV1ResponseParams", - "DeleteProjectV1Response", - "DeleteProjectV1ResponseParams", - "ElevenLabsSpeakProvider", - "ElevenLabsSpeakProviderModelId", - "ElevenLabsSpeakProviderParams", - "ErrorResponse", - "ErrorResponseLegacyError", - "ErrorResponseLegacyErrorParams", - "ErrorResponseModernError", - "ErrorResponseModernErrorParams", - "ErrorResponseParams", - "ErrorResponseTextError", - "GetModelV1Response", - "GetModelV1ResponseBatch", - "GetModelV1ResponseBatchParams", - "GetModelV1ResponseMetadata", - "GetModelV1ResponseMetadataMetadata", - "GetModelV1ResponseMetadataMetadataParams", - "GetModelV1ResponseMetadataParams", - "GetModelV1ResponseParams", - "GetProjectBalanceV1Response", - "GetProjectBalanceV1ResponseParams", - "GetProjectDistributionCredentialsV1Response", - "GetProjectDistributionCredentialsV1ResponseDistributionCredentials", - "GetProjectDistributionCredentialsV1ResponseDistributionCredentialsParams", - "GetProjectDistributionCredentialsV1ResponseMember", - "GetProjectDistributionCredentialsV1ResponseMemberParams", - "GetProjectDistributionCredentialsV1ResponseParams", - "GetProjectKeyV1Response", - "GetProjectKeyV1ResponseItem", - "GetProjectKeyV1ResponseItemMember", - "GetProjectKeyV1ResponseItemMemberApiKey", - "GetProjectKeyV1ResponseItemMemberApiKeyParams", - "GetProjectKeyV1ResponseItemMemberParams", - "GetProjectKeyV1ResponseItemParams", - "GetProjectKeyV1ResponseParams", - "GetProjectRequestV1Response", - "GetProjectRequestV1ResponseParams", - "GetProjectV1Response", - "GetProjectV1ResponseParams", - "Google", - "GoogleModel", - "GoogleParams", - "GoogleVersion", - "GrantV1Response", - "GrantV1ResponseParams", - "Groq", - "GroqParams", - "GroqReasoningMode", - "LeaveProjectV1Response", - "LeaveProjectV1ResponseParams", - "ListAgentConfigurationsV1Response", - "ListAgentConfigurationsV1ResponseParams", - "ListAgentVariablesV1Response", - "ListAgentVariablesV1ResponseParams", - "ListBillingFieldsV1Response", - "ListBillingFieldsV1ResponseDeploymentsItem", - "ListBillingFieldsV1ResponseParams", - "ListModelsV1Response", - "ListModelsV1ResponseParams", - "ListModelsV1ResponseSttModels", - "ListModelsV1ResponseSttModelsParams", - "ListModelsV1ResponseTtsModels", - "ListModelsV1ResponseTtsModelsMetadata", - "ListModelsV1ResponseTtsModelsMetadataParams", - "ListModelsV1ResponseTtsModelsParams", - "ListProjectBalancesV1Response", - "ListProjectBalancesV1ResponseBalancesItem", - "ListProjectBalancesV1ResponseBalancesItemParams", - "ListProjectBalancesV1ResponseParams", - "ListProjectDistributionCredentialsV1Response", - "ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItem", - "ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemDistributionCredentials", - "ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemDistributionCredentialsParams", - "ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemMember", - "ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemMemberParams", - "ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemParams", - "ListProjectDistributionCredentialsV1ResponseParams", - "ListProjectInvitesV1Response", - "ListProjectInvitesV1ResponseInvitesItem", - "ListProjectInvitesV1ResponseInvitesItemParams", - "ListProjectInvitesV1ResponseParams", - "ListProjectKeysV1Response", - "ListProjectKeysV1ResponseApiKeysItem", - "ListProjectKeysV1ResponseApiKeysItemApiKey", - "ListProjectKeysV1ResponseApiKeysItemApiKeyParams", - "ListProjectKeysV1ResponseApiKeysItemMember", - "ListProjectKeysV1ResponseApiKeysItemMemberParams", - "ListProjectKeysV1ResponseApiKeysItemParams", - "ListProjectKeysV1ResponseParams", - "ListProjectMemberScopesV1Response", - "ListProjectMemberScopesV1ResponseParams", - "ListProjectMembersV1Response", - "ListProjectMembersV1ResponseMembersItem", - "ListProjectMembersV1ResponseMembersItemParams", - "ListProjectMembersV1ResponseParams", - "ListProjectPurchasesV1Response", - "ListProjectPurchasesV1ResponseOrdersItem", - "ListProjectPurchasesV1ResponseOrdersItemParams", - "ListProjectPurchasesV1ResponseParams", - "ListProjectRequestsV1Response", - "ListProjectRequestsV1ResponseParams", - "ListProjectsV1Response", - "ListProjectsV1ResponseParams", - "ListProjectsV1ResponseProjectsItem", - "ListProjectsV1ResponseProjectsItemParams", - "ListenV1AcceptedResponse", - "ListenV1AcceptedResponseParams", - "ListenV1Callback", - "ListenV1CallbackMethod", - "ListenV1Channels", - "ListenV1DetectEntities", - "ListenV1Diarize", - "ListenV1Dictation", - "ListenV1Encoding", - "ListenV1Endpointing", - "ListenV1Extra", - "ListenV1InterimResults", - "ListenV1Keyterm", - "ListenV1Keywords", - "ListenV1Language", - "ListenV1LanguageHint", - "ListenV1LanguageHintParams", - "ListenV1MipOptOut", - "ListenV1Model", - "ListenV1Multichannel", - "ListenV1Numerals", - "ListenV1ProfanityFilter", - "ListenV1Punctuate", - "ListenV1Redact", - "ListenV1RedactUsage", - "ListenV1Replace", - "ListenV1RequestFile", - "ListenV1Response", - "ListenV1ResponseMetadata", - "ListenV1ResponseMetadataDiarizeInfo", - "ListenV1ResponseMetadataDiarizeInfoParams", - "ListenV1ResponseMetadataIntentsInfo", - "ListenV1ResponseMetadataIntentsInfoParams", - "ListenV1ResponseMetadataParams", - "ListenV1ResponseMetadataSentimentInfo", - "ListenV1ResponseMetadataSentimentInfoParams", - "ListenV1ResponseMetadataSummaryInfo", - "ListenV1ResponseMetadataSummaryInfoParams", - "ListenV1ResponseMetadataTopicsInfo", - "ListenV1ResponseMetadataTopicsInfoParams", - "ListenV1ResponseParams", - "ListenV1ResponseResults", - "ListenV1ResponseResultsChannels", - "ListenV1ResponseResultsChannelsItem", - "ListenV1ResponseResultsChannelsItemAlternativesItem", - "ListenV1ResponseResultsChannelsItemAlternativesItemEntitiesItem", - "ListenV1ResponseResultsChannelsItemAlternativesItemEntitiesItemParams", - "ListenV1ResponseResultsChannelsItemAlternativesItemParagraphs", - "ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParagraphsItem", - "ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParagraphsItemParams", - "ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParagraphsItemSentencesItem", - "ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParagraphsItemSentencesItemParams", - "ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParams", - "ListenV1ResponseResultsChannelsItemAlternativesItemParams", - "ListenV1ResponseResultsChannelsItemAlternativesItemSummariesItem", - "ListenV1ResponseResultsChannelsItemAlternativesItemSummariesItemParams", - "ListenV1ResponseResultsChannelsItemAlternativesItemTopicsItem", - "ListenV1ResponseResultsChannelsItemAlternativesItemTopicsItemParams", - "ListenV1ResponseResultsChannelsItemAlternativesItemWordsItem", - "ListenV1ResponseResultsChannelsItemAlternativesItemWordsItemParams", - "ListenV1ResponseResultsChannelsItemParams", - "ListenV1ResponseResultsChannelsItemSearchItem", - "ListenV1ResponseResultsChannelsItemSearchItemHitsItem", - "ListenV1ResponseResultsChannelsItemSearchItemHitsItemParams", - "ListenV1ResponseResultsChannelsItemSearchItemParams", - "ListenV1ResponseResultsChannelsParams", - "ListenV1ResponseResultsParams", - "ListenV1ResponseResultsSummary", - "ListenV1ResponseResultsSummaryParams", - "ListenV1ResponseResultsUtterances", - "ListenV1ResponseResultsUtterancesItem", - "ListenV1ResponseResultsUtterancesItemParams", - "ListenV1ResponseResultsUtterancesItemWordsItem", - "ListenV1ResponseResultsUtterancesItemWordsItemParams", - "ListenV1ResponseResultsUtterancesParams", - "ListenV1SampleRate", - "ListenV1Search", - "ListenV1SmartFormat", - "ListenV1Tag", - "ListenV1UtteranceEndMs", - "ListenV1VadEvents", - "ListenV1Version", - "ListenV2ConfigureNumerals", - "ListenV2ConfigureRedactUsage", - "ListenV2EagerEotThreshold", - "ListenV2Encoding", - "ListenV2EotThreshold", - "ListenV2EotTimeoutMs", - "ListenV2Keyterm", - "ListenV2KeytermParams", - "ListenV2LanguageHint", - "ListenV2LanguageHintParams", - "ListenV2MipOptOut", - "ListenV2Model", - "ListenV2Numerals", - "ListenV2ProfanityFilter", - "ListenV2Redact", - "ListenV2RedactUsage", - "ListenV2SampleRate", - "ListenV2Tag", - "OpenAiSpeakProvider", - "OpenAiSpeakProviderModel", - "OpenAiSpeakProviderParams", - "OpenAiSpeakProviderVoice", - "OpenAiThinkProvider", - "OpenAiThinkProviderModel", - "OpenAiThinkProviderParams", - "OpenAiThinkProviderReasoningMode", - "ProjectRequestResponse", - "ProjectRequestResponseParams", - "ReadV1Request", - "ReadV1RequestParams", - "ReadV1RequestText", - "ReadV1RequestTextParams", - "ReadV1RequestUrl", - "ReadV1RequestUrlParams", - "ReadV1Response", - "ReadV1ResponseMetadata", - "ReadV1ResponseMetadataMetadata", - "ReadV1ResponseMetadataMetadataIntentsInfo", - "ReadV1ResponseMetadataMetadataIntentsInfoParams", - "ReadV1ResponseMetadataMetadataParams", - "ReadV1ResponseMetadataMetadataSentimentInfo", - "ReadV1ResponseMetadataMetadataSentimentInfoParams", - "ReadV1ResponseMetadataMetadataSummaryInfo", - "ReadV1ResponseMetadataMetadataSummaryInfoParams", - "ReadV1ResponseMetadataMetadataTopicsInfo", - "ReadV1ResponseMetadataMetadataTopicsInfoParams", - "ReadV1ResponseMetadataParams", - "ReadV1ResponseParams", - "ReadV1ResponseResults", - "ReadV1ResponseResultsParams", - "ReadV1ResponseResultsSummary", - "ReadV1ResponseResultsSummaryParams", - "ReadV1ResponseResultsSummaryResults", - "ReadV1ResponseResultsSummaryResultsParams", - "ReadV1ResponseResultsSummaryResultsSummary", - "ReadV1ResponseResultsSummaryResultsSummaryParams", - "SharedIntents", - "SharedIntentsParams", - "SharedIntentsSegmentsItem", - "SharedIntentsSegmentsItemIntentsItem", - "SharedIntentsSegmentsItemIntentsItemParams", - "SharedIntentsSegmentsItemParams", - "SharedSentiments", - "SharedSentimentsAverage", - "SharedSentimentsAverageParams", - "SharedSentimentsParams", - "SharedSentimentsSegmentsItem", - "SharedSentimentsSegmentsItemParams", - "SharedTopics", - "SharedTopicsParams", - "SharedTopicsSegmentsItem", - "SharedTopicsSegmentsItemParams", - "SharedTopicsSegmentsItemTopicsItem", - "SharedTopicsSegmentsItemTopicsItemParams", - "SpeakSettingsV1", - "SpeakSettingsV1Endpoint", - "SpeakSettingsV1EndpointParams", - "SpeakSettingsV1Params", - "SpeakSettingsV1Provider", - "SpeakSettingsV1ProviderParams", - "SpeakSettingsV1Provider_AwsPolly", - "SpeakSettingsV1Provider_AwsPollyParams", - "SpeakSettingsV1Provider_Cartesia", - "SpeakSettingsV1Provider_CartesiaParams", - "SpeakSettingsV1Provider_Deepgram", - "SpeakSettingsV1Provider_DeepgramParams", - "SpeakSettingsV1Provider_ElevenLabs", - "SpeakSettingsV1Provider_ElevenLabsParams", - "SpeakSettingsV1Provider_OpenAi", - "SpeakSettingsV1Provider_OpenAiParams", - "SpeakV1Encoding", - "SpeakV1MipOptOut", - "SpeakV1Model", - "SpeakV1Response", - "SpeakV1SampleRate", - "SpeakV1Speed", - "SpeakV2AcceptedResponse", - "SpeakV2AcceptedResponseParams", - "SpeakV2Encoding", - "SpeakV2Expressivity", - "SpeakV2MipOptOut", - "SpeakV2Model", - "SpeakV2NormalizeVolume", - "SpeakV2Response", - "SpeakV2SampleRate", - "SpeakV2Speed", - "SpeakV2SpeedValue", - "SpeakV2Tag", - "ThinkLiveSettingsV1", - "ThinkLiveSettingsV1Params", - "ThinkSettingsV1", - "ThinkSettingsV1ContextLength", - "ThinkSettingsV1ContextLengthParams", - "ThinkSettingsV1Endpoint", - "ThinkSettingsV1EndpointParams", - "ThinkSettingsV1FunctionsItem", - "ThinkSettingsV1FunctionsItemEndpoint", - "ThinkSettingsV1FunctionsItemEndpointParams", - "ThinkSettingsV1FunctionsItemParams", - "ThinkSettingsV1Params", - "ThinkSettingsV1Provider", - "ThinkSettingsV1ProviderParams", - "ThinkSettingsV1Provider_Anthropic", - "ThinkSettingsV1Provider_AnthropicParams", - "ThinkSettingsV1Provider_AwsBedrock", - "ThinkSettingsV1Provider_AwsBedrockParams", - "ThinkSettingsV1Provider_Deepgram", - "ThinkSettingsV1Provider_DeepgramParams", - "ThinkSettingsV1Provider_Google", - "ThinkSettingsV1Provider_GoogleParams", - "ThinkSettingsV1Provider_Groq", - "ThinkSettingsV1Provider_GroqParams", - "ThinkSettingsV1Provider_OpenAi", - "ThinkSettingsV1Provider_OpenAiParams", - "UpdateProjectMemberScopesV1Response", - "UpdateProjectMemberScopesV1ResponseParams", - "UpdateProjectV1Response", - "UpdateProjectV1ResponseParams", - "UsageBreakdownV1Response", - "UsageBreakdownV1ResponseParams", - "UsageBreakdownV1ResponseResolution", - "UsageBreakdownV1ResponseResolutionParams", - "UsageBreakdownV1ResponseResultsItem", - "UsageBreakdownV1ResponseResultsItemGrouping", - "UsageBreakdownV1ResponseResultsItemGroupingParams", - "UsageBreakdownV1ResponseResultsItemParams", - "UsageFieldsV1Response", - "UsageFieldsV1ResponseModelsItem", - "UsageFieldsV1ResponseModelsItemParams", - "UsageFieldsV1ResponseParams", - "UsageV1Response", - "UsageV1ResponseParams", - "UsageV1ResponseResolution", - "UsageV1ResponseResolutionParams", - "__version__", - "agent", - "auth", - "listen", - "manage", - "read", - "self_hosted", - "speak", - "voice_agent", -] - -__all__.extend( - [ - "SharedIntentsResults", - "SharedIntentsResultsIntents", - "SharedIntentsResultsIntentsParams", - "SharedIntentsResultsIntentsSegmentsItem", - "SharedIntentsResultsIntentsSegmentsItemIntentsItem", - "SharedIntentsResultsIntentsSegmentsItemIntentsItemParams", - "SharedIntentsResultsIntentsSegmentsItemParams", - "SharedIntentsResultsParams", - "SharedTopicsResults", - "SharedTopicsResultsParams", - "SharedTopicsResultsTopics", - "SharedTopicsResultsTopicsParams", - "SharedTopicsResultsTopicsSegmentsItem", - "SharedTopicsResultsTopicsSegmentsItemParams", - "SharedTopicsResultsTopicsSegmentsItemTopicsItem", - "SharedTopicsResultsTopicsSegmentsItemTopicsItemParams", - "AnthropicThinkProviderModel", - "CartesiaSpeakProviderModelId", - "CartesiaSpeakProviderVoice", - "CartesiaSpeakProviderVoiceParams", - "CreateKeyV1RequestOne", - "DeepgramListenProviderV2LanguageHint", - "DeepgramListenProviderV2LanguageHintParams", - "DeepgramSpeakProviderModel", - "GoogleThinkProviderModel", - "GoogleThinkProviderVersion", - "GroqThinkProviderReasoningMode", - ] -) diff --git a/src/deepgram/agent/__init__.py b/src/deepgram/agent/__init__.py index a9248312..23f670de 100644 --- a/src/deepgram/agent/__init__.py +++ b/src/deepgram/agent/__init__.py @@ -293,6 +293,40 @@ "v1": ".v1", } +_dynamic_imports.update( + { + "AgentV1HistoryContent": ".v1", + "AgentV1HistoryContentParams": ".v1", + "AgentV1HistoryContentRole": ".v1", + "AgentV1HistoryFunctionCalls": ".v1", + "AgentV1HistoryFunctionCallsFunctionCallsItem": ".v1", + "AgentV1HistoryFunctionCallsFunctionCallsItemParams": ".v1", + "AgentV1HistoryFunctionCallsParams": ".v1", + "AgentV1SettingsAgentContextContextMessagesItemContentRole": ".v1", + "AgentV1SettingsAgentContextContextMessagesItemFunctionCallsFunctionCallsItem": ".v1", + "AgentV1SettingsAgentContextContextMessagesItemFunctionCallsFunctionCallsItemParams": ".v1", + "AgentV1SettingsAgentContextListenProviderV1": ".v1", + "AgentV1SettingsAgentContextListenProviderV1Params": ".v1", + "AgentV1SettingsAgentContextListenProviderV2": ".v1", + "AgentV1SettingsAgentContextListenProviderV2LanguageHint": ".v1", + "AgentV1SettingsAgentContextListenProviderV2LanguageHintParams": ".v1", + "AgentV1SettingsAgentContextListenProviderV2Params": ".v1", + "AgentV1SettingsAgentContextMessagesItem": ".v1", + "AgentV1SettingsAgentContextMessagesItemContent": ".v1", + "AgentV1SettingsAgentContextMessagesItemContentParams": ".v1", + "AgentV1SettingsAgentContextMessagesItemContentRole": ".v1", + "AgentV1SettingsAgentContextMessagesItemFunctionCalls": ".v1", + "AgentV1SettingsAgentContextMessagesItemFunctionCallsFunctionCallsItem": ".v1", + "AgentV1SettingsAgentContextMessagesItemFunctionCallsFunctionCallsItemParams": ".v1", + "AgentV1SettingsAgentContextMessagesItemFunctionCallsParams": ".v1", + "AgentV1SettingsAgentContextMessagesItemParams": ".v1", + "AgentV1SettingsAgentListenProviderV1": ".v1", + "AgentV1SettingsAgentListenProviderV1Params": ".v1", + "AgentV1SettingsAgentListenProviderV2": ".v1", + "AgentV1SettingsAgentListenProviderV2Params": ".v1", + } +) + def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) @@ -458,3 +492,37 @@ def __dir__(): "FunctionCallHistoryMessageParams", "v1", ] + +__all__.extend( + [ + "AgentV1HistoryContent", + "AgentV1HistoryContentParams", + "AgentV1HistoryContentRole", + "AgentV1HistoryFunctionCalls", + "AgentV1HistoryFunctionCallsFunctionCallsItem", + "AgentV1HistoryFunctionCallsFunctionCallsItemParams", + "AgentV1HistoryFunctionCallsParams", + "AgentV1SettingsAgentContextContextMessagesItemContentRole", + "AgentV1SettingsAgentContextContextMessagesItemFunctionCallsFunctionCallsItem", + "AgentV1SettingsAgentContextContextMessagesItemFunctionCallsFunctionCallsItemParams", + "AgentV1SettingsAgentContextListenProviderV1", + "AgentV1SettingsAgentContextListenProviderV1Params", + "AgentV1SettingsAgentContextListenProviderV2", + "AgentV1SettingsAgentContextListenProviderV2LanguageHint", + "AgentV1SettingsAgentContextListenProviderV2LanguageHintParams", + "AgentV1SettingsAgentContextListenProviderV2Params", + "AgentV1SettingsAgentContextMessagesItem", + "AgentV1SettingsAgentContextMessagesItemContent", + "AgentV1SettingsAgentContextMessagesItemContentParams", + "AgentV1SettingsAgentContextMessagesItemContentRole", + "AgentV1SettingsAgentContextMessagesItemFunctionCalls", + "AgentV1SettingsAgentContextMessagesItemFunctionCallsFunctionCallsItem", + "AgentV1SettingsAgentContextMessagesItemFunctionCallsFunctionCallsItemParams", + "AgentV1SettingsAgentContextMessagesItemFunctionCallsParams", + "AgentV1SettingsAgentContextMessagesItemParams", + "AgentV1SettingsAgentListenProviderV1", + "AgentV1SettingsAgentListenProviderV1Params", + "AgentV1SettingsAgentListenProviderV2", + "AgentV1SettingsAgentListenProviderV2Params", + ] +) diff --git a/src/deepgram/agent/__init__.py.bak b/src/deepgram/agent/__init__.py.bak deleted file mode 100644 index 23f670de..00000000 --- a/src/deepgram/agent/__init__.py.bak +++ /dev/null @@ -1,528 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# isort: skip_file - -import typing -from importlib import import_module - -if typing.TYPE_CHECKING: - from . import v1 - from .v1 import ( - AgentV1AgentAudioDone, - AgentV1AgentAudioDoneParams, - AgentV1AgentStartedSpeaking, - AgentV1AgentStartedSpeakingParams, - AgentV1AgentThinking, - AgentV1AgentThinkingParams, - AgentV1ConversationText, - AgentV1ConversationTextConversationalBehavior, - AgentV1ConversationTextParams, - AgentV1ConversationTextRole, - AgentV1CustomFromThinkProvider, - AgentV1CustomFromThinkProviderParams, - AgentV1CustomToThinkProvider, - AgentV1CustomToThinkProviderParams, - AgentV1Error, - AgentV1ErrorParams, - AgentV1ForceEndTurn, - AgentV1ForceEndTurnParams, - AgentV1FrustrationDetected, - AgentV1FrustrationDetectedParams, - AgentV1FunctionCallCancelled, - AgentV1FunctionCallCancelledFunctionsItem, - AgentV1FunctionCallCancelledFunctionsItemParams, - AgentV1FunctionCallCancelledParams, - AgentV1FunctionCallRequest, - AgentV1FunctionCallRequestFunctionsItem, - AgentV1FunctionCallRequestFunctionsItemParams, - AgentV1FunctionCallRequestParams, - AgentV1History, - AgentV1HistoryParams, - AgentV1InjectAgentMessage, - AgentV1InjectAgentMessageBehavior, - AgentV1InjectAgentMessageParams, - AgentV1InjectDynamicAgentMessage, - AgentV1InjectDynamicAgentMessageBehavior, - AgentV1InjectDynamicAgentMessageParams, - AgentV1InjectUserMessage, - AgentV1InjectUserMessageParams, - AgentV1InjectionRefused, - AgentV1InjectionRefusedParams, - AgentV1KeepAlive, - AgentV1KeepAliveParams, - AgentV1LatencyReport, - AgentV1LatencyReportParams, - AgentV1ListenUpdated, - AgentV1ListenUpdatedParams, - AgentV1PromptUpdated, - AgentV1PromptUpdatedParams, - AgentV1ReceiveFunctionCallResponse, - AgentV1ReceiveFunctionCallResponseParams, - AgentV1SendFunctionCallResponse, - AgentV1SendFunctionCallResponseParams, - AgentV1Settings, - AgentV1SettingsAgent, - AgentV1SettingsAgentContext, - AgentV1SettingsAgentContextContext, - AgentV1SettingsAgentContextContextMessagesItem, - AgentV1SettingsAgentContextContextMessagesItemParams, - AgentV1SettingsAgentContextContextParams, - AgentV1SettingsAgentContextListen, - AgentV1SettingsAgentContextListenParams, - AgentV1SettingsAgentContextListenProvider, - AgentV1SettingsAgentContextListenProviderParams, - AgentV1SettingsAgentContextListenProvider_V1, - AgentV1SettingsAgentContextListenProvider_V1Params, - AgentV1SettingsAgentContextListenProvider_V2, - AgentV1SettingsAgentContextListenProvider_V2Params, - AgentV1SettingsAgentContextParams, - AgentV1SettingsAgentContextSpeak, - AgentV1SettingsAgentContextSpeakParams, - AgentV1SettingsAgentContextThink, - AgentV1SettingsAgentContextThinkParams, - AgentV1SettingsAgentListen, - AgentV1SettingsAgentListenParams, - AgentV1SettingsAgentListenProvider, - AgentV1SettingsAgentListenProviderParams, - AgentV1SettingsAgentListenProvider_V1, - AgentV1SettingsAgentListenProvider_V1Params, - AgentV1SettingsAgentListenProvider_V2, - AgentV1SettingsAgentListenProvider_V2Params, - AgentV1SettingsAgentParams, - AgentV1SettingsAgentSpeak, - AgentV1SettingsAgentSpeakParams, - AgentV1SettingsAgentThink, - AgentV1SettingsAgentThinkParams, - AgentV1SettingsApplied, - AgentV1SettingsAppliedParams, - AgentV1SettingsAudio, - AgentV1SettingsAudioInput, - AgentV1SettingsAudioInputEncoding, - AgentV1SettingsAudioInputParams, - AgentV1SettingsAudioOutput, - AgentV1SettingsAudioOutputContainer, - AgentV1SettingsAudioOutputEncoding, - AgentV1SettingsAudioOutputParams, - AgentV1SettingsAudioParams, - AgentV1SettingsFlags, - AgentV1SettingsFlagsParams, - AgentV1SettingsParams, - AgentV1SpeakUpdated, - AgentV1SpeakUpdatedParams, - AgentV1ThinkLiveUpdated, - AgentV1ThinkLiveUpdatedParams, - AgentV1ThinkUpdated, - AgentV1ThinkUpdatedParams, - AgentV1UpdateListen, - AgentV1UpdateListenListen, - AgentV1UpdateListenListenParams, - AgentV1UpdateListenListenProvider, - AgentV1UpdateListenListenProviderParams, - AgentV1UpdateListenListenProvider_V1, - AgentV1UpdateListenListenProvider_V1Params, - AgentV1UpdateListenListenProvider_V2, - AgentV1UpdateListenListenProvider_V2Params, - AgentV1UpdateListenParams, - AgentV1UpdatePrompt, - AgentV1UpdatePromptParams, - AgentV1UpdateSpeak, - AgentV1UpdateSpeakParams, - AgentV1UpdateSpeakSpeak, - AgentV1UpdateSpeakSpeakParams, - AgentV1UpdateThink, - AgentV1UpdateThinkLive, - AgentV1UpdateThinkLiveParams, - AgentV1UpdateThinkParams, - AgentV1UpdateThinkThink, - AgentV1UpdateThinkThinkParams, - AgentV1UserStartedSpeaking, - AgentV1UserStartedSpeakingParams, - AgentV1Warning, - AgentV1WarningParams, - AgentV1Welcome, - AgentV1WelcomeParams, - ConversationHistoryMessage, - ConversationHistoryMessageParams, - ConversationHistoryMessageRole, - FunctionCallHistoryMessage, - FunctionCallHistoryMessageFunctionCallsItem, - FunctionCallHistoryMessageFunctionCallsItemParams, - FunctionCallHistoryMessageParams, - ) -_dynamic_imports: typing.Dict[str, str] = { - "AgentV1AgentAudioDone": ".v1", - "AgentV1AgentAudioDoneParams": ".v1", - "AgentV1AgentStartedSpeaking": ".v1", - "AgentV1AgentStartedSpeakingParams": ".v1", - "AgentV1AgentThinking": ".v1", - "AgentV1AgentThinkingParams": ".v1", - "AgentV1ConversationText": ".v1", - "AgentV1ConversationTextConversationalBehavior": ".v1", - "AgentV1ConversationTextParams": ".v1", - "AgentV1ConversationTextRole": ".v1", - "AgentV1CustomFromThinkProvider": ".v1", - "AgentV1CustomFromThinkProviderParams": ".v1", - "AgentV1CustomToThinkProvider": ".v1", - "AgentV1CustomToThinkProviderParams": ".v1", - "AgentV1Error": ".v1", - "AgentV1ErrorParams": ".v1", - "AgentV1ForceEndTurn": ".v1", - "AgentV1ForceEndTurnParams": ".v1", - "AgentV1FrustrationDetected": ".v1", - "AgentV1FrustrationDetectedParams": ".v1", - "AgentV1FunctionCallCancelled": ".v1", - "AgentV1FunctionCallCancelledFunctionsItem": ".v1", - "AgentV1FunctionCallCancelledFunctionsItemParams": ".v1", - "AgentV1FunctionCallCancelledParams": ".v1", - "AgentV1FunctionCallRequest": ".v1", - "AgentV1FunctionCallRequestFunctionsItem": ".v1", - "AgentV1FunctionCallRequestFunctionsItemParams": ".v1", - "AgentV1FunctionCallRequestParams": ".v1", - "AgentV1History": ".v1", - "AgentV1HistoryParams": ".v1", - "AgentV1InjectAgentMessage": ".v1", - "AgentV1InjectAgentMessageBehavior": ".v1", - "AgentV1InjectAgentMessageParams": ".v1", - "AgentV1InjectDynamicAgentMessage": ".v1", - "AgentV1InjectDynamicAgentMessageBehavior": ".v1", - "AgentV1InjectDynamicAgentMessageParams": ".v1", - "AgentV1InjectUserMessage": ".v1", - "AgentV1InjectUserMessageParams": ".v1", - "AgentV1InjectionRefused": ".v1", - "AgentV1InjectionRefusedParams": ".v1", - "AgentV1KeepAlive": ".v1", - "AgentV1KeepAliveParams": ".v1", - "AgentV1LatencyReport": ".v1", - "AgentV1LatencyReportParams": ".v1", - "AgentV1ListenUpdated": ".v1", - "AgentV1ListenUpdatedParams": ".v1", - "AgentV1PromptUpdated": ".v1", - "AgentV1PromptUpdatedParams": ".v1", - "AgentV1ReceiveFunctionCallResponse": ".v1", - "AgentV1ReceiveFunctionCallResponseParams": ".v1", - "AgentV1SendFunctionCallResponse": ".v1", - "AgentV1SendFunctionCallResponseParams": ".v1", - "AgentV1Settings": ".v1", - "AgentV1SettingsAgent": ".v1", - "AgentV1SettingsAgentContext": ".v1", - "AgentV1SettingsAgentContextContext": ".v1", - "AgentV1SettingsAgentContextContextMessagesItem": ".v1", - "AgentV1SettingsAgentContextContextMessagesItemParams": ".v1", - "AgentV1SettingsAgentContextContextParams": ".v1", - "AgentV1SettingsAgentContextListen": ".v1", - "AgentV1SettingsAgentContextListenParams": ".v1", - "AgentV1SettingsAgentContextListenProvider": ".v1", - "AgentV1SettingsAgentContextListenProviderParams": ".v1", - "AgentV1SettingsAgentContextListenProvider_V1": ".v1", - "AgentV1SettingsAgentContextListenProvider_V1Params": ".v1", - "AgentV1SettingsAgentContextListenProvider_V2": ".v1", - "AgentV1SettingsAgentContextListenProvider_V2Params": ".v1", - "AgentV1SettingsAgentContextParams": ".v1", - "AgentV1SettingsAgentContextSpeak": ".v1", - "AgentV1SettingsAgentContextSpeakParams": ".v1", - "AgentV1SettingsAgentContextThink": ".v1", - "AgentV1SettingsAgentContextThinkParams": ".v1", - "AgentV1SettingsAgentListen": ".v1", - "AgentV1SettingsAgentListenParams": ".v1", - "AgentV1SettingsAgentListenProvider": ".v1", - "AgentV1SettingsAgentListenProviderParams": ".v1", - "AgentV1SettingsAgentListenProvider_V1": ".v1", - "AgentV1SettingsAgentListenProvider_V1Params": ".v1", - "AgentV1SettingsAgentListenProvider_V2": ".v1", - "AgentV1SettingsAgentListenProvider_V2Params": ".v1", - "AgentV1SettingsAgentParams": ".v1", - "AgentV1SettingsAgentSpeak": ".v1", - "AgentV1SettingsAgentSpeakParams": ".v1", - "AgentV1SettingsAgentThink": ".v1", - "AgentV1SettingsAgentThinkParams": ".v1", - "AgentV1SettingsApplied": ".v1", - "AgentV1SettingsAppliedParams": ".v1", - "AgentV1SettingsAudio": ".v1", - "AgentV1SettingsAudioInput": ".v1", - "AgentV1SettingsAudioInputEncoding": ".v1", - "AgentV1SettingsAudioInputParams": ".v1", - "AgentV1SettingsAudioOutput": ".v1", - "AgentV1SettingsAudioOutputContainer": ".v1", - "AgentV1SettingsAudioOutputEncoding": ".v1", - "AgentV1SettingsAudioOutputParams": ".v1", - "AgentV1SettingsAudioParams": ".v1", - "AgentV1SettingsFlags": ".v1", - "AgentV1SettingsFlagsParams": ".v1", - "AgentV1SettingsParams": ".v1", - "AgentV1SpeakUpdated": ".v1", - "AgentV1SpeakUpdatedParams": ".v1", - "AgentV1ThinkLiveUpdated": ".v1", - "AgentV1ThinkLiveUpdatedParams": ".v1", - "AgentV1ThinkUpdated": ".v1", - "AgentV1ThinkUpdatedParams": ".v1", - "AgentV1UpdateListen": ".v1", - "AgentV1UpdateListenListen": ".v1", - "AgentV1UpdateListenListenParams": ".v1", - "AgentV1UpdateListenListenProvider": ".v1", - "AgentV1UpdateListenListenProviderParams": ".v1", - "AgentV1UpdateListenListenProvider_V1": ".v1", - "AgentV1UpdateListenListenProvider_V1Params": ".v1", - "AgentV1UpdateListenListenProvider_V2": ".v1", - "AgentV1UpdateListenListenProvider_V2Params": ".v1", - "AgentV1UpdateListenParams": ".v1", - "AgentV1UpdatePrompt": ".v1", - "AgentV1UpdatePromptParams": ".v1", - "AgentV1UpdateSpeak": ".v1", - "AgentV1UpdateSpeakParams": ".v1", - "AgentV1UpdateSpeakSpeak": ".v1", - "AgentV1UpdateSpeakSpeakParams": ".v1", - "AgentV1UpdateThink": ".v1", - "AgentV1UpdateThinkLive": ".v1", - "AgentV1UpdateThinkLiveParams": ".v1", - "AgentV1UpdateThinkParams": ".v1", - "AgentV1UpdateThinkThink": ".v1", - "AgentV1UpdateThinkThinkParams": ".v1", - "AgentV1UserStartedSpeaking": ".v1", - "AgentV1UserStartedSpeakingParams": ".v1", - "AgentV1Warning": ".v1", - "AgentV1WarningParams": ".v1", - "AgentV1Welcome": ".v1", - "AgentV1WelcomeParams": ".v1", - "ConversationHistoryMessage": ".v1", - "ConversationHistoryMessageParams": ".v1", - "ConversationHistoryMessageRole": ".v1", - "FunctionCallHistoryMessage": ".v1", - "FunctionCallHistoryMessageFunctionCallsItem": ".v1", - "FunctionCallHistoryMessageFunctionCallsItemParams": ".v1", - "FunctionCallHistoryMessageParams": ".v1", - "v1": ".v1", -} - -_dynamic_imports.update( - { - "AgentV1HistoryContent": ".v1", - "AgentV1HistoryContentParams": ".v1", - "AgentV1HistoryContentRole": ".v1", - "AgentV1HistoryFunctionCalls": ".v1", - "AgentV1HistoryFunctionCallsFunctionCallsItem": ".v1", - "AgentV1HistoryFunctionCallsFunctionCallsItemParams": ".v1", - "AgentV1HistoryFunctionCallsParams": ".v1", - "AgentV1SettingsAgentContextContextMessagesItemContentRole": ".v1", - "AgentV1SettingsAgentContextContextMessagesItemFunctionCallsFunctionCallsItem": ".v1", - "AgentV1SettingsAgentContextContextMessagesItemFunctionCallsFunctionCallsItemParams": ".v1", - "AgentV1SettingsAgentContextListenProviderV1": ".v1", - "AgentV1SettingsAgentContextListenProviderV1Params": ".v1", - "AgentV1SettingsAgentContextListenProviderV2": ".v1", - "AgentV1SettingsAgentContextListenProviderV2LanguageHint": ".v1", - "AgentV1SettingsAgentContextListenProviderV2LanguageHintParams": ".v1", - "AgentV1SettingsAgentContextListenProviderV2Params": ".v1", - "AgentV1SettingsAgentContextMessagesItem": ".v1", - "AgentV1SettingsAgentContextMessagesItemContent": ".v1", - "AgentV1SettingsAgentContextMessagesItemContentParams": ".v1", - "AgentV1SettingsAgentContextMessagesItemContentRole": ".v1", - "AgentV1SettingsAgentContextMessagesItemFunctionCalls": ".v1", - "AgentV1SettingsAgentContextMessagesItemFunctionCallsFunctionCallsItem": ".v1", - "AgentV1SettingsAgentContextMessagesItemFunctionCallsFunctionCallsItemParams": ".v1", - "AgentV1SettingsAgentContextMessagesItemFunctionCallsParams": ".v1", - "AgentV1SettingsAgentContextMessagesItemParams": ".v1", - "AgentV1SettingsAgentListenProviderV1": ".v1", - "AgentV1SettingsAgentListenProviderV1Params": ".v1", - "AgentV1SettingsAgentListenProviderV2": ".v1", - "AgentV1SettingsAgentListenProviderV2Params": ".v1", - } -) - - -def __getattr__(attr_name: str) -> typing.Any: - module_name = _dynamic_imports.get(attr_name) - if module_name is None: - raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") - try: - module = import_module(module_name, __package__) - if module_name == f".{attr_name}": - return module - else: - return getattr(module, attr_name) - except ImportError as e: - raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e - except AttributeError as e: - raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e - - -def __dir__(): - lazy_attrs = list(_dynamic_imports.keys()) - return sorted(lazy_attrs) - - -__all__ = [ - "AgentV1AgentAudioDone", - "AgentV1AgentAudioDoneParams", - "AgentV1AgentStartedSpeaking", - "AgentV1AgentStartedSpeakingParams", - "AgentV1AgentThinking", - "AgentV1AgentThinkingParams", - "AgentV1ConversationText", - "AgentV1ConversationTextConversationalBehavior", - "AgentV1ConversationTextParams", - "AgentV1ConversationTextRole", - "AgentV1CustomFromThinkProvider", - "AgentV1CustomFromThinkProviderParams", - "AgentV1CustomToThinkProvider", - "AgentV1CustomToThinkProviderParams", - "AgentV1Error", - "AgentV1ErrorParams", - "AgentV1ForceEndTurn", - "AgentV1ForceEndTurnParams", - "AgentV1FrustrationDetected", - "AgentV1FrustrationDetectedParams", - "AgentV1FunctionCallCancelled", - "AgentV1FunctionCallCancelledFunctionsItem", - "AgentV1FunctionCallCancelledFunctionsItemParams", - "AgentV1FunctionCallCancelledParams", - "AgentV1FunctionCallRequest", - "AgentV1FunctionCallRequestFunctionsItem", - "AgentV1FunctionCallRequestFunctionsItemParams", - "AgentV1FunctionCallRequestParams", - "AgentV1History", - "AgentV1HistoryParams", - "AgentV1InjectAgentMessage", - "AgentV1InjectAgentMessageBehavior", - "AgentV1InjectAgentMessageParams", - "AgentV1InjectDynamicAgentMessage", - "AgentV1InjectDynamicAgentMessageBehavior", - "AgentV1InjectDynamicAgentMessageParams", - "AgentV1InjectUserMessage", - "AgentV1InjectUserMessageParams", - "AgentV1InjectionRefused", - "AgentV1InjectionRefusedParams", - "AgentV1KeepAlive", - "AgentV1KeepAliveParams", - "AgentV1LatencyReport", - "AgentV1LatencyReportParams", - "AgentV1ListenUpdated", - "AgentV1ListenUpdatedParams", - "AgentV1PromptUpdated", - "AgentV1PromptUpdatedParams", - "AgentV1ReceiveFunctionCallResponse", - "AgentV1ReceiveFunctionCallResponseParams", - "AgentV1SendFunctionCallResponse", - "AgentV1SendFunctionCallResponseParams", - "AgentV1Settings", - "AgentV1SettingsAgent", - "AgentV1SettingsAgentContext", - "AgentV1SettingsAgentContextContext", - "AgentV1SettingsAgentContextContextMessagesItem", - "AgentV1SettingsAgentContextContextMessagesItemParams", - "AgentV1SettingsAgentContextContextParams", - "AgentV1SettingsAgentContextListen", - "AgentV1SettingsAgentContextListenParams", - "AgentV1SettingsAgentContextListenProvider", - "AgentV1SettingsAgentContextListenProviderParams", - "AgentV1SettingsAgentContextListenProvider_V1", - "AgentV1SettingsAgentContextListenProvider_V1Params", - "AgentV1SettingsAgentContextListenProvider_V2", - "AgentV1SettingsAgentContextListenProvider_V2Params", - "AgentV1SettingsAgentContextParams", - "AgentV1SettingsAgentContextSpeak", - "AgentV1SettingsAgentContextSpeakParams", - "AgentV1SettingsAgentContextThink", - "AgentV1SettingsAgentContextThinkParams", - "AgentV1SettingsAgentListen", - "AgentV1SettingsAgentListenParams", - "AgentV1SettingsAgentListenProvider", - "AgentV1SettingsAgentListenProviderParams", - "AgentV1SettingsAgentListenProvider_V1", - "AgentV1SettingsAgentListenProvider_V1Params", - "AgentV1SettingsAgentListenProvider_V2", - "AgentV1SettingsAgentListenProvider_V2Params", - "AgentV1SettingsAgentParams", - "AgentV1SettingsAgentSpeak", - "AgentV1SettingsAgentSpeakParams", - "AgentV1SettingsAgentThink", - "AgentV1SettingsAgentThinkParams", - "AgentV1SettingsApplied", - "AgentV1SettingsAppliedParams", - "AgentV1SettingsAudio", - "AgentV1SettingsAudioInput", - "AgentV1SettingsAudioInputEncoding", - "AgentV1SettingsAudioInputParams", - "AgentV1SettingsAudioOutput", - "AgentV1SettingsAudioOutputContainer", - "AgentV1SettingsAudioOutputEncoding", - "AgentV1SettingsAudioOutputParams", - "AgentV1SettingsAudioParams", - "AgentV1SettingsFlags", - "AgentV1SettingsFlagsParams", - "AgentV1SettingsParams", - "AgentV1SpeakUpdated", - "AgentV1SpeakUpdatedParams", - "AgentV1ThinkLiveUpdated", - "AgentV1ThinkLiveUpdatedParams", - "AgentV1ThinkUpdated", - "AgentV1ThinkUpdatedParams", - "AgentV1UpdateListen", - "AgentV1UpdateListenListen", - "AgentV1UpdateListenListenParams", - "AgentV1UpdateListenListenProvider", - "AgentV1UpdateListenListenProviderParams", - "AgentV1UpdateListenListenProvider_V1", - "AgentV1UpdateListenListenProvider_V1Params", - "AgentV1UpdateListenListenProvider_V2", - "AgentV1UpdateListenListenProvider_V2Params", - "AgentV1UpdateListenParams", - "AgentV1UpdatePrompt", - "AgentV1UpdatePromptParams", - "AgentV1UpdateSpeak", - "AgentV1UpdateSpeakParams", - "AgentV1UpdateSpeakSpeak", - "AgentV1UpdateSpeakSpeakParams", - "AgentV1UpdateThink", - "AgentV1UpdateThinkLive", - "AgentV1UpdateThinkLiveParams", - "AgentV1UpdateThinkParams", - "AgentV1UpdateThinkThink", - "AgentV1UpdateThinkThinkParams", - "AgentV1UserStartedSpeaking", - "AgentV1UserStartedSpeakingParams", - "AgentV1Warning", - "AgentV1WarningParams", - "AgentV1Welcome", - "AgentV1WelcomeParams", - "ConversationHistoryMessage", - "ConversationHistoryMessageParams", - "ConversationHistoryMessageRole", - "FunctionCallHistoryMessage", - "FunctionCallHistoryMessageFunctionCallsItem", - "FunctionCallHistoryMessageFunctionCallsItemParams", - "FunctionCallHistoryMessageParams", - "v1", -] - -__all__.extend( - [ - "AgentV1HistoryContent", - "AgentV1HistoryContentParams", - "AgentV1HistoryContentRole", - "AgentV1HistoryFunctionCalls", - "AgentV1HistoryFunctionCallsFunctionCallsItem", - "AgentV1HistoryFunctionCallsFunctionCallsItemParams", - "AgentV1HistoryFunctionCallsParams", - "AgentV1SettingsAgentContextContextMessagesItemContentRole", - "AgentV1SettingsAgentContextContextMessagesItemFunctionCallsFunctionCallsItem", - "AgentV1SettingsAgentContextContextMessagesItemFunctionCallsFunctionCallsItemParams", - "AgentV1SettingsAgentContextListenProviderV1", - "AgentV1SettingsAgentContextListenProviderV1Params", - "AgentV1SettingsAgentContextListenProviderV2", - "AgentV1SettingsAgentContextListenProviderV2LanguageHint", - "AgentV1SettingsAgentContextListenProviderV2LanguageHintParams", - "AgentV1SettingsAgentContextListenProviderV2Params", - "AgentV1SettingsAgentContextMessagesItem", - "AgentV1SettingsAgentContextMessagesItemContent", - "AgentV1SettingsAgentContextMessagesItemContentParams", - "AgentV1SettingsAgentContextMessagesItemContentRole", - "AgentV1SettingsAgentContextMessagesItemFunctionCalls", - "AgentV1SettingsAgentContextMessagesItemFunctionCallsFunctionCallsItem", - "AgentV1SettingsAgentContextMessagesItemFunctionCallsFunctionCallsItemParams", - "AgentV1SettingsAgentContextMessagesItemFunctionCallsParams", - "AgentV1SettingsAgentContextMessagesItemParams", - "AgentV1SettingsAgentListenProviderV1", - "AgentV1SettingsAgentListenProviderV1Params", - "AgentV1SettingsAgentListenProviderV2", - "AgentV1SettingsAgentListenProviderV2Params", - ] -) diff --git a/src/deepgram/agent/v1/__init__.py b/src/deepgram/agent/v1/__init__.py index f58a4a70..205d398c 100644 --- a/src/deepgram/agent/v1/__init__.py +++ b/src/deepgram/agent/v1/__init__.py @@ -295,6 +295,40 @@ "settings": ".settings", } +_dynamic_imports.update( + { + "AgentV1HistoryContent": ".types", + "AgentV1HistoryContentParams": ".requests", + "AgentV1HistoryContentRole": ".types", + "AgentV1HistoryFunctionCalls": ".types", + "AgentV1HistoryFunctionCallsFunctionCallsItem": ".types", + "AgentV1HistoryFunctionCallsFunctionCallsItemParams": ".requests", + "AgentV1HistoryFunctionCallsParams": ".requests", + "AgentV1SettingsAgentContextContextMessagesItemContentRole": ".types", + "AgentV1SettingsAgentContextContextMessagesItemFunctionCallsFunctionCallsItem": ".types", + "AgentV1SettingsAgentContextContextMessagesItemFunctionCallsFunctionCallsItemParams": ".requests", + "AgentV1SettingsAgentContextListenProviderV1": ".types", + "AgentV1SettingsAgentContextListenProviderV1Params": ".requests", + "AgentV1SettingsAgentContextListenProviderV2": ".types", + "AgentV1SettingsAgentContextListenProviderV2LanguageHint": ".types", + "AgentV1SettingsAgentContextListenProviderV2LanguageHintParams": ".requests", + "AgentV1SettingsAgentContextListenProviderV2Params": ".requests", + "AgentV1SettingsAgentContextMessagesItem": ".types", + "AgentV1SettingsAgentContextMessagesItemContent": ".types", + "AgentV1SettingsAgentContextMessagesItemContentParams": ".requests", + "AgentV1SettingsAgentContextMessagesItemContentRole": ".types", + "AgentV1SettingsAgentContextMessagesItemFunctionCalls": ".types", + "AgentV1SettingsAgentContextMessagesItemFunctionCallsFunctionCallsItem": ".types", + "AgentV1SettingsAgentContextMessagesItemFunctionCallsFunctionCallsItemParams": ".requests", + "AgentV1SettingsAgentContextMessagesItemFunctionCallsParams": ".requests", + "AgentV1SettingsAgentContextMessagesItemParams": ".requests", + "AgentV1SettingsAgentListenProviderV1": ".types", + "AgentV1SettingsAgentListenProviderV1Params": ".requests", + "AgentV1SettingsAgentListenProviderV2": ".types", + "AgentV1SettingsAgentListenProviderV2Params": ".requests", + } +) + def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) @@ -460,3 +494,37 @@ def __dir__(): "FunctionCallHistoryMessageParams", "settings", ] + +__all__.extend( + [ + "AgentV1HistoryContent", + "AgentV1HistoryContentParams", + "AgentV1HistoryContentRole", + "AgentV1HistoryFunctionCalls", + "AgentV1HistoryFunctionCallsFunctionCallsItem", + "AgentV1HistoryFunctionCallsFunctionCallsItemParams", + "AgentV1HistoryFunctionCallsParams", + "AgentV1SettingsAgentContextContextMessagesItemContentRole", + "AgentV1SettingsAgentContextContextMessagesItemFunctionCallsFunctionCallsItem", + "AgentV1SettingsAgentContextContextMessagesItemFunctionCallsFunctionCallsItemParams", + "AgentV1SettingsAgentContextListenProviderV1", + "AgentV1SettingsAgentContextListenProviderV1Params", + "AgentV1SettingsAgentContextListenProviderV2", + "AgentV1SettingsAgentContextListenProviderV2LanguageHint", + "AgentV1SettingsAgentContextListenProviderV2LanguageHintParams", + "AgentV1SettingsAgentContextListenProviderV2Params", + "AgentV1SettingsAgentContextMessagesItem", + "AgentV1SettingsAgentContextMessagesItemContent", + "AgentV1SettingsAgentContextMessagesItemContentParams", + "AgentV1SettingsAgentContextMessagesItemContentRole", + "AgentV1SettingsAgentContextMessagesItemFunctionCalls", + "AgentV1SettingsAgentContextMessagesItemFunctionCallsFunctionCallsItem", + "AgentV1SettingsAgentContextMessagesItemFunctionCallsFunctionCallsItemParams", + "AgentV1SettingsAgentContextMessagesItemFunctionCallsParams", + "AgentV1SettingsAgentContextMessagesItemParams", + "AgentV1SettingsAgentListenProviderV1", + "AgentV1SettingsAgentListenProviderV1Params", + "AgentV1SettingsAgentListenProviderV2", + "AgentV1SettingsAgentListenProviderV2Params", + ] +) diff --git a/src/deepgram/agent/v1/__init__.py.bak b/src/deepgram/agent/v1/__init__.py.bak deleted file mode 100644 index 205d398c..00000000 --- a/src/deepgram/agent/v1/__init__.py.bak +++ /dev/null @@ -1,530 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# isort: skip_file - -import typing -from importlib import import_module - -if typing.TYPE_CHECKING: - from .types import ( - AgentV1AgentAudioDone, - AgentV1AgentStartedSpeaking, - AgentV1AgentThinking, - AgentV1ConversationText, - AgentV1ConversationTextConversationalBehavior, - AgentV1ConversationTextRole, - AgentV1CustomFromThinkProvider, - AgentV1CustomToThinkProvider, - AgentV1Error, - AgentV1ForceEndTurn, - AgentV1FrustrationDetected, - AgentV1FunctionCallCancelled, - AgentV1FunctionCallCancelledFunctionsItem, - AgentV1FunctionCallRequest, - AgentV1FunctionCallRequestFunctionsItem, - AgentV1History, - AgentV1InjectAgentMessage, - AgentV1InjectAgentMessageBehavior, - AgentV1InjectDynamicAgentMessage, - AgentV1InjectDynamicAgentMessageBehavior, - AgentV1InjectUserMessage, - AgentV1InjectionRefused, - AgentV1KeepAlive, - AgentV1LatencyReport, - AgentV1ListenUpdated, - AgentV1PromptUpdated, - AgentV1ReceiveFunctionCallResponse, - AgentV1SendFunctionCallResponse, - AgentV1Settings, - AgentV1SettingsAgent, - AgentV1SettingsAgentContext, - AgentV1SettingsAgentContextContext, - AgentV1SettingsAgentContextContextMessagesItem, - AgentV1SettingsAgentContextListen, - AgentV1SettingsAgentContextListenProvider, - AgentV1SettingsAgentContextListenProvider_V1, - AgentV1SettingsAgentContextListenProvider_V2, - AgentV1SettingsAgentContextSpeak, - AgentV1SettingsAgentContextThink, - AgentV1SettingsAgentListen, - AgentV1SettingsAgentListenProvider, - AgentV1SettingsAgentListenProvider_V1, - AgentV1SettingsAgentListenProvider_V2, - AgentV1SettingsAgentSpeak, - AgentV1SettingsAgentThink, - AgentV1SettingsApplied, - AgentV1SettingsAudio, - AgentV1SettingsAudioInput, - AgentV1SettingsAudioInputEncoding, - AgentV1SettingsAudioOutput, - AgentV1SettingsAudioOutputContainer, - AgentV1SettingsAudioOutputEncoding, - AgentV1SettingsFlags, - AgentV1SpeakUpdated, - AgentV1ThinkLiveUpdated, - AgentV1ThinkUpdated, - AgentV1UpdateListen, - AgentV1UpdateListenListen, - AgentV1UpdateListenListenProvider, - AgentV1UpdateListenListenProvider_V1, - AgentV1UpdateListenListenProvider_V2, - AgentV1UpdatePrompt, - AgentV1UpdateSpeak, - AgentV1UpdateSpeakSpeak, - AgentV1UpdateThink, - AgentV1UpdateThinkLive, - AgentV1UpdateThinkThink, - AgentV1UserStartedSpeaking, - AgentV1Warning, - AgentV1Welcome, - ConversationHistoryMessage, - ConversationHistoryMessageRole, - FunctionCallHistoryMessage, - FunctionCallHistoryMessageFunctionCallsItem, - ) - from . import settings - from .requests import ( - AgentV1AgentAudioDoneParams, - AgentV1AgentStartedSpeakingParams, - AgentV1AgentThinkingParams, - AgentV1ConversationTextParams, - AgentV1CustomFromThinkProviderParams, - AgentV1CustomToThinkProviderParams, - AgentV1ErrorParams, - AgentV1ForceEndTurnParams, - AgentV1FrustrationDetectedParams, - AgentV1FunctionCallCancelledFunctionsItemParams, - AgentV1FunctionCallCancelledParams, - AgentV1FunctionCallRequestFunctionsItemParams, - AgentV1FunctionCallRequestParams, - AgentV1HistoryParams, - AgentV1InjectAgentMessageParams, - AgentV1InjectDynamicAgentMessageParams, - AgentV1InjectUserMessageParams, - AgentV1InjectionRefusedParams, - AgentV1KeepAliveParams, - AgentV1LatencyReportParams, - AgentV1ListenUpdatedParams, - AgentV1PromptUpdatedParams, - AgentV1ReceiveFunctionCallResponseParams, - AgentV1SendFunctionCallResponseParams, - AgentV1SettingsAgentContextContextMessagesItemParams, - AgentV1SettingsAgentContextContextParams, - AgentV1SettingsAgentContextListenParams, - AgentV1SettingsAgentContextListenProviderParams, - AgentV1SettingsAgentContextListenProvider_V1Params, - AgentV1SettingsAgentContextListenProvider_V2Params, - AgentV1SettingsAgentContextParams, - AgentV1SettingsAgentContextSpeakParams, - AgentV1SettingsAgentContextThinkParams, - AgentV1SettingsAgentListenParams, - AgentV1SettingsAgentListenProviderParams, - AgentV1SettingsAgentListenProvider_V1Params, - AgentV1SettingsAgentListenProvider_V2Params, - AgentV1SettingsAgentParams, - AgentV1SettingsAgentSpeakParams, - AgentV1SettingsAgentThinkParams, - AgentV1SettingsAppliedParams, - AgentV1SettingsAudioInputParams, - AgentV1SettingsAudioOutputParams, - AgentV1SettingsAudioParams, - AgentV1SettingsFlagsParams, - AgentV1SettingsParams, - AgentV1SpeakUpdatedParams, - AgentV1ThinkLiveUpdatedParams, - AgentV1ThinkUpdatedParams, - AgentV1UpdateListenListenParams, - AgentV1UpdateListenListenProviderParams, - AgentV1UpdateListenListenProvider_V1Params, - AgentV1UpdateListenListenProvider_V2Params, - AgentV1UpdateListenParams, - AgentV1UpdatePromptParams, - AgentV1UpdateSpeakParams, - AgentV1UpdateSpeakSpeakParams, - AgentV1UpdateThinkLiveParams, - AgentV1UpdateThinkParams, - AgentV1UpdateThinkThinkParams, - AgentV1UserStartedSpeakingParams, - AgentV1WarningParams, - AgentV1WelcomeParams, - ConversationHistoryMessageParams, - FunctionCallHistoryMessageFunctionCallsItemParams, - FunctionCallHistoryMessageParams, - ) -_dynamic_imports: typing.Dict[str, str] = { - "AgentV1AgentAudioDone": ".types", - "AgentV1AgentAudioDoneParams": ".requests", - "AgentV1AgentStartedSpeaking": ".types", - "AgentV1AgentStartedSpeakingParams": ".requests", - "AgentV1AgentThinking": ".types", - "AgentV1AgentThinkingParams": ".requests", - "AgentV1ConversationText": ".types", - "AgentV1ConversationTextConversationalBehavior": ".types", - "AgentV1ConversationTextParams": ".requests", - "AgentV1ConversationTextRole": ".types", - "AgentV1CustomFromThinkProvider": ".types", - "AgentV1CustomFromThinkProviderParams": ".requests", - "AgentV1CustomToThinkProvider": ".types", - "AgentV1CustomToThinkProviderParams": ".requests", - "AgentV1Error": ".types", - "AgentV1ErrorParams": ".requests", - "AgentV1ForceEndTurn": ".types", - "AgentV1ForceEndTurnParams": ".requests", - "AgentV1FrustrationDetected": ".types", - "AgentV1FrustrationDetectedParams": ".requests", - "AgentV1FunctionCallCancelled": ".types", - "AgentV1FunctionCallCancelledFunctionsItem": ".types", - "AgentV1FunctionCallCancelledFunctionsItemParams": ".requests", - "AgentV1FunctionCallCancelledParams": ".requests", - "AgentV1FunctionCallRequest": ".types", - "AgentV1FunctionCallRequestFunctionsItem": ".types", - "AgentV1FunctionCallRequestFunctionsItemParams": ".requests", - "AgentV1FunctionCallRequestParams": ".requests", - "AgentV1History": ".types", - "AgentV1HistoryParams": ".requests", - "AgentV1InjectAgentMessage": ".types", - "AgentV1InjectAgentMessageBehavior": ".types", - "AgentV1InjectAgentMessageParams": ".requests", - "AgentV1InjectDynamicAgentMessage": ".types", - "AgentV1InjectDynamicAgentMessageBehavior": ".types", - "AgentV1InjectDynamicAgentMessageParams": ".requests", - "AgentV1InjectUserMessage": ".types", - "AgentV1InjectUserMessageParams": ".requests", - "AgentV1InjectionRefused": ".types", - "AgentV1InjectionRefusedParams": ".requests", - "AgentV1KeepAlive": ".types", - "AgentV1KeepAliveParams": ".requests", - "AgentV1LatencyReport": ".types", - "AgentV1LatencyReportParams": ".requests", - "AgentV1ListenUpdated": ".types", - "AgentV1ListenUpdatedParams": ".requests", - "AgentV1PromptUpdated": ".types", - "AgentV1PromptUpdatedParams": ".requests", - "AgentV1ReceiveFunctionCallResponse": ".types", - "AgentV1ReceiveFunctionCallResponseParams": ".requests", - "AgentV1SendFunctionCallResponse": ".types", - "AgentV1SendFunctionCallResponseParams": ".requests", - "AgentV1Settings": ".types", - "AgentV1SettingsAgent": ".types", - "AgentV1SettingsAgentContext": ".types", - "AgentV1SettingsAgentContextContext": ".types", - "AgentV1SettingsAgentContextContextMessagesItem": ".types", - "AgentV1SettingsAgentContextContextMessagesItemParams": ".requests", - "AgentV1SettingsAgentContextContextParams": ".requests", - "AgentV1SettingsAgentContextListen": ".types", - "AgentV1SettingsAgentContextListenParams": ".requests", - "AgentV1SettingsAgentContextListenProvider": ".types", - "AgentV1SettingsAgentContextListenProviderParams": ".requests", - "AgentV1SettingsAgentContextListenProvider_V1": ".types", - "AgentV1SettingsAgentContextListenProvider_V1Params": ".requests", - "AgentV1SettingsAgentContextListenProvider_V2": ".types", - "AgentV1SettingsAgentContextListenProvider_V2Params": ".requests", - "AgentV1SettingsAgentContextParams": ".requests", - "AgentV1SettingsAgentContextSpeak": ".types", - "AgentV1SettingsAgentContextSpeakParams": ".requests", - "AgentV1SettingsAgentContextThink": ".types", - "AgentV1SettingsAgentContextThinkParams": ".requests", - "AgentV1SettingsAgentListen": ".types", - "AgentV1SettingsAgentListenParams": ".requests", - "AgentV1SettingsAgentListenProvider": ".types", - "AgentV1SettingsAgentListenProviderParams": ".requests", - "AgentV1SettingsAgentListenProvider_V1": ".types", - "AgentV1SettingsAgentListenProvider_V1Params": ".requests", - "AgentV1SettingsAgentListenProvider_V2": ".types", - "AgentV1SettingsAgentListenProvider_V2Params": ".requests", - "AgentV1SettingsAgentParams": ".requests", - "AgentV1SettingsAgentSpeak": ".types", - "AgentV1SettingsAgentSpeakParams": ".requests", - "AgentV1SettingsAgentThink": ".types", - "AgentV1SettingsAgentThinkParams": ".requests", - "AgentV1SettingsApplied": ".types", - "AgentV1SettingsAppliedParams": ".requests", - "AgentV1SettingsAudio": ".types", - "AgentV1SettingsAudioInput": ".types", - "AgentV1SettingsAudioInputEncoding": ".types", - "AgentV1SettingsAudioInputParams": ".requests", - "AgentV1SettingsAudioOutput": ".types", - "AgentV1SettingsAudioOutputContainer": ".types", - "AgentV1SettingsAudioOutputEncoding": ".types", - "AgentV1SettingsAudioOutputParams": ".requests", - "AgentV1SettingsAudioParams": ".requests", - "AgentV1SettingsFlags": ".types", - "AgentV1SettingsFlagsParams": ".requests", - "AgentV1SettingsParams": ".requests", - "AgentV1SpeakUpdated": ".types", - "AgentV1SpeakUpdatedParams": ".requests", - "AgentV1ThinkLiveUpdated": ".types", - "AgentV1ThinkLiveUpdatedParams": ".requests", - "AgentV1ThinkUpdated": ".types", - "AgentV1ThinkUpdatedParams": ".requests", - "AgentV1UpdateListen": ".types", - "AgentV1UpdateListenListen": ".types", - "AgentV1UpdateListenListenParams": ".requests", - "AgentV1UpdateListenListenProvider": ".types", - "AgentV1UpdateListenListenProviderParams": ".requests", - "AgentV1UpdateListenListenProvider_V1": ".types", - "AgentV1UpdateListenListenProvider_V1Params": ".requests", - "AgentV1UpdateListenListenProvider_V2": ".types", - "AgentV1UpdateListenListenProvider_V2Params": ".requests", - "AgentV1UpdateListenParams": ".requests", - "AgentV1UpdatePrompt": ".types", - "AgentV1UpdatePromptParams": ".requests", - "AgentV1UpdateSpeak": ".types", - "AgentV1UpdateSpeakParams": ".requests", - "AgentV1UpdateSpeakSpeak": ".types", - "AgentV1UpdateSpeakSpeakParams": ".requests", - "AgentV1UpdateThink": ".types", - "AgentV1UpdateThinkLive": ".types", - "AgentV1UpdateThinkLiveParams": ".requests", - "AgentV1UpdateThinkParams": ".requests", - "AgentV1UpdateThinkThink": ".types", - "AgentV1UpdateThinkThinkParams": ".requests", - "AgentV1UserStartedSpeaking": ".types", - "AgentV1UserStartedSpeakingParams": ".requests", - "AgentV1Warning": ".types", - "AgentV1WarningParams": ".requests", - "AgentV1Welcome": ".types", - "AgentV1WelcomeParams": ".requests", - "ConversationHistoryMessage": ".types", - "ConversationHistoryMessageParams": ".requests", - "ConversationHistoryMessageRole": ".types", - "FunctionCallHistoryMessage": ".types", - "FunctionCallHistoryMessageFunctionCallsItem": ".types", - "FunctionCallHistoryMessageFunctionCallsItemParams": ".requests", - "FunctionCallHistoryMessageParams": ".requests", - "settings": ".settings", -} - -_dynamic_imports.update( - { - "AgentV1HistoryContent": ".types", - "AgentV1HistoryContentParams": ".requests", - "AgentV1HistoryContentRole": ".types", - "AgentV1HistoryFunctionCalls": ".types", - "AgentV1HistoryFunctionCallsFunctionCallsItem": ".types", - "AgentV1HistoryFunctionCallsFunctionCallsItemParams": ".requests", - "AgentV1HistoryFunctionCallsParams": ".requests", - "AgentV1SettingsAgentContextContextMessagesItemContentRole": ".types", - "AgentV1SettingsAgentContextContextMessagesItemFunctionCallsFunctionCallsItem": ".types", - "AgentV1SettingsAgentContextContextMessagesItemFunctionCallsFunctionCallsItemParams": ".requests", - "AgentV1SettingsAgentContextListenProviderV1": ".types", - "AgentV1SettingsAgentContextListenProviderV1Params": ".requests", - "AgentV1SettingsAgentContextListenProviderV2": ".types", - "AgentV1SettingsAgentContextListenProviderV2LanguageHint": ".types", - "AgentV1SettingsAgentContextListenProviderV2LanguageHintParams": ".requests", - "AgentV1SettingsAgentContextListenProviderV2Params": ".requests", - "AgentV1SettingsAgentContextMessagesItem": ".types", - "AgentV1SettingsAgentContextMessagesItemContent": ".types", - "AgentV1SettingsAgentContextMessagesItemContentParams": ".requests", - "AgentV1SettingsAgentContextMessagesItemContentRole": ".types", - "AgentV1SettingsAgentContextMessagesItemFunctionCalls": ".types", - "AgentV1SettingsAgentContextMessagesItemFunctionCallsFunctionCallsItem": ".types", - "AgentV1SettingsAgentContextMessagesItemFunctionCallsFunctionCallsItemParams": ".requests", - "AgentV1SettingsAgentContextMessagesItemFunctionCallsParams": ".requests", - "AgentV1SettingsAgentContextMessagesItemParams": ".requests", - "AgentV1SettingsAgentListenProviderV1": ".types", - "AgentV1SettingsAgentListenProviderV1Params": ".requests", - "AgentV1SettingsAgentListenProviderV2": ".types", - "AgentV1SettingsAgentListenProviderV2Params": ".requests", - } -) - - -def __getattr__(attr_name: str) -> typing.Any: - module_name = _dynamic_imports.get(attr_name) - if module_name is None: - raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") - try: - module = import_module(module_name, __package__) - if module_name == f".{attr_name}": - return module - else: - return getattr(module, attr_name) - except ImportError as e: - raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e - except AttributeError as e: - raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e - - -def __dir__(): - lazy_attrs = list(_dynamic_imports.keys()) - return sorted(lazy_attrs) - - -__all__ = [ - "AgentV1AgentAudioDone", - "AgentV1AgentAudioDoneParams", - "AgentV1AgentStartedSpeaking", - "AgentV1AgentStartedSpeakingParams", - "AgentV1AgentThinking", - "AgentV1AgentThinkingParams", - "AgentV1ConversationText", - "AgentV1ConversationTextConversationalBehavior", - "AgentV1ConversationTextParams", - "AgentV1ConversationTextRole", - "AgentV1CustomFromThinkProvider", - "AgentV1CustomFromThinkProviderParams", - "AgentV1CustomToThinkProvider", - "AgentV1CustomToThinkProviderParams", - "AgentV1Error", - "AgentV1ErrorParams", - "AgentV1ForceEndTurn", - "AgentV1ForceEndTurnParams", - "AgentV1FrustrationDetected", - "AgentV1FrustrationDetectedParams", - "AgentV1FunctionCallCancelled", - "AgentV1FunctionCallCancelledFunctionsItem", - "AgentV1FunctionCallCancelledFunctionsItemParams", - "AgentV1FunctionCallCancelledParams", - "AgentV1FunctionCallRequest", - "AgentV1FunctionCallRequestFunctionsItem", - "AgentV1FunctionCallRequestFunctionsItemParams", - "AgentV1FunctionCallRequestParams", - "AgentV1History", - "AgentV1HistoryParams", - "AgentV1InjectAgentMessage", - "AgentV1InjectAgentMessageBehavior", - "AgentV1InjectAgentMessageParams", - "AgentV1InjectDynamicAgentMessage", - "AgentV1InjectDynamicAgentMessageBehavior", - "AgentV1InjectDynamicAgentMessageParams", - "AgentV1InjectUserMessage", - "AgentV1InjectUserMessageParams", - "AgentV1InjectionRefused", - "AgentV1InjectionRefusedParams", - "AgentV1KeepAlive", - "AgentV1KeepAliveParams", - "AgentV1LatencyReport", - "AgentV1LatencyReportParams", - "AgentV1ListenUpdated", - "AgentV1ListenUpdatedParams", - "AgentV1PromptUpdated", - "AgentV1PromptUpdatedParams", - "AgentV1ReceiveFunctionCallResponse", - "AgentV1ReceiveFunctionCallResponseParams", - "AgentV1SendFunctionCallResponse", - "AgentV1SendFunctionCallResponseParams", - "AgentV1Settings", - "AgentV1SettingsAgent", - "AgentV1SettingsAgentContext", - "AgentV1SettingsAgentContextContext", - "AgentV1SettingsAgentContextContextMessagesItem", - "AgentV1SettingsAgentContextContextMessagesItemParams", - "AgentV1SettingsAgentContextContextParams", - "AgentV1SettingsAgentContextListen", - "AgentV1SettingsAgentContextListenParams", - "AgentV1SettingsAgentContextListenProvider", - "AgentV1SettingsAgentContextListenProviderParams", - "AgentV1SettingsAgentContextListenProvider_V1", - "AgentV1SettingsAgentContextListenProvider_V1Params", - "AgentV1SettingsAgentContextListenProvider_V2", - "AgentV1SettingsAgentContextListenProvider_V2Params", - "AgentV1SettingsAgentContextParams", - "AgentV1SettingsAgentContextSpeak", - "AgentV1SettingsAgentContextSpeakParams", - "AgentV1SettingsAgentContextThink", - "AgentV1SettingsAgentContextThinkParams", - "AgentV1SettingsAgentListen", - "AgentV1SettingsAgentListenParams", - "AgentV1SettingsAgentListenProvider", - "AgentV1SettingsAgentListenProviderParams", - "AgentV1SettingsAgentListenProvider_V1", - "AgentV1SettingsAgentListenProvider_V1Params", - "AgentV1SettingsAgentListenProvider_V2", - "AgentV1SettingsAgentListenProvider_V2Params", - "AgentV1SettingsAgentParams", - "AgentV1SettingsAgentSpeak", - "AgentV1SettingsAgentSpeakParams", - "AgentV1SettingsAgentThink", - "AgentV1SettingsAgentThinkParams", - "AgentV1SettingsApplied", - "AgentV1SettingsAppliedParams", - "AgentV1SettingsAudio", - "AgentV1SettingsAudioInput", - "AgentV1SettingsAudioInputEncoding", - "AgentV1SettingsAudioInputParams", - "AgentV1SettingsAudioOutput", - "AgentV1SettingsAudioOutputContainer", - "AgentV1SettingsAudioOutputEncoding", - "AgentV1SettingsAudioOutputParams", - "AgentV1SettingsAudioParams", - "AgentV1SettingsFlags", - "AgentV1SettingsFlagsParams", - "AgentV1SettingsParams", - "AgentV1SpeakUpdated", - "AgentV1SpeakUpdatedParams", - "AgentV1ThinkLiveUpdated", - "AgentV1ThinkLiveUpdatedParams", - "AgentV1ThinkUpdated", - "AgentV1ThinkUpdatedParams", - "AgentV1UpdateListen", - "AgentV1UpdateListenListen", - "AgentV1UpdateListenListenParams", - "AgentV1UpdateListenListenProvider", - "AgentV1UpdateListenListenProviderParams", - "AgentV1UpdateListenListenProvider_V1", - "AgentV1UpdateListenListenProvider_V1Params", - "AgentV1UpdateListenListenProvider_V2", - "AgentV1UpdateListenListenProvider_V2Params", - "AgentV1UpdateListenParams", - "AgentV1UpdatePrompt", - "AgentV1UpdatePromptParams", - "AgentV1UpdateSpeak", - "AgentV1UpdateSpeakParams", - "AgentV1UpdateSpeakSpeak", - "AgentV1UpdateSpeakSpeakParams", - "AgentV1UpdateThink", - "AgentV1UpdateThinkLive", - "AgentV1UpdateThinkLiveParams", - "AgentV1UpdateThinkParams", - "AgentV1UpdateThinkThink", - "AgentV1UpdateThinkThinkParams", - "AgentV1UserStartedSpeaking", - "AgentV1UserStartedSpeakingParams", - "AgentV1Warning", - "AgentV1WarningParams", - "AgentV1Welcome", - "AgentV1WelcomeParams", - "ConversationHistoryMessage", - "ConversationHistoryMessageParams", - "ConversationHistoryMessageRole", - "FunctionCallHistoryMessage", - "FunctionCallHistoryMessageFunctionCallsItem", - "FunctionCallHistoryMessageFunctionCallsItemParams", - "FunctionCallHistoryMessageParams", - "settings", -] - -__all__.extend( - [ - "AgentV1HistoryContent", - "AgentV1HistoryContentParams", - "AgentV1HistoryContentRole", - "AgentV1HistoryFunctionCalls", - "AgentV1HistoryFunctionCallsFunctionCallsItem", - "AgentV1HistoryFunctionCallsFunctionCallsItemParams", - "AgentV1HistoryFunctionCallsParams", - "AgentV1SettingsAgentContextContextMessagesItemContentRole", - "AgentV1SettingsAgentContextContextMessagesItemFunctionCallsFunctionCallsItem", - "AgentV1SettingsAgentContextContextMessagesItemFunctionCallsFunctionCallsItemParams", - "AgentV1SettingsAgentContextListenProviderV1", - "AgentV1SettingsAgentContextListenProviderV1Params", - "AgentV1SettingsAgentContextListenProviderV2", - "AgentV1SettingsAgentContextListenProviderV2LanguageHint", - "AgentV1SettingsAgentContextListenProviderV2LanguageHintParams", - "AgentV1SettingsAgentContextListenProviderV2Params", - "AgentV1SettingsAgentContextMessagesItem", - "AgentV1SettingsAgentContextMessagesItemContent", - "AgentV1SettingsAgentContextMessagesItemContentParams", - "AgentV1SettingsAgentContextMessagesItemContentRole", - "AgentV1SettingsAgentContextMessagesItemFunctionCalls", - "AgentV1SettingsAgentContextMessagesItemFunctionCallsFunctionCallsItem", - "AgentV1SettingsAgentContextMessagesItemFunctionCallsFunctionCallsItemParams", - "AgentV1SettingsAgentContextMessagesItemFunctionCallsParams", - "AgentV1SettingsAgentContextMessagesItemParams", - "AgentV1SettingsAgentListenProviderV1", - "AgentV1SettingsAgentListenProviderV1Params", - "AgentV1SettingsAgentListenProviderV2", - "AgentV1SettingsAgentListenProviderV2Params", - ] -) diff --git a/src/deepgram/agent/v1/requests/__init__.py b/src/deepgram/agent/v1/requests/__init__.py index f57784b8..766d9807 100644 --- a/src/deepgram/agent/v1/requests/__init__.py +++ b/src/deepgram/agent/v1/requests/__init__.py @@ -20,6 +20,8 @@ from .agent_v1function_call_request import AgentV1FunctionCallRequestParams from .agent_v1function_call_request_functions_item import AgentV1FunctionCallRequestFunctionsItemParams from .agent_v1history import AgentV1HistoryParams + from .agent_v1history_content import AgentV1HistoryContentParams # noqa: F401 + from .agent_v1history_function_calls import AgentV1HistoryFunctionCallsParams # noqa: F401 from .agent_v1inject_agent_message import AgentV1InjectAgentMessageParams from .agent_v1inject_dynamic_agent_message import AgentV1InjectDynamicAgentMessageParams from .agent_v1inject_user_message import AgentV1InjectUserMessageParams @@ -149,6 +151,24 @@ "FunctionCallHistoryMessageParams": ".function_call_history_message", } +_dynamic_imports.update( + { + "AgentV1HistoryContentParams": ".agent_v1history_content", + "AgentV1HistoryFunctionCallsParams": ".agent_v1history_function_calls", + "AgentV1HistoryFunctionCallsFunctionCallsItemParams": ".agent_v1history_function_calls_function_calls_item", + "AgentV1SettingsAgentContextContextMessagesItemFunctionCallsFunctionCallsItemParams": ".agent_v1settings_agent_context_context_messages_item_function_calls_function_calls_item", + "AgentV1SettingsAgentContextListenProviderV1Params": ".agent_v1settings_agent_context_listen_provider_v1", + "AgentV1SettingsAgentContextListenProviderV2Params": ".agent_v1settings_agent_context_listen_provider_v2", + "AgentV1SettingsAgentContextListenProviderV2LanguageHintParams": ".agent_v1settings_agent_context_listen_provider_v2language_hint", + "AgentV1SettingsAgentContextMessagesItemParams": ".agent_v1settings_agent_context_messages_item", + "AgentV1SettingsAgentContextMessagesItemContentParams": ".agent_v1settings_agent_context_messages_item_content", + "AgentV1SettingsAgentContextMessagesItemFunctionCallsParams": ".agent_v1settings_agent_context_messages_item_function_calls", + "AgentV1SettingsAgentContextMessagesItemFunctionCallsFunctionCallsItemParams": ".agent_v1settings_agent_context_messages_item_function_calls_function_calls_item", + "AgentV1SettingsAgentListenProviderV1Params": ".agent_v1settings_agent_listen_provider_v1", + "AgentV1SettingsAgentListenProviderV2Params": ".agent_v1settings_agent_listen_provider_v2", + } +) + def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) @@ -239,3 +259,21 @@ def __dir__(): "FunctionCallHistoryMessageFunctionCallsItemParams", "FunctionCallHistoryMessageParams", ] + +__all__.extend( + [ + "AgentV1HistoryContentParams", + "AgentV1HistoryFunctionCallsParams", + "AgentV1HistoryFunctionCallsFunctionCallsItemParams", + "AgentV1SettingsAgentContextContextMessagesItemFunctionCallsFunctionCallsItemParams", + "AgentV1SettingsAgentContextListenProviderV1Params", + "AgentV1SettingsAgentContextListenProviderV2Params", + "AgentV1SettingsAgentContextListenProviderV2LanguageHintParams", + "AgentV1SettingsAgentContextMessagesItemParams", + "AgentV1SettingsAgentContextMessagesItemContentParams", + "AgentV1SettingsAgentContextMessagesItemFunctionCallsParams", + "AgentV1SettingsAgentContextMessagesItemFunctionCallsFunctionCallsItemParams", + "AgentV1SettingsAgentListenProviderV1Params", + "AgentV1SettingsAgentListenProviderV2Params", + ] +) diff --git a/src/deepgram/agent/v1/requests/__init__.py.bak b/src/deepgram/agent/v1/requests/__init__.py.bak deleted file mode 100644 index 766d9807..00000000 --- a/src/deepgram/agent/v1/requests/__init__.py.bak +++ /dev/null @@ -1,279 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# isort: skip_file - -import typing -from importlib import import_module - -if typing.TYPE_CHECKING: - from .agent_v1agent_audio_done import AgentV1AgentAudioDoneParams - from .agent_v1agent_started_speaking import AgentV1AgentStartedSpeakingParams - from .agent_v1agent_thinking import AgentV1AgentThinkingParams - from .agent_v1conversation_text import AgentV1ConversationTextParams - from .agent_v1custom_from_think_provider import AgentV1CustomFromThinkProviderParams - from .agent_v1custom_to_think_provider import AgentV1CustomToThinkProviderParams - from .agent_v1error import AgentV1ErrorParams - from .agent_v1force_end_turn import AgentV1ForceEndTurnParams - from .agent_v1frustration_detected import AgentV1FrustrationDetectedParams - from .agent_v1function_call_cancelled import AgentV1FunctionCallCancelledParams - from .agent_v1function_call_cancelled_functions_item import AgentV1FunctionCallCancelledFunctionsItemParams - from .agent_v1function_call_request import AgentV1FunctionCallRequestParams - from .agent_v1function_call_request_functions_item import AgentV1FunctionCallRequestFunctionsItemParams - from .agent_v1history import AgentV1HistoryParams - from .agent_v1history_content import AgentV1HistoryContentParams # noqa: F401 - from .agent_v1history_function_calls import AgentV1HistoryFunctionCallsParams # noqa: F401 - from .agent_v1inject_agent_message import AgentV1InjectAgentMessageParams - from .agent_v1inject_dynamic_agent_message import AgentV1InjectDynamicAgentMessageParams - from .agent_v1inject_user_message import AgentV1InjectUserMessageParams - from .agent_v1injection_refused import AgentV1InjectionRefusedParams - from .agent_v1keep_alive import AgentV1KeepAliveParams - from .agent_v1latency_report import AgentV1LatencyReportParams - from .agent_v1listen_updated import AgentV1ListenUpdatedParams - from .agent_v1prompt_updated import AgentV1PromptUpdatedParams - from .agent_v1receive_function_call_response import AgentV1ReceiveFunctionCallResponseParams - from .agent_v1send_function_call_response import AgentV1SendFunctionCallResponseParams - from .agent_v1settings import AgentV1SettingsParams - from .agent_v1settings_agent import AgentV1SettingsAgentParams - from .agent_v1settings_agent_context import AgentV1SettingsAgentContextParams - from .agent_v1settings_agent_context_context import AgentV1SettingsAgentContextContextParams - from .agent_v1settings_agent_context_context_messages_item import ( - AgentV1SettingsAgentContextContextMessagesItemParams, - ) - from .agent_v1settings_agent_context_listen import AgentV1SettingsAgentContextListenParams - from .agent_v1settings_agent_context_listen_provider import ( - AgentV1SettingsAgentContextListenProviderParams, - AgentV1SettingsAgentContextListenProvider_V1Params, - AgentV1SettingsAgentContextListenProvider_V2Params, - ) - from .agent_v1settings_agent_context_speak import AgentV1SettingsAgentContextSpeakParams - from .agent_v1settings_agent_context_think import AgentV1SettingsAgentContextThinkParams - from .agent_v1settings_agent_listen import AgentV1SettingsAgentListenParams - from .agent_v1settings_agent_listen_provider import ( - AgentV1SettingsAgentListenProviderParams, - AgentV1SettingsAgentListenProvider_V1Params, - AgentV1SettingsAgentListenProvider_V2Params, - ) - from .agent_v1settings_agent_speak import AgentV1SettingsAgentSpeakParams - from .agent_v1settings_agent_think import AgentV1SettingsAgentThinkParams - from .agent_v1settings_applied import AgentV1SettingsAppliedParams - from .agent_v1settings_audio import AgentV1SettingsAudioParams - from .agent_v1settings_audio_input import AgentV1SettingsAudioInputParams - from .agent_v1settings_audio_output import AgentV1SettingsAudioOutputParams - from .agent_v1settings_flags import AgentV1SettingsFlagsParams - from .agent_v1speak_updated import AgentV1SpeakUpdatedParams - from .agent_v1think_live_updated import AgentV1ThinkLiveUpdatedParams - from .agent_v1think_updated import AgentV1ThinkUpdatedParams - from .agent_v1update_listen import AgentV1UpdateListenParams - from .agent_v1update_listen_listen import AgentV1UpdateListenListenParams - from .agent_v1update_listen_listen_provider import ( - AgentV1UpdateListenListenProviderParams, - AgentV1UpdateListenListenProvider_V1Params, - AgentV1UpdateListenListenProvider_V2Params, - ) - from .agent_v1update_prompt import AgentV1UpdatePromptParams - from .agent_v1update_speak import AgentV1UpdateSpeakParams - from .agent_v1update_speak_speak import AgentV1UpdateSpeakSpeakParams - from .agent_v1update_think import AgentV1UpdateThinkParams - from .agent_v1update_think_live import AgentV1UpdateThinkLiveParams - from .agent_v1update_think_think import AgentV1UpdateThinkThinkParams - from .agent_v1user_started_speaking import AgentV1UserStartedSpeakingParams - from .agent_v1warning import AgentV1WarningParams - from .agent_v1welcome import AgentV1WelcomeParams - from .conversation_history_message import ConversationHistoryMessageParams - from .function_call_history_message import FunctionCallHistoryMessageParams - from .function_call_history_message_function_calls_item import FunctionCallHistoryMessageFunctionCallsItemParams -_dynamic_imports: typing.Dict[str, str] = { - "AgentV1AgentAudioDoneParams": ".agent_v1agent_audio_done", - "AgentV1AgentStartedSpeakingParams": ".agent_v1agent_started_speaking", - "AgentV1AgentThinkingParams": ".agent_v1agent_thinking", - "AgentV1ConversationTextParams": ".agent_v1conversation_text", - "AgentV1CustomFromThinkProviderParams": ".agent_v1custom_from_think_provider", - "AgentV1CustomToThinkProviderParams": ".agent_v1custom_to_think_provider", - "AgentV1ErrorParams": ".agent_v1error", - "AgentV1ForceEndTurnParams": ".agent_v1force_end_turn", - "AgentV1FrustrationDetectedParams": ".agent_v1frustration_detected", - "AgentV1FunctionCallCancelledFunctionsItemParams": ".agent_v1function_call_cancelled_functions_item", - "AgentV1FunctionCallCancelledParams": ".agent_v1function_call_cancelled", - "AgentV1FunctionCallRequestFunctionsItemParams": ".agent_v1function_call_request_functions_item", - "AgentV1FunctionCallRequestParams": ".agent_v1function_call_request", - "AgentV1HistoryParams": ".agent_v1history", - "AgentV1InjectAgentMessageParams": ".agent_v1inject_agent_message", - "AgentV1InjectDynamicAgentMessageParams": ".agent_v1inject_dynamic_agent_message", - "AgentV1InjectUserMessageParams": ".agent_v1inject_user_message", - "AgentV1InjectionRefusedParams": ".agent_v1injection_refused", - "AgentV1KeepAliveParams": ".agent_v1keep_alive", - "AgentV1LatencyReportParams": ".agent_v1latency_report", - "AgentV1ListenUpdatedParams": ".agent_v1listen_updated", - "AgentV1PromptUpdatedParams": ".agent_v1prompt_updated", - "AgentV1ReceiveFunctionCallResponseParams": ".agent_v1receive_function_call_response", - "AgentV1SendFunctionCallResponseParams": ".agent_v1send_function_call_response", - "AgentV1SettingsAgentContextContextMessagesItemParams": ".agent_v1settings_agent_context_context_messages_item", - "AgentV1SettingsAgentContextContextParams": ".agent_v1settings_agent_context_context", - "AgentV1SettingsAgentContextListenParams": ".agent_v1settings_agent_context_listen", - "AgentV1SettingsAgentContextListenProviderParams": ".agent_v1settings_agent_context_listen_provider", - "AgentV1SettingsAgentContextListenProvider_V1Params": ".agent_v1settings_agent_context_listen_provider", - "AgentV1SettingsAgentContextListenProvider_V2Params": ".agent_v1settings_agent_context_listen_provider", - "AgentV1SettingsAgentContextParams": ".agent_v1settings_agent_context", - "AgentV1SettingsAgentContextSpeakParams": ".agent_v1settings_agent_context_speak", - "AgentV1SettingsAgentContextThinkParams": ".agent_v1settings_agent_context_think", - "AgentV1SettingsAgentListenParams": ".agent_v1settings_agent_listen", - "AgentV1SettingsAgentListenProviderParams": ".agent_v1settings_agent_listen_provider", - "AgentV1SettingsAgentListenProvider_V1Params": ".agent_v1settings_agent_listen_provider", - "AgentV1SettingsAgentListenProvider_V2Params": ".agent_v1settings_agent_listen_provider", - "AgentV1SettingsAgentParams": ".agent_v1settings_agent", - "AgentV1SettingsAgentSpeakParams": ".agent_v1settings_agent_speak", - "AgentV1SettingsAgentThinkParams": ".agent_v1settings_agent_think", - "AgentV1SettingsAppliedParams": ".agent_v1settings_applied", - "AgentV1SettingsAudioInputParams": ".agent_v1settings_audio_input", - "AgentV1SettingsAudioOutputParams": ".agent_v1settings_audio_output", - "AgentV1SettingsAudioParams": ".agent_v1settings_audio", - "AgentV1SettingsFlagsParams": ".agent_v1settings_flags", - "AgentV1SettingsParams": ".agent_v1settings", - "AgentV1SpeakUpdatedParams": ".agent_v1speak_updated", - "AgentV1ThinkLiveUpdatedParams": ".agent_v1think_live_updated", - "AgentV1ThinkUpdatedParams": ".agent_v1think_updated", - "AgentV1UpdateListenListenParams": ".agent_v1update_listen_listen", - "AgentV1UpdateListenListenProviderParams": ".agent_v1update_listen_listen_provider", - "AgentV1UpdateListenListenProvider_V1Params": ".agent_v1update_listen_listen_provider", - "AgentV1UpdateListenListenProvider_V2Params": ".agent_v1update_listen_listen_provider", - "AgentV1UpdateListenParams": ".agent_v1update_listen", - "AgentV1UpdatePromptParams": ".agent_v1update_prompt", - "AgentV1UpdateSpeakParams": ".agent_v1update_speak", - "AgentV1UpdateSpeakSpeakParams": ".agent_v1update_speak_speak", - "AgentV1UpdateThinkLiveParams": ".agent_v1update_think_live", - "AgentV1UpdateThinkParams": ".agent_v1update_think", - "AgentV1UpdateThinkThinkParams": ".agent_v1update_think_think", - "AgentV1UserStartedSpeakingParams": ".agent_v1user_started_speaking", - "AgentV1WarningParams": ".agent_v1warning", - "AgentV1WelcomeParams": ".agent_v1welcome", - "ConversationHistoryMessageParams": ".conversation_history_message", - "FunctionCallHistoryMessageFunctionCallsItemParams": ".function_call_history_message_function_calls_item", - "FunctionCallHistoryMessageParams": ".function_call_history_message", -} - -_dynamic_imports.update( - { - "AgentV1HistoryContentParams": ".agent_v1history_content", - "AgentV1HistoryFunctionCallsParams": ".agent_v1history_function_calls", - "AgentV1HistoryFunctionCallsFunctionCallsItemParams": ".agent_v1history_function_calls_function_calls_item", - "AgentV1SettingsAgentContextContextMessagesItemFunctionCallsFunctionCallsItemParams": ".agent_v1settings_agent_context_context_messages_item_function_calls_function_calls_item", - "AgentV1SettingsAgentContextListenProviderV1Params": ".agent_v1settings_agent_context_listen_provider_v1", - "AgentV1SettingsAgentContextListenProviderV2Params": ".agent_v1settings_agent_context_listen_provider_v2", - "AgentV1SettingsAgentContextListenProviderV2LanguageHintParams": ".agent_v1settings_agent_context_listen_provider_v2language_hint", - "AgentV1SettingsAgentContextMessagesItemParams": ".agent_v1settings_agent_context_messages_item", - "AgentV1SettingsAgentContextMessagesItemContentParams": ".agent_v1settings_agent_context_messages_item_content", - "AgentV1SettingsAgentContextMessagesItemFunctionCallsParams": ".agent_v1settings_agent_context_messages_item_function_calls", - "AgentV1SettingsAgentContextMessagesItemFunctionCallsFunctionCallsItemParams": ".agent_v1settings_agent_context_messages_item_function_calls_function_calls_item", - "AgentV1SettingsAgentListenProviderV1Params": ".agent_v1settings_agent_listen_provider_v1", - "AgentV1SettingsAgentListenProviderV2Params": ".agent_v1settings_agent_listen_provider_v2", - } -) - - -def __getattr__(attr_name: str) -> typing.Any: - module_name = _dynamic_imports.get(attr_name) - if module_name is None: - raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") - try: - module = import_module(module_name, __package__) - if module_name == f".{attr_name}": - return module - else: - return getattr(module, attr_name) - except ImportError as e: - raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e - except AttributeError as e: - raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e - - -def __dir__(): - lazy_attrs = list(_dynamic_imports.keys()) - return sorted(lazy_attrs) - - -__all__ = [ - "AgentV1AgentAudioDoneParams", - "AgentV1AgentStartedSpeakingParams", - "AgentV1AgentThinkingParams", - "AgentV1ConversationTextParams", - "AgentV1CustomFromThinkProviderParams", - "AgentV1CustomToThinkProviderParams", - "AgentV1ErrorParams", - "AgentV1ForceEndTurnParams", - "AgentV1FrustrationDetectedParams", - "AgentV1FunctionCallCancelledFunctionsItemParams", - "AgentV1FunctionCallCancelledParams", - "AgentV1FunctionCallRequestFunctionsItemParams", - "AgentV1FunctionCallRequestParams", - "AgentV1HistoryParams", - "AgentV1InjectAgentMessageParams", - "AgentV1InjectDynamicAgentMessageParams", - "AgentV1InjectUserMessageParams", - "AgentV1InjectionRefusedParams", - "AgentV1KeepAliveParams", - "AgentV1LatencyReportParams", - "AgentV1ListenUpdatedParams", - "AgentV1PromptUpdatedParams", - "AgentV1ReceiveFunctionCallResponseParams", - "AgentV1SendFunctionCallResponseParams", - "AgentV1SettingsAgentContextContextMessagesItemParams", - "AgentV1SettingsAgentContextContextParams", - "AgentV1SettingsAgentContextListenParams", - "AgentV1SettingsAgentContextListenProviderParams", - "AgentV1SettingsAgentContextListenProvider_V1Params", - "AgentV1SettingsAgentContextListenProvider_V2Params", - "AgentV1SettingsAgentContextParams", - "AgentV1SettingsAgentContextSpeakParams", - "AgentV1SettingsAgentContextThinkParams", - "AgentV1SettingsAgentListenParams", - "AgentV1SettingsAgentListenProviderParams", - "AgentV1SettingsAgentListenProvider_V1Params", - "AgentV1SettingsAgentListenProvider_V2Params", - "AgentV1SettingsAgentParams", - "AgentV1SettingsAgentSpeakParams", - "AgentV1SettingsAgentThinkParams", - "AgentV1SettingsAppliedParams", - "AgentV1SettingsAudioInputParams", - "AgentV1SettingsAudioOutputParams", - "AgentV1SettingsAudioParams", - "AgentV1SettingsFlagsParams", - "AgentV1SettingsParams", - "AgentV1SpeakUpdatedParams", - "AgentV1ThinkLiveUpdatedParams", - "AgentV1ThinkUpdatedParams", - "AgentV1UpdateListenListenParams", - "AgentV1UpdateListenListenProviderParams", - "AgentV1UpdateListenListenProvider_V1Params", - "AgentV1UpdateListenListenProvider_V2Params", - "AgentV1UpdateListenParams", - "AgentV1UpdatePromptParams", - "AgentV1UpdateSpeakParams", - "AgentV1UpdateSpeakSpeakParams", - "AgentV1UpdateThinkLiveParams", - "AgentV1UpdateThinkParams", - "AgentV1UpdateThinkThinkParams", - "AgentV1UserStartedSpeakingParams", - "AgentV1WarningParams", - "AgentV1WelcomeParams", - "ConversationHistoryMessageParams", - "FunctionCallHistoryMessageFunctionCallsItemParams", - "FunctionCallHistoryMessageParams", -] - -__all__.extend( - [ - "AgentV1HistoryContentParams", - "AgentV1HistoryFunctionCallsParams", - "AgentV1HistoryFunctionCallsFunctionCallsItemParams", - "AgentV1SettingsAgentContextContextMessagesItemFunctionCallsFunctionCallsItemParams", - "AgentV1SettingsAgentContextListenProviderV1Params", - "AgentV1SettingsAgentContextListenProviderV2Params", - "AgentV1SettingsAgentContextListenProviderV2LanguageHintParams", - "AgentV1SettingsAgentContextMessagesItemParams", - "AgentV1SettingsAgentContextMessagesItemContentParams", - "AgentV1SettingsAgentContextMessagesItemFunctionCallsParams", - "AgentV1SettingsAgentContextMessagesItemFunctionCallsFunctionCallsItemParams", - "AgentV1SettingsAgentListenProviderV1Params", - "AgentV1SettingsAgentListenProviderV2Params", - ] -) diff --git a/src/deepgram/agent/v1/requests/agent_v1conversation_text.py b/src/deepgram/agent/v1/requests/agent_v1conversation_text.py index ee6f97cf..059f094a 100644 --- a/src/deepgram/agent/v1/requests/agent_v1conversation_text.py +++ b/src/deepgram/agent/v1/requests/agent_v1conversation_text.py @@ -23,7 +23,7 @@ class AgentV1ConversationTextParams(typing_extensions.TypedDict): The actual statement that was spoken """ - conversational_behavior: AgentV1ConversationTextConversationalBehavior + conversational_behavior: typing_extensions.NotRequired[AgentV1ConversationTextConversationalBehavior] """ Annotates what kind of utterance the message represents: `default` (a standard turn), `backchannel` (a short acknowledgement while the user held the floor), `presence_check` (a prompt after extended silence), or `filler` (a line covering a wait on a function call or a dynamic InjectAgentMessage). Always sent; it is `default` for every message while Think Live is off """ diff --git a/src/deepgram/agent/v1/requests/agent_v1conversation_text.py.bak b/src/deepgram/agent/v1/requests/agent_v1conversation_text.py.bak deleted file mode 100644 index 059f094a..00000000 --- a/src/deepgram/agent/v1/requests/agent_v1conversation_text.py.bak +++ /dev/null @@ -1,39 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import typing_extensions -from ..types.agent_v1conversation_text_conversational_behavior import AgentV1ConversationTextConversationalBehavior -from ..types.agent_v1conversation_text_role import AgentV1ConversationTextRole - - -class AgentV1ConversationTextParams(typing_extensions.TypedDict): - type: typing.Literal["ConversationText"] - """ - Message type identifier for conversation text - """ - - role: AgentV1ConversationTextRole - """ - Identifies who spoke the statement - """ - - content: str - """ - The actual statement that was spoken - """ - - conversational_behavior: typing_extensions.NotRequired[AgentV1ConversationTextConversationalBehavior] - """ - Annotates what kind of utterance the message represents: `default` (a standard turn), `backchannel` (a short acknowledgement while the user held the floor), `presence_check` (a prompt after extended silence), or `filler` (a line covering a wait on a function call or a dynamic InjectAgentMessage). Always sent; it is `default` for every message while Think Live is off - """ - - languages_hinted: typing_extensions.NotRequired[typing.Sequence[str]] - """ - The language hints that were active at the time of the turn. Only present on user-role messages when the listen model is flux-general-multi. - """ - - languages: typing_extensions.NotRequired[typing.Sequence[str]] - """ - Languages detected in the user's speech, sorted by word count (descending). Only present on user-role messages when the listen model is flux-general-multi. - """ diff --git a/src/deepgram/agent/v1/requests/agent_v1inject_dynamic_agent_message.py b/src/deepgram/agent/v1/requests/agent_v1inject_dynamic_agent_message.py index c6d114de..1d912428 100644 --- a/src/deepgram/agent/v1/requests/agent_v1inject_dynamic_agent_message.py +++ b/src/deepgram/agent/v1/requests/agent_v1inject_dynamic_agent_message.py @@ -20,7 +20,7 @@ class AgentV1InjectDynamicAgentMessageParams(typing_extensions.TypedDict): behavior: typing_extensions.NotRequired[AgentV1InjectDynamicAgentMessageBehavior] """ Controls how the injection interacts with any in-progress user or agent turn. - + * `default` — The agent speaks only if neither the user nor the agent is mid-turn. If a turn is in progress, the server replies with `InjectionRefused`. * `queue` — The message is appended after any already-queued `ConversationText` without interrupting the current agent turn or think response. If nothing is queued, the message plays immediately. * `interrupt` — The agent immediately speaks. If the agent was already speaking, it interrupts the current speech and replaces it with the new message. If the user is speaking, the agent interrupts with the new message, but the user's continued speech triggers `UserStartedSpeaking`, which quickly interrupts the agent. diff --git a/src/deepgram/agent/v1/requests/agent_v1inject_dynamic_agent_message.py.bak b/src/deepgram/agent/v1/requests/agent_v1inject_dynamic_agent_message.py.bak deleted file mode 100644 index 1d912428..00000000 --- a/src/deepgram/agent/v1/requests/agent_v1inject_dynamic_agent_message.py.bak +++ /dev/null @@ -1,27 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import typing_extensions -from ..types.agent_v1inject_dynamic_agent_message_behavior import AgentV1InjectDynamicAgentMessageBehavior - - -class AgentV1InjectDynamicAgentMessageParams(typing_extensions.TypedDict): - type: typing.Literal["InjectAgentMessage"] - """ - Message type identifier for injecting an agent message - """ - - is_dynamic: typing.Literal[True] - """ - Must be `true`. The Think Live model generates the line, so no `message` is sent - """ - - behavior: typing_extensions.NotRequired[AgentV1InjectDynamicAgentMessageBehavior] - """ - Controls how the injection interacts with any in-progress user or agent turn. - - * `default` — The agent speaks only if neither the user nor the agent is mid-turn. If a turn is in progress, the server replies with `InjectionRefused`. - * `queue` — The message is appended after any already-queued `ConversationText` without interrupting the current agent turn or think response. If nothing is queued, the message plays immediately. - * `interrupt` — The agent immediately speaks. If the agent was already speaking, it interrupts the current speech and replaces it with the new message. If the user is speaking, the agent interrupts with the new message, but the user's continued speech triggers `UserStartedSpeaking`, which quickly interrupts the agent. - """ diff --git a/src/deepgram/agent/v1/requests/agent_v1settings.py b/src/deepgram/agent/v1/requests/agent_v1settings.py index 2f748dcd..5ada0975 100644 --- a/src/deepgram/agent/v1/requests/agent_v1settings.py +++ b/src/deepgram/agent/v1/requests/agent_v1settings.py @@ -4,6 +4,7 @@ import typing_extensions from .agent_v1settings_agent import AgentV1SettingsAgentParams +from .agent_v1settings_agent_context import AgentV1SettingsAgentContextParams from .agent_v1settings_audio import AgentV1SettingsAudioParams from .agent_v1settings_flags import AgentV1SettingsFlagsParams @@ -27,4 +28,4 @@ class AgentV1SettingsParams(typing_extensions.TypedDict): """ audio: AgentV1SettingsAudioParams - agent: AgentV1SettingsAgentParams + agent: typing.Union[AgentV1SettingsAgentParams, AgentV1SettingsAgentContextParams, str] diff --git a/src/deepgram/agent/v1/requests/agent_v1settings.py.bak b/src/deepgram/agent/v1/requests/agent_v1settings.py.bak deleted file mode 100644 index 5ada0975..00000000 --- a/src/deepgram/agent/v1/requests/agent_v1settings.py.bak +++ /dev/null @@ -1,31 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import typing_extensions -from .agent_v1settings_agent import AgentV1SettingsAgentParams -from .agent_v1settings_agent_context import AgentV1SettingsAgentContextParams -from .agent_v1settings_audio import AgentV1SettingsAudioParams -from .agent_v1settings_flags import AgentV1SettingsFlagsParams - - -class AgentV1SettingsParams(typing_extensions.TypedDict): - type: typing.Literal["Settings"] - tags: typing_extensions.NotRequired[typing.Sequence[str]] - """ - Tags to associate with the request - """ - - experimental: typing_extensions.NotRequired[bool] - """ - To enable experimental features - """ - - flags: typing_extensions.NotRequired[AgentV1SettingsFlagsParams] - mip_opt_out: typing_extensions.NotRequired[bool] - """ - To opt out of Deepgram Model Improvement Program - """ - - audio: AgentV1SettingsAudioParams - agent: typing.Union[AgentV1SettingsAgentParams, AgentV1SettingsAgentContextParams, str] diff --git a/src/deepgram/agent/v1/requests/agent_v1settings_agent.py b/src/deepgram/agent/v1/requests/agent_v1settings_agent.py index 0da4b0f3..4a2bcf8c 100644 --- a/src/deepgram/agent/v1/requests/agent_v1settings_agent.py +++ b/src/deepgram/agent/v1/requests/agent_v1settings_agent.py @@ -1,7 +1,18 @@ # This file was auto-generated by Fern from our API Definition. -import typing - +import typing_extensions +from ....requests.think_live_settings_v1 import ThinkLiveSettingsV1Params from .agent_v1settings_agent_context import AgentV1SettingsAgentContextParams +from .agent_v1settings_agent_listen import AgentV1SettingsAgentListenParams +from .agent_v1settings_agent_speak import AgentV1SettingsAgentSpeakParams +from .agent_v1settings_agent_think import AgentV1SettingsAgentThinkParams + -AgentV1SettingsAgentParams = typing.Union[AgentV1SettingsAgentContextParams, str] +class AgentV1SettingsAgentParams(typing_extensions.TypedDict): + language: typing_extensions.NotRequired[str] + context: typing_extensions.NotRequired[AgentV1SettingsAgentContextParams] + listen: typing_extensions.NotRequired[AgentV1SettingsAgentListenParams] + think: typing_extensions.NotRequired[AgentV1SettingsAgentThinkParams] + think_live: typing_extensions.NotRequired[ThinkLiveSettingsV1Params] + speak: typing_extensions.NotRequired[AgentV1SettingsAgentSpeakParams] + greeting: typing_extensions.NotRequired[str] diff --git a/src/deepgram/agent/v1/requests/agent_v1settings_agent.py.bak b/src/deepgram/agent/v1/requests/agent_v1settings_agent.py.bak deleted file mode 100644 index 4a2bcf8c..00000000 --- a/src/deepgram/agent/v1/requests/agent_v1settings_agent.py.bak +++ /dev/null @@ -1,18 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing_extensions -from ....requests.think_live_settings_v1 import ThinkLiveSettingsV1Params -from .agent_v1settings_agent_context import AgentV1SettingsAgentContextParams -from .agent_v1settings_agent_listen import AgentV1SettingsAgentListenParams -from .agent_v1settings_agent_speak import AgentV1SettingsAgentSpeakParams -from .agent_v1settings_agent_think import AgentV1SettingsAgentThinkParams - - -class AgentV1SettingsAgentParams(typing_extensions.TypedDict): - language: typing_extensions.NotRequired[str] - context: typing_extensions.NotRequired[AgentV1SettingsAgentContextParams] - listen: typing_extensions.NotRequired[AgentV1SettingsAgentListenParams] - think: typing_extensions.NotRequired[AgentV1SettingsAgentThinkParams] - think_live: typing_extensions.NotRequired[ThinkLiveSettingsV1Params] - speak: typing_extensions.NotRequired[AgentV1SettingsAgentSpeakParams] - greeting: typing_extensions.NotRequired[str] diff --git a/src/deepgram/agent/v1/requests/agent_v1settings_agent_context.py b/src/deepgram/agent/v1/requests/agent_v1settings_agent_context.py index 3dbb6e72..19503b6f 100644 --- a/src/deepgram/agent/v1/requests/agent_v1settings_agent_context.py +++ b/src/deepgram/agent/v1/requests/agent_v1settings_agent_context.py @@ -1,9 +1,12 @@ # This file was auto-generated by Fern from our API Definition. +import typing + import typing_extensions from ....requests.think_live_settings_v1 import ThinkLiveSettingsV1Params from .agent_v1settings_agent_context_context import AgentV1SettingsAgentContextContextParams from .agent_v1settings_agent_context_listen import AgentV1SettingsAgentContextListenParams +from .agent_v1settings_agent_context_messages_item import AgentV1SettingsAgentContextMessagesItemParams from .agent_v1settings_agent_context_speak import AgentV1SettingsAgentContextSpeakParams from .agent_v1settings_agent_context_think import AgentV1SettingsAgentContextThinkParams @@ -14,6 +17,7 @@ class AgentV1SettingsAgentContextParams(typing_extensions.TypedDict): Deprecated. Use `listen.provider.language` and `speak.provider.language` fields instead. """ + messages: typing_extensions.NotRequired[typing.Sequence[AgentV1SettingsAgentContextMessagesItemParams]] context: typing_extensions.NotRequired[AgentV1SettingsAgentContextContextParams] """ Conversation context including the history of messages and function calls diff --git a/src/deepgram/agent/v1/requests/agent_v1settings_agent_context.py.bak b/src/deepgram/agent/v1/requests/agent_v1settings_agent_context.py.bak deleted file mode 100644 index 19503b6f..00000000 --- a/src/deepgram/agent/v1/requests/agent_v1settings_agent_context.py.bak +++ /dev/null @@ -1,37 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import typing_extensions -from ....requests.think_live_settings_v1 import ThinkLiveSettingsV1Params -from .agent_v1settings_agent_context_context import AgentV1SettingsAgentContextContextParams -from .agent_v1settings_agent_context_listen import AgentV1SettingsAgentContextListenParams -from .agent_v1settings_agent_context_messages_item import AgentV1SettingsAgentContextMessagesItemParams -from .agent_v1settings_agent_context_speak import AgentV1SettingsAgentContextSpeakParams -from .agent_v1settings_agent_context_think import AgentV1SettingsAgentContextThinkParams - - -class AgentV1SettingsAgentContextParams(typing_extensions.TypedDict): - language: typing_extensions.NotRequired[str] - """ - Deprecated. Use `listen.provider.language` and `speak.provider.language` fields instead. - """ - - messages: typing_extensions.NotRequired[typing.Sequence[AgentV1SettingsAgentContextMessagesItemParams]] - context: typing_extensions.NotRequired[AgentV1SettingsAgentContextContextParams] - """ - Conversation context including the history of messages and function calls - """ - - listen: typing_extensions.NotRequired[AgentV1SettingsAgentContextListenParams] - think: typing_extensions.NotRequired[AgentV1SettingsAgentContextThinkParams] - """ - Your reasoning LLM. With Think Live on, this is the reasoning half of the pair, running alongside the Think Live model configured in `think_live` - """ - - think_live: typing_extensions.NotRequired[ThinkLiveSettingsV1Params] - speak: typing_extensions.NotRequired[AgentV1SettingsAgentContextSpeakParams] - greeting: typing_extensions.NotRequired[str] - """ - Optional message that agent will speak at the start - """ diff --git a/src/deepgram/agent/v1/socket_client.py b/src/deepgram/agent/v1/socket_client.py index 35ebd833..44ffcaed 100644 --- a/src/deepgram/agent/v1/socket_client.py +++ b/src/deepgram/agent/v1/socket_client.py @@ -3,9 +3,7 @@ import json import logging import typing -from json.decoder import JSONDecodeError -import websockets import websockets.sync.connection as websockets_sync_connection from ...core.events import EventEmitterMixin, EventType from ...core.unchecked_base_model import construct_type @@ -50,6 +48,18 @@ except ImportError: from websockets import WebSocketClientProtocol # type: ignore + +def _sanitize_numeric_types(obj: typing.Any) -> typing.Any: + """Convert whole-number floats to integers for wire-compatible JSON.""" + if isinstance(obj, dict): + return {key: _sanitize_numeric_types(value) for key, value in obj.items()} + if isinstance(obj, list): + return [_sanitize_numeric_types(item) for item in obj] + if isinstance(obj, float) and obj.is_integer(): + return int(obj) + return obj + + _logger = logging.getLogger(__name__) V1SocketClientResponse = typing.Union[ AgentV1ListenUpdated, @@ -75,6 +85,7 @@ AgentV1Warning, AgentV1History, bytes, + typing.Dict[str, typing.Any], ] @@ -121,7 +132,7 @@ async def start_listening(self): ) continue await self._emit_async(EventType.MESSAGE, parsed) - except (websockets.WebSocketException, JSONDecodeError) as exc: + except Exception as exc: await self._emit_async(EventType.ERROR, exc) finally: await self._emit_async(EventType.CLOSE, None) @@ -189,12 +200,12 @@ async def send_function_call_response(self, message: AgentV1SendFunctionCallResp """ await self._send_model(message) - async def send_keep_alive(self, message: AgentV1KeepAlive) -> None: + async def send_keep_alive(self, message: typing.Optional[AgentV1KeepAlive] = None) -> None: """ Send a message to the websocket connection. The message will be sent as a AgentV1KeepAlive. """ - await self._send_model(message) + await self._send_model(message or AgentV1KeepAlive(type="KeepAlive")) async def send_update_prompt(self, message: AgentV1UpdatePrompt) -> None: """ @@ -203,12 +214,12 @@ async def send_update_prompt(self, message: AgentV1UpdatePrompt) -> None: """ await self._send_model(message) - async def send_force_end_turn(self, message: AgentV1ForceEndTurn) -> None: + async def send_force_end_turn(self, message: typing.Optional[AgentV1ForceEndTurn] = None) -> None: """ Send a message to the websocket connection. The message will be sent as a AgentV1ForceEndTurn. """ - await self._send_model(message) + await self._send_model(message or AgentV1ForceEndTurn(type="ForceEndTurn")) async def send_custom_to_think_provider(self, message: AgentV1CustomToThinkProvider) -> None: """ @@ -217,6 +228,10 @@ async def send_custom_to_think_provider(self, message: AgentV1CustomToThinkProvi """ await self._send_model(message) + async def send_raw(self, message: typing.Union[typing.Dict[str, typing.Any], str]) -> None: + """Send a JSON control frame without model validation.""" + await self._send(message) + async def send_media(self, message: bytes) -> None: """ Send a message to the websocket connection. @@ -250,7 +265,7 @@ async def _send_model(self, data: typing.Any) -> None: """ Send a Pydantic model to the websocket connection. """ - await self._send(data.dict()) + await self._send(_sanitize_numeric_types(data.dict())) class V1SocketClient(EventEmitterMixin): @@ -296,7 +311,7 @@ def start_listening(self): ) continue self._emit(EventType.MESSAGE, parsed) - except (websockets.WebSocketException, JSONDecodeError) as exc: + except Exception as exc: self._emit(EventType.ERROR, exc) finally: self._emit(EventType.CLOSE, None) @@ -364,12 +379,12 @@ def send_function_call_response(self, message: AgentV1SendFunctionCallResponse) """ self._send_model(message) - def send_keep_alive(self, message: AgentV1KeepAlive) -> None: + def send_keep_alive(self, message: typing.Optional[AgentV1KeepAlive] = None) -> None: """ Send a message to the websocket connection. The message will be sent as a AgentV1KeepAlive. """ - self._send_model(message) + self._send_model(message or AgentV1KeepAlive(type="KeepAlive")) def send_update_prompt(self, message: AgentV1UpdatePrompt) -> None: """ @@ -378,12 +393,12 @@ def send_update_prompt(self, message: AgentV1UpdatePrompt) -> None: """ self._send_model(message) - def send_force_end_turn(self, message: AgentV1ForceEndTurn) -> None: + def send_force_end_turn(self, message: typing.Optional[AgentV1ForceEndTurn] = None) -> None: """ Send a message to the websocket connection. The message will be sent as a AgentV1ForceEndTurn. """ - self._send_model(message) + self._send_model(message or AgentV1ForceEndTurn(type="ForceEndTurn")) def send_custom_to_think_provider(self, message: AgentV1CustomToThinkProvider) -> None: """ @@ -392,6 +407,10 @@ def send_custom_to_think_provider(self, message: AgentV1CustomToThinkProvider) - """ self._send_model(message) + def send_raw(self, message: typing.Union[typing.Dict[str, typing.Any], str]) -> None: + """Send a JSON control frame without model validation.""" + self._send(message) + def send_media(self, message: bytes) -> None: """ Send a message to the websocket connection. @@ -425,4 +444,4 @@ def _send_model(self, data: typing.Any) -> None: """ Send a Pydantic model to the websocket connection. """ - self._send(data.dict()) + self._send(_sanitize_numeric_types(data.dict())) diff --git a/src/deepgram/agent/v1/socket_client.py.bak b/src/deepgram/agent/v1/socket_client.py.bak deleted file mode 100644 index 44ffcaed..00000000 --- a/src/deepgram/agent/v1/socket_client.py.bak +++ /dev/null @@ -1,447 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import json -import logging -import typing - -import websockets.sync.connection as websockets_sync_connection -from ...core.events import EventEmitterMixin, EventType -from ...core.unchecked_base_model import construct_type -from .types.agent_v1agent_audio_done import AgentV1AgentAudioDone -from .types.agent_v1agent_started_speaking import AgentV1AgentStartedSpeaking -from .types.agent_v1agent_thinking import AgentV1AgentThinking -from .types.agent_v1conversation_text import AgentV1ConversationText -from .types.agent_v1custom_from_think_provider import AgentV1CustomFromThinkProvider -from .types.agent_v1custom_to_think_provider import AgentV1CustomToThinkProvider -from .types.agent_v1error import AgentV1Error -from .types.agent_v1force_end_turn import AgentV1ForceEndTurn -from .types.agent_v1frustration_detected import AgentV1FrustrationDetected -from .types.agent_v1function_call_cancelled import AgentV1FunctionCallCancelled -from .types.agent_v1function_call_request import AgentV1FunctionCallRequest -from .types.agent_v1history import AgentV1History -from .types.agent_v1inject_agent_message import AgentV1InjectAgentMessage -from .types.agent_v1inject_dynamic_agent_message import AgentV1InjectDynamicAgentMessage -from .types.agent_v1inject_user_message import AgentV1InjectUserMessage -from .types.agent_v1injection_refused import AgentV1InjectionRefused -from .types.agent_v1keep_alive import AgentV1KeepAlive -from .types.agent_v1latency_report import AgentV1LatencyReport -from .types.agent_v1listen_updated import AgentV1ListenUpdated -from .types.agent_v1prompt_updated import AgentV1PromptUpdated -from .types.agent_v1receive_function_call_response import AgentV1ReceiveFunctionCallResponse -from .types.agent_v1send_function_call_response import AgentV1SendFunctionCallResponse -from .types.agent_v1settings import AgentV1Settings -from .types.agent_v1settings_applied import AgentV1SettingsApplied -from .types.agent_v1speak_updated import AgentV1SpeakUpdated -from .types.agent_v1think_live_updated import AgentV1ThinkLiveUpdated -from .types.agent_v1think_updated import AgentV1ThinkUpdated -from .types.agent_v1update_listen import AgentV1UpdateListen -from .types.agent_v1update_prompt import AgentV1UpdatePrompt -from .types.agent_v1update_speak import AgentV1UpdateSpeak -from .types.agent_v1update_think import AgentV1UpdateThink -from .types.agent_v1update_think_live import AgentV1UpdateThinkLive -from .types.agent_v1user_started_speaking import AgentV1UserStartedSpeaking -from .types.agent_v1warning import AgentV1Warning -from .types.agent_v1welcome import AgentV1Welcome - -try: - from websockets.legacy.client import WebSocketClientProtocol # type: ignore -except ImportError: - from websockets import WebSocketClientProtocol # type: ignore - - -def _sanitize_numeric_types(obj: typing.Any) -> typing.Any: - """Convert whole-number floats to integers for wire-compatible JSON.""" - if isinstance(obj, dict): - return {key: _sanitize_numeric_types(value) for key, value in obj.items()} - if isinstance(obj, list): - return [_sanitize_numeric_types(item) for item in obj] - if isinstance(obj, float) and obj.is_integer(): - return int(obj) - return obj - - -_logger = logging.getLogger(__name__) -V1SocketClientResponse = typing.Union[ - AgentV1ListenUpdated, - AgentV1ThinkUpdated, - AgentV1ThinkLiveUpdated, - AgentV1FrustrationDetected, - AgentV1ReceiveFunctionCallResponse, - AgentV1PromptUpdated, - AgentV1SpeakUpdated, - AgentV1InjectionRefused, - AgentV1Welcome, - AgentV1SettingsApplied, - AgentV1ConversationText, - AgentV1UserStartedSpeaking, - AgentV1AgentThinking, - AgentV1LatencyReport, - AgentV1FunctionCallRequest, - AgentV1FunctionCallCancelled, - AgentV1AgentStartedSpeaking, - AgentV1AgentAudioDone, - AgentV1CustomFromThinkProvider, - AgentV1Error, - AgentV1Warning, - AgentV1History, - bytes, - typing.Dict[str, typing.Any], -] - - -class AsyncV1SocketClient(EventEmitterMixin): - def __init__(self, *, websocket: WebSocketClientProtocol): - super().__init__() - self._websocket = websocket - - async def __aiter__(self) -> typing.AsyncIterator[V1SocketClientResponse]: - async for message in self._websocket: - if isinstance(message, bytes): - yield message # type: ignore - else: - try: - yield construct_type(type_=V1SocketClientResponse, object_=json.loads(message)) # type: ignore - except Exception: - _logger.warning( - "Skipping unknown WebSocket message; update your SDK version to support new message types." - ) - continue - - async def start_listening(self): - """ - Start listening for messages on the websocket connection. - - Emits events in the following order: - - EventType.OPEN when connection is established - - EventType.MESSAGE for each message received - - EventType.ERROR if an error occurs - - EventType.CLOSE when connection is closed - """ - await self._emit_async(EventType.OPEN, None) - try: - async for raw_message in self._websocket: - if isinstance(raw_message, bytes): - parsed = raw_message - else: - json_data = json.loads(raw_message) - try: - parsed = construct_type(type_=V1SocketClientResponse, object_=json_data) # type: ignore - except Exception: - _logger.warning( - "Skipping unknown WebSocket message; update your SDK version to support new message types." - ) - continue - await self._emit_async(EventType.MESSAGE, parsed) - except Exception as exc: - await self._emit_async(EventType.ERROR, exc) - finally: - await self._emit_async(EventType.CLOSE, None) - - async def send_settings(self, message: AgentV1Settings) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a AgentV1Settings. - """ - await self._send_model(message) - - async def send_update_listen(self, message: AgentV1UpdateListen) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a AgentV1UpdateListen. - """ - await self._send_model(message) - - async def send_update_think(self, message: AgentV1UpdateThink) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a AgentV1UpdateThink. - """ - await self._send_model(message) - - async def send_update_think_live(self, message: AgentV1UpdateThinkLive) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a AgentV1UpdateThinkLive. - """ - await self._send_model(message) - - async def send_update_speak(self, message: AgentV1UpdateSpeak) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a AgentV1UpdateSpeak. - """ - await self._send_model(message) - - async def send_inject_user_message(self, message: AgentV1InjectUserMessage) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a AgentV1InjectUserMessage. - """ - await self._send_model(message) - - async def send_inject_agent_message(self, message: AgentV1InjectAgentMessage) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a AgentV1InjectAgentMessage. - """ - await self._send_model(message) - - async def send_inject_dynamic_agent_message(self, message: AgentV1InjectDynamicAgentMessage) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a AgentV1InjectDynamicAgentMessage. - """ - await self._send_model(message) - - async def send_function_call_response(self, message: AgentV1SendFunctionCallResponse) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a AgentV1SendFunctionCallResponse. - """ - await self._send_model(message) - - async def send_keep_alive(self, message: typing.Optional[AgentV1KeepAlive] = None) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a AgentV1KeepAlive. - """ - await self._send_model(message or AgentV1KeepAlive(type="KeepAlive")) - - async def send_update_prompt(self, message: AgentV1UpdatePrompt) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a AgentV1UpdatePrompt. - """ - await self._send_model(message) - - async def send_force_end_turn(self, message: typing.Optional[AgentV1ForceEndTurn] = None) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a AgentV1ForceEndTurn. - """ - await self._send_model(message or AgentV1ForceEndTurn(type="ForceEndTurn")) - - async def send_custom_to_think_provider(self, message: AgentV1CustomToThinkProvider) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a AgentV1CustomToThinkProvider. - """ - await self._send_model(message) - - async def send_raw(self, message: typing.Union[typing.Dict[str, typing.Any], str]) -> None: - """Send a JSON control frame without model validation.""" - await self._send(message) - - async def send_media(self, message: bytes) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a bytes. - """ - await self._send(message) - - async def recv(self) -> V1SocketClientResponse: - """ - Receive a message from the websocket connection. - """ - data = await self._websocket.recv() - if isinstance(data, bytes): - return data # type: ignore - json_data = json.loads(data) - try: - return construct_type(type_=V1SocketClientResponse, object_=json_data) # type: ignore - except Exception: - _logger.warning("Skipping unknown WebSocket message; update your SDK version to support new message types.") - return json_data # type: ignore - - async def _send(self, data: typing.Any) -> None: - """ - Send a message to the websocket connection. - """ - if isinstance(data, dict): - data = json.dumps(data) - await self._websocket.send(data) - - async def _send_model(self, data: typing.Any) -> None: - """ - Send a Pydantic model to the websocket connection. - """ - await self._send(_sanitize_numeric_types(data.dict())) - - -class V1SocketClient(EventEmitterMixin): - def __init__(self, *, websocket: websockets_sync_connection.Connection): - super().__init__() - self._websocket = websocket - - def __iter__(self) -> typing.Iterator[V1SocketClientResponse]: - for message in self._websocket: - if isinstance(message, bytes): - yield message # type: ignore - else: - try: - yield construct_type(type_=V1SocketClientResponse, object_=json.loads(message)) # type: ignore - except Exception: - _logger.warning( - "Skipping unknown WebSocket message; update your SDK version to support new message types." - ) - continue - - def start_listening(self): - """ - Start listening for messages on the websocket connection. - - Emits events in the following order: - - EventType.OPEN when connection is established - - EventType.MESSAGE for each message received - - EventType.ERROR if an error occurs - - EventType.CLOSE when connection is closed - """ - self._emit(EventType.OPEN, None) - try: - for raw_message in self._websocket: - if isinstance(raw_message, bytes): - parsed = raw_message - else: - json_data = json.loads(raw_message) - try: - parsed = construct_type(type_=V1SocketClientResponse, object_=json_data) # type: ignore - except Exception: - _logger.warning( - "Skipping unknown WebSocket message; update your SDK version to support new message types." - ) - continue - self._emit(EventType.MESSAGE, parsed) - except Exception as exc: - self._emit(EventType.ERROR, exc) - finally: - self._emit(EventType.CLOSE, None) - - def send_settings(self, message: AgentV1Settings) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a AgentV1Settings. - """ - self._send_model(message) - - def send_update_listen(self, message: AgentV1UpdateListen) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a AgentV1UpdateListen. - """ - self._send_model(message) - - def send_update_think(self, message: AgentV1UpdateThink) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a AgentV1UpdateThink. - """ - self._send_model(message) - - def send_update_think_live(self, message: AgentV1UpdateThinkLive) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a AgentV1UpdateThinkLive. - """ - self._send_model(message) - - def send_update_speak(self, message: AgentV1UpdateSpeak) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a AgentV1UpdateSpeak. - """ - self._send_model(message) - - def send_inject_user_message(self, message: AgentV1InjectUserMessage) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a AgentV1InjectUserMessage. - """ - self._send_model(message) - - def send_inject_agent_message(self, message: AgentV1InjectAgentMessage) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a AgentV1InjectAgentMessage. - """ - self._send_model(message) - - def send_inject_dynamic_agent_message(self, message: AgentV1InjectDynamicAgentMessage) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a AgentV1InjectDynamicAgentMessage. - """ - self._send_model(message) - - def send_function_call_response(self, message: AgentV1SendFunctionCallResponse) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a AgentV1SendFunctionCallResponse. - """ - self._send_model(message) - - def send_keep_alive(self, message: typing.Optional[AgentV1KeepAlive] = None) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a AgentV1KeepAlive. - """ - self._send_model(message or AgentV1KeepAlive(type="KeepAlive")) - - def send_update_prompt(self, message: AgentV1UpdatePrompt) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a AgentV1UpdatePrompt. - """ - self._send_model(message) - - def send_force_end_turn(self, message: typing.Optional[AgentV1ForceEndTurn] = None) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a AgentV1ForceEndTurn. - """ - self._send_model(message or AgentV1ForceEndTurn(type="ForceEndTurn")) - - def send_custom_to_think_provider(self, message: AgentV1CustomToThinkProvider) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a AgentV1CustomToThinkProvider. - """ - self._send_model(message) - - def send_raw(self, message: typing.Union[typing.Dict[str, typing.Any], str]) -> None: - """Send a JSON control frame without model validation.""" - self._send(message) - - def send_media(self, message: bytes) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a bytes. - """ - self._send(message) - - def recv(self) -> V1SocketClientResponse: - """ - Receive a message from the websocket connection. - """ - data = self._websocket.recv() - if isinstance(data, bytes): - return data # type: ignore - json_data = json.loads(data) - try: - return construct_type(type_=V1SocketClientResponse, object_=json_data) # type: ignore - except Exception: - _logger.warning("Skipping unknown WebSocket message; update your SDK version to support new message types.") - return json_data # type: ignore - - def _send(self, data: typing.Any) -> None: - """ - Send a message to the websocket connection. - """ - if isinstance(data, dict): - data = json.dumps(data) - self._websocket.send(data) - - def _send_model(self, data: typing.Any) -> None: - """ - Send a Pydantic model to the websocket connection. - """ - self._send(_sanitize_numeric_types(data.dict())) diff --git a/src/deepgram/agent/v1/types/__init__.py b/src/deepgram/agent/v1/types/__init__.py index 232c2180..e6a3fdc7 100644 --- a/src/deepgram/agent/v1/types/__init__.py +++ b/src/deepgram/agent/v1/types/__init__.py @@ -163,6 +163,27 @@ "FunctionCallHistoryMessageFunctionCallsItem": ".function_call_history_message_function_calls_item", } +_dynamic_imports.update( + { + "AgentV1HistoryContent": ".agent_v1history_content", + "AgentV1HistoryContentRole": ".agent_v1history_content_role", + "AgentV1HistoryFunctionCalls": ".agent_v1history_function_calls", + "AgentV1HistoryFunctionCallsFunctionCallsItem": ".agent_v1history_function_calls_function_calls_item", + "AgentV1SettingsAgentContextContextMessagesItemContentRole": ".agent_v1settings_agent_context_context_messages_item_content_role", + "AgentV1SettingsAgentContextContextMessagesItemFunctionCallsFunctionCallsItem": ".agent_v1settings_agent_context_context_messages_item_function_calls_function_calls_item", + "AgentV1SettingsAgentContextListenProviderV1": ".agent_v1settings_agent_context_listen_provider_v1", + "AgentV1SettingsAgentContextListenProviderV2": ".agent_v1settings_agent_context_listen_provider_v2", + "AgentV1SettingsAgentContextListenProviderV2LanguageHint": ".agent_v1settings_agent_context_listen_provider_v2language_hint", + "AgentV1SettingsAgentContextMessagesItem": ".agent_v1settings_agent_context_messages_item", + "AgentV1SettingsAgentContextMessagesItemContent": ".agent_v1settings_agent_context_messages_item_content", + "AgentV1SettingsAgentContextMessagesItemContentRole": ".agent_v1settings_agent_context_messages_item_content_role", + "AgentV1SettingsAgentContextMessagesItemFunctionCalls": ".agent_v1settings_agent_context_messages_item_function_calls", + "AgentV1SettingsAgentContextMessagesItemFunctionCallsFunctionCallsItem": ".agent_v1settings_agent_context_messages_item_function_calls_function_calls_item", + "AgentV1SettingsAgentListenProviderV1": ".agent_v1settings_agent_listen_provider_v1", + "AgentV1SettingsAgentListenProviderV2": ".agent_v1settings_agent_listen_provider_v2", + } +) + def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) @@ -261,3 +282,24 @@ def __dir__(): "FunctionCallHistoryMessage", "FunctionCallHistoryMessageFunctionCallsItem", ] + +__all__.extend( + [ + "AgentV1HistoryContent", + "AgentV1HistoryContentRole", + "AgentV1HistoryFunctionCalls", + "AgentV1HistoryFunctionCallsFunctionCallsItem", + "AgentV1SettingsAgentContextContextMessagesItemContentRole", + "AgentV1SettingsAgentContextContextMessagesItemFunctionCallsFunctionCallsItem", + "AgentV1SettingsAgentContextListenProviderV1", + "AgentV1SettingsAgentContextListenProviderV2", + "AgentV1SettingsAgentContextListenProviderV2LanguageHint", + "AgentV1SettingsAgentContextMessagesItem", + "AgentV1SettingsAgentContextMessagesItemContent", + "AgentV1SettingsAgentContextMessagesItemContentRole", + "AgentV1SettingsAgentContextMessagesItemFunctionCalls", + "AgentV1SettingsAgentContextMessagesItemFunctionCallsFunctionCallsItem", + "AgentV1SettingsAgentListenProviderV1", + "AgentV1SettingsAgentListenProviderV2", + ] +) diff --git a/src/deepgram/agent/v1/types/__init__.py.bak b/src/deepgram/agent/v1/types/__init__.py.bak deleted file mode 100644 index e6a3fdc7..00000000 --- a/src/deepgram/agent/v1/types/__init__.py.bak +++ /dev/null @@ -1,305 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# isort: skip_file - -import typing -from importlib import import_module - -if typing.TYPE_CHECKING: - from .agent_v1agent_audio_done import AgentV1AgentAudioDone - from .agent_v1agent_started_speaking import AgentV1AgentStartedSpeaking - from .agent_v1agent_thinking import AgentV1AgentThinking - from .agent_v1conversation_text import AgentV1ConversationText - from .agent_v1conversation_text_conversational_behavior import AgentV1ConversationTextConversationalBehavior - from .agent_v1conversation_text_role import AgentV1ConversationTextRole - from .agent_v1custom_from_think_provider import AgentV1CustomFromThinkProvider - from .agent_v1custom_to_think_provider import AgentV1CustomToThinkProvider - from .agent_v1error import AgentV1Error - from .agent_v1force_end_turn import AgentV1ForceEndTurn - from .agent_v1frustration_detected import AgentV1FrustrationDetected - from .agent_v1function_call_cancelled import AgentV1FunctionCallCancelled - from .agent_v1function_call_cancelled_functions_item import AgentV1FunctionCallCancelledFunctionsItem - from .agent_v1function_call_request import AgentV1FunctionCallRequest - from .agent_v1function_call_request_functions_item import AgentV1FunctionCallRequestFunctionsItem - from .agent_v1history import AgentV1History - from .agent_v1inject_agent_message import AgentV1InjectAgentMessage - from .agent_v1inject_agent_message_behavior import AgentV1InjectAgentMessageBehavior - from .agent_v1inject_dynamic_agent_message import AgentV1InjectDynamicAgentMessage - from .agent_v1inject_dynamic_agent_message_behavior import AgentV1InjectDynamicAgentMessageBehavior - from .agent_v1inject_user_message import AgentV1InjectUserMessage - from .agent_v1injection_refused import AgentV1InjectionRefused - from .agent_v1keep_alive import AgentV1KeepAlive - from .agent_v1latency_report import AgentV1LatencyReport - from .agent_v1listen_updated import AgentV1ListenUpdated - from .agent_v1prompt_updated import AgentV1PromptUpdated - from .agent_v1receive_function_call_response import AgentV1ReceiveFunctionCallResponse - from .agent_v1send_function_call_response import AgentV1SendFunctionCallResponse - from .agent_v1settings import AgentV1Settings - from .agent_v1settings_agent import AgentV1SettingsAgent - from .agent_v1settings_agent_context import AgentV1SettingsAgentContext - from .agent_v1settings_agent_context_context import AgentV1SettingsAgentContextContext - from .agent_v1settings_agent_context_context_messages_item import AgentV1SettingsAgentContextContextMessagesItem - from .agent_v1settings_agent_context_listen import AgentV1SettingsAgentContextListen - from .agent_v1settings_agent_context_listen_provider import ( - AgentV1SettingsAgentContextListenProvider, - AgentV1SettingsAgentContextListenProvider_V1, - AgentV1SettingsAgentContextListenProvider_V2, - ) - from .agent_v1settings_agent_context_speak import AgentV1SettingsAgentContextSpeak - from .agent_v1settings_agent_context_think import AgentV1SettingsAgentContextThink - from .agent_v1settings_agent_listen import AgentV1SettingsAgentListen - from .agent_v1settings_agent_listen_provider import ( - AgentV1SettingsAgentListenProvider, - AgentV1SettingsAgentListenProvider_V1, - AgentV1SettingsAgentListenProvider_V2, - ) - from .agent_v1settings_agent_speak import AgentV1SettingsAgentSpeak - from .agent_v1settings_agent_think import AgentV1SettingsAgentThink - from .agent_v1settings_applied import AgentV1SettingsApplied - from .agent_v1settings_audio import AgentV1SettingsAudio - from .agent_v1settings_audio_input import AgentV1SettingsAudioInput - from .agent_v1settings_audio_input_encoding import AgentV1SettingsAudioInputEncoding - from .agent_v1settings_audio_output import AgentV1SettingsAudioOutput - from .agent_v1settings_audio_output_container import AgentV1SettingsAudioOutputContainer - from .agent_v1settings_audio_output_encoding import AgentV1SettingsAudioOutputEncoding - from .agent_v1settings_flags import AgentV1SettingsFlags - from .agent_v1speak_updated import AgentV1SpeakUpdated - from .agent_v1think_live_updated import AgentV1ThinkLiveUpdated - from .agent_v1think_updated import AgentV1ThinkUpdated - from .agent_v1update_listen import AgentV1UpdateListen - from .agent_v1update_listen_listen import AgentV1UpdateListenListen - from .agent_v1update_listen_listen_provider import ( - AgentV1UpdateListenListenProvider, - AgentV1UpdateListenListenProvider_V1, - AgentV1UpdateListenListenProvider_V2, - ) - from .agent_v1update_prompt import AgentV1UpdatePrompt - from .agent_v1update_speak import AgentV1UpdateSpeak - from .agent_v1update_speak_speak import AgentV1UpdateSpeakSpeak - from .agent_v1update_think import AgentV1UpdateThink - from .agent_v1update_think_live import AgentV1UpdateThinkLive - from .agent_v1update_think_think import AgentV1UpdateThinkThink - from .agent_v1user_started_speaking import AgentV1UserStartedSpeaking - from .agent_v1warning import AgentV1Warning - from .agent_v1welcome import AgentV1Welcome - from .conversation_history_message import ConversationHistoryMessage - from .conversation_history_message_role import ConversationHistoryMessageRole - from .function_call_history_message import FunctionCallHistoryMessage - from .function_call_history_message_function_calls_item import FunctionCallHistoryMessageFunctionCallsItem -_dynamic_imports: typing.Dict[str, str] = { - "AgentV1AgentAudioDone": ".agent_v1agent_audio_done", - "AgentV1AgentStartedSpeaking": ".agent_v1agent_started_speaking", - "AgentV1AgentThinking": ".agent_v1agent_thinking", - "AgentV1ConversationText": ".agent_v1conversation_text", - "AgentV1ConversationTextConversationalBehavior": ".agent_v1conversation_text_conversational_behavior", - "AgentV1ConversationTextRole": ".agent_v1conversation_text_role", - "AgentV1CustomFromThinkProvider": ".agent_v1custom_from_think_provider", - "AgentV1CustomToThinkProvider": ".agent_v1custom_to_think_provider", - "AgentV1Error": ".agent_v1error", - "AgentV1ForceEndTurn": ".agent_v1force_end_turn", - "AgentV1FrustrationDetected": ".agent_v1frustration_detected", - "AgentV1FunctionCallCancelled": ".agent_v1function_call_cancelled", - "AgentV1FunctionCallCancelledFunctionsItem": ".agent_v1function_call_cancelled_functions_item", - "AgentV1FunctionCallRequest": ".agent_v1function_call_request", - "AgentV1FunctionCallRequestFunctionsItem": ".agent_v1function_call_request_functions_item", - "AgentV1History": ".agent_v1history", - "AgentV1InjectAgentMessage": ".agent_v1inject_agent_message", - "AgentV1InjectAgentMessageBehavior": ".agent_v1inject_agent_message_behavior", - "AgentV1InjectDynamicAgentMessage": ".agent_v1inject_dynamic_agent_message", - "AgentV1InjectDynamicAgentMessageBehavior": ".agent_v1inject_dynamic_agent_message_behavior", - "AgentV1InjectUserMessage": ".agent_v1inject_user_message", - "AgentV1InjectionRefused": ".agent_v1injection_refused", - "AgentV1KeepAlive": ".agent_v1keep_alive", - "AgentV1LatencyReport": ".agent_v1latency_report", - "AgentV1ListenUpdated": ".agent_v1listen_updated", - "AgentV1PromptUpdated": ".agent_v1prompt_updated", - "AgentV1ReceiveFunctionCallResponse": ".agent_v1receive_function_call_response", - "AgentV1SendFunctionCallResponse": ".agent_v1send_function_call_response", - "AgentV1Settings": ".agent_v1settings", - "AgentV1SettingsAgent": ".agent_v1settings_agent", - "AgentV1SettingsAgentContext": ".agent_v1settings_agent_context", - "AgentV1SettingsAgentContextContext": ".agent_v1settings_agent_context_context", - "AgentV1SettingsAgentContextContextMessagesItem": ".agent_v1settings_agent_context_context_messages_item", - "AgentV1SettingsAgentContextListen": ".agent_v1settings_agent_context_listen", - "AgentV1SettingsAgentContextListenProvider": ".agent_v1settings_agent_context_listen_provider", - "AgentV1SettingsAgentContextListenProvider_V1": ".agent_v1settings_agent_context_listen_provider", - "AgentV1SettingsAgentContextListenProvider_V2": ".agent_v1settings_agent_context_listen_provider", - "AgentV1SettingsAgentContextSpeak": ".agent_v1settings_agent_context_speak", - "AgentV1SettingsAgentContextThink": ".agent_v1settings_agent_context_think", - "AgentV1SettingsAgentListen": ".agent_v1settings_agent_listen", - "AgentV1SettingsAgentListenProvider": ".agent_v1settings_agent_listen_provider", - "AgentV1SettingsAgentListenProvider_V1": ".agent_v1settings_agent_listen_provider", - "AgentV1SettingsAgentListenProvider_V2": ".agent_v1settings_agent_listen_provider", - "AgentV1SettingsAgentSpeak": ".agent_v1settings_agent_speak", - "AgentV1SettingsAgentThink": ".agent_v1settings_agent_think", - "AgentV1SettingsApplied": ".agent_v1settings_applied", - "AgentV1SettingsAudio": ".agent_v1settings_audio", - "AgentV1SettingsAudioInput": ".agent_v1settings_audio_input", - "AgentV1SettingsAudioInputEncoding": ".agent_v1settings_audio_input_encoding", - "AgentV1SettingsAudioOutput": ".agent_v1settings_audio_output", - "AgentV1SettingsAudioOutputContainer": ".agent_v1settings_audio_output_container", - "AgentV1SettingsAudioOutputEncoding": ".agent_v1settings_audio_output_encoding", - "AgentV1SettingsFlags": ".agent_v1settings_flags", - "AgentV1SpeakUpdated": ".agent_v1speak_updated", - "AgentV1ThinkLiveUpdated": ".agent_v1think_live_updated", - "AgentV1ThinkUpdated": ".agent_v1think_updated", - "AgentV1UpdateListen": ".agent_v1update_listen", - "AgentV1UpdateListenListen": ".agent_v1update_listen_listen", - "AgentV1UpdateListenListenProvider": ".agent_v1update_listen_listen_provider", - "AgentV1UpdateListenListenProvider_V1": ".agent_v1update_listen_listen_provider", - "AgentV1UpdateListenListenProvider_V2": ".agent_v1update_listen_listen_provider", - "AgentV1UpdatePrompt": ".agent_v1update_prompt", - "AgentV1UpdateSpeak": ".agent_v1update_speak", - "AgentV1UpdateSpeakSpeak": ".agent_v1update_speak_speak", - "AgentV1UpdateThink": ".agent_v1update_think", - "AgentV1UpdateThinkLive": ".agent_v1update_think_live", - "AgentV1UpdateThinkThink": ".agent_v1update_think_think", - "AgentV1UserStartedSpeaking": ".agent_v1user_started_speaking", - "AgentV1Warning": ".agent_v1warning", - "AgentV1Welcome": ".agent_v1welcome", - "ConversationHistoryMessage": ".conversation_history_message", - "ConversationHistoryMessageRole": ".conversation_history_message_role", - "FunctionCallHistoryMessage": ".function_call_history_message", - "FunctionCallHistoryMessageFunctionCallsItem": ".function_call_history_message_function_calls_item", -} - -_dynamic_imports.update( - { - "AgentV1HistoryContent": ".agent_v1history_content", - "AgentV1HistoryContentRole": ".agent_v1history_content_role", - "AgentV1HistoryFunctionCalls": ".agent_v1history_function_calls", - "AgentV1HistoryFunctionCallsFunctionCallsItem": ".agent_v1history_function_calls_function_calls_item", - "AgentV1SettingsAgentContextContextMessagesItemContentRole": ".agent_v1settings_agent_context_context_messages_item_content_role", - "AgentV1SettingsAgentContextContextMessagesItemFunctionCallsFunctionCallsItem": ".agent_v1settings_agent_context_context_messages_item_function_calls_function_calls_item", - "AgentV1SettingsAgentContextListenProviderV1": ".agent_v1settings_agent_context_listen_provider_v1", - "AgentV1SettingsAgentContextListenProviderV2": ".agent_v1settings_agent_context_listen_provider_v2", - "AgentV1SettingsAgentContextListenProviderV2LanguageHint": ".agent_v1settings_agent_context_listen_provider_v2language_hint", - "AgentV1SettingsAgentContextMessagesItem": ".agent_v1settings_agent_context_messages_item", - "AgentV1SettingsAgentContextMessagesItemContent": ".agent_v1settings_agent_context_messages_item_content", - "AgentV1SettingsAgentContextMessagesItemContentRole": ".agent_v1settings_agent_context_messages_item_content_role", - "AgentV1SettingsAgentContextMessagesItemFunctionCalls": ".agent_v1settings_agent_context_messages_item_function_calls", - "AgentV1SettingsAgentContextMessagesItemFunctionCallsFunctionCallsItem": ".agent_v1settings_agent_context_messages_item_function_calls_function_calls_item", - "AgentV1SettingsAgentListenProviderV1": ".agent_v1settings_agent_listen_provider_v1", - "AgentV1SettingsAgentListenProviderV2": ".agent_v1settings_agent_listen_provider_v2", - } -) - - -def __getattr__(attr_name: str) -> typing.Any: - module_name = _dynamic_imports.get(attr_name) - if module_name is None: - raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") - try: - module = import_module(module_name, __package__) - if module_name == f".{attr_name}": - return module - else: - return getattr(module, attr_name) - except ImportError as e: - raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e - except AttributeError as e: - raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e - - -def __dir__(): - lazy_attrs = list(_dynamic_imports.keys()) - return sorted(lazy_attrs) - - -__all__ = [ - "AgentV1AgentAudioDone", - "AgentV1AgentStartedSpeaking", - "AgentV1AgentThinking", - "AgentV1ConversationText", - "AgentV1ConversationTextConversationalBehavior", - "AgentV1ConversationTextRole", - "AgentV1CustomFromThinkProvider", - "AgentV1CustomToThinkProvider", - "AgentV1Error", - "AgentV1ForceEndTurn", - "AgentV1FrustrationDetected", - "AgentV1FunctionCallCancelled", - "AgentV1FunctionCallCancelledFunctionsItem", - "AgentV1FunctionCallRequest", - "AgentV1FunctionCallRequestFunctionsItem", - "AgentV1History", - "AgentV1InjectAgentMessage", - "AgentV1InjectAgentMessageBehavior", - "AgentV1InjectDynamicAgentMessage", - "AgentV1InjectDynamicAgentMessageBehavior", - "AgentV1InjectUserMessage", - "AgentV1InjectionRefused", - "AgentV1KeepAlive", - "AgentV1LatencyReport", - "AgentV1ListenUpdated", - "AgentV1PromptUpdated", - "AgentV1ReceiveFunctionCallResponse", - "AgentV1SendFunctionCallResponse", - "AgentV1Settings", - "AgentV1SettingsAgent", - "AgentV1SettingsAgentContext", - "AgentV1SettingsAgentContextContext", - "AgentV1SettingsAgentContextContextMessagesItem", - "AgentV1SettingsAgentContextListen", - "AgentV1SettingsAgentContextListenProvider", - "AgentV1SettingsAgentContextListenProvider_V1", - "AgentV1SettingsAgentContextListenProvider_V2", - "AgentV1SettingsAgentContextSpeak", - "AgentV1SettingsAgentContextThink", - "AgentV1SettingsAgentListen", - "AgentV1SettingsAgentListenProvider", - "AgentV1SettingsAgentListenProvider_V1", - "AgentV1SettingsAgentListenProvider_V2", - "AgentV1SettingsAgentSpeak", - "AgentV1SettingsAgentThink", - "AgentV1SettingsApplied", - "AgentV1SettingsAudio", - "AgentV1SettingsAudioInput", - "AgentV1SettingsAudioInputEncoding", - "AgentV1SettingsAudioOutput", - "AgentV1SettingsAudioOutputContainer", - "AgentV1SettingsAudioOutputEncoding", - "AgentV1SettingsFlags", - "AgentV1SpeakUpdated", - "AgentV1ThinkLiveUpdated", - "AgentV1ThinkUpdated", - "AgentV1UpdateListen", - "AgentV1UpdateListenListen", - "AgentV1UpdateListenListenProvider", - "AgentV1UpdateListenListenProvider_V1", - "AgentV1UpdateListenListenProvider_V2", - "AgentV1UpdatePrompt", - "AgentV1UpdateSpeak", - "AgentV1UpdateSpeakSpeak", - "AgentV1UpdateThink", - "AgentV1UpdateThinkLive", - "AgentV1UpdateThinkThink", - "AgentV1UserStartedSpeaking", - "AgentV1Warning", - "AgentV1Welcome", - "ConversationHistoryMessage", - "ConversationHistoryMessageRole", - "FunctionCallHistoryMessage", - "FunctionCallHistoryMessageFunctionCallsItem", -] - -__all__.extend( - [ - "AgentV1HistoryContent", - "AgentV1HistoryContentRole", - "AgentV1HistoryFunctionCalls", - "AgentV1HistoryFunctionCallsFunctionCallsItem", - "AgentV1SettingsAgentContextContextMessagesItemContentRole", - "AgentV1SettingsAgentContextContextMessagesItemFunctionCallsFunctionCallsItem", - "AgentV1SettingsAgentContextListenProviderV1", - "AgentV1SettingsAgentContextListenProviderV2", - "AgentV1SettingsAgentContextListenProviderV2LanguageHint", - "AgentV1SettingsAgentContextMessagesItem", - "AgentV1SettingsAgentContextMessagesItemContent", - "AgentV1SettingsAgentContextMessagesItemContentRole", - "AgentV1SettingsAgentContextMessagesItemFunctionCalls", - "AgentV1SettingsAgentContextMessagesItemFunctionCallsFunctionCallsItem", - "AgentV1SettingsAgentListenProviderV1", - "AgentV1SettingsAgentListenProviderV2", - ] -) diff --git a/src/deepgram/agent/v1/types/agent_v1conversation_text.py b/src/deepgram/agent/v1/types/agent_v1conversation_text.py index 1e85d656..eb33f9f0 100644 --- a/src/deepgram/agent/v1/types/agent_v1conversation_text.py +++ b/src/deepgram/agent/v1/types/agent_v1conversation_text.py @@ -25,9 +25,9 @@ class AgentV1ConversationText(UncheckedBaseModel): The actual statement that was spoken """ - conversational_behavior: AgentV1ConversationTextConversationalBehavior = pydantic.Field() + conversational_behavior: AgentV1ConversationTextConversationalBehavior = pydantic.Field(default="default") """ - Annotates what kind of utterance the message represents: `default` (a standard turn), `backchannel` (a short acknowledgement while the user held the floor), `presence_check` (a prompt after extended silence), or `filler` (a line covering a wait on a function call or a dynamic InjectAgentMessage). Always sent; it is `default` for every message while Think Live is off + Annotates what kind of utterance the message represents: `default` (a standard turn), `backchannel` (a short acknowledgement while the user held the floor), `presence_check` (a prompt after extended silence), or `filler` (a line covering a wait on a function call or a dynamic InjectAgentMessage). Always sent; it is `default` for every message while Think Live is off. Defaults to `default` when an older or self-hosted server omits it. """ languages_hinted: typing.Optional[typing.List[str]] = pydantic.Field(default=None) diff --git a/src/deepgram/agent/v1/types/agent_v1conversation_text.py.bak b/src/deepgram/agent/v1/types/agent_v1conversation_text.py.bak deleted file mode 100644 index eb33f9f0..00000000 --- a/src/deepgram/agent/v1/types/agent_v1conversation_text.py.bak +++ /dev/null @@ -1,50 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ....core.pydantic_utilities import IS_PYDANTIC_V2 -from ....core.unchecked_base_model import UncheckedBaseModel -from .agent_v1conversation_text_conversational_behavior import AgentV1ConversationTextConversationalBehavior -from .agent_v1conversation_text_role import AgentV1ConversationTextRole - - -class AgentV1ConversationText(UncheckedBaseModel): - type: typing.Literal["ConversationText"] = pydantic.Field(default="ConversationText") - """ - Message type identifier for conversation text - """ - - role: AgentV1ConversationTextRole = pydantic.Field() - """ - Identifies who spoke the statement - """ - - content: str = pydantic.Field() - """ - The actual statement that was spoken - """ - - conversational_behavior: AgentV1ConversationTextConversationalBehavior = pydantic.Field(default="default") - """ - Annotates what kind of utterance the message represents: `default` (a standard turn), `backchannel` (a short acknowledgement while the user held the floor), `presence_check` (a prompt after extended silence), or `filler` (a line covering a wait on a function call or a dynamic InjectAgentMessage). Always sent; it is `default` for every message while Think Live is off. Defaults to `default` when an older or self-hosted server omits it. - """ - - languages_hinted: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - The language hints that were active at the time of the turn. Only present on user-role messages when the listen model is flux-general-multi. - """ - - languages: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - Languages detected in the user's speech, sorted by word count (descending). Only present on user-role messages when the listen model is flux-general-multi. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/deepgram/agent/v1/types/agent_v1inject_dynamic_agent_message.py b/src/deepgram/agent/v1/types/agent_v1inject_dynamic_agent_message.py index aefd967d..471d6f61 100644 --- a/src/deepgram/agent/v1/types/agent_v1inject_dynamic_agent_message.py +++ b/src/deepgram/agent/v1/types/agent_v1inject_dynamic_agent_message.py @@ -22,7 +22,7 @@ class AgentV1InjectDynamicAgentMessage(UncheckedBaseModel): behavior: typing.Optional[AgentV1InjectDynamicAgentMessageBehavior] = pydantic.Field(default=None) """ Controls how the injection interacts with any in-progress user or agent turn. - + * `default` — The agent speaks only if neither the user nor the agent is mid-turn. If a turn is in progress, the server replies with `InjectionRefused`. * `queue` — The message is appended after any already-queued `ConversationText` without interrupting the current agent turn or think response. If nothing is queued, the message plays immediately. * `interrupt` — The agent immediately speaks. If the agent was already speaking, it interrupts the current speech and replaces it with the new message. If the user is speaking, the agent interrupts with the new message, but the user's continued speech triggers `UserStartedSpeaking`, which quickly interrupts the agent. diff --git a/src/deepgram/agent/v1/types/agent_v1inject_dynamic_agent_message.py.bak b/src/deepgram/agent/v1/types/agent_v1inject_dynamic_agent_message.py.bak deleted file mode 100644 index 471d6f61..00000000 --- a/src/deepgram/agent/v1/types/agent_v1inject_dynamic_agent_message.py.bak +++ /dev/null @@ -1,38 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ....core.pydantic_utilities import IS_PYDANTIC_V2 -from ....core.unchecked_base_model import UncheckedBaseModel -from .agent_v1inject_dynamic_agent_message_behavior import AgentV1InjectDynamicAgentMessageBehavior - - -class AgentV1InjectDynamicAgentMessage(UncheckedBaseModel): - type: typing.Literal["InjectAgentMessage"] = pydantic.Field(default="InjectAgentMessage") - """ - Message type identifier for injecting an agent message - """ - - is_dynamic: typing.Literal[True] = pydantic.Field(default=True) - """ - Must be `true`. The Think Live model generates the line, so no `message` is sent - """ - - behavior: typing.Optional[AgentV1InjectDynamicAgentMessageBehavior] = pydantic.Field(default=None) - """ - Controls how the injection interacts with any in-progress user or agent turn. - - * `default` — The agent speaks only if neither the user nor the agent is mid-turn. If a turn is in progress, the server replies with `InjectionRefused`. - * `queue` — The message is appended after any already-queued `ConversationText` without interrupting the current agent turn or think response. If nothing is queued, the message plays immediately. - * `interrupt` — The agent immediately speaks. If the agent was already speaking, it interrupts the current speech and replaces it with the new message. If the user is speaking, the agent interrupts with the new message, but the user's continued speech triggers `UserStartedSpeaking`, which quickly interrupts the agent. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/deepgram/agent/v1/types/agent_v1settings.py b/src/deepgram/agent/v1/types/agent_v1settings.py index 11601dfc..ff58da13 100644 --- a/src/deepgram/agent/v1/types/agent_v1settings.py +++ b/src/deepgram/agent/v1/types/agent_v1settings.py @@ -6,6 +6,7 @@ from ....core.pydantic_utilities import IS_PYDANTIC_V2 from ....core.unchecked_base_model import UncheckedBaseModel from .agent_v1settings_agent import AgentV1SettingsAgent +from .agent_v1settings_agent_context import AgentV1SettingsAgentContext from .agent_v1settings_audio import AgentV1SettingsAudio from .agent_v1settings_flags import AgentV1SettingsFlags @@ -29,7 +30,7 @@ class AgentV1Settings(UncheckedBaseModel): """ audio: AgentV1SettingsAudio - agent: AgentV1SettingsAgent + agent: typing.Union[AgentV1SettingsAgent, AgentV1SettingsAgentContext, str] if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/deepgram/agent/v1/types/agent_v1settings.py.bak b/src/deepgram/agent/v1/types/agent_v1settings.py.bak deleted file mode 100644 index ff58da13..00000000 --- a/src/deepgram/agent/v1/types/agent_v1settings.py.bak +++ /dev/null @@ -1,42 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ....core.pydantic_utilities import IS_PYDANTIC_V2 -from ....core.unchecked_base_model import UncheckedBaseModel -from .agent_v1settings_agent import AgentV1SettingsAgent -from .agent_v1settings_agent_context import AgentV1SettingsAgentContext -from .agent_v1settings_audio import AgentV1SettingsAudio -from .agent_v1settings_flags import AgentV1SettingsFlags - - -class AgentV1Settings(UncheckedBaseModel): - type: typing.Literal["Settings"] = "Settings" - tags: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - Tags to associate with the request - """ - - experimental: typing.Optional[bool] = pydantic.Field(default=None) - """ - To enable experimental features - """ - - flags: typing.Optional[AgentV1SettingsFlags] = None - mip_opt_out: typing.Optional[bool] = pydantic.Field(default=None) - """ - To opt out of Deepgram Model Improvement Program - """ - - audio: AgentV1SettingsAudio - agent: typing.Union[AgentV1SettingsAgent, AgentV1SettingsAgentContext, str] - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/deepgram/agent/v1/types/agent_v1settings_agent.py b/src/deepgram/agent/v1/types/agent_v1settings_agent.py index c1483c35..1a4d67fd 100644 --- a/src/deepgram/agent/v1/types/agent_v1settings_agent.py +++ b/src/deepgram/agent/v1/types/agent_v1settings_agent.py @@ -2,6 +2,57 @@ import typing +import pydantic +from ....core.pydantic_utilities import IS_PYDANTIC_V2 from .agent_v1settings_agent_context import AgentV1SettingsAgentContext +from .agent_v1settings_agent_listen import AgentV1SettingsAgentListen -AgentV1SettingsAgent = typing.Union[AgentV1SettingsAgentContext, str] + +class AgentV1SettingsAgent(AgentV1SettingsAgentContext): + if IS_PYDANTIC_V2: + + @pydantic.model_validator(mode="before") + @classmethod + def _migrate_legacy_nested_context(cls, values: typing.Any) -> typing.Any: + if not isinstance(values, dict): + return values + context = values.get("context") + if isinstance(context, AgentV1SettingsAgentContext) and ( + context.context is not None + and context.language is None + and context.listen is None + and context.think is None + and context.think_live is None + and context.speak is None + and context.greeting is None + ): + values = dict(values) + values["context"] = context.context + listen = values.get("listen") + if isinstance(listen, AgentV1SettingsAgentListen): + values = dict(values) + values["listen"] = listen.dict() + return values + else: + + @pydantic.root_validator(pre=True) # type: ignore[deprecated] + def _migrate_legacy_nested_context(cls, values: typing.Any) -> typing.Any: # type: ignore[no-redef] + if not isinstance(values, dict): + return values + context = values.get("context") + if isinstance(context, AgentV1SettingsAgentContext) and ( + context.context is not None + and context.language is None + and context.listen is None + and context.think is None + and context.think_live is None + and context.speak is None + and context.greeting is None + ): + values = dict(values) + values["context"] = context.context + listen = values.get("listen") + if isinstance(listen, AgentV1SettingsAgentListen): + values = dict(values) + values["listen"] = listen.dict() + return values diff --git a/src/deepgram/agent/v1/types/agent_v1settings_agent.py.bak b/src/deepgram/agent/v1/types/agent_v1settings_agent.py.bak deleted file mode 100644 index 1a4d67fd..00000000 --- a/src/deepgram/agent/v1/types/agent_v1settings_agent.py.bak +++ /dev/null @@ -1,58 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ....core.pydantic_utilities import IS_PYDANTIC_V2 -from .agent_v1settings_agent_context import AgentV1SettingsAgentContext -from .agent_v1settings_agent_listen import AgentV1SettingsAgentListen - - -class AgentV1SettingsAgent(AgentV1SettingsAgentContext): - if IS_PYDANTIC_V2: - - @pydantic.model_validator(mode="before") - @classmethod - def _migrate_legacy_nested_context(cls, values: typing.Any) -> typing.Any: - if not isinstance(values, dict): - return values - context = values.get("context") - if isinstance(context, AgentV1SettingsAgentContext) and ( - context.context is not None - and context.language is None - and context.listen is None - and context.think is None - and context.think_live is None - and context.speak is None - and context.greeting is None - ): - values = dict(values) - values["context"] = context.context - listen = values.get("listen") - if isinstance(listen, AgentV1SettingsAgentListen): - values = dict(values) - values["listen"] = listen.dict() - return values - else: - - @pydantic.root_validator(pre=True) # type: ignore[deprecated] - def _migrate_legacy_nested_context(cls, values: typing.Any) -> typing.Any: # type: ignore[no-redef] - if not isinstance(values, dict): - return values - context = values.get("context") - if isinstance(context, AgentV1SettingsAgentContext) and ( - context.context is not None - and context.language is None - and context.listen is None - and context.think is None - and context.think_live is None - and context.speak is None - and context.greeting is None - ): - values = dict(values) - values["context"] = context.context - listen = values.get("listen") - if isinstance(listen, AgentV1SettingsAgentListen): - values = dict(values) - values["listen"] = listen.dict() - return values diff --git a/src/deepgram/agent/v1/types/agent_v1settings_agent_context.py b/src/deepgram/agent/v1/types/agent_v1settings_agent_context.py index d32ebcaa..181472b4 100644 --- a/src/deepgram/agent/v1/types/agent_v1settings_agent_context.py +++ b/src/deepgram/agent/v1/types/agent_v1settings_agent_context.py @@ -8,6 +8,7 @@ from ....types.think_live_settings_v1 import ThinkLiveSettingsV1 from .agent_v1settings_agent_context_context import AgentV1SettingsAgentContextContext from .agent_v1settings_agent_context_listen import AgentV1SettingsAgentContextListen +from .agent_v1settings_agent_context_messages_item import AgentV1SettingsAgentContextMessagesItem from .agent_v1settings_agent_context_speak import AgentV1SettingsAgentContextSpeak from .agent_v1settings_agent_context_think import AgentV1SettingsAgentContextThink @@ -37,10 +38,30 @@ class AgentV1SettingsAgentContext(UncheckedBaseModel): """ if IS_PYDANTIC_V2: + + @pydantic.model_validator(mode="before") + @classmethod + def _migrate_legacy_messages_to_context(cls, values: typing.Any) -> typing.Any: + if isinstance(values, dict) and "messages" in values and "context" not in values: + values = dict(values) + values["context"] = {"messages": values.pop("messages")} + return values + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: + @pydantic.root_validator(pre=True) # type: ignore[deprecated] + def _migrate_legacy_messages_to_context(cls, values: typing.Any) -> typing.Any: # type: ignore[no-redef] + if isinstance(values, dict) and "messages" in values and "context" not in values: + values = dict(values) + values["context"] = {"messages": values.pop("messages")} + return values + class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + @property + def messages(self) -> typing.Optional[typing.List[AgentV1SettingsAgentContextMessagesItem]]: + return None if self.context is None else self.context.messages diff --git a/src/deepgram/agent/v1/types/agent_v1settings_agent_context.py.bak b/src/deepgram/agent/v1/types/agent_v1settings_agent_context.py.bak deleted file mode 100644 index 181472b4..00000000 --- a/src/deepgram/agent/v1/types/agent_v1settings_agent_context.py.bak +++ /dev/null @@ -1,67 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ....core.pydantic_utilities import IS_PYDANTIC_V2 -from ....core.unchecked_base_model import UncheckedBaseModel -from ....types.think_live_settings_v1 import ThinkLiveSettingsV1 -from .agent_v1settings_agent_context_context import AgentV1SettingsAgentContextContext -from .agent_v1settings_agent_context_listen import AgentV1SettingsAgentContextListen -from .agent_v1settings_agent_context_messages_item import AgentV1SettingsAgentContextMessagesItem -from .agent_v1settings_agent_context_speak import AgentV1SettingsAgentContextSpeak -from .agent_v1settings_agent_context_think import AgentV1SettingsAgentContextThink - - -class AgentV1SettingsAgentContext(UncheckedBaseModel): - language: typing.Optional[str] = pydantic.Field(default=None) - """ - Deprecated. Use `listen.provider.language` and `speak.provider.language` fields instead. - """ - - context: typing.Optional[AgentV1SettingsAgentContextContext] = pydantic.Field(default=None) - """ - Conversation context including the history of messages and function calls - """ - - listen: typing.Optional[AgentV1SettingsAgentContextListen] = None - think: typing.Optional[AgentV1SettingsAgentContextThink] = pydantic.Field(default=None) - """ - Your reasoning LLM. With Think Live on, this is the reasoning half of the pair, running alongside the Think Live model configured in `think_live` - """ - - think_live: typing.Optional[ThinkLiveSettingsV1] = None - speak: typing.Optional[AgentV1SettingsAgentContextSpeak] = None - greeting: typing.Optional[str] = pydantic.Field(default=None) - """ - Optional message that agent will speak at the start - """ - - if IS_PYDANTIC_V2: - - @pydantic.model_validator(mode="before") - @classmethod - def _migrate_legacy_messages_to_context(cls, values: typing.Any) -> typing.Any: - if isinstance(values, dict) and "messages" in values and "context" not in values: - values = dict(values) - values["context"] = {"messages": values.pop("messages")} - return values - - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - @pydantic.root_validator(pre=True) # type: ignore[deprecated] - def _migrate_legacy_messages_to_context(cls, values: typing.Any) -> typing.Any: # type: ignore[no-redef] - if isinstance(values, dict) and "messages" in values and "context" not in values: - values = dict(values) - values["context"] = {"messages": values.pop("messages")} - return values - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow - - @property - def messages(self) -> typing.Optional[typing.List[AgentV1SettingsAgentContextMessagesItem]]: - return None if self.context is None else self.context.messages diff --git a/src/deepgram/agent/v1/types/agent_v1settings_agent_context_listen_provider.py b/src/deepgram/agent/v1/types/agent_v1settings_agent_context_listen_provider.py index b806f202..222c18a3 100644 --- a/src/deepgram/agent/v1/types/agent_v1settings_agent_context_listen_provider.py +++ b/src/deepgram/agent/v1/types/agent_v1settings_agent_context_listen_provider.py @@ -33,15 +33,38 @@ class AgentV1SettingsAgentContextListenProvider_V2(UncheckedBaseModel): type: typing.Literal["deepgram"] = "deepgram" model: str language_hints: typing.Optional[typing.List[str]] = None + language_hint: typing.Optional[typing.Union[str, typing.List[str]]] = pydantic.Field(default=None, exclude=True) eot_threshold: typing.Optional[float] = None eager_eot_threshold: typing.Optional[float] = None eot_timeout_ms: typing.Optional[int] = None keyterms: typing.Optional[typing.List[str]] = None if IS_PYDANTIC_V2: + + @pydantic.model_validator(mode="before") + @classmethod + def _migrate_language_hint(cls, values: typing.Any) -> typing.Any: + if not isinstance(values, dict) or "language_hint" not in values: + return values + values = dict(values) + hint = values.pop("language_hint") + if hint is not None and values.get("language_hints") is None: + values["language_hints"] = [hint] if isinstance(hint, str) else list(hint) + return values + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: + @pydantic.root_validator(pre=True) # type: ignore[deprecated] + def _migrate_language_hint(cls, values: typing.Any) -> typing.Any: # type: ignore[no-redef] + if not isinstance(values, dict) or "language_hint" not in values: + return values + values = dict(values) + hint = values.pop("language_hint") + if hint is not None and values.get("language_hints") is None: + values["language_hints"] = [hint] if isinstance(hint, str) else list(hint) + return values + class Config: frozen = True smart_union = True diff --git a/src/deepgram/agent/v1/types/agent_v1settings_agent_context_listen_provider.py.bak b/src/deepgram/agent/v1/types/agent_v1settings_agent_context_listen_provider.py.bak deleted file mode 100644 index 222c18a3..00000000 --- a/src/deepgram/agent/v1/types/agent_v1settings_agent_context_listen_provider.py.bak +++ /dev/null @@ -1,77 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from __future__ import annotations - -import typing - -import pydantic -import typing_extensions -from ....core.pydantic_utilities import IS_PYDANTIC_V2 -from ....core.unchecked_base_model import UncheckedBaseModel, UnionMetadata - - -class AgentV1SettingsAgentContextListenProvider_V1(UncheckedBaseModel): - version: typing.Literal["v1"] = "v1" - type: typing.Literal["deepgram"] = "deepgram" - model: typing.Optional[str] = None - language: typing.Optional[str] = None - keyterms: typing.Optional[typing.List[str]] = None - smart_format: typing.Optional[bool] = None - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow - - -class AgentV1SettingsAgentContextListenProvider_V2(UncheckedBaseModel): - version: typing.Literal["v2"] = "v2" - type: typing.Literal["deepgram"] = "deepgram" - model: str - language_hints: typing.Optional[typing.List[str]] = None - language_hint: typing.Optional[typing.Union[str, typing.List[str]]] = pydantic.Field(default=None, exclude=True) - eot_threshold: typing.Optional[float] = None - eager_eot_threshold: typing.Optional[float] = None - eot_timeout_ms: typing.Optional[int] = None - keyterms: typing.Optional[typing.List[str]] = None - - if IS_PYDANTIC_V2: - - @pydantic.model_validator(mode="before") - @classmethod - def _migrate_language_hint(cls, values: typing.Any) -> typing.Any: - if not isinstance(values, dict) or "language_hint" not in values: - return values - values = dict(values) - hint = values.pop("language_hint") - if hint is not None and values.get("language_hints") is None: - values["language_hints"] = [hint] if isinstance(hint, str) else list(hint) - return values - - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - @pydantic.root_validator(pre=True) # type: ignore[deprecated] - def _migrate_language_hint(cls, values: typing.Any) -> typing.Any: # type: ignore[no-redef] - if not isinstance(values, dict) or "language_hint" not in values: - return values - values = dict(values) - hint = values.pop("language_hint") - if hint is not None and values.get("language_hints") is None: - values["language_hints"] = [hint] if isinstance(hint, str) else list(hint) - return values - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow - - -AgentV1SettingsAgentContextListenProvider = typing_extensions.Annotated[ - typing.Union[AgentV1SettingsAgentContextListenProvider_V1, AgentV1SettingsAgentContextListenProvider_V2], - UnionMetadata(discriminant="version"), -] diff --git a/src/deepgram/agent/v1/types/agent_v1settings_agent_listen_provider.py b/src/deepgram/agent/v1/types/agent_v1settings_agent_listen_provider.py index d053b2b9..d225e261 100644 --- a/src/deepgram/agent/v1/types/agent_v1settings_agent_listen_provider.py +++ b/src/deepgram/agent/v1/types/agent_v1settings_agent_listen_provider.py @@ -33,15 +33,38 @@ class AgentV1SettingsAgentListenProvider_V2(UncheckedBaseModel): type: typing.Literal["deepgram"] = "deepgram" model: str language_hints: typing.Optional[typing.List[str]] = None + language_hint: typing.Optional[typing.Union[str, typing.List[str]]] = pydantic.Field(default=None, exclude=True) eot_threshold: typing.Optional[float] = None eager_eot_threshold: typing.Optional[float] = None eot_timeout_ms: typing.Optional[int] = None keyterms: typing.Optional[typing.List[str]] = None if IS_PYDANTIC_V2: + + @pydantic.model_validator(mode="before") + @classmethod + def _migrate_language_hint(cls, values: typing.Any) -> typing.Any: + if not isinstance(values, dict) or "language_hint" not in values: + return values + values = dict(values) + hint = values.pop("language_hint") + if hint is not None and values.get("language_hints") is None: + values["language_hints"] = [hint] if isinstance(hint, str) else list(hint) + return values + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: + @pydantic.root_validator(pre=True) # type: ignore[deprecated] + def _migrate_language_hint(cls, values: typing.Any) -> typing.Any: # type: ignore[no-redef] + if not isinstance(values, dict) or "language_hint" not in values: + return values + values = dict(values) + hint = values.pop("language_hint") + if hint is not None and values.get("language_hints") is None: + values["language_hints"] = [hint] if isinstance(hint, str) else list(hint) + return values + class Config: frozen = True smart_union = True diff --git a/src/deepgram/agent/v1/types/agent_v1settings_agent_listen_provider.py.bak b/src/deepgram/agent/v1/types/agent_v1settings_agent_listen_provider.py.bak deleted file mode 100644 index d225e261..00000000 --- a/src/deepgram/agent/v1/types/agent_v1settings_agent_listen_provider.py.bak +++ /dev/null @@ -1,77 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from __future__ import annotations - -import typing - -import pydantic -import typing_extensions -from ....core.pydantic_utilities import IS_PYDANTIC_V2 -from ....core.unchecked_base_model import UncheckedBaseModel, UnionMetadata - - -class AgentV1SettingsAgentListenProvider_V1(UncheckedBaseModel): - version: typing.Literal["v1"] = "v1" - type: typing.Literal["deepgram"] = "deepgram" - model: typing.Optional[str] = None - language: typing.Optional[str] = None - keyterms: typing.Optional[typing.List[str]] = None - smart_format: typing.Optional[bool] = None - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow - - -class AgentV1SettingsAgentListenProvider_V2(UncheckedBaseModel): - version: typing.Literal["v2"] = "v2" - type: typing.Literal["deepgram"] = "deepgram" - model: str - language_hints: typing.Optional[typing.List[str]] = None - language_hint: typing.Optional[typing.Union[str, typing.List[str]]] = pydantic.Field(default=None, exclude=True) - eot_threshold: typing.Optional[float] = None - eager_eot_threshold: typing.Optional[float] = None - eot_timeout_ms: typing.Optional[int] = None - keyterms: typing.Optional[typing.List[str]] = None - - if IS_PYDANTIC_V2: - - @pydantic.model_validator(mode="before") - @classmethod - def _migrate_language_hint(cls, values: typing.Any) -> typing.Any: - if not isinstance(values, dict) or "language_hint" not in values: - return values - values = dict(values) - hint = values.pop("language_hint") - if hint is not None and values.get("language_hints") is None: - values["language_hints"] = [hint] if isinstance(hint, str) else list(hint) - return values - - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - @pydantic.root_validator(pre=True) # type: ignore[deprecated] - def _migrate_language_hint(cls, values: typing.Any) -> typing.Any: # type: ignore[no-redef] - if not isinstance(values, dict) or "language_hint" not in values: - return values - values = dict(values) - hint = values.pop("language_hint") - if hint is not None and values.get("language_hints") is None: - values["language_hints"] = [hint] if isinstance(hint, str) else list(hint) - return values - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow - - -AgentV1SettingsAgentListenProvider = typing_extensions.Annotated[ - typing.Union[AgentV1SettingsAgentListenProvider_V1, AgentV1SettingsAgentListenProvider_V2], - UnionMetadata(discriminant="version"), -] diff --git a/src/deepgram/agent/v1/types/agent_v1update_listen_listen.py b/src/deepgram/agent/v1/types/agent_v1update_listen_listen.py index f345904c..d7ed4fab 100644 --- a/src/deepgram/agent/v1/types/agent_v1update_listen_listen.py +++ b/src/deepgram/agent/v1/types/agent_v1update_listen_listen.py @@ -5,8 +5,34 @@ import pydantic from ....core.pydantic_utilities import IS_PYDANTIC_V2 from ....core.unchecked_base_model import UncheckedBaseModel +from ....types.deepgram_listen_provider_v1 import DeepgramListenProviderV1 +from ....types.deepgram_listen_provider_v2 import DeepgramListenProviderV2 from .agent_v1update_listen_listen_provider import AgentV1UpdateListenListenProvider +_V1_ONLY_KEYS = frozenset({"language", "smart_format"}) + + +def _coerce_legacy_update_listen_provider(values: typing.Any) -> typing.Any: + if not isinstance(values, dict): + return values + provider = values.get("provider") + if isinstance(provider, DeepgramListenProviderV2): + values = dict(values) + values["provider"] = {**provider.dict(), "version": "v2"} + elif isinstance(provider, DeepgramListenProviderV1): + values = dict(values) + values["provider"] = {**provider.dict(), "version": "v1"} + elif isinstance(provider, dict) and "version" not in provider: + values = dict(values) + version = "v1" if _V1_ONLY_KEYS & provider.keys() else "v2" + provider_cls = DeepgramListenProviderV1 if version == "v1" else DeepgramListenProviderV2 + try: + coerced = provider_cls(**provider).dict() + except Exception: + coerced = dict(provider) + values["provider"] = {**coerced, "version": version} + return values + class AgentV1UpdateListenListen(UncheckedBaseModel): """ @@ -16,9 +42,19 @@ class AgentV1UpdateListenListen(UncheckedBaseModel): provider: AgentV1UpdateListenListenProvider if IS_PYDANTIC_V2: + + @pydantic.model_validator(mode="before") + @classmethod + def _migrate_legacy_provider(cls, values: typing.Any) -> typing.Any: + return _coerce_legacy_update_listen_provider(values) + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: + @pydantic.root_validator(pre=True) # type: ignore[deprecated] + def _migrate_legacy_provider(cls, values: typing.Any) -> typing.Any: # type: ignore[no-redef] + return _coerce_legacy_update_listen_provider(values) + class Config: frozen = True smart_union = True diff --git a/src/deepgram/agent/v1/types/agent_v1update_listen_listen.py.bak b/src/deepgram/agent/v1/types/agent_v1update_listen_listen.py.bak deleted file mode 100644 index d7ed4fab..00000000 --- a/src/deepgram/agent/v1/types/agent_v1update_listen_listen.py.bak +++ /dev/null @@ -1,61 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ....core.pydantic_utilities import IS_PYDANTIC_V2 -from ....core.unchecked_base_model import UncheckedBaseModel -from ....types.deepgram_listen_provider_v1 import DeepgramListenProviderV1 -from ....types.deepgram_listen_provider_v2 import DeepgramListenProviderV2 -from .agent_v1update_listen_listen_provider import AgentV1UpdateListenListenProvider - -_V1_ONLY_KEYS = frozenset({"language", "smart_format"}) - - -def _coerce_legacy_update_listen_provider(values: typing.Any) -> typing.Any: - if not isinstance(values, dict): - return values - provider = values.get("provider") - if isinstance(provider, DeepgramListenProviderV2): - values = dict(values) - values["provider"] = {**provider.dict(), "version": "v2"} - elif isinstance(provider, DeepgramListenProviderV1): - values = dict(values) - values["provider"] = {**provider.dict(), "version": "v1"} - elif isinstance(provider, dict) and "version" not in provider: - values = dict(values) - version = "v1" if _V1_ONLY_KEYS & provider.keys() else "v2" - provider_cls = DeepgramListenProviderV1 if version == "v1" else DeepgramListenProviderV2 - try: - coerced = provider_cls(**provider).dict() - except Exception: - coerced = dict(provider) - values["provider"] = {**coerced, "version": version} - return values - - -class AgentV1UpdateListenListen(UncheckedBaseModel): - """ - Listen configuration to update. Contains a provider object with the same schema as Settings. The model and language can be changed mid-session. Keyterms can only be updated mid-session for Flux models. - """ - - provider: AgentV1UpdateListenListenProvider - - if IS_PYDANTIC_V2: - - @pydantic.model_validator(mode="before") - @classmethod - def _migrate_legacy_provider(cls, values: typing.Any) -> typing.Any: - return _coerce_legacy_update_listen_provider(values) - - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - @pydantic.root_validator(pre=True) # type: ignore[deprecated] - def _migrate_legacy_provider(cls, values: typing.Any) -> typing.Any: # type: ignore[no-redef] - return _coerce_legacy_update_listen_provider(values) - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/deepgram/core/api_error.py b/src/deepgram/core/api_error.py index 6f850a60..2aa93914 100644 --- a/src/deepgram/core/api_error.py +++ b/src/deepgram/core/api_error.py @@ -2,6 +2,8 @@ from typing import Any, Dict, Optional +from .._secure_logging import redact_sensitive_headers + class ApiError(Exception): headers: Optional[Dict[str, str]] @@ -15,7 +17,7 @@ def __init__( status_code: Optional[int] = None, body: Any = None, ) -> None: - self.headers = headers + self.headers = redact_sensitive_headers(headers) self.status_code = status_code self.body = body diff --git a/src/deepgram/core/api_error.py.bak b/src/deepgram/core/api_error.py.bak deleted file mode 100644 index 2aa93914..00000000 --- a/src/deepgram/core/api_error.py.bak +++ /dev/null @@ -1,25 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from typing import Any, Dict, Optional - -from .._secure_logging import redact_sensitive_headers - - -class ApiError(Exception): - headers: Optional[Dict[str, str]] - status_code: Optional[int] - body: Any - - def __init__( - self, - *, - headers: Optional[Dict[str, str]] = None, - status_code: Optional[int] = None, - body: Any = None, - ) -> None: - self.headers = redact_sensitive_headers(headers) - self.status_code = status_code - self.body = body - - def __str__(self) -> str: - return f"headers: {self.headers}, status_code: {self.status_code}, body: {self.body}" diff --git a/src/deepgram/core/client_wrapper.py b/src/deepgram/core/client_wrapper.py index b55f2802..f8afc3bb 100644 --- a/src/deepgram/core/client_wrapper.py +++ b/src/deepgram/core/client_wrapper.py @@ -37,7 +37,7 @@ def get_headers(self) -> typing.Dict[str, str]: try: _sdk_version = _fern_importlib_metadata.version("deepgram-sdk") except _fern_importlib_metadata.PackageNotFoundError: - _sdk_version = "7.20.1" + _sdk_version = "7.20.0" # x-release-please-version headers: typing.Dict[str, str] = { "User-Agent": "deepgram-sdk/" + _sdk_version, diff --git a/src/deepgram/core/client_wrapper.py.bak b/src/deepgram/core/client_wrapper.py.bak deleted file mode 100644 index f8afc3bb..00000000 --- a/src/deepgram/core/client_wrapper.py.bak +++ /dev/null @@ -1,146 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import httpx -from ..environment import DeepgramClientEnvironment -from .http_client import AsyncHttpClient, HttpClient -from .logging import LogConfig, Logger - - -class BaseClientWrapper: - def __init__( - self, - *, - api_key: str, - headers: typing.Optional[typing.Dict[str, str]] = None, - environment: DeepgramClientEnvironment, - timeout: typing.Optional[float] = None, - max_retries: int = 2, - stream_reconnection_enabled: typing.Optional[bool] = None, - max_stream_reconnection_attempts: typing.Optional[int] = None, - logging: typing.Optional[typing.Union[LogConfig, Logger]] = None, - ): - self.api_key = api_key - self._headers = headers - self._environment = environment - self._timeout = timeout - self._max_retries = max_retries - self._stream_reconnection_enabled = stream_reconnection_enabled - self._max_stream_reconnection_attempts = max_stream_reconnection_attempts - self._logging = logging - - def get_headers(self) -> typing.Dict[str, str]: - import platform - from importlib import metadata as _fern_importlib_metadata - - try: - _sdk_version = _fern_importlib_metadata.version("deepgram-sdk") - except _fern_importlib_metadata.PackageNotFoundError: - _sdk_version = "7.20.0" # x-release-please-version - - headers: typing.Dict[str, str] = { - "User-Agent": "deepgram-sdk/" + _sdk_version, - "X-Fern-Language": "Python", - "X-Fern-Runtime": f"python/{platform.python_version()}", - "X-Fern-Platform": f"{platform.system().lower()}/{platform.release()}", - "X-Fern-SDK-Name": "deepgram-sdk", - "X-Fern-SDK-Version": _sdk_version, - **(self.get_custom_headers() or {}), - } - headers["Authorization"] = f"Token {self.api_key}" - return headers - - def get_custom_headers(self) -> typing.Optional[typing.Dict[str, str]]: - return self._headers - - def get_environment(self) -> DeepgramClientEnvironment: - return self._environment - - def get_timeout(self) -> typing.Optional[float]: - return self._timeout - - def get_max_retries(self) -> int: - return self._max_retries - - def get_stream_reconnection_enabled(self) -> bool: - return self._stream_reconnection_enabled if self._stream_reconnection_enabled is not None else True - - def get_max_stream_reconnection_attempts(self) -> typing.Optional[int]: - return self._max_stream_reconnection_attempts - - -class SyncClientWrapper(BaseClientWrapper): - def __init__( - self, - *, - api_key: str, - headers: typing.Optional[typing.Dict[str, str]] = None, - environment: DeepgramClientEnvironment, - timeout: typing.Optional[float] = None, - max_retries: int = 2, - stream_reconnection_enabled: typing.Optional[bool] = None, - max_stream_reconnection_attempts: typing.Optional[int] = None, - logging: typing.Optional[typing.Union[LogConfig, Logger]] = None, - httpx_client: httpx.Client, - ): - super().__init__( - api_key=api_key, - headers=headers, - environment=environment, - timeout=timeout, - max_retries=max_retries, - stream_reconnection_enabled=stream_reconnection_enabled, - max_stream_reconnection_attempts=max_stream_reconnection_attempts, - logging=logging, - ) - self.httpx_client = HttpClient( - httpx_client=httpx_client, - base_headers=self.get_headers, - base_timeout=self.get_timeout, - base_max_retries=self.get_max_retries(), - logging_config=self._logging, - ) - - -class AsyncClientWrapper(BaseClientWrapper): - def __init__( - self, - *, - api_key: str, - headers: typing.Optional[typing.Dict[str, str]] = None, - environment: DeepgramClientEnvironment, - timeout: typing.Optional[float] = None, - max_retries: int = 2, - stream_reconnection_enabled: typing.Optional[bool] = None, - max_stream_reconnection_attempts: typing.Optional[int] = None, - logging: typing.Optional[typing.Union[LogConfig, Logger]] = None, - async_token: typing.Optional[typing.Callable[[], typing.Awaitable[str]]] = None, - httpx_client: httpx.AsyncClient, - ): - super().__init__( - api_key=api_key, - headers=headers, - environment=environment, - timeout=timeout, - max_retries=max_retries, - stream_reconnection_enabled=stream_reconnection_enabled, - max_stream_reconnection_attempts=max_stream_reconnection_attempts, - logging=logging, - ) - self._async_token = async_token - self.httpx_client = AsyncHttpClient( - httpx_client=httpx_client, - base_headers=self.get_headers, - base_timeout=self.get_timeout, - base_max_retries=self.get_max_retries(), - async_base_headers=self.async_get_headers, - logging_config=self._logging, - ) - - async def async_get_headers(self) -> typing.Dict[str, str]: - headers = self.get_headers() - if self._async_token is not None: - token = await self._async_token() - headers["Authorization"] = f"Bearer {token}" - return headers diff --git a/src/deepgram/core/parse_error.py b/src/deepgram/core/parse_error.py index 4527c6a8..c510c0e8 100644 --- a/src/deepgram/core/parse_error.py +++ b/src/deepgram/core/parse_error.py @@ -2,6 +2,8 @@ from typing import Any, Dict, Optional +from .._secure_logging import redact_sensitive_headers + class ParsingError(Exception): """ @@ -23,7 +25,7 @@ def __init__( body: Any = None, cause: Optional[Exception] = None, ) -> None: - self.headers = headers + self.headers = redact_sensitive_headers(headers) self.status_code = status_code self.body = body self.cause = cause diff --git a/src/deepgram/core/parse_error.py.bak b/src/deepgram/core/parse_error.py.bak deleted file mode 100644 index c510c0e8..00000000 --- a/src/deepgram/core/parse_error.py.bak +++ /dev/null @@ -1,38 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from typing import Any, Dict, Optional - -from .._secure_logging import redact_sensitive_headers - - -class ParsingError(Exception): - """ - Raised when the SDK fails to parse/validate a response from the server. - This typically indicates that the server returned a response whose shape - does not match the expected schema. - """ - - headers: Optional[Dict[str, str]] - status_code: Optional[int] - body: Any - cause: Optional[Exception] - - def __init__( - self, - *, - headers: Optional[Dict[str, str]] = None, - status_code: Optional[int] = None, - body: Any = None, - cause: Optional[Exception] = None, - ) -> None: - self.headers = redact_sensitive_headers(headers) - self.status_code = status_code - self.body = body - self.cause = cause - super().__init__() - if cause is not None: - self.__cause__ = cause - - def __str__(self) -> str: - cause_str = f", cause: {self.cause}" if self.cause is not None else "" - return f"headers: {self.headers}, status_code: {self.status_code}, body: {self.body}{cause_str}" diff --git a/src/deepgram/core/query_encoder.py b/src/deepgram/core/query_encoder.py index 3183001d..58088258 100644 --- a/src/deepgram/core/query_encoder.py +++ b/src/deepgram/core/query_encoder.py @@ -5,6 +5,13 @@ import pydantic +def _coerce_query_value(value: Any) -> Any: + # urllib.parse.urlencode would otherwise turn bools into "True"/"False". + if isinstance(value, bool): + return "true" if value else "false" + return value + + # Flattens dicts to be of the form {"key[subkey][subkey2]": value} where value is not a dict def traverse_query_dict(dict_flat: Dict[str, Any], key_prefix: Optional[str] = None) -> List[Tuple[str, Any]]: result = [] @@ -17,9 +24,9 @@ def traverse_query_dict(dict_flat: Dict[str, Any], key_prefix: Optional[str] = N if isinstance(arr_v, dict): result.extend(traverse_query_dict(arr_v, key)) else: - result.append((key, arr_v)) + result.append((key, _coerce_query_value(arr_v))) else: - result.append((key, v)) + result.append((key, _coerce_query_value(v))) return result @@ -41,11 +48,11 @@ def single_query_encoder(query_key: str, query_value: Any) -> List[Tuple[str, An encoded_values.extend(single_query_encoder(query_key, obj_dict)) else: - encoded_values.append((query_key, value)) + encoded_values.append((query_key, _coerce_query_value(value))) return encoded_values - return [(query_key, query_value)] + return [(query_key, _coerce_query_value(query_value))] def encode_query(query: Optional[Dict[str, Any]]) -> Optional[List[Tuple[str, Any]]]: diff --git a/src/deepgram/core/query_encoder.py.bak b/src/deepgram/core/query_encoder.py.bak deleted file mode 100644 index 58088258..00000000 --- a/src/deepgram/core/query_encoder.py.bak +++ /dev/null @@ -1,65 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from typing import Any, Dict, List, Optional, Tuple - -import pydantic - - -def _coerce_query_value(value: Any) -> Any: - # urllib.parse.urlencode would otherwise turn bools into "True"/"False". - if isinstance(value, bool): - return "true" if value else "false" - return value - - -# Flattens dicts to be of the form {"key[subkey][subkey2]": value} where value is not a dict -def traverse_query_dict(dict_flat: Dict[str, Any], key_prefix: Optional[str] = None) -> List[Tuple[str, Any]]: - result = [] - for k, v in dict_flat.items(): - key = f"{key_prefix}[{k}]" if key_prefix is not None else k - if isinstance(v, dict): - result.extend(traverse_query_dict(v, key)) - elif isinstance(v, list): - for arr_v in v: - if isinstance(arr_v, dict): - result.extend(traverse_query_dict(arr_v, key)) - else: - result.append((key, _coerce_query_value(arr_v))) - else: - result.append((key, _coerce_query_value(v))) - return result - - -def single_query_encoder(query_key: str, query_value: Any) -> List[Tuple[str, Any]]: - if isinstance(query_value, pydantic.BaseModel) or isinstance(query_value, dict): - if isinstance(query_value, pydantic.BaseModel): - obj_dict = query_value.dict(by_alias=True) - else: - obj_dict = query_value - return traverse_query_dict(obj_dict, query_key) - elif isinstance(query_value, list): - encoded_values: List[Tuple[str, Any]] = [] - for value in query_value: - if isinstance(value, pydantic.BaseModel) or isinstance(value, dict): - if isinstance(value, pydantic.BaseModel): - obj_dict = value.dict(by_alias=True) - elif isinstance(value, dict): - obj_dict = value - - encoded_values.extend(single_query_encoder(query_key, obj_dict)) - else: - encoded_values.append((query_key, _coerce_query_value(value))) - - return encoded_values - - return [(query_key, _coerce_query_value(query_value))] - - -def encode_query(query: Optional[Dict[str, Any]]) -> Optional[List[Tuple[str, Any]]]: - if query is None: - return None - - encoded_query = [] - for k, v in query.items(): - encoded_query.extend(single_query_encoder(k, v)) - return encoded_query diff --git a/src/deepgram/listen/__init__.py b/src/deepgram/listen/__init__.py index 79d16232..d2b6487e 100644 --- a/src/deepgram/listen/__init__.py +++ b/src/deepgram/listen/__init__.py @@ -148,6 +148,8 @@ "v2": ".v2", } +_dynamic_imports["ListenV2CloseStreamType"] = ".v2" + def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) @@ -240,3 +242,5 @@ def __dir__(): "v1", "v2", ] + +__all__.append("ListenV2CloseStreamType") diff --git a/src/deepgram/listen/__init__.py.bak b/src/deepgram/listen/__init__.py.bak deleted file mode 100644 index d2b6487e..00000000 --- a/src/deepgram/listen/__init__.py.bak +++ /dev/null @@ -1,246 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# isort: skip_file - -import typing -from importlib import import_module - -if typing.TYPE_CHECKING: - from . import v1, v2 - from .v1 import ( - DiarizeModel, - ListenV1CloseStream, - ListenV1CloseStreamParams, - ListenV1CloseStreamType, - ListenV1Configure, - ListenV1ConfigureFailure, - ListenV1ConfigureFailureCode, - ListenV1ConfigureFailureParams, - ListenV1ConfigureParams, - ListenV1ConfigureSuccess, - ListenV1ConfigureSuccessParams, - ListenV1Error, - ListenV1ErrorParams, - ListenV1Finalize, - ListenV1FinalizeParams, - ListenV1FinalizeType, - ListenV1KeepAlive, - ListenV1KeepAliveParams, - ListenV1KeepAliveType, - ListenV1Metadata, - ListenV1MetadataParams, - ListenV1Results, - ListenV1ResultsChannel, - ListenV1ResultsChannelAlternativesItem, - ListenV1ResultsChannelAlternativesItemParams, - ListenV1ResultsChannelAlternativesItemWordsItem, - ListenV1ResultsChannelAlternativesItemWordsItemParams, - ListenV1ResultsChannelParams, - ListenV1ResultsEntitiesItem, - ListenV1ResultsEntitiesItemParams, - ListenV1ResultsMetadata, - ListenV1ResultsMetadataDiarizeInfo, - ListenV1ResultsMetadataDiarizeInfoParams, - ListenV1ResultsMetadataModelInfo, - ListenV1ResultsMetadataModelInfoParams, - ListenV1ResultsMetadataParams, - ListenV1ResultsParams, - ListenV1SpeechStarted, - ListenV1SpeechStartedParams, - ListenV1UtteranceEnd, - ListenV1UtteranceEndParams, - ) - from .v2 import ( - ListenV2CloseStream, - ListenV2CloseStreamParams, - ListenV2Configure, - ListenV2ConfigureFailure, - ListenV2ConfigureFailureParams, - ListenV2ConfigureParams, - ListenV2ConfigureSuccess, - ListenV2ConfigureSuccessParams, - ListenV2ConfigureSuccessThresholds, - ListenV2ConfigureSuccessThresholdsParams, - ListenV2ConfigureThresholds, - ListenV2ConfigureThresholdsParams, - ListenV2Connected, - ListenV2ConnectedParams, - ListenV2FatalError, - ListenV2FatalErrorParams, - ListenV2ForceEndTurn, - ListenV2ForceEndTurnParams, - ListenV2TurnInfo, - ListenV2TurnInfoEvent, - ListenV2TurnInfoParams, - ListenV2TurnInfoWordsItem, - ListenV2TurnInfoWordsItemParams, - ListenV2Warning, - ListenV2WarningParams, - ) -_dynamic_imports: typing.Dict[str, str] = { - "DiarizeModel": ".v1", - "ListenV1CloseStream": ".v1", - "ListenV1CloseStreamParams": ".v1", - "ListenV1CloseStreamType": ".v1", - "ListenV1Configure": ".v1", - "ListenV1ConfigureFailure": ".v1", - "ListenV1ConfigureFailureCode": ".v1", - "ListenV1ConfigureFailureParams": ".v1", - "ListenV1ConfigureParams": ".v1", - "ListenV1ConfigureSuccess": ".v1", - "ListenV1ConfigureSuccessParams": ".v1", - "ListenV1Error": ".v1", - "ListenV1ErrorParams": ".v1", - "ListenV1Finalize": ".v1", - "ListenV1FinalizeParams": ".v1", - "ListenV1FinalizeType": ".v1", - "ListenV1KeepAlive": ".v1", - "ListenV1KeepAliveParams": ".v1", - "ListenV1KeepAliveType": ".v1", - "ListenV1Metadata": ".v1", - "ListenV1MetadataParams": ".v1", - "ListenV1Results": ".v1", - "ListenV1ResultsChannel": ".v1", - "ListenV1ResultsChannelAlternativesItem": ".v1", - "ListenV1ResultsChannelAlternativesItemParams": ".v1", - "ListenV1ResultsChannelAlternativesItemWordsItem": ".v1", - "ListenV1ResultsChannelAlternativesItemWordsItemParams": ".v1", - "ListenV1ResultsChannelParams": ".v1", - "ListenV1ResultsEntitiesItem": ".v1", - "ListenV1ResultsEntitiesItemParams": ".v1", - "ListenV1ResultsMetadata": ".v1", - "ListenV1ResultsMetadataDiarizeInfo": ".v1", - "ListenV1ResultsMetadataDiarizeInfoParams": ".v1", - "ListenV1ResultsMetadataModelInfo": ".v1", - "ListenV1ResultsMetadataModelInfoParams": ".v1", - "ListenV1ResultsMetadataParams": ".v1", - "ListenV1ResultsParams": ".v1", - "ListenV1SpeechStarted": ".v1", - "ListenV1SpeechStartedParams": ".v1", - "ListenV1UtteranceEnd": ".v1", - "ListenV1UtteranceEndParams": ".v1", - "ListenV2CloseStream": ".v2", - "ListenV2CloseStreamParams": ".v2", - "ListenV2Configure": ".v2", - "ListenV2ConfigureFailure": ".v2", - "ListenV2ConfigureFailureParams": ".v2", - "ListenV2ConfigureParams": ".v2", - "ListenV2ConfigureSuccess": ".v2", - "ListenV2ConfigureSuccessParams": ".v2", - "ListenV2ConfigureSuccessThresholds": ".v2", - "ListenV2ConfigureSuccessThresholdsParams": ".v2", - "ListenV2ConfigureThresholds": ".v2", - "ListenV2ConfigureThresholdsParams": ".v2", - "ListenV2Connected": ".v2", - "ListenV2ConnectedParams": ".v2", - "ListenV2FatalError": ".v2", - "ListenV2FatalErrorParams": ".v2", - "ListenV2ForceEndTurn": ".v2", - "ListenV2ForceEndTurnParams": ".v2", - "ListenV2TurnInfo": ".v2", - "ListenV2TurnInfoEvent": ".v2", - "ListenV2TurnInfoParams": ".v2", - "ListenV2TurnInfoWordsItem": ".v2", - "ListenV2TurnInfoWordsItemParams": ".v2", - "ListenV2Warning": ".v2", - "ListenV2WarningParams": ".v2", - "v1": ".v1", - "v2": ".v2", -} - -_dynamic_imports["ListenV2CloseStreamType"] = ".v2" - - -def __getattr__(attr_name: str) -> typing.Any: - module_name = _dynamic_imports.get(attr_name) - if module_name is None: - raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") - try: - module = import_module(module_name, __package__) - if module_name == f".{attr_name}": - return module - else: - return getattr(module, attr_name) - except ImportError as e: - raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e - except AttributeError as e: - raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e - - -def __dir__(): - lazy_attrs = list(_dynamic_imports.keys()) - return sorted(lazy_attrs) - - -__all__ = [ - "DiarizeModel", - "ListenV1CloseStream", - "ListenV1CloseStreamParams", - "ListenV1CloseStreamType", - "ListenV1Configure", - "ListenV1ConfigureFailure", - "ListenV1ConfigureFailureCode", - "ListenV1ConfigureFailureParams", - "ListenV1ConfigureParams", - "ListenV1ConfigureSuccess", - "ListenV1ConfigureSuccessParams", - "ListenV1Error", - "ListenV1ErrorParams", - "ListenV1Finalize", - "ListenV1FinalizeParams", - "ListenV1FinalizeType", - "ListenV1KeepAlive", - "ListenV1KeepAliveParams", - "ListenV1KeepAliveType", - "ListenV1Metadata", - "ListenV1MetadataParams", - "ListenV1Results", - "ListenV1ResultsChannel", - "ListenV1ResultsChannelAlternativesItem", - "ListenV1ResultsChannelAlternativesItemParams", - "ListenV1ResultsChannelAlternativesItemWordsItem", - "ListenV1ResultsChannelAlternativesItemWordsItemParams", - "ListenV1ResultsChannelParams", - "ListenV1ResultsEntitiesItem", - "ListenV1ResultsEntitiesItemParams", - "ListenV1ResultsMetadata", - "ListenV1ResultsMetadataDiarizeInfo", - "ListenV1ResultsMetadataDiarizeInfoParams", - "ListenV1ResultsMetadataModelInfo", - "ListenV1ResultsMetadataModelInfoParams", - "ListenV1ResultsMetadataParams", - "ListenV1ResultsParams", - "ListenV1SpeechStarted", - "ListenV1SpeechStartedParams", - "ListenV1UtteranceEnd", - "ListenV1UtteranceEndParams", - "ListenV2CloseStream", - "ListenV2CloseStreamParams", - "ListenV2Configure", - "ListenV2ConfigureFailure", - "ListenV2ConfigureFailureParams", - "ListenV2ConfigureParams", - "ListenV2ConfigureSuccess", - "ListenV2ConfigureSuccessParams", - "ListenV2ConfigureSuccessThresholds", - "ListenV2ConfigureSuccessThresholdsParams", - "ListenV2ConfigureThresholds", - "ListenV2ConfigureThresholdsParams", - "ListenV2Connected", - "ListenV2ConnectedParams", - "ListenV2FatalError", - "ListenV2FatalErrorParams", - "ListenV2ForceEndTurn", - "ListenV2ForceEndTurnParams", - "ListenV2TurnInfo", - "ListenV2TurnInfoEvent", - "ListenV2TurnInfoParams", - "ListenV2TurnInfoWordsItem", - "ListenV2TurnInfoWordsItemParams", - "ListenV2Warning", - "ListenV2WarningParams", - "v1", - "v2", -] - -__all__.append("ListenV2CloseStreamType") diff --git a/src/deepgram/listen/v1/requests/listen_v1configure_failure.py b/src/deepgram/listen/v1/requests/listen_v1configure_failure.py index 410201ed..af007f39 100644 --- a/src/deepgram/listen/v1/requests/listen_v1configure_failure.py +++ b/src/deepgram/listen/v1/requests/listen_v1configure_failure.py @@ -20,7 +20,7 @@ class ListenV1ConfigureFailureParams(typing_extensions.TypedDict): code: ListenV1ConfigureFailureCode """ Identifies why the `Configure` was rejected. - + - `CONFIGURE_KEYTERMS_NOT_SUPPORTED`: the stream's model does not support mid-stream keyterm updates. Only Nova-3 models do. - `CONFIGURE_KEYTERM_LIMIT_EXCEEDED`: the keyterms exceed the 500-token keyterm limit. diff --git a/src/deepgram/listen/v1/requests/listen_v1configure_failure.py.bak b/src/deepgram/listen/v1/requests/listen_v1configure_failure.py.bak deleted file mode 100644 index af007f39..00000000 --- a/src/deepgram/listen/v1/requests/listen_v1configure_failure.py.bak +++ /dev/null @@ -1,34 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import typing_extensions -from ..types.listen_v1configure_failure_code import ListenV1ConfigureFailureCode - - -class ListenV1ConfigureFailureParams(typing_extensions.TypedDict): - type: typing.Literal["ConfigureFailure"] - """ - Message type identifier - """ - - request_id: str - """ - The unique identifier of the request - """ - - code: ListenV1ConfigureFailureCode - """ - Identifies why the `Configure` was rejected. - - - `CONFIGURE_KEYTERMS_NOT_SUPPORTED`: the stream's model does not support mid-stream keyterm updates. Only - Nova-3 models do. - - `CONFIGURE_KEYTERM_LIMIT_EXCEEDED`: the keyterms exceed the 500-token keyterm limit. - - `CONFIGURE_ALREADY_PENDING`: another `Configure` is still awaiting its response. - - `CONFIGURE_INTERNAL_ERROR`: the server failed to apply the configuration. - """ - - description: str - """ - A human-readable explanation of the rejection - """ diff --git a/src/deepgram/listen/v1/socket_client.py b/src/deepgram/listen/v1/socket_client.py index 5666ff3a..20d466f4 100644 --- a/src/deepgram/listen/v1/socket_client.py +++ b/src/deepgram/listen/v1/socket_client.py @@ -3,9 +3,7 @@ import json import logging import typing -from json.decoder import JSONDecodeError -import websockets import websockets.sync.connection as websockets_sync_connection from ...core.events import EventEmitterMixin, EventType from ...core.unchecked_base_model import construct_type @@ -28,6 +26,7 @@ _logger = logging.getLogger(__name__) V1SocketClientResponse = typing.Union[ + bytes, ListenV1ConfigureSuccess, ListenV1ConfigureFailure, ListenV1Results, @@ -35,6 +34,7 @@ ListenV1UtteranceEnd, ListenV1SpeechStarted, ListenV1Error, + typing.Dict[str, typing.Any], ] @@ -81,7 +81,7 @@ async def start_listening(self): ) continue await self._emit_async(EventType.MESSAGE, parsed) - except (websockets.WebSocketException, JSONDecodeError) as exc: + except Exception as exc: await self._emit_async(EventType.ERROR, exc) finally: await self._emit_async(EventType.CLOSE, None) @@ -93,26 +93,26 @@ async def send_media(self, message: bytes) -> None: """ await self._send(message) - async def send_finalize(self, message: ListenV1Finalize) -> None: + async def send_finalize(self, message: typing.Optional[ListenV1Finalize] = None) -> None: """ Send a message to the websocket connection. The message will be sent as a ListenV1Finalize. """ - await self._send_model(message) + await self._send_model(message or ListenV1Finalize(type="Finalize")) - async def send_close_stream(self, message: ListenV1CloseStream) -> None: + async def send_close_stream(self, message: typing.Optional[ListenV1CloseStream] = None) -> None: """ Send a message to the websocket connection. The message will be sent as a ListenV1CloseStream. """ - await self._send_model(message) + await self._send_model(message or ListenV1CloseStream(type="CloseStream")) - async def send_keep_alive(self, message: ListenV1KeepAlive) -> None: + async def send_keep_alive(self, message: typing.Optional[ListenV1KeepAlive] = None) -> None: """ Send a message to the websocket connection. The message will be sent as a ListenV1KeepAlive. """ - await self._send_model(message) + await self._send_model(message or ListenV1KeepAlive(type="KeepAlive")) async def send_configure(self, message: ListenV1Configure) -> None: """ @@ -193,7 +193,7 @@ def start_listening(self): ) continue self._emit(EventType.MESSAGE, parsed) - except (websockets.WebSocketException, JSONDecodeError) as exc: + except Exception as exc: self._emit(EventType.ERROR, exc) finally: self._emit(EventType.CLOSE, None) @@ -205,26 +205,26 @@ def send_media(self, message: bytes) -> None: """ self._send(message) - def send_finalize(self, message: ListenV1Finalize) -> None: + def send_finalize(self, message: typing.Optional[ListenV1Finalize] = None) -> None: """ Send a message to the websocket connection. The message will be sent as a ListenV1Finalize. """ - self._send_model(message) + self._send_model(message or ListenV1Finalize(type="Finalize")) - def send_close_stream(self, message: ListenV1CloseStream) -> None: + def send_close_stream(self, message: typing.Optional[ListenV1CloseStream] = None) -> None: """ Send a message to the websocket connection. The message will be sent as a ListenV1CloseStream. """ - self._send_model(message) + self._send_model(message or ListenV1CloseStream(type="CloseStream")) - def send_keep_alive(self, message: ListenV1KeepAlive) -> None: + def send_keep_alive(self, message: typing.Optional[ListenV1KeepAlive] = None) -> None: """ Send a message to the websocket connection. The message will be sent as a ListenV1KeepAlive. """ - self._send_model(message) + self._send_model(message or ListenV1KeepAlive(type="KeepAlive")) def send_configure(self, message: ListenV1Configure) -> None: """ diff --git a/src/deepgram/listen/v1/socket_client.py.bak b/src/deepgram/listen/v1/socket_client.py.bak deleted file mode 100644 index 20d466f4..00000000 --- a/src/deepgram/listen/v1/socket_client.py.bak +++ /dev/null @@ -1,262 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import json -import logging -import typing - -import websockets.sync.connection as websockets_sync_connection -from ...core.events import EventEmitterMixin, EventType -from ...core.unchecked_base_model import construct_type -from .types.listen_v1close_stream import ListenV1CloseStream -from .types.listen_v1configure import ListenV1Configure -from .types.listen_v1configure_failure import ListenV1ConfigureFailure -from .types.listen_v1configure_success import ListenV1ConfigureSuccess -from .types.listen_v1error import ListenV1Error -from .types.listen_v1finalize import ListenV1Finalize -from .types.listen_v1keep_alive import ListenV1KeepAlive -from .types.listen_v1metadata import ListenV1Metadata -from .types.listen_v1results import ListenV1Results -from .types.listen_v1speech_started import ListenV1SpeechStarted -from .types.listen_v1utterance_end import ListenV1UtteranceEnd - -try: - from websockets.legacy.client import WebSocketClientProtocol # type: ignore -except ImportError: - from websockets import WebSocketClientProtocol # type: ignore - -_logger = logging.getLogger(__name__) -V1SocketClientResponse = typing.Union[ - bytes, - ListenV1ConfigureSuccess, - ListenV1ConfigureFailure, - ListenV1Results, - ListenV1Metadata, - ListenV1UtteranceEnd, - ListenV1SpeechStarted, - ListenV1Error, - typing.Dict[str, typing.Any], -] - - -class AsyncV1SocketClient(EventEmitterMixin): - def __init__(self, *, websocket: WebSocketClientProtocol): - super().__init__() - self._websocket = websocket - - async def __aiter__(self) -> typing.AsyncIterator[V1SocketClientResponse]: - async for message in self._websocket: - if isinstance(message, bytes): - yield message # type: ignore - else: - try: - yield construct_type(type_=V1SocketClientResponse, object_=json.loads(message)) # type: ignore - except Exception: - _logger.warning( - "Skipping unknown WebSocket message; update your SDK version to support new message types." - ) - continue - - async def start_listening(self): - """ - Start listening for messages on the websocket connection. - - Emits events in the following order: - - EventType.OPEN when connection is established - - EventType.MESSAGE for each message received - - EventType.ERROR if an error occurs - - EventType.CLOSE when connection is closed - """ - await self._emit_async(EventType.OPEN, None) - try: - async for raw_message in self._websocket: - if isinstance(raw_message, bytes): - parsed = raw_message - else: - json_data = json.loads(raw_message) - try: - parsed = construct_type(type_=V1SocketClientResponse, object_=json_data) # type: ignore - except Exception: - _logger.warning( - "Skipping unknown WebSocket message; update your SDK version to support new message types." - ) - continue - await self._emit_async(EventType.MESSAGE, parsed) - except Exception as exc: - await self._emit_async(EventType.ERROR, exc) - finally: - await self._emit_async(EventType.CLOSE, None) - - async def send_media(self, message: bytes) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a bytes. - """ - await self._send(message) - - async def send_finalize(self, message: typing.Optional[ListenV1Finalize] = None) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a ListenV1Finalize. - """ - await self._send_model(message or ListenV1Finalize(type="Finalize")) - - async def send_close_stream(self, message: typing.Optional[ListenV1CloseStream] = None) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a ListenV1CloseStream. - """ - await self._send_model(message or ListenV1CloseStream(type="CloseStream")) - - async def send_keep_alive(self, message: typing.Optional[ListenV1KeepAlive] = None) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a ListenV1KeepAlive. - """ - await self._send_model(message or ListenV1KeepAlive(type="KeepAlive")) - - async def send_configure(self, message: ListenV1Configure) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a ListenV1Configure. - """ - await self._send_model(message) - - async def recv(self) -> V1SocketClientResponse: - """ - Receive a message from the websocket connection. - """ - data = await self._websocket.recv() - if isinstance(data, bytes): - return data # type: ignore - json_data = json.loads(data) - try: - return construct_type(type_=V1SocketClientResponse, object_=json_data) # type: ignore - except Exception: - _logger.warning("Skipping unknown WebSocket message; update your SDK version to support new message types.") - return json_data # type: ignore - - async def _send(self, data: typing.Any) -> None: - """ - Send a message to the websocket connection. - """ - if isinstance(data, dict): - data = json.dumps(data) - await self._websocket.send(data) - - async def _send_model(self, data: typing.Any) -> None: - """ - Send a Pydantic model to the websocket connection. - """ - await self._send(data.dict()) - - -class V1SocketClient(EventEmitterMixin): - def __init__(self, *, websocket: websockets_sync_connection.Connection): - super().__init__() - self._websocket = websocket - - def __iter__(self) -> typing.Iterator[V1SocketClientResponse]: - for message in self._websocket: - if isinstance(message, bytes): - yield message # type: ignore - else: - try: - yield construct_type(type_=V1SocketClientResponse, object_=json.loads(message)) # type: ignore - except Exception: - _logger.warning( - "Skipping unknown WebSocket message; update your SDK version to support new message types." - ) - continue - - def start_listening(self): - """ - Start listening for messages on the websocket connection. - - Emits events in the following order: - - EventType.OPEN when connection is established - - EventType.MESSAGE for each message received - - EventType.ERROR if an error occurs - - EventType.CLOSE when connection is closed - """ - self._emit(EventType.OPEN, None) - try: - for raw_message in self._websocket: - if isinstance(raw_message, bytes): - parsed = raw_message - else: - json_data = json.loads(raw_message) - try: - parsed = construct_type(type_=V1SocketClientResponse, object_=json_data) # type: ignore - except Exception: - _logger.warning( - "Skipping unknown WebSocket message; update your SDK version to support new message types." - ) - continue - self._emit(EventType.MESSAGE, parsed) - except Exception as exc: - self._emit(EventType.ERROR, exc) - finally: - self._emit(EventType.CLOSE, None) - - def send_media(self, message: bytes) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a bytes. - """ - self._send(message) - - def send_finalize(self, message: typing.Optional[ListenV1Finalize] = None) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a ListenV1Finalize. - """ - self._send_model(message or ListenV1Finalize(type="Finalize")) - - def send_close_stream(self, message: typing.Optional[ListenV1CloseStream] = None) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a ListenV1CloseStream. - """ - self._send_model(message or ListenV1CloseStream(type="CloseStream")) - - def send_keep_alive(self, message: typing.Optional[ListenV1KeepAlive] = None) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a ListenV1KeepAlive. - """ - self._send_model(message or ListenV1KeepAlive(type="KeepAlive")) - - def send_configure(self, message: ListenV1Configure) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a ListenV1Configure. - """ - self._send_model(message) - - def recv(self) -> V1SocketClientResponse: - """ - Receive a message from the websocket connection. - """ - data = self._websocket.recv() - if isinstance(data, bytes): - return data # type: ignore - json_data = json.loads(data) - try: - return construct_type(type_=V1SocketClientResponse, object_=json_data) # type: ignore - except Exception: - _logger.warning("Skipping unknown WebSocket message; update your SDK version to support new message types.") - return json_data # type: ignore - - def _send(self, data: typing.Any) -> None: - """ - Send a message to the websocket connection. - """ - if isinstance(data, dict): - data = json.dumps(data) - self._websocket.send(data) - - def _send_model(self, data: typing.Any) -> None: - """ - Send a Pydantic model to the websocket connection. - """ - self._send(data.dict()) diff --git a/src/deepgram/listen/v1/types/listen_v1configure_failure.py b/src/deepgram/listen/v1/types/listen_v1configure_failure.py index 7352f3df..859a834c 100644 --- a/src/deepgram/listen/v1/types/listen_v1configure_failure.py +++ b/src/deepgram/listen/v1/types/listen_v1configure_failure.py @@ -22,7 +22,7 @@ class ListenV1ConfigureFailure(UncheckedBaseModel): code: ListenV1ConfigureFailureCode = pydantic.Field() """ Identifies why the `Configure` was rejected. - + - `CONFIGURE_KEYTERMS_NOT_SUPPORTED`: the stream's model does not support mid-stream keyterm updates. Only Nova-3 models do. - `CONFIGURE_KEYTERM_LIMIT_EXCEEDED`: the keyterms exceed the 500-token keyterm limit. diff --git a/src/deepgram/listen/v1/types/listen_v1configure_failure.py.bak b/src/deepgram/listen/v1/types/listen_v1configure_failure.py.bak deleted file mode 100644 index 859a834c..00000000 --- a/src/deepgram/listen/v1/types/listen_v1configure_failure.py.bak +++ /dev/null @@ -1,45 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ....core.pydantic_utilities import IS_PYDANTIC_V2 -from ....core.unchecked_base_model import UncheckedBaseModel -from .listen_v1configure_failure_code import ListenV1ConfigureFailureCode - - -class ListenV1ConfigureFailure(UncheckedBaseModel): - type: typing.Literal["ConfigureFailure"] = pydantic.Field(default="ConfigureFailure") - """ - Message type identifier - """ - - request_id: str = pydantic.Field() - """ - The unique identifier of the request - """ - - code: ListenV1ConfigureFailureCode = pydantic.Field() - """ - Identifies why the `Configure` was rejected. - - - `CONFIGURE_KEYTERMS_NOT_SUPPORTED`: the stream's model does not support mid-stream keyterm updates. Only - Nova-3 models do. - - `CONFIGURE_KEYTERM_LIMIT_EXCEEDED`: the keyterms exceed the 500-token keyterm limit. - - `CONFIGURE_ALREADY_PENDING`: another `Configure` is still awaiting its response. - - `CONFIGURE_INTERNAL_ERROR`: the server failed to apply the configuration. - """ - - description: str = pydantic.Field() - """ - A human-readable explanation of the rejection - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/deepgram/listen/v2/__init__.py b/src/deepgram/listen/v2/__init__.py index 8dea11db..7585b5ab 100644 --- a/src/deepgram/listen/v2/__init__.py +++ b/src/deepgram/listen/v2/__init__.py @@ -63,6 +63,8 @@ "ListenV2WarningParams": ".requests", } +_dynamic_imports["ListenV2CloseStreamType"] = ".types" + def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) @@ -112,3 +114,5 @@ def __dir__(): "ListenV2Warning", "ListenV2WarningParams", ] + +__all__.append("ListenV2CloseStreamType") diff --git a/src/deepgram/listen/v2/__init__.py.bak b/src/deepgram/listen/v2/__init__.py.bak deleted file mode 100644 index 7585b5ab..00000000 --- a/src/deepgram/listen/v2/__init__.py.bak +++ /dev/null @@ -1,118 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# isort: skip_file - -import typing -from importlib import import_module - -if typing.TYPE_CHECKING: - from .types import ( - ListenV2CloseStream, - ListenV2Configure, - ListenV2ConfigureFailure, - ListenV2ConfigureSuccess, - ListenV2ConfigureSuccessThresholds, - ListenV2ConfigureThresholds, - ListenV2Connected, - ListenV2FatalError, - ListenV2ForceEndTurn, - ListenV2TurnInfo, - ListenV2TurnInfoEvent, - ListenV2TurnInfoWordsItem, - ListenV2Warning, - ) - from .requests import ( - ListenV2CloseStreamParams, - ListenV2ConfigureFailureParams, - ListenV2ConfigureParams, - ListenV2ConfigureSuccessParams, - ListenV2ConfigureSuccessThresholdsParams, - ListenV2ConfigureThresholdsParams, - ListenV2ConnectedParams, - ListenV2FatalErrorParams, - ListenV2ForceEndTurnParams, - ListenV2TurnInfoParams, - ListenV2TurnInfoWordsItemParams, - ListenV2WarningParams, - ) -_dynamic_imports: typing.Dict[str, str] = { - "ListenV2CloseStream": ".types", - "ListenV2CloseStreamParams": ".requests", - "ListenV2Configure": ".types", - "ListenV2ConfigureFailure": ".types", - "ListenV2ConfigureFailureParams": ".requests", - "ListenV2ConfigureParams": ".requests", - "ListenV2ConfigureSuccess": ".types", - "ListenV2ConfigureSuccessParams": ".requests", - "ListenV2ConfigureSuccessThresholds": ".types", - "ListenV2ConfigureSuccessThresholdsParams": ".requests", - "ListenV2ConfigureThresholds": ".types", - "ListenV2ConfigureThresholdsParams": ".requests", - "ListenV2Connected": ".types", - "ListenV2ConnectedParams": ".requests", - "ListenV2FatalError": ".types", - "ListenV2FatalErrorParams": ".requests", - "ListenV2ForceEndTurn": ".types", - "ListenV2ForceEndTurnParams": ".requests", - "ListenV2TurnInfo": ".types", - "ListenV2TurnInfoEvent": ".types", - "ListenV2TurnInfoParams": ".requests", - "ListenV2TurnInfoWordsItem": ".types", - "ListenV2TurnInfoWordsItemParams": ".requests", - "ListenV2Warning": ".types", - "ListenV2WarningParams": ".requests", -} - -_dynamic_imports["ListenV2CloseStreamType"] = ".types" - - -def __getattr__(attr_name: str) -> typing.Any: - module_name = _dynamic_imports.get(attr_name) - if module_name is None: - raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") - try: - module = import_module(module_name, __package__) - if module_name == f".{attr_name}": - return module - else: - return getattr(module, attr_name) - except ImportError as e: - raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e - except AttributeError as e: - raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e - - -def __dir__(): - lazy_attrs = list(_dynamic_imports.keys()) - return sorted(lazy_attrs) - - -__all__ = [ - "ListenV2CloseStream", - "ListenV2CloseStreamParams", - "ListenV2Configure", - "ListenV2ConfigureFailure", - "ListenV2ConfigureFailureParams", - "ListenV2ConfigureParams", - "ListenV2ConfigureSuccess", - "ListenV2ConfigureSuccessParams", - "ListenV2ConfigureSuccessThresholds", - "ListenV2ConfigureSuccessThresholdsParams", - "ListenV2ConfigureThresholds", - "ListenV2ConfigureThresholdsParams", - "ListenV2Connected", - "ListenV2ConnectedParams", - "ListenV2FatalError", - "ListenV2FatalErrorParams", - "ListenV2ForceEndTurn", - "ListenV2ForceEndTurnParams", - "ListenV2TurnInfo", - "ListenV2TurnInfoEvent", - "ListenV2TurnInfoParams", - "ListenV2TurnInfoWordsItem", - "ListenV2TurnInfoWordsItemParams", - "ListenV2Warning", - "ListenV2WarningParams", -] - -__all__.append("ListenV2CloseStreamType") diff --git a/src/deepgram/listen/v2/socket_client.py b/src/deepgram/listen/v2/socket_client.py index e60bd78a..4295e44c 100644 --- a/src/deepgram/listen/v2/socket_client.py +++ b/src/deepgram/listen/v2/socket_client.py @@ -3,9 +3,7 @@ import json import logging import typing -from json.decoder import JSONDecodeError -import websockets import websockets.sync.connection as websockets_sync_connection from ...core.events import EventEmitterMixin, EventType from ...core.unchecked_base_model import construct_type @@ -26,12 +24,14 @@ _logger = logging.getLogger(__name__) V2SocketClientResponse = typing.Union[ + bytes, ListenV2Connected, ListenV2TurnInfo, ListenV2ConfigureSuccess, ListenV2ConfigureFailure, ListenV2Warning, ListenV2FatalError, + typing.Dict[str, typing.Any], ] @@ -78,7 +78,7 @@ async def start_listening(self): ) continue await self._emit_async(EventType.MESSAGE, parsed) - except (websockets.WebSocketException, JSONDecodeError) as exc: + except Exception as exc: await self._emit_async(EventType.ERROR, exc) finally: await self._emit_async(EventType.CLOSE, None) @@ -90,26 +90,29 @@ async def send_media(self, message: bytes) -> None: """ await self._send(message) - async def send_close_stream(self, message: ListenV2CloseStream) -> None: + async def send_close_stream(self, message: typing.Optional[ListenV2CloseStream] = None) -> None: """ Send a message to the websocket connection. The message will be sent as a ListenV2CloseStream. """ - await self._send_model(message) + await self._send_model(message or ListenV2CloseStream(type="CloseStream")) - async def send_force_end_turn(self, message: ListenV2ForceEndTurn) -> None: + async def send_force_end_turn(self, message: typing.Optional[ListenV2ForceEndTurn] = None) -> None: """ Send a message to the websocket connection. The message will be sent as a ListenV2ForceEndTurn. """ - await self._send_model(message) + await self._send_model(message or ListenV2ForceEndTurn(type="ForceEndTurn")) - async def send_configure(self, message: ListenV2Configure) -> None: + async def send_configure(self, message: typing.Union[ListenV2Configure, typing.Dict[str, typing.Any]]) -> None: """ Send a message to the websocket connection. The message will be sent as a ListenV2Configure. """ - await self._send_model(message) + if isinstance(message, dict): + await self._send(message) + else: + await self._send_model(message) async def recv(self) -> V2SocketClientResponse: """ @@ -183,7 +186,7 @@ def start_listening(self): ) continue self._emit(EventType.MESSAGE, parsed) - except (websockets.WebSocketException, JSONDecodeError) as exc: + except Exception as exc: self._emit(EventType.ERROR, exc) finally: self._emit(EventType.CLOSE, None) @@ -195,26 +198,29 @@ def send_media(self, message: bytes) -> None: """ self._send(message) - def send_close_stream(self, message: ListenV2CloseStream) -> None: + def send_close_stream(self, message: typing.Optional[ListenV2CloseStream] = None) -> None: """ Send a message to the websocket connection. The message will be sent as a ListenV2CloseStream. """ - self._send_model(message) + self._send_model(message or ListenV2CloseStream(type="CloseStream")) - def send_force_end_turn(self, message: ListenV2ForceEndTurn) -> None: + def send_force_end_turn(self, message: typing.Optional[ListenV2ForceEndTurn] = None) -> None: """ Send a message to the websocket connection. The message will be sent as a ListenV2ForceEndTurn. """ - self._send_model(message) + self._send_model(message or ListenV2ForceEndTurn(type="ForceEndTurn")) - def send_configure(self, message: ListenV2Configure) -> None: + def send_configure(self, message: typing.Union[ListenV2Configure, typing.Dict[str, typing.Any]]) -> None: """ Send a message to the websocket connection. The message will be sent as a ListenV2Configure. """ - self._send_model(message) + if isinstance(message, dict): + self._send(message) + else: + self._send_model(message) def recv(self) -> V2SocketClientResponse: """ diff --git a/src/deepgram/listen/v2/socket_client.py.bak b/src/deepgram/listen/v2/socket_client.py.bak deleted file mode 100644 index 4295e44c..00000000 --- a/src/deepgram/listen/v2/socket_client.py.bak +++ /dev/null @@ -1,251 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import json -import logging -import typing - -import websockets.sync.connection as websockets_sync_connection -from ...core.events import EventEmitterMixin, EventType -from ...core.unchecked_base_model import construct_type -from .types.listen_v2close_stream import ListenV2CloseStream -from .types.listen_v2configure import ListenV2Configure -from .types.listen_v2configure_failure import ListenV2ConfigureFailure -from .types.listen_v2configure_success import ListenV2ConfigureSuccess -from .types.listen_v2connected import ListenV2Connected -from .types.listen_v2fatal_error import ListenV2FatalError -from .types.listen_v2force_end_turn import ListenV2ForceEndTurn -from .types.listen_v2turn_info import ListenV2TurnInfo -from .types.listen_v2warning import ListenV2Warning - -try: - from websockets.legacy.client import WebSocketClientProtocol # type: ignore -except ImportError: - from websockets import WebSocketClientProtocol # type: ignore - -_logger = logging.getLogger(__name__) -V2SocketClientResponse = typing.Union[ - bytes, - ListenV2Connected, - ListenV2TurnInfo, - ListenV2ConfigureSuccess, - ListenV2ConfigureFailure, - ListenV2Warning, - ListenV2FatalError, - typing.Dict[str, typing.Any], -] - - -class AsyncV2SocketClient(EventEmitterMixin): - def __init__(self, *, websocket: WebSocketClientProtocol): - super().__init__() - self._websocket = websocket - - async def __aiter__(self) -> typing.AsyncIterator[V2SocketClientResponse]: - async for message in self._websocket: - if isinstance(message, bytes): - yield message # type: ignore - else: - try: - yield construct_type(type_=V2SocketClientResponse, object_=json.loads(message)) # type: ignore - except Exception: - _logger.warning( - "Skipping unknown WebSocket message; update your SDK version to support new message types." - ) - continue - - async def start_listening(self): - """ - Start listening for messages on the websocket connection. - - Emits events in the following order: - - EventType.OPEN when connection is established - - EventType.MESSAGE for each message received - - EventType.ERROR if an error occurs - - EventType.CLOSE when connection is closed - """ - await self._emit_async(EventType.OPEN, None) - try: - async for raw_message in self._websocket: - if isinstance(raw_message, bytes): - parsed = raw_message - else: - json_data = json.loads(raw_message) - try: - parsed = construct_type(type_=V2SocketClientResponse, object_=json_data) # type: ignore - except Exception: - _logger.warning( - "Skipping unknown WebSocket message; update your SDK version to support new message types." - ) - continue - await self._emit_async(EventType.MESSAGE, parsed) - except Exception as exc: - await self._emit_async(EventType.ERROR, exc) - finally: - await self._emit_async(EventType.CLOSE, None) - - async def send_media(self, message: bytes) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a bytes. - """ - await self._send(message) - - async def send_close_stream(self, message: typing.Optional[ListenV2CloseStream] = None) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a ListenV2CloseStream. - """ - await self._send_model(message or ListenV2CloseStream(type="CloseStream")) - - async def send_force_end_turn(self, message: typing.Optional[ListenV2ForceEndTurn] = None) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a ListenV2ForceEndTurn. - """ - await self._send_model(message or ListenV2ForceEndTurn(type="ForceEndTurn")) - - async def send_configure(self, message: typing.Union[ListenV2Configure, typing.Dict[str, typing.Any]]) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a ListenV2Configure. - """ - if isinstance(message, dict): - await self._send(message) - else: - await self._send_model(message) - - async def recv(self) -> V2SocketClientResponse: - """ - Receive a message from the websocket connection. - """ - data = await self._websocket.recv() - if isinstance(data, bytes): - return data # type: ignore - json_data = json.loads(data) - try: - return construct_type(type_=V2SocketClientResponse, object_=json_data) # type: ignore - except Exception: - _logger.warning("Skipping unknown WebSocket message; update your SDK version to support new message types.") - return json_data # type: ignore - - async def _send(self, data: typing.Any) -> None: - """ - Send a message to the websocket connection. - """ - if isinstance(data, dict): - data = json.dumps(data) - await self._websocket.send(data) - - async def _send_model(self, data: typing.Any) -> None: - """ - Send a Pydantic model to the websocket connection. - """ - await self._send(data.dict()) - - -class V2SocketClient(EventEmitterMixin): - def __init__(self, *, websocket: websockets_sync_connection.Connection): - super().__init__() - self._websocket = websocket - - def __iter__(self) -> typing.Iterator[V2SocketClientResponse]: - for message in self._websocket: - if isinstance(message, bytes): - yield message # type: ignore - else: - try: - yield construct_type(type_=V2SocketClientResponse, object_=json.loads(message)) # type: ignore - except Exception: - _logger.warning( - "Skipping unknown WebSocket message; update your SDK version to support new message types." - ) - continue - - def start_listening(self): - """ - Start listening for messages on the websocket connection. - - Emits events in the following order: - - EventType.OPEN when connection is established - - EventType.MESSAGE for each message received - - EventType.ERROR if an error occurs - - EventType.CLOSE when connection is closed - """ - self._emit(EventType.OPEN, None) - try: - for raw_message in self._websocket: - if isinstance(raw_message, bytes): - parsed = raw_message - else: - json_data = json.loads(raw_message) - try: - parsed = construct_type(type_=V2SocketClientResponse, object_=json_data) # type: ignore - except Exception: - _logger.warning( - "Skipping unknown WebSocket message; update your SDK version to support new message types." - ) - continue - self._emit(EventType.MESSAGE, parsed) - except Exception as exc: - self._emit(EventType.ERROR, exc) - finally: - self._emit(EventType.CLOSE, None) - - def send_media(self, message: bytes) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a bytes. - """ - self._send(message) - - def send_close_stream(self, message: typing.Optional[ListenV2CloseStream] = None) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a ListenV2CloseStream. - """ - self._send_model(message or ListenV2CloseStream(type="CloseStream")) - - def send_force_end_turn(self, message: typing.Optional[ListenV2ForceEndTurn] = None) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a ListenV2ForceEndTurn. - """ - self._send_model(message or ListenV2ForceEndTurn(type="ForceEndTurn")) - - def send_configure(self, message: typing.Union[ListenV2Configure, typing.Dict[str, typing.Any]]) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a ListenV2Configure. - """ - if isinstance(message, dict): - self._send(message) - else: - self._send_model(message) - - def recv(self) -> V2SocketClientResponse: - """ - Receive a message from the websocket connection. - """ - data = self._websocket.recv() - if isinstance(data, bytes): - return data # type: ignore - json_data = json.loads(data) - try: - return construct_type(type_=V2SocketClientResponse, object_=json_data) # type: ignore - except Exception: - _logger.warning("Skipping unknown WebSocket message; update your SDK version to support new message types.") - return json_data # type: ignore - - def _send(self, data: typing.Any) -> None: - """ - Send a message to the websocket connection. - """ - if isinstance(data, dict): - data = json.dumps(data) - self._websocket.send(data) - - def _send_model(self, data: typing.Any) -> None: - """ - Send a Pydantic model to the websocket connection. - """ - self._send(data.dict()) diff --git a/src/deepgram/listen/v2/types/__init__.py b/src/deepgram/listen/v2/types/__init__.py index 7f4ffc34..8ec84d29 100644 --- a/src/deepgram/listen/v2/types/__init__.py +++ b/src/deepgram/listen/v2/types/__init__.py @@ -35,6 +35,8 @@ "ListenV2Warning": ".listen_v2warning", } +_dynamic_imports["ListenV2CloseStreamType"] = ".listen_v2close_stream_type" + def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) @@ -72,3 +74,5 @@ def __dir__(): "ListenV2TurnInfoWordsItem", "ListenV2Warning", ] + +__all__.append("ListenV2CloseStreamType") diff --git a/src/deepgram/listen/v2/types/__init__.py.bak b/src/deepgram/listen/v2/types/__init__.py.bak deleted file mode 100644 index 8ec84d29..00000000 --- a/src/deepgram/listen/v2/types/__init__.py.bak +++ /dev/null @@ -1,78 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# isort: skip_file - -import typing -from importlib import import_module - -if typing.TYPE_CHECKING: - from .listen_v2close_stream import ListenV2CloseStream - from .listen_v2configure import ListenV2Configure - from .listen_v2configure_failure import ListenV2ConfigureFailure - from .listen_v2configure_success import ListenV2ConfigureSuccess - from .listen_v2configure_success_thresholds import ListenV2ConfigureSuccessThresholds - from .listen_v2configure_thresholds import ListenV2ConfigureThresholds - from .listen_v2connected import ListenV2Connected - from .listen_v2fatal_error import ListenV2FatalError - from .listen_v2force_end_turn import ListenV2ForceEndTurn - from .listen_v2turn_info import ListenV2TurnInfo - from .listen_v2turn_info_event import ListenV2TurnInfoEvent - from .listen_v2turn_info_words_item import ListenV2TurnInfoWordsItem - from .listen_v2warning import ListenV2Warning -_dynamic_imports: typing.Dict[str, str] = { - "ListenV2CloseStream": ".listen_v2close_stream", - "ListenV2Configure": ".listen_v2configure", - "ListenV2ConfigureFailure": ".listen_v2configure_failure", - "ListenV2ConfigureSuccess": ".listen_v2configure_success", - "ListenV2ConfigureSuccessThresholds": ".listen_v2configure_success_thresholds", - "ListenV2ConfigureThresholds": ".listen_v2configure_thresholds", - "ListenV2Connected": ".listen_v2connected", - "ListenV2FatalError": ".listen_v2fatal_error", - "ListenV2ForceEndTurn": ".listen_v2force_end_turn", - "ListenV2TurnInfo": ".listen_v2turn_info", - "ListenV2TurnInfoEvent": ".listen_v2turn_info_event", - "ListenV2TurnInfoWordsItem": ".listen_v2turn_info_words_item", - "ListenV2Warning": ".listen_v2warning", -} - -_dynamic_imports["ListenV2CloseStreamType"] = ".listen_v2close_stream_type" - - -def __getattr__(attr_name: str) -> typing.Any: - module_name = _dynamic_imports.get(attr_name) - if module_name is None: - raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") - try: - module = import_module(module_name, __package__) - if module_name == f".{attr_name}": - return module - else: - return getattr(module, attr_name) - except ImportError as e: - raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e - except AttributeError as e: - raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e - - -def __dir__(): - lazy_attrs = list(_dynamic_imports.keys()) - return sorted(lazy_attrs) - - -__all__ = [ - "ListenV2CloseStream", - "ListenV2Configure", - "ListenV2ConfigureFailure", - "ListenV2ConfigureSuccess", - "ListenV2ConfigureSuccessThresholds", - "ListenV2ConfigureThresholds", - "ListenV2Connected", - "ListenV2FatalError", - "ListenV2ForceEndTurn", - "ListenV2TurnInfo", - "ListenV2TurnInfoEvent", - "ListenV2TurnInfoWordsItem", - "ListenV2Warning", -] - -__all__.append("ListenV2CloseStreamType") diff --git a/src/deepgram/listen/v2/types/listen_v2configure_failure.py b/src/deepgram/listen/v2/types/listen_v2configure_failure.py index 7b3772d6..1daf8af6 100644 --- a/src/deepgram/listen/v2/types/listen_v2configure_failure.py +++ b/src/deepgram/listen/v2/types/listen_v2configure_failure.py @@ -4,10 +4,10 @@ import pydantic from ....core.pydantic_utilities import IS_PYDANTIC_V2 -from ....core.unchecked_base_model import UncheckedBaseModel +from ._dict_compat import ListenV2ResponseDictCompatModel -class ListenV2ConfigureFailure(UncheckedBaseModel): +class ListenV2ConfigureFailure(ListenV2ResponseDictCompatModel): type: typing.Literal["ConfigureFailure"] = pydantic.Field(default="ConfigureFailure") """ Message type identifier diff --git a/src/deepgram/listen/v2/types/listen_v2configure_failure.py.bak b/src/deepgram/listen/v2/types/listen_v2configure_failure.py.bak deleted file mode 100644 index 1daf8af6..00000000 --- a/src/deepgram/listen/v2/types/listen_v2configure_failure.py.bak +++ /dev/null @@ -1,45 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ....core.pydantic_utilities import IS_PYDANTIC_V2 -from ._dict_compat import ListenV2ResponseDictCompatModel - - -class ListenV2ConfigureFailure(ListenV2ResponseDictCompatModel): - type: typing.Literal["ConfigureFailure"] = pydantic.Field(default="ConfigureFailure") - """ - Message type identifier - """ - - request_id: str = pydantic.Field() - """ - The unique identifier of the request - """ - - sequence_id: int = pydantic.Field() - """ - Starts at `0` and increments for each message the server sends - to the client. This includes messages of other types, like - `TurnInfo` messages. - """ - - code: typing.Optional[str] = pydantic.Field(default=None) - """ - Failure code identifying the rejected configuration - """ - - description: typing.Optional[str] = pydantic.Field(default=None) - """ - A human-readable description of the configuration failure - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/deepgram/listen/v2/types/listen_v2configure_success.py b/src/deepgram/listen/v2/types/listen_v2configure_success.py index d04cce1b..0faaec9d 100644 --- a/src/deepgram/listen/v2/types/listen_v2configure_success.py +++ b/src/deepgram/listen/v2/types/listen_v2configure_success.py @@ -4,13 +4,13 @@ import pydantic from ....core.pydantic_utilities import IS_PYDANTIC_V2 -from ....core.unchecked_base_model import UncheckedBaseModel from ....types.listen_v2configure_numerals import ListenV2ConfigureNumerals from ....types.listen_v2keyterm import ListenV2Keyterm +from ._dict_compat import ListenV2ResponseDictCompatModel from .listen_v2configure_success_thresholds import ListenV2ConfigureSuccessThresholds -class ListenV2ConfigureSuccess(UncheckedBaseModel): +class ListenV2ConfigureSuccess(ListenV2ResponseDictCompatModel): type: typing.Literal["ConfigureSuccess"] = pydantic.Field(default="ConfigureSuccess") """ Message type identifier diff --git a/src/deepgram/listen/v2/types/listen_v2configure_success.py.bak b/src/deepgram/listen/v2/types/listen_v2configure_success.py.bak deleted file mode 100644 index 0faaec9d..00000000 --- a/src/deepgram/listen/v2/types/listen_v2configure_success.py.bak +++ /dev/null @@ -1,60 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ....core.pydantic_utilities import IS_PYDANTIC_V2 -from ....types.listen_v2configure_numerals import ListenV2ConfigureNumerals -from ....types.listen_v2keyterm import ListenV2Keyterm -from ._dict_compat import ListenV2ResponseDictCompatModel -from .listen_v2configure_success_thresholds import ListenV2ConfigureSuccessThresholds - - -class ListenV2ConfigureSuccess(ListenV2ResponseDictCompatModel): - type: typing.Literal["ConfigureSuccess"] = pydantic.Field(default="ConfigureSuccess") - """ - Message type identifier - """ - - request_id: str = pydantic.Field() - """ - The unique identifier of the request - """ - - thresholds: ListenV2ConfigureSuccessThresholds = pydantic.Field() - """ - Updates each parameter, if it is supplied. If a particular threshold parameter - is not supplied, the configuration continues using the currently configured value. - """ - - keyterms: ListenV2Keyterm - language_hints: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - The currently active language hints. Only applicable to the flux-general-multi model. - """ - - numerals: typing.Optional[ListenV2ConfigureNumerals] = pydantic.Field(default=None) - """ - Whether numeral formatting is enabled for transcripts Flux STT sends after it processes the update. - """ - - redact_usage: typing.Optional[bool] = pydantic.Field(default=None) - """ - Whether usage redaction is on for this connection. - """ - - sequence_id: int = pydantic.Field() - """ - Starts at `0` and increments for each message the server sends - to the client. This includes messages of other types, like - `TurnInfo` messages. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/deepgram/listen/v2/types/listen_v2configure_success_thresholds.py b/src/deepgram/listen/v2/types/listen_v2configure_success_thresholds.py index 6c719233..e0353ec9 100644 --- a/src/deepgram/listen/v2/types/listen_v2configure_success_thresholds.py +++ b/src/deepgram/listen/v2/types/listen_v2configure_success_thresholds.py @@ -4,13 +4,13 @@ import pydantic from ....core.pydantic_utilities import IS_PYDANTIC_V2 -from ....core.unchecked_base_model import UncheckedBaseModel from ....types.listen_v2eager_eot_threshold import ListenV2EagerEotThreshold from ....types.listen_v2eot_threshold import ListenV2EotThreshold from ....types.listen_v2eot_timeout_ms import ListenV2EotTimeoutMs +from ._dict_compat import ListenV2ResponseDictCompatModel -class ListenV2ConfigureSuccessThresholds(UncheckedBaseModel): +class ListenV2ConfigureSuccessThresholds(ListenV2ResponseDictCompatModel): """ Updates each parameter, if it is supplied. If a particular threshold parameter is not supplied, the configuration continues using the currently configured value. diff --git a/src/deepgram/listen/v2/types/listen_v2configure_success_thresholds.py.bak b/src/deepgram/listen/v2/types/listen_v2configure_success_thresholds.py.bak deleted file mode 100644 index e0353ec9..00000000 --- a/src/deepgram/listen/v2/types/listen_v2configure_success_thresholds.py.bak +++ /dev/null @@ -1,30 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ....core.pydantic_utilities import IS_PYDANTIC_V2 -from ....types.listen_v2eager_eot_threshold import ListenV2EagerEotThreshold -from ....types.listen_v2eot_threshold import ListenV2EotThreshold -from ....types.listen_v2eot_timeout_ms import ListenV2EotTimeoutMs -from ._dict_compat import ListenV2ResponseDictCompatModel - - -class ListenV2ConfigureSuccessThresholds(ListenV2ResponseDictCompatModel): - """ - Updates each parameter, if it is supplied. If a particular threshold parameter - is not supplied, the configuration continues using the currently configured value. - """ - - eager_eot_threshold: typing.Optional[ListenV2EagerEotThreshold] = None - eot_threshold: typing.Optional[ListenV2EotThreshold] = None - eot_timeout_ms: typing.Optional[ListenV2EotTimeoutMs] = None - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/deepgram/listen/v2/types/listen_v2connected.py b/src/deepgram/listen/v2/types/listen_v2connected.py index cefc0236..b253d86c 100644 --- a/src/deepgram/listen/v2/types/listen_v2connected.py +++ b/src/deepgram/listen/v2/types/listen_v2connected.py @@ -4,10 +4,10 @@ import pydantic from ....core.pydantic_utilities import IS_PYDANTIC_V2 -from ....core.unchecked_base_model import UncheckedBaseModel +from ._dict_compat import ListenV2ResponseDictCompatModel -class ListenV2Connected(UncheckedBaseModel): +class ListenV2Connected(ListenV2ResponseDictCompatModel): type: typing.Literal["Connected"] = pydantic.Field(default="Connected") """ Message type identifier diff --git a/src/deepgram/listen/v2/types/listen_v2connected.py.bak b/src/deepgram/listen/v2/types/listen_v2connected.py.bak deleted file mode 100644 index b253d86c..00000000 --- a/src/deepgram/listen/v2/types/listen_v2connected.py.bak +++ /dev/null @@ -1,35 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ....core.pydantic_utilities import IS_PYDANTIC_V2 -from ._dict_compat import ListenV2ResponseDictCompatModel - - -class ListenV2Connected(ListenV2ResponseDictCompatModel): - type: typing.Literal["Connected"] = pydantic.Field(default="Connected") - """ - Message type identifier - """ - - request_id: str = pydantic.Field() - """ - The unique identifier of the request - """ - - sequence_id: int = pydantic.Field() - """ - Starts at `0` and increments for each message the server sends - to the client. This includes messages of other types, like - `TurnInfo` messages. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/deepgram/listen/v2/types/listen_v2fatal_error.py b/src/deepgram/listen/v2/types/listen_v2fatal_error.py index c5106f07..2202c82e 100644 --- a/src/deepgram/listen/v2/types/listen_v2fatal_error.py +++ b/src/deepgram/listen/v2/types/listen_v2fatal_error.py @@ -4,10 +4,10 @@ import pydantic from ....core.pydantic_utilities import IS_PYDANTIC_V2 -from ....core.unchecked_base_model import UncheckedBaseModel +from ._dict_compat import ListenV2ResponseDictCompatModel -class ListenV2FatalError(UncheckedBaseModel): +class ListenV2FatalError(ListenV2ResponseDictCompatModel): type: typing.Literal["Error"] = pydantic.Field(default="Error") """ Message type identifier diff --git a/src/deepgram/listen/v2/types/listen_v2fatal_error.py.bak b/src/deepgram/listen/v2/types/listen_v2fatal_error.py.bak deleted file mode 100644 index 2202c82e..00000000 --- a/src/deepgram/listen/v2/types/listen_v2fatal_error.py.bak +++ /dev/null @@ -1,40 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ....core.pydantic_utilities import IS_PYDANTIC_V2 -from ._dict_compat import ListenV2ResponseDictCompatModel - - -class ListenV2FatalError(ListenV2ResponseDictCompatModel): - type: typing.Literal["Error"] = pydantic.Field(default="Error") - """ - Message type identifier - """ - - sequence_id: int = pydantic.Field() - """ - Starts at `0` and increments for each message the server sends - to the client. This includes messages of other types, like - `Connected` messages. - """ - - code: str = pydantic.Field() - """ - A string code describing the error, e.g. `INTERNAL_SERVER_ERROR` - """ - - description: str = pydantic.Field() - """ - Prose description of the error - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/deepgram/listen/v2/types/listen_v2turn_info.py b/src/deepgram/listen/v2/types/listen_v2turn_info.py index d87a1032..969d6d0c 100644 --- a/src/deepgram/listen/v2/types/listen_v2turn_info.py +++ b/src/deepgram/listen/v2/types/listen_v2turn_info.py @@ -4,12 +4,12 @@ import pydantic from ....core.pydantic_utilities import IS_PYDANTIC_V2 -from ....core.unchecked_base_model import UncheckedBaseModel +from ._dict_compat import ListenV2ResponseDictCompatModel from .listen_v2turn_info_event import ListenV2TurnInfoEvent from .listen_v2turn_info_words_item import ListenV2TurnInfoWordsItem -class ListenV2TurnInfo(UncheckedBaseModel): +class ListenV2TurnInfo(ListenV2ResponseDictCompatModel): """ Describes the current turn and latest state of the turn """ diff --git a/src/deepgram/listen/v2/types/listen_v2turn_info.py.bak b/src/deepgram/listen/v2/types/listen_v2turn_info.py.bak deleted file mode 100644 index 969d6d0c..00000000 --- a/src/deepgram/listen/v2/types/listen_v2turn_info.py.bak +++ /dev/null @@ -1,102 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ....core.pydantic_utilities import IS_PYDANTIC_V2 -from ._dict_compat import ListenV2ResponseDictCompatModel -from .listen_v2turn_info_event import ListenV2TurnInfoEvent -from .listen_v2turn_info_words_item import ListenV2TurnInfoWordsItem - - -class ListenV2TurnInfo(ListenV2ResponseDictCompatModel): - """ - Describes the current turn and latest state of the turn - """ - - type: typing.Literal["TurnInfo"] = "TurnInfo" - request_id: str = pydantic.Field() - """ - The unique identifier of the request - """ - - sequence_id: int = pydantic.Field() - """ - Starts at `0` and increments for each message the server sends to the client. This includes messages of other types, like `Connected` messages. - """ - - event: ListenV2TurnInfoEvent = pydantic.Field() - """ - The type of event being reported. - - - **Update** - Additional audio has been transcribed, but the turn state hasn't changed - - **StartOfTurn** - The user has begun speaking for the first time in the turn - - **EagerEndOfTurn** - The system has moderate confidence that the user has finished speaking for the turn. This is an opportunity to begin preparing an agent reply - - **TurnResumed** - The system detected that speech had ended and therefore sent an **EagerEndOfTurn** event, but speech is actually continuing for this turn - - **EndOfTurn** - The user has finished speaking for the turn - """ - - turn_index: int = pydantic.Field() - """ - The index of the current turn - """ - - audio_window_start: float = pydantic.Field() - """ - Start time in seconds of the audio range that was transcribed - """ - - audio_window_end: float = pydantic.Field() - """ - End time in seconds of the audio range that was transcribed - """ - - transcript: str = pydantic.Field() - """ - Text that was said over the course of the current turn - """ - - words: typing.List[ListenV2TurnInfoWordsItem] = pydantic.Field() - """ - The words in the `transcript` - """ - - end_of_turn_confidence: float = pydantic.Field() - """ - Confidence that no more speech is coming in this turn - """ - - trigger: typing.Optional[str] = pydantic.Field(default=None) - """ - The cause of the turn ending. Present on every `EndOfTurn` event and only there. - - - **model** - the turn ended by Flux's native end-of-turn detection - - - **manual** - the turn ended because a `ForceEndTurn` message was sent - - - **timeout** - the turn ended because `eot_timeout_ms` elapsed - - This is an open enum. New values may be added over time, so clients must tolerate values they do not recognize. - """ - - languages: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - Detected languages sorted by descending frequency in the - transcript. Only present when the flux-general-multi model - detects languages in the audio. - """ - - languages_hinted: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - The language hints that were supplied for this turn. Only - present when language hints are configured. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/deepgram/listen/v2/types/listen_v2turn_info_words_item.py b/src/deepgram/listen/v2/types/listen_v2turn_info_words_item.py index 07ada673..88240cd9 100644 --- a/src/deepgram/listen/v2/types/listen_v2turn_info_words_item.py +++ b/src/deepgram/listen/v2/types/listen_v2turn_info_words_item.py @@ -4,10 +4,10 @@ import pydantic from ....core.pydantic_utilities import IS_PYDANTIC_V2 -from ....core.unchecked_base_model import UncheckedBaseModel +from ._dict_compat import ListenV2ResponseDictCompatModel -class ListenV2TurnInfoWordsItem(UncheckedBaseModel): +class ListenV2TurnInfoWordsItem(ListenV2ResponseDictCompatModel): word: str = pydantic.Field() """ The individual punctuated, properly-cased word from the transcript diff --git a/src/deepgram/listen/v2/types/listen_v2turn_info_words_item.py.bak b/src/deepgram/listen/v2/types/listen_v2turn_info_words_item.py.bak deleted file mode 100644 index 88240cd9..00000000 --- a/src/deepgram/listen/v2/types/listen_v2turn_info_words_item.py.bak +++ /dev/null @@ -1,38 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ....core.pydantic_utilities import IS_PYDANTIC_V2 -from ._dict_compat import ListenV2ResponseDictCompatModel - - -class ListenV2TurnInfoWordsItem(ListenV2ResponseDictCompatModel): - word: str = pydantic.Field() - """ - The individual punctuated, properly-cased word from the transcript - """ - - confidence: float = pydantic.Field() - """ - Confidence that this word was transcribed correctly - """ - - start: typing.Optional[float] = pydantic.Field(default=None) - """ - The start time of the word - """ - - end: typing.Optional[float] = pydantic.Field(default=None) - """ - The end time of the word - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/deepgram/listen/v2/types/listen_v2warning.py b/src/deepgram/listen/v2/types/listen_v2warning.py index c392cd25..19bfe19a 100644 --- a/src/deepgram/listen/v2/types/listen_v2warning.py +++ b/src/deepgram/listen/v2/types/listen_v2warning.py @@ -4,10 +4,10 @@ import pydantic from ....core.pydantic_utilities import IS_PYDANTIC_V2 -from ....core.unchecked_base_model import UncheckedBaseModel +from ._dict_compat import ListenV2ResponseDictCompatModel -class ListenV2Warning(UncheckedBaseModel): +class ListenV2Warning(ListenV2ResponseDictCompatModel): type: typing.Literal["Warning"] = pydantic.Field(default="Warning") """ Message type identifier diff --git a/src/deepgram/listen/v2/types/listen_v2warning.py.bak b/src/deepgram/listen/v2/types/listen_v2warning.py.bak deleted file mode 100644 index 19bfe19a..00000000 --- a/src/deepgram/listen/v2/types/listen_v2warning.py.bak +++ /dev/null @@ -1,45 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ....core.pydantic_utilities import IS_PYDANTIC_V2 -from ._dict_compat import ListenV2ResponseDictCompatModel - - -class ListenV2Warning(ListenV2ResponseDictCompatModel): - type: typing.Literal["Warning"] = pydantic.Field(default="Warning") - """ - Message type identifier - """ - - request_id: str = pydantic.Field() - """ - The unique identifier of the request - """ - - sequence_id: int = pydantic.Field() - """ - Starts at `0` and increments for each message the server sends - to the client. This includes messages of other types, like - `TurnInfo` messages. - """ - - code: str = pydantic.Field() - """ - Warning code identifying the condition, in `SCREAMING_SNAKE_CASE` - """ - - description: str = pydantic.Field() - """ - A human-readable description of the warning - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/deepgram/manage/v1/projects/keys/client.py b/src/deepgram/manage/v1/projects/keys/client.py index 095defaa..43fc26d7 100644 --- a/src/deepgram/manage/v1/projects/keys/client.py +++ b/src/deepgram/manage/v1/projects/keys/client.py @@ -5,6 +5,7 @@ from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from .....core.request_options import RequestOptions +from .....requests.create_key_v1request import CreateKeyV1RequestParams from .....types.create_key_v1response import CreateKeyV1Response from .....types.delete_project_key_v1response import DeleteProjectKeyV1Response from .....types.get_project_key_v1response import GetProjectKeyV1Response @@ -76,11 +77,12 @@ def create( self, project_id: str, *, - comment: str, - scopes: typing.Sequence[str], + comment: typing.Optional[str] = None, + scopes: typing.Optional[typing.Sequence[str]] = None, tags: typing.Optional[typing.Sequence[str]] = OMIT, expiration_date: typing.Optional[dt.datetime] = OMIT, time_to_live_in_seconds: typing.Optional[float] = OMIT, + request: typing.Optional[CreateKeyV1RequestParams] = None, request_options: typing.Optional[RequestOptions] = None, ) -> CreateKeyV1Response: """ @@ -91,9 +93,9 @@ def create( project_id : str The unique identifier of the project - comment : str + comment : typing.Optional[str] - scopes : typing.Sequence[str] + scopes : typing.Optional[typing.Sequence[str]] tags : typing.Optional[typing.Sequence[str]] @@ -101,6 +103,10 @@ def create( time_to_live_in_seconds : typing.Optional[float] + request : typing.Optional[CreateKeyV1RequestParams] + Deprecated. The pre-2026-12 single-mapping form of this call. Its keys are unpacked + into the arguments above, which take precedence when both are supplied. + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -129,6 +135,7 @@ def create( tags=tags, expiration_date=expiration_date, time_to_live_in_seconds=time_to_live_in_seconds, + request=request, request_options=request_options, ) return _response.data @@ -276,11 +283,12 @@ async def create( self, project_id: str, *, - comment: str, - scopes: typing.Sequence[str], + comment: typing.Optional[str] = None, + scopes: typing.Optional[typing.Sequence[str]] = None, tags: typing.Optional[typing.Sequence[str]] = OMIT, expiration_date: typing.Optional[dt.datetime] = OMIT, time_to_live_in_seconds: typing.Optional[float] = OMIT, + request: typing.Optional[CreateKeyV1RequestParams] = None, request_options: typing.Optional[RequestOptions] = None, ) -> CreateKeyV1Response: """ @@ -291,9 +299,9 @@ async def create( project_id : str The unique identifier of the project - comment : str + comment : typing.Optional[str] - scopes : typing.Sequence[str] + scopes : typing.Optional[typing.Sequence[str]] tags : typing.Optional[typing.Sequence[str]] @@ -301,6 +309,10 @@ async def create( time_to_live_in_seconds : typing.Optional[float] + request : typing.Optional[CreateKeyV1RequestParams] + Deprecated. The pre-2026-12 single-mapping form of this call. Its keys are unpacked + into the arguments above, which take precedence when both are supplied. + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -337,6 +349,7 @@ async def main() -> None: tags=tags, expiration_date=expiration_date, time_to_live_in_seconds=time_to_live_in_seconds, + request=request, request_options=request_options, ) return _response.data diff --git a/src/deepgram/manage/v1/projects/keys/raw_client.py b/src/deepgram/manage/v1/projects/keys/raw_client.py index 18fbf804..8798769a 100644 --- a/src/deepgram/manage/v1/projects/keys/raw_client.py +++ b/src/deepgram/manage/v1/projects/keys/raw_client.py @@ -12,6 +12,7 @@ from .....core.request_options import RequestOptions from .....core.unchecked_base_model import construct_type from .....errors.bad_request_error import BadRequestError +from .....requests.create_key_v1request import CreateKeyV1RequestParams from .....types.create_key_v1response import CreateKeyV1Response from .....types.delete_project_key_v1response import DeleteProjectKeyV1Response from .....types.get_project_key_v1response import GetProjectKeyV1Response @@ -23,6 +24,47 @@ OMIT = typing.cast(typing.Any, ...) +def _build_create_key_body( + request: typing.Optional[typing.Any], + comment: typing.Optional[str], + scopes: typing.Optional[typing.Sequence[str]], + tags: typing.Optional[typing.Sequence[str]], + expiration_date: typing.Optional[dt.datetime], + time_to_live_in_seconds: typing.Optional[float], +) -> typing.Dict[str, typing.Any]: + """Build the create-key request body from either the current or the deprecated call shape. + + Through SDK 7.20 this endpoint took one opaque `request` mapping, typed `Any`, which the SDK + forwarded to the server without validating or filtering it. The 2026-12-01 regen replaced it + with explicit keyword arguments, which raises TypeError for every caller written against an + earlier release, so the old form is still accepted. + + The legacy path stays a passthrough on purpose: unknown keys are forwarded and no field is + required, because the server, not the SDK, decided what a valid body was. Adding validation + here would reject payloads that used to reach the API. Explicit keyword arguments are applied + on top of the mapping, so they win where both supply a key. + """ + body: typing.Dict[str, typing.Any] = {} + if request is not None: + if not isinstance(request, dict): + raise TypeError(f"`request` must be a mapping, got {type(request).__name__}") + body.update(request) + elif comment is None or scopes is None: + missing = "comment" if comment is None else "scopes" + raise TypeError(f"create() missing required keyword argument: {missing!r}") + if comment is not None: + body["comment"] = comment + if scopes is not None: + body["scopes"] = scopes + if tags is not OMIT: + body["tags"] = tags + if expiration_date is not OMIT: + body["expiration_date"] = expiration_date + if time_to_live_in_seconds is not OMIT: + body["time_to_live_in_seconds"] = time_to_live_in_seconds + return body + + class RawKeysClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper @@ -96,11 +138,12 @@ def create( self, project_id: str, *, - comment: str, - scopes: typing.Sequence[str], + comment: typing.Optional[str] = None, + scopes: typing.Optional[typing.Sequence[str]] = None, tags: typing.Optional[typing.Sequence[str]] = OMIT, expiration_date: typing.Optional[dt.datetime] = OMIT, time_to_live_in_seconds: typing.Optional[float] = OMIT, + request: typing.Optional[CreateKeyV1RequestParams] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[CreateKeyV1Response]: """ @@ -111,9 +154,9 @@ def create( project_id : str The unique identifier of the project - comment : str + comment : typing.Optional[str] - scopes : typing.Sequence[str] + scopes : typing.Optional[typing.Sequence[str]] tags : typing.Optional[typing.Sequence[str]] @@ -121,6 +164,10 @@ def create( time_to_live_in_seconds : typing.Optional[float] + request : typing.Optional[CreateKeyV1RequestParams] + Deprecated. The pre-2026-12 single-mapping form of this call. Its keys are forwarded + as the request body; the arguments above override the matching keys. + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -129,17 +176,12 @@ def create( HttpResponse[CreateKeyV1Response] API key created successfully """ + _body = _build_create_key_body(request, comment, scopes, tags, expiration_date, time_to_live_in_seconds) _response = self._client_wrapper.httpx_client.request( f"v1/projects/{encode_path_param(project_id)}/keys", base_url=self._client_wrapper.get_environment().base, method="POST", - json={ - "comment": comment, - "scopes": scopes, - "tags": tags, - "expiration_date": expiration_date, - "time_to_live_in_seconds": time_to_live_in_seconds, - }, + json=_body, headers={ "content-type": "application/json", }, @@ -366,11 +408,12 @@ async def create( self, project_id: str, *, - comment: str, - scopes: typing.Sequence[str], + comment: typing.Optional[str] = None, + scopes: typing.Optional[typing.Sequence[str]] = None, tags: typing.Optional[typing.Sequence[str]] = OMIT, expiration_date: typing.Optional[dt.datetime] = OMIT, time_to_live_in_seconds: typing.Optional[float] = OMIT, + request: typing.Optional[CreateKeyV1RequestParams] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[CreateKeyV1Response]: """ @@ -381,9 +424,9 @@ async def create( project_id : str The unique identifier of the project - comment : str + comment : typing.Optional[str] - scopes : typing.Sequence[str] + scopes : typing.Optional[typing.Sequence[str]] tags : typing.Optional[typing.Sequence[str]] @@ -391,6 +434,10 @@ async def create( time_to_live_in_seconds : typing.Optional[float] + request : typing.Optional[CreateKeyV1RequestParams] + Deprecated. The pre-2026-12 single-mapping form of this call. Its keys are forwarded + as the request body; the arguments above override the matching keys. + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -399,17 +446,12 @@ async def create( AsyncHttpResponse[CreateKeyV1Response] API key created successfully """ + _body = _build_create_key_body(request, comment, scopes, tags, expiration_date, time_to_live_in_seconds) _response = await self._client_wrapper.httpx_client.request( f"v1/projects/{encode_path_param(project_id)}/keys", base_url=self._client_wrapper.get_environment().base, method="POST", - json={ - "comment": comment, - "scopes": scopes, - "tags": tags, - "expiration_date": expiration_date, - "time_to_live_in_seconds": time_to_live_in_seconds, - }, + json=_body, headers={ "content-type": "application/json", }, diff --git a/src/deepgram/requests/__init__.py b/src/deepgram/requests/__init__.py index c75e91f6..93f0b503 100644 --- a/src/deepgram/requests/__init__.py +++ b/src/deepgram/requests/__init__.py @@ -27,6 +27,7 @@ from .cartesia import CartesiaParams from .cartesia_voice import CartesiaVoiceParams from .create_agent_configuration_v1response import CreateAgentConfigurationV1ResponseParams + from .create_key_v1request import CreateKeyV1RequestParams from .create_key_v1response import CreateKeyV1ResponseParams from .create_project_distribution_credentials_v1response import CreateProjectDistributionCredentialsV1ResponseParams from .create_project_distribution_credentials_v1response_distribution_credentials import ( @@ -238,6 +239,7 @@ "CartesiaParams": ".cartesia", "CartesiaVoiceParams": ".cartesia_voice", "CreateAgentConfigurationV1ResponseParams": ".create_agent_configuration_v1response", + "CreateKeyV1RequestParams": ".create_key_v1request", "CreateKeyV1ResponseParams": ".create_key_v1response", "CreateProjectDistributionCredentialsV1ResponseDistributionCredentialsParams": ".create_project_distribution_credentials_v1response_distribution_credentials", "CreateProjectDistributionCredentialsV1ResponseMemberParams": ".create_project_distribution_credentials_v1response_member", @@ -391,6 +393,22 @@ "UsageV1ResponseResolutionParams": ".usage_v1response_resolution", } +_dynamic_imports.update( + { + "SharedIntentsResultsParams": ".shared_intents_results", + "SharedIntentsResultsIntentsParams": ".shared_intents_results_intents", + "SharedIntentsResultsIntentsSegmentsItemParams": ".shared_intents_results_intents_segments_item", + "SharedIntentsResultsIntentsSegmentsItemIntentsItemParams": ".shared_intents_results_intents_segments_item_intents_item", + "SharedTopicsResultsParams": ".shared_topics_results", + "SharedTopicsResultsTopicsParams": ".shared_topics_results_topics", + "SharedTopicsResultsTopicsSegmentsItemParams": ".shared_topics_results_topics_segments_item", + "SharedTopicsResultsTopicsSegmentsItemTopicsItemParams": ".shared_topics_results_topics_segments_item_topics_item", + "CartesiaSpeakProviderVoiceParams": ".cartesia_speak_provider_voice", + "CreateKeyV1RequestOneParams": ".create_key_v1request_one", + "DeepgramListenProviderV2LanguageHintParams": ".deepgram_listen_provider_v2language_hint", + } +) + def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) @@ -435,6 +453,7 @@ def __dir__(): "CartesiaParams", "CartesiaVoiceParams", "CreateAgentConfigurationV1ResponseParams", + "CreateKeyV1RequestParams", "CreateKeyV1ResponseParams", "CreateProjectDistributionCredentialsV1ResponseDistributionCredentialsParams", "CreateProjectDistributionCredentialsV1ResponseMemberParams", @@ -587,3 +606,19 @@ def __dir__(): "UsageV1ResponseParams", "UsageV1ResponseResolutionParams", ] + +__all__.extend( + [ + "SharedIntentsResultsParams", + "SharedIntentsResultsIntentsParams", + "SharedIntentsResultsIntentsSegmentsItemParams", + "SharedIntentsResultsIntentsSegmentsItemIntentsItemParams", + "SharedTopicsResultsParams", + "SharedTopicsResultsTopicsParams", + "SharedTopicsResultsTopicsSegmentsItemParams", + "SharedTopicsResultsTopicsSegmentsItemTopicsItemParams", + "CartesiaSpeakProviderVoiceParams", + "CreateKeyV1RequestOneParams", + "DeepgramListenProviderV2LanguageHintParams", + ] +) diff --git a/src/deepgram/requests/__init__.py.bak b/src/deepgram/requests/__init__.py.bak deleted file mode 100644 index beb2e2db..00000000 --- a/src/deepgram/requests/__init__.py.bak +++ /dev/null @@ -1,618 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# isort: skip_file - -import typing -from importlib import import_module - -if typing.TYPE_CHECKING: - from .agent_configuration_v1 import AgentConfigurationV1Params - from .agent_think_models_v1response import AgentThinkModelsV1ResponseParams - from .agent_think_models_v1response_models_item import AgentThinkModelsV1ResponseModelsItemParams - from .agent_think_models_v1response_models_item_id import AgentThinkModelsV1ResponseModelsItemIdParams - from .agent_think_models_v1response_models_item_one import AgentThinkModelsV1ResponseModelsItemOneParams - from .agent_think_models_v1response_models_item_three import AgentThinkModelsV1ResponseModelsItemThreeParams - from .agent_think_models_v1response_models_item_two import AgentThinkModelsV1ResponseModelsItemTwoParams - from .agent_think_models_v1response_models_item_zero import AgentThinkModelsV1ResponseModelsItemZeroParams - from .agent_variable_v1 import AgentVariableV1Params - from .anthropic import AnthropicParams - from .aws_bedrock_think_provider import AwsBedrockThinkProviderParams - from .aws_bedrock_think_provider_credentials import AwsBedrockThinkProviderCredentialsParams - from .aws_polly_speak_provider import AwsPollySpeakProviderParams - from .aws_polly_speak_provider_credentials import AwsPollySpeakProviderCredentialsParams - from .billing_breakdown_v1response import BillingBreakdownV1ResponseParams - from .billing_breakdown_v1response_resolution import BillingBreakdownV1ResponseResolutionParams - from .billing_breakdown_v1response_results_item import BillingBreakdownV1ResponseResultsItemParams - from .billing_breakdown_v1response_results_item_grouping import BillingBreakdownV1ResponseResultsItemGroupingParams - from .cartesia import CartesiaParams - from .cartesia_voice import CartesiaVoiceParams - from .create_agent_configuration_v1response import CreateAgentConfigurationV1ResponseParams - from .create_key_v1request import CreateKeyV1RequestParams - from .create_key_v1response import CreateKeyV1ResponseParams - from .create_project_distribution_credentials_v1response import CreateProjectDistributionCredentialsV1ResponseParams - from .create_project_distribution_credentials_v1response_distribution_credentials import ( - CreateProjectDistributionCredentialsV1ResponseDistributionCredentialsParams, - ) - from .create_project_distribution_credentials_v1response_member import ( - CreateProjectDistributionCredentialsV1ResponseMemberParams, - ) - from .create_project_invite_v1response import CreateProjectInviteV1ResponseParams - from .deepgram import DeepgramParams - from .deepgram_listen_provider_v1 import DeepgramListenProviderV1Params - from .deepgram_listen_provider_v2 import DeepgramListenProviderV2Params - from .deepgram_think_live_provider_v1 import DeepgramThinkLiveProviderV1Params - from .deepgram_think_provider import DeepgramThinkProviderParams - from .delete_project_invite_v1response import DeleteProjectInviteV1ResponseParams - from .delete_project_key_v1response import DeleteProjectKeyV1ResponseParams - from .delete_project_member_v1response import DeleteProjectMemberV1ResponseParams - from .delete_project_v1response import DeleteProjectV1ResponseParams - from .eleven_labs_speak_provider import ElevenLabsSpeakProviderParams - from .error_response import ErrorResponseParams - from .error_response_legacy_error import ErrorResponseLegacyErrorParams - from .error_response_modern_error import ErrorResponseModernErrorParams - from .get_model_v1response import GetModelV1ResponseParams - from .get_model_v1response_batch import GetModelV1ResponseBatchParams - from .get_model_v1response_metadata import GetModelV1ResponseMetadataParams - from .get_model_v1response_metadata_metadata import GetModelV1ResponseMetadataMetadataParams - from .get_project_balance_v1response import GetProjectBalanceV1ResponseParams - from .get_project_distribution_credentials_v1response import GetProjectDistributionCredentialsV1ResponseParams - from .get_project_distribution_credentials_v1response_distribution_credentials import ( - GetProjectDistributionCredentialsV1ResponseDistributionCredentialsParams, - ) - from .get_project_distribution_credentials_v1response_member import ( - GetProjectDistributionCredentialsV1ResponseMemberParams, - ) - from .get_project_key_v1response import GetProjectKeyV1ResponseParams - from .get_project_key_v1response_item import GetProjectKeyV1ResponseItemParams - from .get_project_key_v1response_item_member import GetProjectKeyV1ResponseItemMemberParams - from .get_project_key_v1response_item_member_api_key import GetProjectKeyV1ResponseItemMemberApiKeyParams - from .get_project_request_v1response import GetProjectRequestV1ResponseParams - from .get_project_v1response import GetProjectV1ResponseParams - from .google import GoogleParams - from .grant_v1response import GrantV1ResponseParams - from .groq import GroqParams - from .leave_project_v1response import LeaveProjectV1ResponseParams - from .list_agent_configurations_v1response import ListAgentConfigurationsV1ResponseParams - from .list_agent_variables_v1response import ListAgentVariablesV1ResponseParams - from .list_billing_fields_v1response import ListBillingFieldsV1ResponseParams - from .list_models_v1response import ListModelsV1ResponseParams - from .list_models_v1response_stt_models import ListModelsV1ResponseSttModelsParams - from .list_models_v1response_tts_models import ListModelsV1ResponseTtsModelsParams - from .list_models_v1response_tts_models_metadata import ListModelsV1ResponseTtsModelsMetadataParams - from .list_project_balances_v1response import ListProjectBalancesV1ResponseParams - from .list_project_balances_v1response_balances_item import ListProjectBalancesV1ResponseBalancesItemParams - from .list_project_distribution_credentials_v1response import ListProjectDistributionCredentialsV1ResponseParams - from .list_project_distribution_credentials_v1response_distribution_credentials_item import ( - ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemParams, - ) - from .list_project_distribution_credentials_v1response_distribution_credentials_item_distribution_credentials import ( - ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemDistributionCredentialsParams, - ) - from .list_project_distribution_credentials_v1response_distribution_credentials_item_member import ( - ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemMemberParams, - ) - from .list_project_invites_v1response import ListProjectInvitesV1ResponseParams - from .list_project_invites_v1response_invites_item import ListProjectInvitesV1ResponseInvitesItemParams - from .list_project_keys_v1response import ListProjectKeysV1ResponseParams - from .list_project_keys_v1response_api_keys_item import ListProjectKeysV1ResponseApiKeysItemParams - from .list_project_keys_v1response_api_keys_item_api_key import ListProjectKeysV1ResponseApiKeysItemApiKeyParams - from .list_project_keys_v1response_api_keys_item_member import ListProjectKeysV1ResponseApiKeysItemMemberParams - from .list_project_member_scopes_v1response import ListProjectMemberScopesV1ResponseParams - from .list_project_members_v1response import ListProjectMembersV1ResponseParams - from .list_project_members_v1response_members_item import ListProjectMembersV1ResponseMembersItemParams - from .list_project_purchases_v1response import ListProjectPurchasesV1ResponseParams - from .list_project_purchases_v1response_orders_item import ListProjectPurchasesV1ResponseOrdersItemParams - from .list_project_requests_v1response import ListProjectRequestsV1ResponseParams - from .list_projects_v1response import ListProjectsV1ResponseParams - from .list_projects_v1response_projects_item import ListProjectsV1ResponseProjectsItemParams - from .listen_v1accepted_response import ListenV1AcceptedResponseParams - from .listen_v1language_hint import ListenV1LanguageHintParams - from .listen_v1response import ListenV1ResponseParams - from .listen_v1response_metadata import ListenV1ResponseMetadataParams - from .listen_v1response_metadata_diarize_info import ListenV1ResponseMetadataDiarizeInfoParams - from .listen_v1response_metadata_intents_info import ListenV1ResponseMetadataIntentsInfoParams - from .listen_v1response_metadata_sentiment_info import ListenV1ResponseMetadataSentimentInfoParams - from .listen_v1response_metadata_summary_info import ListenV1ResponseMetadataSummaryInfoParams - from .listen_v1response_metadata_topics_info import ListenV1ResponseMetadataTopicsInfoParams - from .listen_v1response_results import ListenV1ResponseResultsParams - from .listen_v1response_results_channels import ListenV1ResponseResultsChannelsParams - from .listen_v1response_results_channels_item import ListenV1ResponseResultsChannelsItemParams - from .listen_v1response_results_channels_item_alternatives_item import ( - ListenV1ResponseResultsChannelsItemAlternativesItemParams, - ) - from .listen_v1response_results_channels_item_alternatives_item_entities_item import ( - ListenV1ResponseResultsChannelsItemAlternativesItemEntitiesItemParams, - ) - from .listen_v1response_results_channels_item_alternatives_item_paragraphs import ( - ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParams, - ) - from .listen_v1response_results_channels_item_alternatives_item_paragraphs_paragraphs_item import ( - ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParagraphsItemParams, - ) - from .listen_v1response_results_channels_item_alternatives_item_paragraphs_paragraphs_item_sentences_item import ( - ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParagraphsItemSentencesItemParams, - ) - from .listen_v1response_results_channels_item_alternatives_item_summaries_item import ( - ListenV1ResponseResultsChannelsItemAlternativesItemSummariesItemParams, - ) - from .listen_v1response_results_channels_item_alternatives_item_topics_item import ( - ListenV1ResponseResultsChannelsItemAlternativesItemTopicsItemParams, - ) - from .listen_v1response_results_channels_item_alternatives_item_words_item import ( - ListenV1ResponseResultsChannelsItemAlternativesItemWordsItemParams, - ) - from .listen_v1response_results_channels_item_search_item import ListenV1ResponseResultsChannelsItemSearchItemParams - from .listen_v1response_results_channels_item_search_item_hits_item import ( - ListenV1ResponseResultsChannelsItemSearchItemHitsItemParams, - ) - from .listen_v1response_results_summary import ListenV1ResponseResultsSummaryParams - from .listen_v1response_results_utterances import ListenV1ResponseResultsUtterancesParams - from .listen_v1response_results_utterances_item import ListenV1ResponseResultsUtterancesItemParams - from .listen_v1response_results_utterances_item_words_item import ( - ListenV1ResponseResultsUtterancesItemWordsItemParams, - ) - from .listen_v2keyterm import ListenV2KeytermParams - from .listen_v2language_hint import ListenV2LanguageHintParams - from .open_ai_speak_provider import OpenAiSpeakProviderParams - from .open_ai_think_provider import OpenAiThinkProviderParams - from .project_request_response import ProjectRequestResponseParams - from .read_v1request import ReadV1RequestParams - from .read_v1request_text import ReadV1RequestTextParams - from .read_v1request_url import ReadV1RequestUrlParams - from .read_v1response import ReadV1ResponseParams - from .read_v1response_metadata import ReadV1ResponseMetadataParams - from .read_v1response_metadata_metadata import ReadV1ResponseMetadataMetadataParams - from .read_v1response_metadata_metadata_intents_info import ReadV1ResponseMetadataMetadataIntentsInfoParams - from .read_v1response_metadata_metadata_sentiment_info import ReadV1ResponseMetadataMetadataSentimentInfoParams - from .read_v1response_metadata_metadata_summary_info import ReadV1ResponseMetadataMetadataSummaryInfoParams - from .read_v1response_metadata_metadata_topics_info import ReadV1ResponseMetadataMetadataTopicsInfoParams - from .read_v1response_results import ReadV1ResponseResultsParams - from .read_v1response_results_summary import ReadV1ResponseResultsSummaryParams - from .read_v1response_results_summary_results import ReadV1ResponseResultsSummaryResultsParams - from .read_v1response_results_summary_results_summary import ReadV1ResponseResultsSummaryResultsSummaryParams - from .shared_intents import SharedIntentsParams - from .shared_intents_segments_item import SharedIntentsSegmentsItemParams - from .shared_intents_segments_item_intents_item import SharedIntentsSegmentsItemIntentsItemParams - from .shared_sentiments import SharedSentimentsParams - from .shared_sentiments_average import SharedSentimentsAverageParams - from .shared_sentiments_segments_item import SharedSentimentsSegmentsItemParams - from .shared_topics import SharedTopicsParams - from .shared_topics_segments_item import SharedTopicsSegmentsItemParams - from .shared_topics_segments_item_topics_item import SharedTopicsSegmentsItemTopicsItemParams - from .speak_settings_v1 import SpeakSettingsV1Params - from .speak_settings_v1endpoint import SpeakSettingsV1EndpointParams - from .speak_settings_v1provider import ( - SpeakSettingsV1ProviderParams, - SpeakSettingsV1Provider_AwsPollyParams, - SpeakSettingsV1Provider_CartesiaParams, - SpeakSettingsV1Provider_DeepgramParams, - SpeakSettingsV1Provider_ElevenLabsParams, - SpeakSettingsV1Provider_OpenAiParams, - ) - from .speak_v2accepted_response import SpeakV2AcceptedResponseParams - from .think_live_settings_v1 import ThinkLiveSettingsV1Params - from .think_settings_v1 import ThinkSettingsV1Params - from .think_settings_v1context_length import ThinkSettingsV1ContextLengthParams - from .think_settings_v1endpoint import ThinkSettingsV1EndpointParams - from .think_settings_v1functions_item import ThinkSettingsV1FunctionsItemParams - from .think_settings_v1functions_item_endpoint import ThinkSettingsV1FunctionsItemEndpointParams - from .think_settings_v1provider import ( - ThinkSettingsV1ProviderParams, - ThinkSettingsV1Provider_AnthropicParams, - ThinkSettingsV1Provider_AwsBedrockParams, - ThinkSettingsV1Provider_DeepgramParams, - ThinkSettingsV1Provider_GoogleParams, - ThinkSettingsV1Provider_GroqParams, - ThinkSettingsV1Provider_OpenAiParams, - ) - from .update_project_member_scopes_v1response import UpdateProjectMemberScopesV1ResponseParams - from .update_project_v1response import UpdateProjectV1ResponseParams - from .usage_breakdown_v1response import UsageBreakdownV1ResponseParams - from .usage_breakdown_v1response_resolution import UsageBreakdownV1ResponseResolutionParams - from .usage_breakdown_v1response_results_item import UsageBreakdownV1ResponseResultsItemParams - from .usage_breakdown_v1response_results_item_grouping import UsageBreakdownV1ResponseResultsItemGroupingParams - from .usage_fields_v1response import UsageFieldsV1ResponseParams - from .usage_fields_v1response_models_item import UsageFieldsV1ResponseModelsItemParams - from .usage_v1response import UsageV1ResponseParams - from .usage_v1response_resolution import UsageV1ResponseResolutionParams -_dynamic_imports: typing.Dict[str, str] = { - "AgentConfigurationV1Params": ".agent_configuration_v1", - "AgentThinkModelsV1ResponseModelsItemIdParams": ".agent_think_models_v1response_models_item_id", - "AgentThinkModelsV1ResponseModelsItemOneParams": ".agent_think_models_v1response_models_item_one", - "AgentThinkModelsV1ResponseModelsItemParams": ".agent_think_models_v1response_models_item", - "AgentThinkModelsV1ResponseModelsItemThreeParams": ".agent_think_models_v1response_models_item_three", - "AgentThinkModelsV1ResponseModelsItemTwoParams": ".agent_think_models_v1response_models_item_two", - "AgentThinkModelsV1ResponseModelsItemZeroParams": ".agent_think_models_v1response_models_item_zero", - "AgentThinkModelsV1ResponseParams": ".agent_think_models_v1response", - "AgentVariableV1Params": ".agent_variable_v1", - "AnthropicParams": ".anthropic", - "AwsBedrockThinkProviderCredentialsParams": ".aws_bedrock_think_provider_credentials", - "AwsBedrockThinkProviderParams": ".aws_bedrock_think_provider", - "AwsPollySpeakProviderCredentialsParams": ".aws_polly_speak_provider_credentials", - "AwsPollySpeakProviderParams": ".aws_polly_speak_provider", - "BillingBreakdownV1ResponseParams": ".billing_breakdown_v1response", - "BillingBreakdownV1ResponseResolutionParams": ".billing_breakdown_v1response_resolution", - "BillingBreakdownV1ResponseResultsItemGroupingParams": ".billing_breakdown_v1response_results_item_grouping", - "BillingBreakdownV1ResponseResultsItemParams": ".billing_breakdown_v1response_results_item", - "CartesiaParams": ".cartesia", - "CartesiaVoiceParams": ".cartesia_voice", - "CreateAgentConfigurationV1ResponseParams": ".create_agent_configuration_v1response", - "CreateKeyV1RequestParams": ".create_key_v1request", - "CreateKeyV1ResponseParams": ".create_key_v1response", - "CreateProjectDistributionCredentialsV1ResponseDistributionCredentialsParams": ".create_project_distribution_credentials_v1response_distribution_credentials", - "CreateProjectDistributionCredentialsV1ResponseMemberParams": ".create_project_distribution_credentials_v1response_member", - "CreateProjectDistributionCredentialsV1ResponseParams": ".create_project_distribution_credentials_v1response", - "CreateProjectInviteV1ResponseParams": ".create_project_invite_v1response", - "DeepgramListenProviderV1Params": ".deepgram_listen_provider_v1", - "DeepgramListenProviderV2Params": ".deepgram_listen_provider_v2", - "DeepgramParams": ".deepgram", - "DeepgramThinkLiveProviderV1Params": ".deepgram_think_live_provider_v1", - "DeepgramThinkProviderParams": ".deepgram_think_provider", - "DeleteProjectInviteV1ResponseParams": ".delete_project_invite_v1response", - "DeleteProjectKeyV1ResponseParams": ".delete_project_key_v1response", - "DeleteProjectMemberV1ResponseParams": ".delete_project_member_v1response", - "DeleteProjectV1ResponseParams": ".delete_project_v1response", - "ElevenLabsSpeakProviderParams": ".eleven_labs_speak_provider", - "ErrorResponseLegacyErrorParams": ".error_response_legacy_error", - "ErrorResponseModernErrorParams": ".error_response_modern_error", - "ErrorResponseParams": ".error_response", - "GetModelV1ResponseBatchParams": ".get_model_v1response_batch", - "GetModelV1ResponseMetadataMetadataParams": ".get_model_v1response_metadata_metadata", - "GetModelV1ResponseMetadataParams": ".get_model_v1response_metadata", - "GetModelV1ResponseParams": ".get_model_v1response", - "GetProjectBalanceV1ResponseParams": ".get_project_balance_v1response", - "GetProjectDistributionCredentialsV1ResponseDistributionCredentialsParams": ".get_project_distribution_credentials_v1response_distribution_credentials", - "GetProjectDistributionCredentialsV1ResponseMemberParams": ".get_project_distribution_credentials_v1response_member", - "GetProjectDistributionCredentialsV1ResponseParams": ".get_project_distribution_credentials_v1response", - "GetProjectKeyV1ResponseItemMemberApiKeyParams": ".get_project_key_v1response_item_member_api_key", - "GetProjectKeyV1ResponseItemMemberParams": ".get_project_key_v1response_item_member", - "GetProjectKeyV1ResponseItemParams": ".get_project_key_v1response_item", - "GetProjectKeyV1ResponseParams": ".get_project_key_v1response", - "GetProjectRequestV1ResponseParams": ".get_project_request_v1response", - "GetProjectV1ResponseParams": ".get_project_v1response", - "GoogleParams": ".google", - "GrantV1ResponseParams": ".grant_v1response", - "GroqParams": ".groq", - "LeaveProjectV1ResponseParams": ".leave_project_v1response", - "ListAgentConfigurationsV1ResponseParams": ".list_agent_configurations_v1response", - "ListAgentVariablesV1ResponseParams": ".list_agent_variables_v1response", - "ListBillingFieldsV1ResponseParams": ".list_billing_fields_v1response", - "ListModelsV1ResponseParams": ".list_models_v1response", - "ListModelsV1ResponseSttModelsParams": ".list_models_v1response_stt_models", - "ListModelsV1ResponseTtsModelsMetadataParams": ".list_models_v1response_tts_models_metadata", - "ListModelsV1ResponseTtsModelsParams": ".list_models_v1response_tts_models", - "ListProjectBalancesV1ResponseBalancesItemParams": ".list_project_balances_v1response_balances_item", - "ListProjectBalancesV1ResponseParams": ".list_project_balances_v1response", - "ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemDistributionCredentialsParams": ".list_project_distribution_credentials_v1response_distribution_credentials_item_distribution_credentials", - "ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemMemberParams": ".list_project_distribution_credentials_v1response_distribution_credentials_item_member", - "ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemParams": ".list_project_distribution_credentials_v1response_distribution_credentials_item", - "ListProjectDistributionCredentialsV1ResponseParams": ".list_project_distribution_credentials_v1response", - "ListProjectInvitesV1ResponseInvitesItemParams": ".list_project_invites_v1response_invites_item", - "ListProjectInvitesV1ResponseParams": ".list_project_invites_v1response", - "ListProjectKeysV1ResponseApiKeysItemApiKeyParams": ".list_project_keys_v1response_api_keys_item_api_key", - "ListProjectKeysV1ResponseApiKeysItemMemberParams": ".list_project_keys_v1response_api_keys_item_member", - "ListProjectKeysV1ResponseApiKeysItemParams": ".list_project_keys_v1response_api_keys_item", - "ListProjectKeysV1ResponseParams": ".list_project_keys_v1response", - "ListProjectMemberScopesV1ResponseParams": ".list_project_member_scopes_v1response", - "ListProjectMembersV1ResponseMembersItemParams": ".list_project_members_v1response_members_item", - "ListProjectMembersV1ResponseParams": ".list_project_members_v1response", - "ListProjectPurchasesV1ResponseOrdersItemParams": ".list_project_purchases_v1response_orders_item", - "ListProjectPurchasesV1ResponseParams": ".list_project_purchases_v1response", - "ListProjectRequestsV1ResponseParams": ".list_project_requests_v1response", - "ListProjectsV1ResponseParams": ".list_projects_v1response", - "ListProjectsV1ResponseProjectsItemParams": ".list_projects_v1response_projects_item", - "ListenV1AcceptedResponseParams": ".listen_v1accepted_response", - "ListenV1LanguageHintParams": ".listen_v1language_hint", - "ListenV1ResponseMetadataDiarizeInfoParams": ".listen_v1response_metadata_diarize_info", - "ListenV1ResponseMetadataIntentsInfoParams": ".listen_v1response_metadata_intents_info", - "ListenV1ResponseMetadataParams": ".listen_v1response_metadata", - "ListenV1ResponseMetadataSentimentInfoParams": ".listen_v1response_metadata_sentiment_info", - "ListenV1ResponseMetadataSummaryInfoParams": ".listen_v1response_metadata_summary_info", - "ListenV1ResponseMetadataTopicsInfoParams": ".listen_v1response_metadata_topics_info", - "ListenV1ResponseParams": ".listen_v1response", - "ListenV1ResponseResultsChannelsItemAlternativesItemEntitiesItemParams": ".listen_v1response_results_channels_item_alternatives_item_entities_item", - "ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParagraphsItemParams": ".listen_v1response_results_channels_item_alternatives_item_paragraphs_paragraphs_item", - "ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParagraphsItemSentencesItemParams": ".listen_v1response_results_channels_item_alternatives_item_paragraphs_paragraphs_item_sentences_item", - "ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParams": ".listen_v1response_results_channels_item_alternatives_item_paragraphs", - "ListenV1ResponseResultsChannelsItemAlternativesItemParams": ".listen_v1response_results_channels_item_alternatives_item", - "ListenV1ResponseResultsChannelsItemAlternativesItemSummariesItemParams": ".listen_v1response_results_channels_item_alternatives_item_summaries_item", - "ListenV1ResponseResultsChannelsItemAlternativesItemTopicsItemParams": ".listen_v1response_results_channels_item_alternatives_item_topics_item", - "ListenV1ResponseResultsChannelsItemAlternativesItemWordsItemParams": ".listen_v1response_results_channels_item_alternatives_item_words_item", - "ListenV1ResponseResultsChannelsItemParams": ".listen_v1response_results_channels_item", - "ListenV1ResponseResultsChannelsItemSearchItemHitsItemParams": ".listen_v1response_results_channels_item_search_item_hits_item", - "ListenV1ResponseResultsChannelsItemSearchItemParams": ".listen_v1response_results_channels_item_search_item", - "ListenV1ResponseResultsChannelsParams": ".listen_v1response_results_channels", - "ListenV1ResponseResultsParams": ".listen_v1response_results", - "ListenV1ResponseResultsSummaryParams": ".listen_v1response_results_summary", - "ListenV1ResponseResultsUtterancesItemParams": ".listen_v1response_results_utterances_item", - "ListenV1ResponseResultsUtterancesItemWordsItemParams": ".listen_v1response_results_utterances_item_words_item", - "ListenV1ResponseResultsUtterancesParams": ".listen_v1response_results_utterances", - "ListenV2KeytermParams": ".listen_v2keyterm", - "ListenV2LanguageHintParams": ".listen_v2language_hint", - "OpenAiSpeakProviderParams": ".open_ai_speak_provider", - "OpenAiThinkProviderParams": ".open_ai_think_provider", - "ProjectRequestResponseParams": ".project_request_response", - "ReadV1RequestParams": ".read_v1request", - "ReadV1RequestTextParams": ".read_v1request_text", - "ReadV1RequestUrlParams": ".read_v1request_url", - "ReadV1ResponseMetadataMetadataIntentsInfoParams": ".read_v1response_metadata_metadata_intents_info", - "ReadV1ResponseMetadataMetadataParams": ".read_v1response_metadata_metadata", - "ReadV1ResponseMetadataMetadataSentimentInfoParams": ".read_v1response_metadata_metadata_sentiment_info", - "ReadV1ResponseMetadataMetadataSummaryInfoParams": ".read_v1response_metadata_metadata_summary_info", - "ReadV1ResponseMetadataMetadataTopicsInfoParams": ".read_v1response_metadata_metadata_topics_info", - "ReadV1ResponseMetadataParams": ".read_v1response_metadata", - "ReadV1ResponseParams": ".read_v1response", - "ReadV1ResponseResultsParams": ".read_v1response_results", - "ReadV1ResponseResultsSummaryParams": ".read_v1response_results_summary", - "ReadV1ResponseResultsSummaryResultsParams": ".read_v1response_results_summary_results", - "ReadV1ResponseResultsSummaryResultsSummaryParams": ".read_v1response_results_summary_results_summary", - "SharedIntentsParams": ".shared_intents", - "SharedIntentsSegmentsItemIntentsItemParams": ".shared_intents_segments_item_intents_item", - "SharedIntentsSegmentsItemParams": ".shared_intents_segments_item", - "SharedSentimentsAverageParams": ".shared_sentiments_average", - "SharedSentimentsParams": ".shared_sentiments", - "SharedSentimentsSegmentsItemParams": ".shared_sentiments_segments_item", - "SharedTopicsParams": ".shared_topics", - "SharedTopicsSegmentsItemParams": ".shared_topics_segments_item", - "SharedTopicsSegmentsItemTopicsItemParams": ".shared_topics_segments_item_topics_item", - "SpeakSettingsV1EndpointParams": ".speak_settings_v1endpoint", - "SpeakSettingsV1Params": ".speak_settings_v1", - "SpeakSettingsV1ProviderParams": ".speak_settings_v1provider", - "SpeakSettingsV1Provider_AwsPollyParams": ".speak_settings_v1provider", - "SpeakSettingsV1Provider_CartesiaParams": ".speak_settings_v1provider", - "SpeakSettingsV1Provider_DeepgramParams": ".speak_settings_v1provider", - "SpeakSettingsV1Provider_ElevenLabsParams": ".speak_settings_v1provider", - "SpeakSettingsV1Provider_OpenAiParams": ".speak_settings_v1provider", - "SpeakV2AcceptedResponseParams": ".speak_v2accepted_response", - "ThinkLiveSettingsV1Params": ".think_live_settings_v1", - "ThinkSettingsV1ContextLengthParams": ".think_settings_v1context_length", - "ThinkSettingsV1EndpointParams": ".think_settings_v1endpoint", - "ThinkSettingsV1FunctionsItemEndpointParams": ".think_settings_v1functions_item_endpoint", - "ThinkSettingsV1FunctionsItemParams": ".think_settings_v1functions_item", - "ThinkSettingsV1Params": ".think_settings_v1", - "ThinkSettingsV1ProviderParams": ".think_settings_v1provider", - "ThinkSettingsV1Provider_AnthropicParams": ".think_settings_v1provider", - "ThinkSettingsV1Provider_AwsBedrockParams": ".think_settings_v1provider", - "ThinkSettingsV1Provider_DeepgramParams": ".think_settings_v1provider", - "ThinkSettingsV1Provider_GoogleParams": ".think_settings_v1provider", - "ThinkSettingsV1Provider_GroqParams": ".think_settings_v1provider", - "ThinkSettingsV1Provider_OpenAiParams": ".think_settings_v1provider", - "UpdateProjectMemberScopesV1ResponseParams": ".update_project_member_scopes_v1response", - "UpdateProjectV1ResponseParams": ".update_project_v1response", - "UsageBreakdownV1ResponseParams": ".usage_breakdown_v1response", - "UsageBreakdownV1ResponseResolutionParams": ".usage_breakdown_v1response_resolution", - "UsageBreakdownV1ResponseResultsItemGroupingParams": ".usage_breakdown_v1response_results_item_grouping", - "UsageBreakdownV1ResponseResultsItemParams": ".usage_breakdown_v1response_results_item", - "UsageFieldsV1ResponseModelsItemParams": ".usage_fields_v1response_models_item", - "UsageFieldsV1ResponseParams": ".usage_fields_v1response", - "UsageV1ResponseParams": ".usage_v1response", - "UsageV1ResponseResolutionParams": ".usage_v1response_resolution", -} - -_dynamic_imports.update( - { - "SharedIntentsResultsParams": ".shared_intents_results", - "SharedIntentsResultsIntentsParams": ".shared_intents_results_intents", - "SharedIntentsResultsIntentsSegmentsItemParams": ".shared_intents_results_intents_segments_item", - "SharedIntentsResultsIntentsSegmentsItemIntentsItemParams": ".shared_intents_results_intents_segments_item_intents_item", - "SharedTopicsResultsParams": ".shared_topics_results", - "SharedTopicsResultsTopicsParams": ".shared_topics_results_topics", - "SharedTopicsResultsTopicsSegmentsItemParams": ".shared_topics_results_topics_segments_item", - "SharedTopicsResultsTopicsSegmentsItemTopicsItemParams": ".shared_topics_results_topics_segments_item_topics_item", - "CartesiaSpeakProviderVoiceParams": ".cartesia_speak_provider_voice", - "CreateKeyV1RequestOneParams": ".create_key_v1request_one", - "DeepgramListenProviderV2LanguageHintParams": ".deepgram_listen_provider_v2language_hint", - } -) - - -def __getattr__(attr_name: str) -> typing.Any: - module_name = _dynamic_imports.get(attr_name) - if module_name is None: - raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") - try: - module = import_module(module_name, __package__) - if module_name == f".{attr_name}": - return module - else: - return getattr(module, attr_name) - except ImportError as e: - raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e - except AttributeError as e: - raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e - - -def __dir__(): - lazy_attrs = list(_dynamic_imports.keys()) - return sorted(lazy_attrs) - - -__all__ = [ - "AgentConfigurationV1Params", - "AgentThinkModelsV1ResponseModelsItemIdParams", - "AgentThinkModelsV1ResponseModelsItemOneParams", - "AgentThinkModelsV1ResponseModelsItemParams", - "AgentThinkModelsV1ResponseModelsItemThreeParams", - "AgentThinkModelsV1ResponseModelsItemTwoParams", - "AgentThinkModelsV1ResponseModelsItemZeroParams", - "AgentThinkModelsV1ResponseParams", - "AgentVariableV1Params", - "AnthropicParams", - "AwsBedrockThinkProviderCredentialsParams", - "AwsBedrockThinkProviderParams", - "AwsPollySpeakProviderCredentialsParams", - "AwsPollySpeakProviderParams", - "BillingBreakdownV1ResponseParams", - "BillingBreakdownV1ResponseResolutionParams", - "BillingBreakdownV1ResponseResultsItemGroupingParams", - "BillingBreakdownV1ResponseResultsItemParams", - "CartesiaParams", - "CartesiaVoiceParams", - "CreateAgentConfigurationV1ResponseParams", - "CreateKeyV1RequestParams", - "CreateKeyV1ResponseParams", - "CreateProjectDistributionCredentialsV1ResponseDistributionCredentialsParams", - "CreateProjectDistributionCredentialsV1ResponseMemberParams", - "CreateProjectDistributionCredentialsV1ResponseParams", - "CreateProjectInviteV1ResponseParams", - "DeepgramListenProviderV1Params", - "DeepgramListenProviderV2Params", - "DeepgramParams", - "DeepgramThinkLiveProviderV1Params", - "DeepgramThinkProviderParams", - "DeleteProjectInviteV1ResponseParams", - "DeleteProjectKeyV1ResponseParams", - "DeleteProjectMemberV1ResponseParams", - "DeleteProjectV1ResponseParams", - "ElevenLabsSpeakProviderParams", - "ErrorResponseLegacyErrorParams", - "ErrorResponseModernErrorParams", - "ErrorResponseParams", - "GetModelV1ResponseBatchParams", - "GetModelV1ResponseMetadataMetadataParams", - "GetModelV1ResponseMetadataParams", - "GetModelV1ResponseParams", - "GetProjectBalanceV1ResponseParams", - "GetProjectDistributionCredentialsV1ResponseDistributionCredentialsParams", - "GetProjectDistributionCredentialsV1ResponseMemberParams", - "GetProjectDistributionCredentialsV1ResponseParams", - "GetProjectKeyV1ResponseItemMemberApiKeyParams", - "GetProjectKeyV1ResponseItemMemberParams", - "GetProjectKeyV1ResponseItemParams", - "GetProjectKeyV1ResponseParams", - "GetProjectRequestV1ResponseParams", - "GetProjectV1ResponseParams", - "GoogleParams", - "GrantV1ResponseParams", - "GroqParams", - "LeaveProjectV1ResponseParams", - "ListAgentConfigurationsV1ResponseParams", - "ListAgentVariablesV1ResponseParams", - "ListBillingFieldsV1ResponseParams", - "ListModelsV1ResponseParams", - "ListModelsV1ResponseSttModelsParams", - "ListModelsV1ResponseTtsModelsMetadataParams", - "ListModelsV1ResponseTtsModelsParams", - "ListProjectBalancesV1ResponseBalancesItemParams", - "ListProjectBalancesV1ResponseParams", - "ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemDistributionCredentialsParams", - "ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemMemberParams", - "ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemParams", - "ListProjectDistributionCredentialsV1ResponseParams", - "ListProjectInvitesV1ResponseInvitesItemParams", - "ListProjectInvitesV1ResponseParams", - "ListProjectKeysV1ResponseApiKeysItemApiKeyParams", - "ListProjectKeysV1ResponseApiKeysItemMemberParams", - "ListProjectKeysV1ResponseApiKeysItemParams", - "ListProjectKeysV1ResponseParams", - "ListProjectMemberScopesV1ResponseParams", - "ListProjectMembersV1ResponseMembersItemParams", - "ListProjectMembersV1ResponseParams", - "ListProjectPurchasesV1ResponseOrdersItemParams", - "ListProjectPurchasesV1ResponseParams", - "ListProjectRequestsV1ResponseParams", - "ListProjectsV1ResponseParams", - "ListProjectsV1ResponseProjectsItemParams", - "ListenV1AcceptedResponseParams", - "ListenV1LanguageHintParams", - "ListenV1ResponseMetadataDiarizeInfoParams", - "ListenV1ResponseMetadataIntentsInfoParams", - "ListenV1ResponseMetadataParams", - "ListenV1ResponseMetadataSentimentInfoParams", - "ListenV1ResponseMetadataSummaryInfoParams", - "ListenV1ResponseMetadataTopicsInfoParams", - "ListenV1ResponseParams", - "ListenV1ResponseResultsChannelsItemAlternativesItemEntitiesItemParams", - "ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParagraphsItemParams", - "ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParagraphsItemSentencesItemParams", - "ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParams", - "ListenV1ResponseResultsChannelsItemAlternativesItemParams", - "ListenV1ResponseResultsChannelsItemAlternativesItemSummariesItemParams", - "ListenV1ResponseResultsChannelsItemAlternativesItemTopicsItemParams", - "ListenV1ResponseResultsChannelsItemAlternativesItemWordsItemParams", - "ListenV1ResponseResultsChannelsItemParams", - "ListenV1ResponseResultsChannelsItemSearchItemHitsItemParams", - "ListenV1ResponseResultsChannelsItemSearchItemParams", - "ListenV1ResponseResultsChannelsParams", - "ListenV1ResponseResultsParams", - "ListenV1ResponseResultsSummaryParams", - "ListenV1ResponseResultsUtterancesItemParams", - "ListenV1ResponseResultsUtterancesItemWordsItemParams", - "ListenV1ResponseResultsUtterancesParams", - "ListenV2KeytermParams", - "ListenV2LanguageHintParams", - "OpenAiSpeakProviderParams", - "OpenAiThinkProviderParams", - "ProjectRequestResponseParams", - "ReadV1RequestParams", - "ReadV1RequestTextParams", - "ReadV1RequestUrlParams", - "ReadV1ResponseMetadataMetadataIntentsInfoParams", - "ReadV1ResponseMetadataMetadataParams", - "ReadV1ResponseMetadataMetadataSentimentInfoParams", - "ReadV1ResponseMetadataMetadataSummaryInfoParams", - "ReadV1ResponseMetadataMetadataTopicsInfoParams", - "ReadV1ResponseMetadataParams", - "ReadV1ResponseParams", - "ReadV1ResponseResultsParams", - "ReadV1ResponseResultsSummaryParams", - "ReadV1ResponseResultsSummaryResultsParams", - "ReadV1ResponseResultsSummaryResultsSummaryParams", - "SharedIntentsParams", - "SharedIntentsSegmentsItemIntentsItemParams", - "SharedIntentsSegmentsItemParams", - "SharedSentimentsAverageParams", - "SharedSentimentsParams", - "SharedSentimentsSegmentsItemParams", - "SharedTopicsParams", - "SharedTopicsSegmentsItemParams", - "SharedTopicsSegmentsItemTopicsItemParams", - "SpeakSettingsV1EndpointParams", - "SpeakSettingsV1Params", - "SpeakSettingsV1ProviderParams", - "SpeakSettingsV1Provider_AwsPollyParams", - "SpeakSettingsV1Provider_CartesiaParams", - "SpeakSettingsV1Provider_DeepgramParams", - "SpeakSettingsV1Provider_ElevenLabsParams", - "SpeakSettingsV1Provider_OpenAiParams", - "SpeakV2AcceptedResponseParams", - "ThinkLiveSettingsV1Params", - "ThinkSettingsV1ContextLengthParams", - "ThinkSettingsV1EndpointParams", - "ThinkSettingsV1FunctionsItemEndpointParams", - "ThinkSettingsV1FunctionsItemParams", - "ThinkSettingsV1Params", - "ThinkSettingsV1ProviderParams", - "ThinkSettingsV1Provider_AnthropicParams", - "ThinkSettingsV1Provider_AwsBedrockParams", - "ThinkSettingsV1Provider_DeepgramParams", - "ThinkSettingsV1Provider_GoogleParams", - "ThinkSettingsV1Provider_GroqParams", - "ThinkSettingsV1Provider_OpenAiParams", - "UpdateProjectMemberScopesV1ResponseParams", - "UpdateProjectV1ResponseParams", - "UsageBreakdownV1ResponseParams", - "UsageBreakdownV1ResponseResolutionParams", - "UsageBreakdownV1ResponseResultsItemGroupingParams", - "UsageBreakdownV1ResponseResultsItemParams", - "UsageFieldsV1ResponseModelsItemParams", - "UsageFieldsV1ResponseParams", - "UsageV1ResponseParams", - "UsageV1ResponseResolutionParams", -] - -__all__.extend( - [ - "SharedIntentsResultsParams", - "SharedIntentsResultsIntentsParams", - "SharedIntentsResultsIntentsSegmentsItemParams", - "SharedIntentsResultsIntentsSegmentsItemIntentsItemParams", - "SharedTopicsResultsParams", - "SharedTopicsResultsTopicsParams", - "SharedTopicsResultsTopicsSegmentsItemParams", - "SharedTopicsResultsTopicsSegmentsItemTopicsItemParams", - "CartesiaSpeakProviderVoiceParams", - "CreateKeyV1RequestOneParams", - "DeepgramListenProviderV2LanguageHintParams", - ] -) diff --git a/src/deepgram/requests/create_key_v1request.py b/src/deepgram/requests/create_key_v1request.py new file mode 100644 index 00000000..06d4927a --- /dev/null +++ b/src/deepgram/requests/create_key_v1request.py @@ -0,0 +1,8 @@ +# Hand-written compatibility shim recreating `CreateKeyV1RequestParams`, which Fern removed in +# the 2026-12-01 regen when `manage.v1.projects.keys.create` moved from a single opaque `request` +# argument to explicit keyword arguments. See the matching note in +# `src/deepgram/types/create_key_v1request.py`. + +import typing + +CreateKeyV1RequestParams = typing.Union[typing.Any] diff --git a/src/deepgram/requests/shared_intents.py b/src/deepgram/requests/shared_intents.py index 7a618c13..8f699d26 100644 --- a/src/deepgram/requests/shared_intents.py +++ b/src/deepgram/requests/shared_intents.py @@ -3,6 +3,7 @@ import typing import typing_extensions +from .shared_intents_results import SharedIntentsResultsParams from .shared_intents_segments_item import SharedIntentsSegmentsItemParams @@ -12,3 +13,4 @@ class SharedIntentsParams(typing_extensions.TypedDict): """ segments: typing_extensions.NotRequired[typing.Sequence[SharedIntentsSegmentsItemParams]] + results: typing_extensions.NotRequired[SharedIntentsResultsParams] diff --git a/src/deepgram/requests/shared_intents.py.bak b/src/deepgram/requests/shared_intents.py.bak deleted file mode 100644 index 8f699d26..00000000 --- a/src/deepgram/requests/shared_intents.py.bak +++ /dev/null @@ -1,16 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import typing_extensions -from .shared_intents_results import SharedIntentsResultsParams -from .shared_intents_segments_item import SharedIntentsSegmentsItemParams - - -class SharedIntentsParams(typing_extensions.TypedDict): - """ - Output whenever `intents=true` is used - """ - - segments: typing_extensions.NotRequired[typing.Sequence[SharedIntentsSegmentsItemParams]] - results: typing_extensions.NotRequired[SharedIntentsResultsParams] diff --git a/src/deepgram/requests/shared_topics.py b/src/deepgram/requests/shared_topics.py index 4965005e..88c0816d 100644 --- a/src/deepgram/requests/shared_topics.py +++ b/src/deepgram/requests/shared_topics.py @@ -3,6 +3,7 @@ import typing import typing_extensions +from .shared_topics_results import SharedTopicsResultsParams from .shared_topics_segments_item import SharedTopicsSegmentsItemParams @@ -12,3 +13,4 @@ class SharedTopicsParams(typing_extensions.TypedDict): """ segments: typing_extensions.NotRequired[typing.Sequence[SharedTopicsSegmentsItemParams]] + results: typing_extensions.NotRequired[SharedTopicsResultsParams] diff --git a/src/deepgram/requests/shared_topics.py.bak b/src/deepgram/requests/shared_topics.py.bak deleted file mode 100644 index 88c0816d..00000000 --- a/src/deepgram/requests/shared_topics.py.bak +++ /dev/null @@ -1,16 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import typing_extensions -from .shared_topics_results import SharedTopicsResultsParams -from .shared_topics_segments_item import SharedTopicsSegmentsItemParams - - -class SharedTopicsParams(typing_extensions.TypedDict): - """ - Output whenever `topics=true` is used - """ - - segments: typing_extensions.NotRequired[typing.Sequence[SharedTopicsSegmentsItemParams]] - results: typing_extensions.NotRequired[SharedTopicsResultsParams] diff --git a/src/deepgram/speak/v1/socket_client.py b/src/deepgram/speak/v1/socket_client.py index 5de6cd20..f268acb4 100644 --- a/src/deepgram/speak/v1/socket_client.py +++ b/src/deepgram/speak/v1/socket_client.py @@ -3,9 +3,7 @@ import json import logging import typing -from json.decoder import JSONDecodeError -import websockets import websockets.sync.connection as websockets_sync_connection from ...core.events import EventEmitterMixin, EventType from ...core.unchecked_base_model import construct_type @@ -24,7 +22,9 @@ from websockets import WebSocketClientProtocol # type: ignore _logger = logging.getLogger(__name__) -V1SocketClientResponse = typing.Union[bytes, SpeakV1Metadata, SpeakV1Flushed, SpeakV1Cleared, SpeakV1Warning] +V1SocketClientResponse = typing.Union[ + bytes, SpeakV1Metadata, SpeakV1Flushed, SpeakV1Cleared, SpeakV1Warning, typing.Dict[str, typing.Any] +] class AsyncV1SocketClient(EventEmitterMixin): @@ -70,7 +70,7 @@ async def start_listening(self): ) continue await self._emit_async(EventType.MESSAGE, parsed) - except (websockets.WebSocketException, JSONDecodeError) as exc: + except Exception as exc: await self._emit_async(EventType.ERROR, exc) finally: await self._emit_async(EventType.CLOSE, None) @@ -82,26 +82,26 @@ async def send_text(self, message: SpeakV1Text) -> None: """ await self._send_model(message) - async def send_flush(self, message: SpeakV1Flush) -> None: + async def send_flush(self, message: typing.Optional[SpeakV1Flush] = None) -> None: """ Send a message to the websocket connection. The message will be sent as a SpeakV1Flush. """ - await self._send_model(message) + await self._send_model(message or SpeakV1Flush(type="Flush")) - async def send_clear(self, message: SpeakV1Clear) -> None: + async def send_clear(self, message: typing.Optional[SpeakV1Clear] = None) -> None: """ Send a message to the websocket connection. The message will be sent as a SpeakV1Clear. """ - await self._send_model(message) + await self._send_model(message or SpeakV1Clear(type="Clear")) - async def send_close(self, message: SpeakV1Close) -> None: + async def send_close(self, message: typing.Optional[SpeakV1Close] = None) -> None: """ Send a message to the websocket connection. The message will be sent as a SpeakV1Close. """ - await self._send_model(message) + await self._send_model(message or SpeakV1Close(type="Close")) async def recv(self) -> V1SocketClientResponse: """ @@ -175,7 +175,7 @@ def start_listening(self): ) continue self._emit(EventType.MESSAGE, parsed) - except (websockets.WebSocketException, JSONDecodeError) as exc: + except Exception as exc: self._emit(EventType.ERROR, exc) finally: self._emit(EventType.CLOSE, None) @@ -187,26 +187,26 @@ def send_text(self, message: SpeakV1Text) -> None: """ self._send_model(message) - def send_flush(self, message: SpeakV1Flush) -> None: + def send_flush(self, message: typing.Optional[SpeakV1Flush] = None) -> None: """ Send a message to the websocket connection. The message will be sent as a SpeakV1Flush. """ - self._send_model(message) + self._send_model(message or SpeakV1Flush(type="Flush")) - def send_clear(self, message: SpeakV1Clear) -> None: + def send_clear(self, message: typing.Optional[SpeakV1Clear] = None) -> None: """ Send a message to the websocket connection. The message will be sent as a SpeakV1Clear. """ - self._send_model(message) + self._send_model(message or SpeakV1Clear(type="Clear")) - def send_close(self, message: SpeakV1Close) -> None: + def send_close(self, message: typing.Optional[SpeakV1Close] = None) -> None: """ Send a message to the websocket connection. The message will be sent as a SpeakV1Close. """ - self._send_model(message) + self._send_model(message or SpeakV1Close(type="Close")) def recv(self) -> V1SocketClientResponse: """ diff --git a/src/deepgram/speak/v1/socket_client.py.bak b/src/deepgram/speak/v1/socket_client.py.bak deleted file mode 100644 index f268acb4..00000000 --- a/src/deepgram/speak/v1/socket_client.py.bak +++ /dev/null @@ -1,237 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import json -import logging -import typing - -import websockets.sync.connection as websockets_sync_connection -from ...core.events import EventEmitterMixin, EventType -from ...core.unchecked_base_model import construct_type -from .types.speak_v1clear import SpeakV1Clear -from .types.speak_v1cleared import SpeakV1Cleared -from .types.speak_v1close import SpeakV1Close -from .types.speak_v1flush import SpeakV1Flush -from .types.speak_v1flushed import SpeakV1Flushed -from .types.speak_v1metadata import SpeakV1Metadata -from .types.speak_v1text import SpeakV1Text -from .types.speak_v1warning import SpeakV1Warning - -try: - from websockets.legacy.client import WebSocketClientProtocol # type: ignore -except ImportError: - from websockets import WebSocketClientProtocol # type: ignore - -_logger = logging.getLogger(__name__) -V1SocketClientResponse = typing.Union[ - bytes, SpeakV1Metadata, SpeakV1Flushed, SpeakV1Cleared, SpeakV1Warning, typing.Dict[str, typing.Any] -] - - -class AsyncV1SocketClient(EventEmitterMixin): - def __init__(self, *, websocket: WebSocketClientProtocol): - super().__init__() - self._websocket = websocket - - async def __aiter__(self) -> typing.AsyncIterator[V1SocketClientResponse]: - async for message in self._websocket: - if isinstance(message, bytes): - yield message # type: ignore - else: - try: - yield construct_type(type_=V1SocketClientResponse, object_=json.loads(message)) # type: ignore - except Exception: - _logger.warning( - "Skipping unknown WebSocket message; update your SDK version to support new message types." - ) - continue - - async def start_listening(self): - """ - Start listening for messages on the websocket connection. - - Emits events in the following order: - - EventType.OPEN when connection is established - - EventType.MESSAGE for each message received - - EventType.ERROR if an error occurs - - EventType.CLOSE when connection is closed - """ - await self._emit_async(EventType.OPEN, None) - try: - async for raw_message in self._websocket: - if isinstance(raw_message, bytes): - parsed = raw_message - else: - json_data = json.loads(raw_message) - try: - parsed = construct_type(type_=V1SocketClientResponse, object_=json_data) # type: ignore - except Exception: - _logger.warning( - "Skipping unknown WebSocket message; update your SDK version to support new message types." - ) - continue - await self._emit_async(EventType.MESSAGE, parsed) - except Exception as exc: - await self._emit_async(EventType.ERROR, exc) - finally: - await self._emit_async(EventType.CLOSE, None) - - async def send_text(self, message: SpeakV1Text) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a SpeakV1Text. - """ - await self._send_model(message) - - async def send_flush(self, message: typing.Optional[SpeakV1Flush] = None) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a SpeakV1Flush. - """ - await self._send_model(message or SpeakV1Flush(type="Flush")) - - async def send_clear(self, message: typing.Optional[SpeakV1Clear] = None) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a SpeakV1Clear. - """ - await self._send_model(message or SpeakV1Clear(type="Clear")) - - async def send_close(self, message: typing.Optional[SpeakV1Close] = None) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a SpeakV1Close. - """ - await self._send_model(message or SpeakV1Close(type="Close")) - - async def recv(self) -> V1SocketClientResponse: - """ - Receive a message from the websocket connection. - """ - data = await self._websocket.recv() - if isinstance(data, bytes): - return data # type: ignore - json_data = json.loads(data) - try: - return construct_type(type_=V1SocketClientResponse, object_=json_data) # type: ignore - except Exception: - _logger.warning("Skipping unknown WebSocket message; update your SDK version to support new message types.") - return json_data # type: ignore - - async def _send(self, data: typing.Any) -> None: - """ - Send a message to the websocket connection. - """ - if isinstance(data, dict): - data = json.dumps(data) - await self._websocket.send(data) - - async def _send_model(self, data: typing.Any) -> None: - """ - Send a Pydantic model to the websocket connection. - """ - await self._send(data.dict()) - - -class V1SocketClient(EventEmitterMixin): - def __init__(self, *, websocket: websockets_sync_connection.Connection): - super().__init__() - self._websocket = websocket - - def __iter__(self) -> typing.Iterator[V1SocketClientResponse]: - for message in self._websocket: - if isinstance(message, bytes): - yield message # type: ignore - else: - try: - yield construct_type(type_=V1SocketClientResponse, object_=json.loads(message)) # type: ignore - except Exception: - _logger.warning( - "Skipping unknown WebSocket message; update your SDK version to support new message types." - ) - continue - - def start_listening(self): - """ - Start listening for messages on the websocket connection. - - Emits events in the following order: - - EventType.OPEN when connection is established - - EventType.MESSAGE for each message received - - EventType.ERROR if an error occurs - - EventType.CLOSE when connection is closed - """ - self._emit(EventType.OPEN, None) - try: - for raw_message in self._websocket: - if isinstance(raw_message, bytes): - parsed = raw_message - else: - json_data = json.loads(raw_message) - try: - parsed = construct_type(type_=V1SocketClientResponse, object_=json_data) # type: ignore - except Exception: - _logger.warning( - "Skipping unknown WebSocket message; update your SDK version to support new message types." - ) - continue - self._emit(EventType.MESSAGE, parsed) - except Exception as exc: - self._emit(EventType.ERROR, exc) - finally: - self._emit(EventType.CLOSE, None) - - def send_text(self, message: SpeakV1Text) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a SpeakV1Text. - """ - self._send_model(message) - - def send_flush(self, message: typing.Optional[SpeakV1Flush] = None) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a SpeakV1Flush. - """ - self._send_model(message or SpeakV1Flush(type="Flush")) - - def send_clear(self, message: typing.Optional[SpeakV1Clear] = None) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a SpeakV1Clear. - """ - self._send_model(message or SpeakV1Clear(type="Clear")) - - def send_close(self, message: typing.Optional[SpeakV1Close] = None) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a SpeakV1Close. - """ - self._send_model(message or SpeakV1Close(type="Close")) - - def recv(self) -> V1SocketClientResponse: - """ - Receive a message from the websocket connection. - """ - data = self._websocket.recv() - if isinstance(data, bytes): - return data # type: ignore - json_data = json.loads(data) - try: - return construct_type(type_=V1SocketClientResponse, object_=json_data) # type: ignore - except Exception: - _logger.warning("Skipping unknown WebSocket message; update your SDK version to support new message types.") - return json_data # type: ignore - - def _send(self, data: typing.Any) -> None: - """ - Send a message to the websocket connection. - """ - if isinstance(data, dict): - data = json.dumps(data) - self._websocket.send(data) - - def _send_model(self, data: typing.Any) -> None: - """ - Send a Pydantic model to the websocket connection. - """ - self._send(data.dict()) diff --git a/src/deepgram/speak/v2/requests/speak_v2warning.py b/src/deepgram/speak/v2/requests/speak_v2warning.py index e16df4d6..6686af44 100644 --- a/src/deepgram/speak/v2/requests/speak_v2warning.py +++ b/src/deepgram/speak/v2/requests/speak_v2warning.py @@ -14,13 +14,13 @@ class SpeakV2WarningParams(typing_extensions.TypedDict): code: str """ Warning code identifying the condition, in `SCREAMING_SNAKE_CASE`. - + Turn-scoped codes: `NO_ACTIVE_SPEECH` (a speech-scoped message arrived with no active turn), `NO_SYNTHESIZABLE_TEXT` (the turn's text was entirely whitespace or punctuation, so it produced no audio and is completed with a zero-duration `SpeechMetadata`), and `SYNTHESIS_RETRYING` (a synthesis request failed and is being retried). - + Pronunciation codes: `PRONUNCIATION_WARNINGS` (a pronunciation override contained invalid IPA; it is still applied best-effort and counted in `pronunciations_applied`), `PRONUNCIATION_TOO_LONG` (an IPA string exceeded the length limit), `PRONUNCIATIONS_LIMIT_EXCEEDED` (too many pronunciation controls in one turn). - + Pause codes (`BREAKS_LIMIT_EXCEEDED`, `BREAK_TOKENS_OUT_OF_RANGE`, `BREAK_TOKENS_WITH_INVALID_INCREMENTS`) are reserved and not emitted: inline pause controls are batch-only, and a pause marker on the WebSocket fails the connection instead. - + Interrupt-scoped codes, each meaning the `Interrupt` was ignored: `NO_AUDIO_GENERATED` (the session has produced no audio yet, so there is nothing to interrupt), `INTERRUPT_IN_PROGRESS` (an earlier `Interrupt` is still being processed — at most one is handled at a time), `INVALID_INTERRUPT_OFFSET` (the `playback_offset` did not advance past the position a prior interrupt established). """ diff --git a/src/deepgram/speak/v2/requests/speak_v2warning.py.bak b/src/deepgram/speak/v2/requests/speak_v2warning.py.bak deleted file mode 100644 index 6686af44..00000000 --- a/src/deepgram/speak/v2/requests/speak_v2warning.py.bak +++ /dev/null @@ -1,30 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import typing_extensions - - -class SpeakV2WarningParams(typing_extensions.TypedDict): - type: typing.Literal["Warning"] - """ - Message type identifier - """ - - code: str - """ - Warning code identifying the condition, in `SCREAMING_SNAKE_CASE`. - - Turn-scoped codes: `NO_ACTIVE_SPEECH` (a speech-scoped message arrived with no active turn), `NO_SYNTHESIZABLE_TEXT` (the turn's text was entirely whitespace or punctuation, so it produced no audio and is completed with a zero-duration `SpeechMetadata`), and `SYNTHESIS_RETRYING` (a synthesis request failed and is being retried). - - Pronunciation codes: `PRONUNCIATION_WARNINGS` (a pronunciation override contained invalid IPA; it is still applied best-effort and counted in `pronunciations_applied`), `PRONUNCIATION_TOO_LONG` (an IPA string exceeded the length limit), `PRONUNCIATIONS_LIMIT_EXCEEDED` (too many pronunciation controls in one turn). - - Pause codes (`BREAKS_LIMIT_EXCEEDED`, `BREAK_TOKENS_OUT_OF_RANGE`, `BREAK_TOKENS_WITH_INVALID_INCREMENTS`) are reserved and not emitted: inline pause controls are batch-only, and a pause marker on the WebSocket fails the connection instead. - - Interrupt-scoped codes, each meaning the `Interrupt` was ignored: `NO_AUDIO_GENERATED` (the session has produced no audio yet, so there is nothing to interrupt), `INTERRUPT_IN_PROGRESS` (an earlier `Interrupt` is still being processed — at most one is handled at a time), `INVALID_INTERRUPT_OFFSET` (the `playback_offset` did not advance past the position a prior interrupt established). - """ - - description: str - """ - A human-readable description of the warning - """ diff --git a/src/deepgram/speak/v2/socket_client.py b/src/deepgram/speak/v2/socket_client.py index 9e91bfff..57c5f8ab 100644 --- a/src/deepgram/speak/v2/socket_client.py +++ b/src/deepgram/speak/v2/socket_client.py @@ -3,9 +3,7 @@ import json import logging import typing -from json.decoder import JSONDecodeError -import websockets import websockets.sync.connection as websockets_sync_connection from ...core.events import EventEmitterMixin, EventType from ...core.unchecked_base_model import construct_type @@ -43,6 +41,7 @@ SpeakV2ConfigureFailure, SpeakV2Warning, SpeakV2Error, + typing.Dict[str, typing.Any], ] @@ -89,7 +88,7 @@ async def start_listening(self): ) continue await self._emit_async(EventType.MESSAGE, parsed) - except (websockets.WebSocketException, JSONDecodeError) as exc: + except Exception as exc: await self._emit_async(EventType.ERROR, exc) finally: await self._emit_async(EventType.CLOSE, None) @@ -101,19 +100,19 @@ async def send_speak(self, message: SpeakV2Speak) -> None: """ await self._send_model(message) - async def send_flush(self, message: SpeakV2Flush) -> None: + async def send_flush(self, message: typing.Optional[SpeakV2Flush] = None) -> None: """ Send a message to the websocket connection. The message will be sent as a SpeakV2Flush. """ - await self._send_model(message) + await self._send_model(message or SpeakV2Flush(type="Flush")) - async def send_interrupt(self, message: SpeakV2Interrupt) -> None: + async def send_interrupt(self, message: typing.Optional[SpeakV2Interrupt] = None) -> None: """ Send a message to the websocket connection. The message will be sent as a SpeakV2Interrupt. """ - await self._send_model(message) + await self._send_model(message or SpeakV2Interrupt(type="Interrupt")) async def send_configure(self, message: SpeakV2Configure) -> None: """ @@ -122,12 +121,12 @@ async def send_configure(self, message: SpeakV2Configure) -> None: """ await self._send_model(message) - async def send_close(self, message: SpeakV2Close) -> None: + async def send_close(self, message: typing.Optional[SpeakV2Close] = None) -> None: """ Send a message to the websocket connection. The message will be sent as a SpeakV2Close. """ - await self._send_model(message) + await self._send_model(message or SpeakV2Close(type="Close")) async def recv(self) -> V2SocketClientResponse: """ @@ -201,7 +200,7 @@ def start_listening(self): ) continue self._emit(EventType.MESSAGE, parsed) - except (websockets.WebSocketException, JSONDecodeError) as exc: + except Exception as exc: self._emit(EventType.ERROR, exc) finally: self._emit(EventType.CLOSE, None) @@ -213,19 +212,19 @@ def send_speak(self, message: SpeakV2Speak) -> None: """ self._send_model(message) - def send_flush(self, message: SpeakV2Flush) -> None: + def send_flush(self, message: typing.Optional[SpeakV2Flush] = None) -> None: """ Send a message to the websocket connection. The message will be sent as a SpeakV2Flush. """ - self._send_model(message) + self._send_model(message or SpeakV2Flush(type="Flush")) - def send_interrupt(self, message: SpeakV2Interrupt) -> None: + def send_interrupt(self, message: typing.Optional[SpeakV2Interrupt] = None) -> None: """ Send a message to the websocket connection. The message will be sent as a SpeakV2Interrupt. """ - self._send_model(message) + self._send_model(message or SpeakV2Interrupt(type="Interrupt")) def send_configure(self, message: SpeakV2Configure) -> None: """ @@ -234,12 +233,12 @@ def send_configure(self, message: SpeakV2Configure) -> None: """ self._send_model(message) - def send_close(self, message: SpeakV2Close) -> None: + def send_close(self, message: typing.Optional[SpeakV2Close] = None) -> None: """ Send a message to the websocket connection. The message will be sent as a SpeakV2Close. """ - self._send_model(message) + self._send_model(message or SpeakV2Close(type="Close")) def recv(self) -> V2SocketClientResponse: """ diff --git a/src/deepgram/speak/v2/socket_client.py.bak b/src/deepgram/speak/v2/socket_client.py.bak deleted file mode 100644 index 57c5f8ab..00000000 --- a/src/deepgram/speak/v2/socket_client.py.bak +++ /dev/null @@ -1,269 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import json -import logging -import typing - -import websockets.sync.connection as websockets_sync_connection -from ...core.events import EventEmitterMixin, EventType -from ...core.unchecked_base_model import construct_type -from .types.speak_v2close import SpeakV2Close -from .types.speak_v2configure import SpeakV2Configure -from .types.speak_v2configure_failure import SpeakV2ConfigureFailure -from .types.speak_v2configure_success import SpeakV2ConfigureSuccess -from .types.speak_v2connected import SpeakV2Connected -from .types.speak_v2error import SpeakV2Error -from .types.speak_v2flush import SpeakV2Flush -from .types.speak_v2flushed import SpeakV2Flushed -from .types.speak_v2interrupt import SpeakV2Interrupt -from .types.speak_v2session_metadata import SpeakV2SessionMetadata -from .types.speak_v2speak import SpeakV2Speak -from .types.speak_v2speech_interrupted import SpeakV2SpeechInterrupted -from .types.speak_v2speech_metadata import SpeakV2SpeechMetadata -from .types.speak_v2speech_started import SpeakV2SpeechStarted -from .types.speak_v2warning import SpeakV2Warning - -try: - from websockets.legacy.client import WebSocketClientProtocol # type: ignore -except ImportError: - from websockets import WebSocketClientProtocol # type: ignore - -_logger = logging.getLogger(__name__) -V2SocketClientResponse = typing.Union[ - bytes, - SpeakV2Connected, - SpeakV2SpeechStarted, - SpeakV2SpeechMetadata, - SpeakV2SpeechInterrupted, - SpeakV2Flushed, - SpeakV2SessionMetadata, - SpeakV2ConfigureSuccess, - SpeakV2ConfigureFailure, - SpeakV2Warning, - SpeakV2Error, - typing.Dict[str, typing.Any], -] - - -class AsyncV2SocketClient(EventEmitterMixin): - def __init__(self, *, websocket: WebSocketClientProtocol): - super().__init__() - self._websocket = websocket - - async def __aiter__(self) -> typing.AsyncIterator[V2SocketClientResponse]: - async for message in self._websocket: - if isinstance(message, bytes): - yield message # type: ignore - else: - try: - yield construct_type(type_=V2SocketClientResponse, object_=json.loads(message)) # type: ignore - except Exception: - _logger.warning( - "Skipping unknown WebSocket message; update your SDK version to support new message types." - ) - continue - - async def start_listening(self): - """ - Start listening for messages on the websocket connection. - - Emits events in the following order: - - EventType.OPEN when connection is established - - EventType.MESSAGE for each message received - - EventType.ERROR if an error occurs - - EventType.CLOSE when connection is closed - """ - await self._emit_async(EventType.OPEN, None) - try: - async for raw_message in self._websocket: - if isinstance(raw_message, bytes): - parsed = raw_message - else: - json_data = json.loads(raw_message) - try: - parsed = construct_type(type_=V2SocketClientResponse, object_=json_data) # type: ignore - except Exception: - _logger.warning( - "Skipping unknown WebSocket message; update your SDK version to support new message types." - ) - continue - await self._emit_async(EventType.MESSAGE, parsed) - except Exception as exc: - await self._emit_async(EventType.ERROR, exc) - finally: - await self._emit_async(EventType.CLOSE, None) - - async def send_speak(self, message: SpeakV2Speak) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a SpeakV2Speak. - """ - await self._send_model(message) - - async def send_flush(self, message: typing.Optional[SpeakV2Flush] = None) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a SpeakV2Flush. - """ - await self._send_model(message or SpeakV2Flush(type="Flush")) - - async def send_interrupt(self, message: typing.Optional[SpeakV2Interrupt] = None) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a SpeakV2Interrupt. - """ - await self._send_model(message or SpeakV2Interrupt(type="Interrupt")) - - async def send_configure(self, message: SpeakV2Configure) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a SpeakV2Configure. - """ - await self._send_model(message) - - async def send_close(self, message: typing.Optional[SpeakV2Close] = None) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a SpeakV2Close. - """ - await self._send_model(message or SpeakV2Close(type="Close")) - - async def recv(self) -> V2SocketClientResponse: - """ - Receive a message from the websocket connection. - """ - data = await self._websocket.recv() - if isinstance(data, bytes): - return data # type: ignore - json_data = json.loads(data) - try: - return construct_type(type_=V2SocketClientResponse, object_=json_data) # type: ignore - except Exception: - _logger.warning("Skipping unknown WebSocket message; update your SDK version to support new message types.") - return json_data # type: ignore - - async def _send(self, data: typing.Any) -> None: - """ - Send a message to the websocket connection. - """ - if isinstance(data, dict): - data = json.dumps(data) - await self._websocket.send(data) - - async def _send_model(self, data: typing.Any) -> None: - """ - Send a Pydantic model to the websocket connection. - """ - await self._send(data.dict()) - - -class V2SocketClient(EventEmitterMixin): - def __init__(self, *, websocket: websockets_sync_connection.Connection): - super().__init__() - self._websocket = websocket - - def __iter__(self) -> typing.Iterator[V2SocketClientResponse]: - for message in self._websocket: - if isinstance(message, bytes): - yield message # type: ignore - else: - try: - yield construct_type(type_=V2SocketClientResponse, object_=json.loads(message)) # type: ignore - except Exception: - _logger.warning( - "Skipping unknown WebSocket message; update your SDK version to support new message types." - ) - continue - - def start_listening(self): - """ - Start listening for messages on the websocket connection. - - Emits events in the following order: - - EventType.OPEN when connection is established - - EventType.MESSAGE for each message received - - EventType.ERROR if an error occurs - - EventType.CLOSE when connection is closed - """ - self._emit(EventType.OPEN, None) - try: - for raw_message in self._websocket: - if isinstance(raw_message, bytes): - parsed = raw_message - else: - json_data = json.loads(raw_message) - try: - parsed = construct_type(type_=V2SocketClientResponse, object_=json_data) # type: ignore - except Exception: - _logger.warning( - "Skipping unknown WebSocket message; update your SDK version to support new message types." - ) - continue - self._emit(EventType.MESSAGE, parsed) - except Exception as exc: - self._emit(EventType.ERROR, exc) - finally: - self._emit(EventType.CLOSE, None) - - def send_speak(self, message: SpeakV2Speak) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a SpeakV2Speak. - """ - self._send_model(message) - - def send_flush(self, message: typing.Optional[SpeakV2Flush] = None) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a SpeakV2Flush. - """ - self._send_model(message or SpeakV2Flush(type="Flush")) - - def send_interrupt(self, message: typing.Optional[SpeakV2Interrupt] = None) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a SpeakV2Interrupt. - """ - self._send_model(message or SpeakV2Interrupt(type="Interrupt")) - - def send_configure(self, message: SpeakV2Configure) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a SpeakV2Configure. - """ - self._send_model(message) - - def send_close(self, message: typing.Optional[SpeakV2Close] = None) -> None: - """ - Send a message to the websocket connection. - The message will be sent as a SpeakV2Close. - """ - self._send_model(message or SpeakV2Close(type="Close")) - - def recv(self) -> V2SocketClientResponse: - """ - Receive a message from the websocket connection. - """ - data = self._websocket.recv() - if isinstance(data, bytes): - return data # type: ignore - json_data = json.loads(data) - try: - return construct_type(type_=V2SocketClientResponse, object_=json_data) # type: ignore - except Exception: - _logger.warning("Skipping unknown WebSocket message; update your SDK version to support new message types.") - return json_data # type: ignore - - def _send(self, data: typing.Any) -> None: - """ - Send a message to the websocket connection. - """ - if isinstance(data, dict): - data = json.dumps(data) - self._websocket.send(data) - - def _send_model(self, data: typing.Any) -> None: - """ - Send a Pydantic model to the websocket connection. - """ - self._send(data.dict()) diff --git a/src/deepgram/speak/v2/types/speak_v2warning.py b/src/deepgram/speak/v2/types/speak_v2warning.py index e142f323..ac771641 100644 --- a/src/deepgram/speak/v2/types/speak_v2warning.py +++ b/src/deepgram/speak/v2/types/speak_v2warning.py @@ -16,13 +16,13 @@ class SpeakV2Warning(UncheckedBaseModel): code: str = pydantic.Field() """ Warning code identifying the condition, in `SCREAMING_SNAKE_CASE`. - + Turn-scoped codes: `NO_ACTIVE_SPEECH` (a speech-scoped message arrived with no active turn), `NO_SYNTHESIZABLE_TEXT` (the turn's text was entirely whitespace or punctuation, so it produced no audio and is completed with a zero-duration `SpeechMetadata`), and `SYNTHESIS_RETRYING` (a synthesis request failed and is being retried). - + Pronunciation codes: `PRONUNCIATION_WARNINGS` (a pronunciation override contained invalid IPA; it is still applied best-effort and counted in `pronunciations_applied`), `PRONUNCIATION_TOO_LONG` (an IPA string exceeded the length limit), `PRONUNCIATIONS_LIMIT_EXCEEDED` (too many pronunciation controls in one turn). - + Pause codes (`BREAKS_LIMIT_EXCEEDED`, `BREAK_TOKENS_OUT_OF_RANGE`, `BREAK_TOKENS_WITH_INVALID_INCREMENTS`) are reserved and not emitted: inline pause controls are batch-only, and a pause marker on the WebSocket fails the connection instead. - + Interrupt-scoped codes, each meaning the `Interrupt` was ignored: `NO_AUDIO_GENERATED` (the session has produced no audio yet, so there is nothing to interrupt), `INTERRUPT_IN_PROGRESS` (an earlier `Interrupt` is still being processed — at most one is handled at a time), `INVALID_INTERRUPT_OFFSET` (the `playback_offset` did not advance past the position a prior interrupt established). """ diff --git a/src/deepgram/speak/v2/types/speak_v2warning.py.bak b/src/deepgram/speak/v2/types/speak_v2warning.py.bak deleted file mode 100644 index ac771641..00000000 --- a/src/deepgram/speak/v2/types/speak_v2warning.py.bak +++ /dev/null @@ -1,41 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ....core.pydantic_utilities import IS_PYDANTIC_V2 -from ....core.unchecked_base_model import UncheckedBaseModel - - -class SpeakV2Warning(UncheckedBaseModel): - type: typing.Literal["Warning"] = pydantic.Field(default="Warning") - """ - Message type identifier - """ - - code: str = pydantic.Field() - """ - Warning code identifying the condition, in `SCREAMING_SNAKE_CASE`. - - Turn-scoped codes: `NO_ACTIVE_SPEECH` (a speech-scoped message arrived with no active turn), `NO_SYNTHESIZABLE_TEXT` (the turn's text was entirely whitespace or punctuation, so it produced no audio and is completed with a zero-duration `SpeechMetadata`), and `SYNTHESIS_RETRYING` (a synthesis request failed and is being retried). - - Pronunciation codes: `PRONUNCIATION_WARNINGS` (a pronunciation override contained invalid IPA; it is still applied best-effort and counted in `pronunciations_applied`), `PRONUNCIATION_TOO_LONG` (an IPA string exceeded the length limit), `PRONUNCIATIONS_LIMIT_EXCEEDED` (too many pronunciation controls in one turn). - - Pause codes (`BREAKS_LIMIT_EXCEEDED`, `BREAK_TOKENS_OUT_OF_RANGE`, `BREAK_TOKENS_WITH_INVALID_INCREMENTS`) are reserved and not emitted: inline pause controls are batch-only, and a pause marker on the WebSocket fails the connection instead. - - Interrupt-scoped codes, each meaning the `Interrupt` was ignored: `NO_AUDIO_GENERATED` (the session has produced no audio yet, so there is nothing to interrupt), `INTERRUPT_IN_PROGRESS` (an earlier `Interrupt` is still being processed — at most one is handled at a time), `INVALID_INTERRUPT_OFFSET` (the `playback_offset` did not advance past the position a prior interrupt established). - """ - - description: str = pydantic.Field() - """ - A human-readable description of the warning - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/deepgram/types/__init__.py b/src/deepgram/types/__init__.py index 31002506..fb555899 100644 --- a/src/deepgram/types/__init__.py +++ b/src/deepgram/types/__init__.py @@ -37,6 +37,7 @@ from .cartesia_model_id import CartesiaModelId from .cartesia_voice import CartesiaVoice from .create_agent_configuration_v1response import CreateAgentConfigurationV1Response + from .create_key_v1request import CreateKeyV1Request from .create_key_v1response import CreateKeyV1Response from .create_project_distribution_credentials_v1response import CreateProjectDistributionCredentialsV1Response from .create_project_distribution_credentials_v1response_distribution_credentials import ( @@ -332,6 +333,7 @@ "CartesiaModelId": ".cartesia_model_id", "CartesiaVoice": ".cartesia_voice", "CreateAgentConfigurationV1Response": ".create_agent_configuration_v1response", + "CreateKeyV1Request": ".create_key_v1request", "CreateKeyV1Response": ".create_key_v1response", "CreateProjectDistributionCredentialsV1Response": ".create_project_distribution_credentials_v1response", "CreateProjectDistributionCredentialsV1ResponseDistributionCredentials": ".create_project_distribution_credentials_v1response_distribution_credentials", @@ -561,6 +563,28 @@ "UsageV1ResponseResolution": ".usage_v1response_resolution", } +_dynamic_imports.update( + { + "SharedIntentsResults": ".shared_intents_results", + "SharedIntentsResultsIntents": ".shared_intents_results_intents", + "SharedIntentsResultsIntentsSegmentsItem": ".shared_intents_results_intents_segments_item", + "SharedIntentsResultsIntentsSegmentsItemIntentsItem": ".shared_intents_results_intents_segments_item_intents_item", + "SharedTopicsResults": ".shared_topics_results", + "SharedTopicsResultsTopics": ".shared_topics_results_topics", + "SharedTopicsResultsTopicsSegmentsItem": ".shared_topics_results_topics_segments_item", + "SharedTopicsResultsTopicsSegmentsItemTopicsItem": ".shared_topics_results_topics_segments_item_topics_item", + "AnthropicThinkProviderModel": ".anthropic_think_provider_model", + "CartesiaSpeakProviderModelId": ".cartesia_speak_provider_model_id", + "CartesiaSpeakProviderVoice": ".cartesia_speak_provider_voice", + "CreateKeyV1RequestOne": ".create_key_v1request_one", + "DeepgramListenProviderV2LanguageHint": ".deepgram_listen_provider_v2language_hint", + "DeepgramSpeakProviderModel": ".deepgram_speak_provider_model", + "GoogleThinkProviderModel": ".google_think_provider_model", + "GoogleThinkProviderVersion": ".google_think_provider_version", + "GroqThinkProviderReasoningMode": ".groq_think_provider_reasoning_mode", + } +) + def __getattr__(attr_name: str) -> typing.Any: module_name = _dynamic_imports.get(attr_name) @@ -615,6 +639,7 @@ def __dir__(): "CartesiaModelId", "CartesiaVoice", "CreateAgentConfigurationV1Response", + "CreateKeyV1Request", "CreateKeyV1Response", "CreateProjectDistributionCredentialsV1Response", "CreateProjectDistributionCredentialsV1ResponseDistributionCredentials", @@ -843,3 +868,25 @@ def __dir__(): "UsageV1Response", "UsageV1ResponseResolution", ] + +__all__.extend( + [ + "SharedIntentsResults", + "SharedIntentsResultsIntents", + "SharedIntentsResultsIntentsSegmentsItem", + "SharedIntentsResultsIntentsSegmentsItemIntentsItem", + "SharedTopicsResults", + "SharedTopicsResultsTopics", + "SharedTopicsResultsTopicsSegmentsItem", + "SharedTopicsResultsTopicsSegmentsItemTopicsItem", + "AnthropicThinkProviderModel", + "CartesiaSpeakProviderModelId", + "CartesiaSpeakProviderVoice", + "CreateKeyV1RequestOne", + "DeepgramListenProviderV2LanguageHint", + "DeepgramSpeakProviderModel", + "GoogleThinkProviderModel", + "GoogleThinkProviderVersion", + "GroqThinkProviderReasoningMode", + ] +) diff --git a/src/deepgram/types/__init__.py.bak b/src/deepgram/types/__init__.py.bak deleted file mode 100644 index 3c76081d..00000000 --- a/src/deepgram/types/__init__.py.bak +++ /dev/null @@ -1,883 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# isort: skip_file - -import typing -from importlib import import_module - -if typing.TYPE_CHECKING: - from .agent_configuration_v1 import AgentConfigurationV1 - from .agent_think_models_v1response import AgentThinkModelsV1Response - from .agent_think_models_v1response_models_item import AgentThinkModelsV1ResponseModelsItem - from .agent_think_models_v1response_models_item_id import AgentThinkModelsV1ResponseModelsItemId - from .agent_think_models_v1response_models_item_one import AgentThinkModelsV1ResponseModelsItemOne - from .agent_think_models_v1response_models_item_one_id import AgentThinkModelsV1ResponseModelsItemOneId - from .agent_think_models_v1response_models_item_three import AgentThinkModelsV1ResponseModelsItemThree - from .agent_think_models_v1response_models_item_two import AgentThinkModelsV1ResponseModelsItemTwo - from .agent_think_models_v1response_models_item_two_id import AgentThinkModelsV1ResponseModelsItemTwoId - from .agent_think_models_v1response_models_item_zero import AgentThinkModelsV1ResponseModelsItemZero - from .agent_think_models_v1response_models_item_zero_id import AgentThinkModelsV1ResponseModelsItemZeroId - from .agent_variable_v1 import AgentVariableV1 - from .anthropic import Anthropic - from .anthropic_model import AnthropicModel - from .aws_bedrock_think_provider import AwsBedrockThinkProvider - from .aws_bedrock_think_provider_credentials import AwsBedrockThinkProviderCredentials - from .aws_bedrock_think_provider_credentials_type import AwsBedrockThinkProviderCredentialsType - from .aws_bedrock_think_provider_model import AwsBedrockThinkProviderModel - from .aws_polly_speak_provider import AwsPollySpeakProvider - from .aws_polly_speak_provider_credentials import AwsPollySpeakProviderCredentials - from .aws_polly_speak_provider_credentials_type import AwsPollySpeakProviderCredentialsType - from .aws_polly_speak_provider_engine import AwsPollySpeakProviderEngine - from .aws_polly_speak_provider_voice import AwsPollySpeakProviderVoice - from .billing_breakdown_v1response import BillingBreakdownV1Response - from .billing_breakdown_v1response_resolution import BillingBreakdownV1ResponseResolution - from .billing_breakdown_v1response_results_item import BillingBreakdownV1ResponseResultsItem - from .billing_breakdown_v1response_results_item_grouping import BillingBreakdownV1ResponseResultsItemGrouping - from .cartesia import Cartesia - from .cartesia_model_id import CartesiaModelId - from .cartesia_voice import CartesiaVoice - from .create_agent_configuration_v1response import CreateAgentConfigurationV1Response - from .create_key_v1request import CreateKeyV1Request - from .create_key_v1response import CreateKeyV1Response - from .create_project_distribution_credentials_v1response import CreateProjectDistributionCredentialsV1Response - from .create_project_distribution_credentials_v1response_distribution_credentials import ( - CreateProjectDistributionCredentialsV1ResponseDistributionCredentials, - ) - from .create_project_distribution_credentials_v1response_member import ( - CreateProjectDistributionCredentialsV1ResponseMember, - ) - from .create_project_invite_v1response import CreateProjectInviteV1Response - from .deepgram import Deepgram - from .deepgram_listen_provider_v1 import DeepgramListenProviderV1 - from .deepgram_listen_provider_v2 import DeepgramListenProviderV2 - from .deepgram_model import DeepgramModel - from .deepgram_think_live_provider_v1 import DeepgramThinkLiveProviderV1 - from .deepgram_think_provider import DeepgramThinkProvider - from .deepgram_think_provider_model import DeepgramThinkProviderModel - from .deepgram_think_provider_reasoning_mode import DeepgramThinkProviderReasoningMode - from .delete_agent_configuration_v1response import DeleteAgentConfigurationV1Response - from .delete_agent_variable_v1response import DeleteAgentVariableV1Response - from .delete_project_invite_v1response import DeleteProjectInviteV1Response - from .delete_project_key_v1response import DeleteProjectKeyV1Response - from .delete_project_member_v1response import DeleteProjectMemberV1Response - from .delete_project_v1response import DeleteProjectV1Response - from .eleven_labs_speak_provider import ElevenLabsSpeakProvider - from .eleven_labs_speak_provider_model_id import ElevenLabsSpeakProviderModelId - from .error_response import ErrorResponse - from .error_response_legacy_error import ErrorResponseLegacyError - from .error_response_modern_error import ErrorResponseModernError - from .error_response_text_error import ErrorResponseTextError - from .get_model_v1response import GetModelV1Response - from .get_model_v1response_batch import GetModelV1ResponseBatch - from .get_model_v1response_metadata import GetModelV1ResponseMetadata - from .get_model_v1response_metadata_metadata import GetModelV1ResponseMetadataMetadata - from .get_project_balance_v1response import GetProjectBalanceV1Response - from .get_project_distribution_credentials_v1response import GetProjectDistributionCredentialsV1Response - from .get_project_distribution_credentials_v1response_distribution_credentials import ( - GetProjectDistributionCredentialsV1ResponseDistributionCredentials, - ) - from .get_project_distribution_credentials_v1response_member import ( - GetProjectDistributionCredentialsV1ResponseMember, - ) - from .get_project_key_v1response import GetProjectKeyV1Response - from .get_project_key_v1response_item import GetProjectKeyV1ResponseItem - from .get_project_key_v1response_item_member import GetProjectKeyV1ResponseItemMember - from .get_project_key_v1response_item_member_api_key import GetProjectKeyV1ResponseItemMemberApiKey - from .get_project_request_v1response import GetProjectRequestV1Response - from .get_project_v1response import GetProjectV1Response - from .google import Google - from .google_model import GoogleModel - from .google_version import GoogleVersion - from .grant_v1response import GrantV1Response - from .groq import Groq - from .groq_reasoning_mode import GroqReasoningMode - from .leave_project_v1response import LeaveProjectV1Response - from .list_agent_configurations_v1response import ListAgentConfigurationsV1Response - from .list_agent_variables_v1response import ListAgentVariablesV1Response - from .list_billing_fields_v1response import ListBillingFieldsV1Response - from .list_billing_fields_v1response_deployments_item import ListBillingFieldsV1ResponseDeploymentsItem - from .list_models_v1response import ListModelsV1Response - from .list_models_v1response_stt_models import ListModelsV1ResponseSttModels - from .list_models_v1response_tts_models import ListModelsV1ResponseTtsModels - from .list_models_v1response_tts_models_metadata import ListModelsV1ResponseTtsModelsMetadata - from .list_project_balances_v1response import ListProjectBalancesV1Response - from .list_project_balances_v1response_balances_item import ListProjectBalancesV1ResponseBalancesItem - from .list_project_distribution_credentials_v1response import ListProjectDistributionCredentialsV1Response - from .list_project_distribution_credentials_v1response_distribution_credentials_item import ( - ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItem, - ) - from .list_project_distribution_credentials_v1response_distribution_credentials_item_distribution_credentials import ( - ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemDistributionCredentials, - ) - from .list_project_distribution_credentials_v1response_distribution_credentials_item_member import ( - ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemMember, - ) - from .list_project_invites_v1response import ListProjectInvitesV1Response - from .list_project_invites_v1response_invites_item import ListProjectInvitesV1ResponseInvitesItem - from .list_project_keys_v1response import ListProjectKeysV1Response - from .list_project_keys_v1response_api_keys_item import ListProjectKeysV1ResponseApiKeysItem - from .list_project_keys_v1response_api_keys_item_api_key import ListProjectKeysV1ResponseApiKeysItemApiKey - from .list_project_keys_v1response_api_keys_item_member import ListProjectKeysV1ResponseApiKeysItemMember - from .list_project_member_scopes_v1response import ListProjectMemberScopesV1Response - from .list_project_members_v1response import ListProjectMembersV1Response - from .list_project_members_v1response_members_item import ListProjectMembersV1ResponseMembersItem - from .list_project_purchases_v1response import ListProjectPurchasesV1Response - from .list_project_purchases_v1response_orders_item import ListProjectPurchasesV1ResponseOrdersItem - from .list_project_requests_v1response import ListProjectRequestsV1Response - from .list_projects_v1response import ListProjectsV1Response - from .list_projects_v1response_projects_item import ListProjectsV1ResponseProjectsItem - from .listen_v1accepted_response import ListenV1AcceptedResponse - from .listen_v1callback import ListenV1Callback - from .listen_v1callback_method import ListenV1CallbackMethod - from .listen_v1channels import ListenV1Channels - from .listen_v1detect_entities import ListenV1DetectEntities - from .listen_v1diarize import ListenV1Diarize - from .listen_v1dictation import ListenV1Dictation - from .listen_v1encoding import ListenV1Encoding - from .listen_v1endpointing import ListenV1Endpointing - from .listen_v1extra import ListenV1Extra - from .listen_v1interim_results import ListenV1InterimResults - from .listen_v1keyterm import ListenV1Keyterm - from .listen_v1keywords import ListenV1Keywords - from .listen_v1language import ListenV1Language - from .listen_v1language_hint import ListenV1LanguageHint - from .listen_v1mip_opt_out import ListenV1MipOptOut - from .listen_v1model import ListenV1Model - from .listen_v1multichannel import ListenV1Multichannel - from .listen_v1numerals import ListenV1Numerals - from .listen_v1profanity_filter import ListenV1ProfanityFilter - from .listen_v1punctuate import ListenV1Punctuate - from .listen_v1redact import ListenV1Redact - from .listen_v1redact_usage import ListenV1RedactUsage - from .listen_v1replace import ListenV1Replace - from .listen_v1request_file import ListenV1RequestFile - from .listen_v1response import ListenV1Response - from .listen_v1response_metadata import ListenV1ResponseMetadata - from .listen_v1response_metadata_diarize_info import ListenV1ResponseMetadataDiarizeInfo - from .listen_v1response_metadata_intents_info import ListenV1ResponseMetadataIntentsInfo - from .listen_v1response_metadata_sentiment_info import ListenV1ResponseMetadataSentimentInfo - from .listen_v1response_metadata_summary_info import ListenV1ResponseMetadataSummaryInfo - from .listen_v1response_metadata_topics_info import ListenV1ResponseMetadataTopicsInfo - from .listen_v1response_results import ListenV1ResponseResults - from .listen_v1response_results_channels import ListenV1ResponseResultsChannels - from .listen_v1response_results_channels_item import ListenV1ResponseResultsChannelsItem - from .listen_v1response_results_channels_item_alternatives_item import ( - ListenV1ResponseResultsChannelsItemAlternativesItem, - ) - from .listen_v1response_results_channels_item_alternatives_item_entities_item import ( - ListenV1ResponseResultsChannelsItemAlternativesItemEntitiesItem, - ) - from .listen_v1response_results_channels_item_alternatives_item_paragraphs import ( - ListenV1ResponseResultsChannelsItemAlternativesItemParagraphs, - ) - from .listen_v1response_results_channels_item_alternatives_item_paragraphs_paragraphs_item import ( - ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParagraphsItem, - ) - from .listen_v1response_results_channels_item_alternatives_item_paragraphs_paragraphs_item_sentences_item import ( - ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParagraphsItemSentencesItem, - ) - from .listen_v1response_results_channels_item_alternatives_item_summaries_item import ( - ListenV1ResponseResultsChannelsItemAlternativesItemSummariesItem, - ) - from .listen_v1response_results_channels_item_alternatives_item_topics_item import ( - ListenV1ResponseResultsChannelsItemAlternativesItemTopicsItem, - ) - from .listen_v1response_results_channels_item_alternatives_item_words_item import ( - ListenV1ResponseResultsChannelsItemAlternativesItemWordsItem, - ) - from .listen_v1response_results_channels_item_search_item import ListenV1ResponseResultsChannelsItemSearchItem - from .listen_v1response_results_channels_item_search_item_hits_item import ( - ListenV1ResponseResultsChannelsItemSearchItemHitsItem, - ) - from .listen_v1response_results_summary import ListenV1ResponseResultsSummary - from .listen_v1response_results_utterances import ListenV1ResponseResultsUtterances - from .listen_v1response_results_utterances_item import ListenV1ResponseResultsUtterancesItem - from .listen_v1response_results_utterances_item_words_item import ListenV1ResponseResultsUtterancesItemWordsItem - from .listen_v1sample_rate import ListenV1SampleRate - from .listen_v1search import ListenV1Search - from .listen_v1smart_format import ListenV1SmartFormat - from .listen_v1tag import ListenV1Tag - from .listen_v1utterance_end_ms import ListenV1UtteranceEndMs - from .listen_v1vad_events import ListenV1VadEvents - from .listen_v1version import ListenV1Version - from .listen_v2configure_numerals import ListenV2ConfigureNumerals - from .listen_v2configure_redact_usage import ListenV2ConfigureRedactUsage - from .listen_v2eager_eot_threshold import ListenV2EagerEotThreshold - from .listen_v2encoding import ListenV2Encoding - from .listen_v2eot_threshold import ListenV2EotThreshold - from .listen_v2eot_timeout_ms import ListenV2EotTimeoutMs - from .listen_v2keyterm import ListenV2Keyterm - from .listen_v2language_hint import ListenV2LanguageHint - from .listen_v2mip_opt_out import ListenV2MipOptOut - from .listen_v2model import ListenV2Model - from .listen_v2numerals import ListenV2Numerals - from .listen_v2profanity_filter import ListenV2ProfanityFilter - from .listen_v2redact import ListenV2Redact - from .listen_v2redact_usage import ListenV2RedactUsage - from .listen_v2sample_rate import ListenV2SampleRate - from .listen_v2tag import ListenV2Tag - from .open_ai_speak_provider import OpenAiSpeakProvider - from .open_ai_speak_provider_model import OpenAiSpeakProviderModel - from .open_ai_speak_provider_voice import OpenAiSpeakProviderVoice - from .open_ai_think_provider import OpenAiThinkProvider - from .open_ai_think_provider_model import OpenAiThinkProviderModel - from .open_ai_think_provider_reasoning_mode import OpenAiThinkProviderReasoningMode - from .project_request_response import ProjectRequestResponse - from .read_v1request import ReadV1Request - from .read_v1request_text import ReadV1RequestText - from .read_v1request_url import ReadV1RequestUrl - from .read_v1response import ReadV1Response - from .read_v1response_metadata import ReadV1ResponseMetadata - from .read_v1response_metadata_metadata import ReadV1ResponseMetadataMetadata - from .read_v1response_metadata_metadata_intents_info import ReadV1ResponseMetadataMetadataIntentsInfo - from .read_v1response_metadata_metadata_sentiment_info import ReadV1ResponseMetadataMetadataSentimentInfo - from .read_v1response_metadata_metadata_summary_info import ReadV1ResponseMetadataMetadataSummaryInfo - from .read_v1response_metadata_metadata_topics_info import ReadV1ResponseMetadataMetadataTopicsInfo - from .read_v1response_results import ReadV1ResponseResults - from .read_v1response_results_summary import ReadV1ResponseResultsSummary - from .read_v1response_results_summary_results import ReadV1ResponseResultsSummaryResults - from .read_v1response_results_summary_results_summary import ReadV1ResponseResultsSummaryResultsSummary - from .shared_intents import SharedIntents - from .shared_intents_segments_item import SharedIntentsSegmentsItem - from .shared_intents_segments_item_intents_item import SharedIntentsSegmentsItemIntentsItem - from .shared_sentiments import SharedSentiments - from .shared_sentiments_average import SharedSentimentsAverage - from .shared_sentiments_segments_item import SharedSentimentsSegmentsItem - from .shared_topics import SharedTopics - from .shared_topics_segments_item import SharedTopicsSegmentsItem - from .shared_topics_segments_item_topics_item import SharedTopicsSegmentsItemTopicsItem - from .speak_settings_v1 import SpeakSettingsV1 - from .speak_settings_v1endpoint import SpeakSettingsV1Endpoint - from .speak_settings_v1provider import ( - SpeakSettingsV1Provider, - SpeakSettingsV1Provider_AwsPolly, - SpeakSettingsV1Provider_Cartesia, - SpeakSettingsV1Provider_Deepgram, - SpeakSettingsV1Provider_ElevenLabs, - SpeakSettingsV1Provider_OpenAi, - ) - from .speak_v1encoding import SpeakV1Encoding - from .speak_v1mip_opt_out import SpeakV1MipOptOut - from .speak_v1model import SpeakV1Model - from .speak_v1response import SpeakV1Response - from .speak_v1sample_rate import SpeakV1SampleRate - from .speak_v1speed import SpeakV1Speed - from .speak_v2accepted_response import SpeakV2AcceptedResponse - from .speak_v2encoding import SpeakV2Encoding - from .speak_v2expressivity import SpeakV2Expressivity - from .speak_v2mip_opt_out import SpeakV2MipOptOut - from .speak_v2model import SpeakV2Model - from .speak_v2normalize_volume import SpeakV2NormalizeVolume - from .speak_v2response import SpeakV2Response - from .speak_v2sample_rate import SpeakV2SampleRate - from .speak_v2speed import SpeakV2Speed - from .speak_v2speed_value import SpeakV2SpeedValue - from .speak_v2tag import SpeakV2Tag - from .think_live_settings_v1 import ThinkLiveSettingsV1 - from .think_settings_v1 import ThinkSettingsV1 - from .think_settings_v1context_length import ThinkSettingsV1ContextLength - from .think_settings_v1endpoint import ThinkSettingsV1Endpoint - from .think_settings_v1functions_item import ThinkSettingsV1FunctionsItem - from .think_settings_v1functions_item_endpoint import ThinkSettingsV1FunctionsItemEndpoint - from .think_settings_v1provider import ( - ThinkSettingsV1Provider, - ThinkSettingsV1Provider_Anthropic, - ThinkSettingsV1Provider_AwsBedrock, - ThinkSettingsV1Provider_Deepgram, - ThinkSettingsV1Provider_Google, - ThinkSettingsV1Provider_Groq, - ThinkSettingsV1Provider_OpenAi, - ) - from .update_project_member_scopes_v1response import UpdateProjectMemberScopesV1Response - from .update_project_v1response import UpdateProjectV1Response - from .usage_breakdown_v1response import UsageBreakdownV1Response - from .usage_breakdown_v1response_resolution import UsageBreakdownV1ResponseResolution - from .usage_breakdown_v1response_results_item import UsageBreakdownV1ResponseResultsItem - from .usage_breakdown_v1response_results_item_grouping import UsageBreakdownV1ResponseResultsItemGrouping - from .usage_fields_v1response import UsageFieldsV1Response - from .usage_fields_v1response_models_item import UsageFieldsV1ResponseModelsItem - from .usage_v1response import UsageV1Response - from .usage_v1response_resolution import UsageV1ResponseResolution -_dynamic_imports: typing.Dict[str, str] = { - "AgentConfigurationV1": ".agent_configuration_v1", - "AgentThinkModelsV1Response": ".agent_think_models_v1response", - "AgentThinkModelsV1ResponseModelsItem": ".agent_think_models_v1response_models_item", - "AgentThinkModelsV1ResponseModelsItemId": ".agent_think_models_v1response_models_item_id", - "AgentThinkModelsV1ResponseModelsItemOne": ".agent_think_models_v1response_models_item_one", - "AgentThinkModelsV1ResponseModelsItemOneId": ".agent_think_models_v1response_models_item_one_id", - "AgentThinkModelsV1ResponseModelsItemThree": ".agent_think_models_v1response_models_item_three", - "AgentThinkModelsV1ResponseModelsItemTwo": ".agent_think_models_v1response_models_item_two", - "AgentThinkModelsV1ResponseModelsItemTwoId": ".agent_think_models_v1response_models_item_two_id", - "AgentThinkModelsV1ResponseModelsItemZero": ".agent_think_models_v1response_models_item_zero", - "AgentThinkModelsV1ResponseModelsItemZeroId": ".agent_think_models_v1response_models_item_zero_id", - "AgentVariableV1": ".agent_variable_v1", - "Anthropic": ".anthropic", - "AnthropicModel": ".anthropic_model", - "AwsBedrockThinkProvider": ".aws_bedrock_think_provider", - "AwsBedrockThinkProviderCredentials": ".aws_bedrock_think_provider_credentials", - "AwsBedrockThinkProviderCredentialsType": ".aws_bedrock_think_provider_credentials_type", - "AwsBedrockThinkProviderModel": ".aws_bedrock_think_provider_model", - "AwsPollySpeakProvider": ".aws_polly_speak_provider", - "AwsPollySpeakProviderCredentials": ".aws_polly_speak_provider_credentials", - "AwsPollySpeakProviderCredentialsType": ".aws_polly_speak_provider_credentials_type", - "AwsPollySpeakProviderEngine": ".aws_polly_speak_provider_engine", - "AwsPollySpeakProviderVoice": ".aws_polly_speak_provider_voice", - "BillingBreakdownV1Response": ".billing_breakdown_v1response", - "BillingBreakdownV1ResponseResolution": ".billing_breakdown_v1response_resolution", - "BillingBreakdownV1ResponseResultsItem": ".billing_breakdown_v1response_results_item", - "BillingBreakdownV1ResponseResultsItemGrouping": ".billing_breakdown_v1response_results_item_grouping", - "Cartesia": ".cartesia", - "CartesiaModelId": ".cartesia_model_id", - "CartesiaVoice": ".cartesia_voice", - "CreateAgentConfigurationV1Response": ".create_agent_configuration_v1response", - "CreateKeyV1Request": ".create_key_v1request", - "CreateKeyV1Response": ".create_key_v1response", - "CreateProjectDistributionCredentialsV1Response": ".create_project_distribution_credentials_v1response", - "CreateProjectDistributionCredentialsV1ResponseDistributionCredentials": ".create_project_distribution_credentials_v1response_distribution_credentials", - "CreateProjectDistributionCredentialsV1ResponseMember": ".create_project_distribution_credentials_v1response_member", - "CreateProjectInviteV1Response": ".create_project_invite_v1response", - "Deepgram": ".deepgram", - "DeepgramListenProviderV1": ".deepgram_listen_provider_v1", - "DeepgramListenProviderV2": ".deepgram_listen_provider_v2", - "DeepgramModel": ".deepgram_model", - "DeepgramThinkLiveProviderV1": ".deepgram_think_live_provider_v1", - "DeepgramThinkProvider": ".deepgram_think_provider", - "DeepgramThinkProviderModel": ".deepgram_think_provider_model", - "DeepgramThinkProviderReasoningMode": ".deepgram_think_provider_reasoning_mode", - "DeleteAgentConfigurationV1Response": ".delete_agent_configuration_v1response", - "DeleteAgentVariableV1Response": ".delete_agent_variable_v1response", - "DeleteProjectInviteV1Response": ".delete_project_invite_v1response", - "DeleteProjectKeyV1Response": ".delete_project_key_v1response", - "DeleteProjectMemberV1Response": ".delete_project_member_v1response", - "DeleteProjectV1Response": ".delete_project_v1response", - "ElevenLabsSpeakProvider": ".eleven_labs_speak_provider", - "ElevenLabsSpeakProviderModelId": ".eleven_labs_speak_provider_model_id", - "ErrorResponse": ".error_response", - "ErrorResponseLegacyError": ".error_response_legacy_error", - "ErrorResponseModernError": ".error_response_modern_error", - "ErrorResponseTextError": ".error_response_text_error", - "GetModelV1Response": ".get_model_v1response", - "GetModelV1ResponseBatch": ".get_model_v1response_batch", - "GetModelV1ResponseMetadata": ".get_model_v1response_metadata", - "GetModelV1ResponseMetadataMetadata": ".get_model_v1response_metadata_metadata", - "GetProjectBalanceV1Response": ".get_project_balance_v1response", - "GetProjectDistributionCredentialsV1Response": ".get_project_distribution_credentials_v1response", - "GetProjectDistributionCredentialsV1ResponseDistributionCredentials": ".get_project_distribution_credentials_v1response_distribution_credentials", - "GetProjectDistributionCredentialsV1ResponseMember": ".get_project_distribution_credentials_v1response_member", - "GetProjectKeyV1Response": ".get_project_key_v1response", - "GetProjectKeyV1ResponseItem": ".get_project_key_v1response_item", - "GetProjectKeyV1ResponseItemMember": ".get_project_key_v1response_item_member", - "GetProjectKeyV1ResponseItemMemberApiKey": ".get_project_key_v1response_item_member_api_key", - "GetProjectRequestV1Response": ".get_project_request_v1response", - "GetProjectV1Response": ".get_project_v1response", - "Google": ".google", - "GoogleModel": ".google_model", - "GoogleVersion": ".google_version", - "GrantV1Response": ".grant_v1response", - "Groq": ".groq", - "GroqReasoningMode": ".groq_reasoning_mode", - "LeaveProjectV1Response": ".leave_project_v1response", - "ListAgentConfigurationsV1Response": ".list_agent_configurations_v1response", - "ListAgentVariablesV1Response": ".list_agent_variables_v1response", - "ListBillingFieldsV1Response": ".list_billing_fields_v1response", - "ListBillingFieldsV1ResponseDeploymentsItem": ".list_billing_fields_v1response_deployments_item", - "ListModelsV1Response": ".list_models_v1response", - "ListModelsV1ResponseSttModels": ".list_models_v1response_stt_models", - "ListModelsV1ResponseTtsModels": ".list_models_v1response_tts_models", - "ListModelsV1ResponseTtsModelsMetadata": ".list_models_v1response_tts_models_metadata", - "ListProjectBalancesV1Response": ".list_project_balances_v1response", - "ListProjectBalancesV1ResponseBalancesItem": ".list_project_balances_v1response_balances_item", - "ListProjectDistributionCredentialsV1Response": ".list_project_distribution_credentials_v1response", - "ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItem": ".list_project_distribution_credentials_v1response_distribution_credentials_item", - "ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemDistributionCredentials": ".list_project_distribution_credentials_v1response_distribution_credentials_item_distribution_credentials", - "ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemMember": ".list_project_distribution_credentials_v1response_distribution_credentials_item_member", - "ListProjectInvitesV1Response": ".list_project_invites_v1response", - "ListProjectInvitesV1ResponseInvitesItem": ".list_project_invites_v1response_invites_item", - "ListProjectKeysV1Response": ".list_project_keys_v1response", - "ListProjectKeysV1ResponseApiKeysItem": ".list_project_keys_v1response_api_keys_item", - "ListProjectKeysV1ResponseApiKeysItemApiKey": ".list_project_keys_v1response_api_keys_item_api_key", - "ListProjectKeysV1ResponseApiKeysItemMember": ".list_project_keys_v1response_api_keys_item_member", - "ListProjectMemberScopesV1Response": ".list_project_member_scopes_v1response", - "ListProjectMembersV1Response": ".list_project_members_v1response", - "ListProjectMembersV1ResponseMembersItem": ".list_project_members_v1response_members_item", - "ListProjectPurchasesV1Response": ".list_project_purchases_v1response", - "ListProjectPurchasesV1ResponseOrdersItem": ".list_project_purchases_v1response_orders_item", - "ListProjectRequestsV1Response": ".list_project_requests_v1response", - "ListProjectsV1Response": ".list_projects_v1response", - "ListProjectsV1ResponseProjectsItem": ".list_projects_v1response_projects_item", - "ListenV1AcceptedResponse": ".listen_v1accepted_response", - "ListenV1Callback": ".listen_v1callback", - "ListenV1CallbackMethod": ".listen_v1callback_method", - "ListenV1Channels": ".listen_v1channels", - "ListenV1DetectEntities": ".listen_v1detect_entities", - "ListenV1Diarize": ".listen_v1diarize", - "ListenV1Dictation": ".listen_v1dictation", - "ListenV1Encoding": ".listen_v1encoding", - "ListenV1Endpointing": ".listen_v1endpointing", - "ListenV1Extra": ".listen_v1extra", - "ListenV1InterimResults": ".listen_v1interim_results", - "ListenV1Keyterm": ".listen_v1keyterm", - "ListenV1Keywords": ".listen_v1keywords", - "ListenV1Language": ".listen_v1language", - "ListenV1LanguageHint": ".listen_v1language_hint", - "ListenV1MipOptOut": ".listen_v1mip_opt_out", - "ListenV1Model": ".listen_v1model", - "ListenV1Multichannel": ".listen_v1multichannel", - "ListenV1Numerals": ".listen_v1numerals", - "ListenV1ProfanityFilter": ".listen_v1profanity_filter", - "ListenV1Punctuate": ".listen_v1punctuate", - "ListenV1Redact": ".listen_v1redact", - "ListenV1RedactUsage": ".listen_v1redact_usage", - "ListenV1Replace": ".listen_v1replace", - "ListenV1RequestFile": ".listen_v1request_file", - "ListenV1Response": ".listen_v1response", - "ListenV1ResponseMetadata": ".listen_v1response_metadata", - "ListenV1ResponseMetadataDiarizeInfo": ".listen_v1response_metadata_diarize_info", - "ListenV1ResponseMetadataIntentsInfo": ".listen_v1response_metadata_intents_info", - "ListenV1ResponseMetadataSentimentInfo": ".listen_v1response_metadata_sentiment_info", - "ListenV1ResponseMetadataSummaryInfo": ".listen_v1response_metadata_summary_info", - "ListenV1ResponseMetadataTopicsInfo": ".listen_v1response_metadata_topics_info", - "ListenV1ResponseResults": ".listen_v1response_results", - "ListenV1ResponseResultsChannels": ".listen_v1response_results_channels", - "ListenV1ResponseResultsChannelsItem": ".listen_v1response_results_channels_item", - "ListenV1ResponseResultsChannelsItemAlternativesItem": ".listen_v1response_results_channels_item_alternatives_item", - "ListenV1ResponseResultsChannelsItemAlternativesItemEntitiesItem": ".listen_v1response_results_channels_item_alternatives_item_entities_item", - "ListenV1ResponseResultsChannelsItemAlternativesItemParagraphs": ".listen_v1response_results_channels_item_alternatives_item_paragraphs", - "ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParagraphsItem": ".listen_v1response_results_channels_item_alternatives_item_paragraphs_paragraphs_item", - "ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParagraphsItemSentencesItem": ".listen_v1response_results_channels_item_alternatives_item_paragraphs_paragraphs_item_sentences_item", - "ListenV1ResponseResultsChannelsItemAlternativesItemSummariesItem": ".listen_v1response_results_channels_item_alternatives_item_summaries_item", - "ListenV1ResponseResultsChannelsItemAlternativesItemTopicsItem": ".listen_v1response_results_channels_item_alternatives_item_topics_item", - "ListenV1ResponseResultsChannelsItemAlternativesItemWordsItem": ".listen_v1response_results_channels_item_alternatives_item_words_item", - "ListenV1ResponseResultsChannelsItemSearchItem": ".listen_v1response_results_channels_item_search_item", - "ListenV1ResponseResultsChannelsItemSearchItemHitsItem": ".listen_v1response_results_channels_item_search_item_hits_item", - "ListenV1ResponseResultsSummary": ".listen_v1response_results_summary", - "ListenV1ResponseResultsUtterances": ".listen_v1response_results_utterances", - "ListenV1ResponseResultsUtterancesItem": ".listen_v1response_results_utterances_item", - "ListenV1ResponseResultsUtterancesItemWordsItem": ".listen_v1response_results_utterances_item_words_item", - "ListenV1SampleRate": ".listen_v1sample_rate", - "ListenV1Search": ".listen_v1search", - "ListenV1SmartFormat": ".listen_v1smart_format", - "ListenV1Tag": ".listen_v1tag", - "ListenV1UtteranceEndMs": ".listen_v1utterance_end_ms", - "ListenV1VadEvents": ".listen_v1vad_events", - "ListenV1Version": ".listen_v1version", - "ListenV2ConfigureNumerals": ".listen_v2configure_numerals", - "ListenV2ConfigureRedactUsage": ".listen_v2configure_redact_usage", - "ListenV2EagerEotThreshold": ".listen_v2eager_eot_threshold", - "ListenV2Encoding": ".listen_v2encoding", - "ListenV2EotThreshold": ".listen_v2eot_threshold", - "ListenV2EotTimeoutMs": ".listen_v2eot_timeout_ms", - "ListenV2Keyterm": ".listen_v2keyterm", - "ListenV2LanguageHint": ".listen_v2language_hint", - "ListenV2MipOptOut": ".listen_v2mip_opt_out", - "ListenV2Model": ".listen_v2model", - "ListenV2Numerals": ".listen_v2numerals", - "ListenV2ProfanityFilter": ".listen_v2profanity_filter", - "ListenV2Redact": ".listen_v2redact", - "ListenV2RedactUsage": ".listen_v2redact_usage", - "ListenV2SampleRate": ".listen_v2sample_rate", - "ListenV2Tag": ".listen_v2tag", - "OpenAiSpeakProvider": ".open_ai_speak_provider", - "OpenAiSpeakProviderModel": ".open_ai_speak_provider_model", - "OpenAiSpeakProviderVoice": ".open_ai_speak_provider_voice", - "OpenAiThinkProvider": ".open_ai_think_provider", - "OpenAiThinkProviderModel": ".open_ai_think_provider_model", - "OpenAiThinkProviderReasoningMode": ".open_ai_think_provider_reasoning_mode", - "ProjectRequestResponse": ".project_request_response", - "ReadV1Request": ".read_v1request", - "ReadV1RequestText": ".read_v1request_text", - "ReadV1RequestUrl": ".read_v1request_url", - "ReadV1Response": ".read_v1response", - "ReadV1ResponseMetadata": ".read_v1response_metadata", - "ReadV1ResponseMetadataMetadata": ".read_v1response_metadata_metadata", - "ReadV1ResponseMetadataMetadataIntentsInfo": ".read_v1response_metadata_metadata_intents_info", - "ReadV1ResponseMetadataMetadataSentimentInfo": ".read_v1response_metadata_metadata_sentiment_info", - "ReadV1ResponseMetadataMetadataSummaryInfo": ".read_v1response_metadata_metadata_summary_info", - "ReadV1ResponseMetadataMetadataTopicsInfo": ".read_v1response_metadata_metadata_topics_info", - "ReadV1ResponseResults": ".read_v1response_results", - "ReadV1ResponseResultsSummary": ".read_v1response_results_summary", - "ReadV1ResponseResultsSummaryResults": ".read_v1response_results_summary_results", - "ReadV1ResponseResultsSummaryResultsSummary": ".read_v1response_results_summary_results_summary", - "SharedIntents": ".shared_intents", - "SharedIntentsSegmentsItem": ".shared_intents_segments_item", - "SharedIntentsSegmentsItemIntentsItem": ".shared_intents_segments_item_intents_item", - "SharedSentiments": ".shared_sentiments", - "SharedSentimentsAverage": ".shared_sentiments_average", - "SharedSentimentsSegmentsItem": ".shared_sentiments_segments_item", - "SharedTopics": ".shared_topics", - "SharedTopicsSegmentsItem": ".shared_topics_segments_item", - "SharedTopicsSegmentsItemTopicsItem": ".shared_topics_segments_item_topics_item", - "SpeakSettingsV1": ".speak_settings_v1", - "SpeakSettingsV1Endpoint": ".speak_settings_v1endpoint", - "SpeakSettingsV1Provider": ".speak_settings_v1provider", - "SpeakSettingsV1Provider_AwsPolly": ".speak_settings_v1provider", - "SpeakSettingsV1Provider_Cartesia": ".speak_settings_v1provider", - "SpeakSettingsV1Provider_Deepgram": ".speak_settings_v1provider", - "SpeakSettingsV1Provider_ElevenLabs": ".speak_settings_v1provider", - "SpeakSettingsV1Provider_OpenAi": ".speak_settings_v1provider", - "SpeakV1Encoding": ".speak_v1encoding", - "SpeakV1MipOptOut": ".speak_v1mip_opt_out", - "SpeakV1Model": ".speak_v1model", - "SpeakV1Response": ".speak_v1response", - "SpeakV1SampleRate": ".speak_v1sample_rate", - "SpeakV1Speed": ".speak_v1speed", - "SpeakV2AcceptedResponse": ".speak_v2accepted_response", - "SpeakV2Encoding": ".speak_v2encoding", - "SpeakV2Expressivity": ".speak_v2expressivity", - "SpeakV2MipOptOut": ".speak_v2mip_opt_out", - "SpeakV2Model": ".speak_v2model", - "SpeakV2NormalizeVolume": ".speak_v2normalize_volume", - "SpeakV2Response": ".speak_v2response", - "SpeakV2SampleRate": ".speak_v2sample_rate", - "SpeakV2Speed": ".speak_v2speed", - "SpeakV2SpeedValue": ".speak_v2speed_value", - "SpeakV2Tag": ".speak_v2tag", - "ThinkLiveSettingsV1": ".think_live_settings_v1", - "ThinkSettingsV1": ".think_settings_v1", - "ThinkSettingsV1ContextLength": ".think_settings_v1context_length", - "ThinkSettingsV1Endpoint": ".think_settings_v1endpoint", - "ThinkSettingsV1FunctionsItem": ".think_settings_v1functions_item", - "ThinkSettingsV1FunctionsItemEndpoint": ".think_settings_v1functions_item_endpoint", - "ThinkSettingsV1Provider": ".think_settings_v1provider", - "ThinkSettingsV1Provider_Anthropic": ".think_settings_v1provider", - "ThinkSettingsV1Provider_AwsBedrock": ".think_settings_v1provider", - "ThinkSettingsV1Provider_Deepgram": ".think_settings_v1provider", - "ThinkSettingsV1Provider_Google": ".think_settings_v1provider", - "ThinkSettingsV1Provider_Groq": ".think_settings_v1provider", - "ThinkSettingsV1Provider_OpenAi": ".think_settings_v1provider", - "UpdateProjectMemberScopesV1Response": ".update_project_member_scopes_v1response", - "UpdateProjectV1Response": ".update_project_v1response", - "UsageBreakdownV1Response": ".usage_breakdown_v1response", - "UsageBreakdownV1ResponseResolution": ".usage_breakdown_v1response_resolution", - "UsageBreakdownV1ResponseResultsItem": ".usage_breakdown_v1response_results_item", - "UsageBreakdownV1ResponseResultsItemGrouping": ".usage_breakdown_v1response_results_item_grouping", - "UsageFieldsV1Response": ".usage_fields_v1response", - "UsageFieldsV1ResponseModelsItem": ".usage_fields_v1response_models_item", - "UsageV1Response": ".usage_v1response", - "UsageV1ResponseResolution": ".usage_v1response_resolution", -} - -_dynamic_imports.update( - { - "SharedIntentsResults": ".shared_intents_results", - "SharedIntentsResultsIntents": ".shared_intents_results_intents", - "SharedIntentsResultsIntentsSegmentsItem": ".shared_intents_results_intents_segments_item", - "SharedIntentsResultsIntentsSegmentsItemIntentsItem": ".shared_intents_results_intents_segments_item_intents_item", - "SharedTopicsResults": ".shared_topics_results", - "SharedTopicsResultsTopics": ".shared_topics_results_topics", - "SharedTopicsResultsTopicsSegmentsItem": ".shared_topics_results_topics_segments_item", - "SharedTopicsResultsTopicsSegmentsItemTopicsItem": ".shared_topics_results_topics_segments_item_topics_item", - "AnthropicThinkProviderModel": ".anthropic_think_provider_model", - "CartesiaSpeakProviderModelId": ".cartesia_speak_provider_model_id", - "CartesiaSpeakProviderVoice": ".cartesia_speak_provider_voice", - "CreateKeyV1RequestOne": ".create_key_v1request_one", - "DeepgramListenProviderV2LanguageHint": ".deepgram_listen_provider_v2language_hint", - "DeepgramSpeakProviderModel": ".deepgram_speak_provider_model", - "GoogleThinkProviderModel": ".google_think_provider_model", - "GoogleThinkProviderVersion": ".google_think_provider_version", - "GroqThinkProviderReasoningMode": ".groq_think_provider_reasoning_mode", - } -) - - -def __getattr__(attr_name: str) -> typing.Any: - module_name = _dynamic_imports.get(attr_name) - if module_name is None: - raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") - try: - module = import_module(module_name, __package__) - if module_name == f".{attr_name}": - return module - else: - return getattr(module, attr_name) - except ImportError as e: - raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e - except AttributeError as e: - raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e - - -def __dir__(): - lazy_attrs = list(_dynamic_imports.keys()) - return sorted(lazy_attrs) - - -__all__ = [ - "AgentConfigurationV1", - "AgentThinkModelsV1Response", - "AgentThinkModelsV1ResponseModelsItem", - "AgentThinkModelsV1ResponseModelsItemId", - "AgentThinkModelsV1ResponseModelsItemOne", - "AgentThinkModelsV1ResponseModelsItemOneId", - "AgentThinkModelsV1ResponseModelsItemThree", - "AgentThinkModelsV1ResponseModelsItemTwo", - "AgentThinkModelsV1ResponseModelsItemTwoId", - "AgentThinkModelsV1ResponseModelsItemZero", - "AgentThinkModelsV1ResponseModelsItemZeroId", - "AgentVariableV1", - "Anthropic", - "AnthropicModel", - "AwsBedrockThinkProvider", - "AwsBedrockThinkProviderCredentials", - "AwsBedrockThinkProviderCredentialsType", - "AwsBedrockThinkProviderModel", - "AwsPollySpeakProvider", - "AwsPollySpeakProviderCredentials", - "AwsPollySpeakProviderCredentialsType", - "AwsPollySpeakProviderEngine", - "AwsPollySpeakProviderVoice", - "BillingBreakdownV1Response", - "BillingBreakdownV1ResponseResolution", - "BillingBreakdownV1ResponseResultsItem", - "BillingBreakdownV1ResponseResultsItemGrouping", - "Cartesia", - "CartesiaModelId", - "CartesiaVoice", - "CreateAgentConfigurationV1Response", - "CreateKeyV1Request", - "CreateKeyV1Response", - "CreateProjectDistributionCredentialsV1Response", - "CreateProjectDistributionCredentialsV1ResponseDistributionCredentials", - "CreateProjectDistributionCredentialsV1ResponseMember", - "CreateProjectInviteV1Response", - "Deepgram", - "DeepgramListenProviderV1", - "DeepgramListenProviderV2", - "DeepgramModel", - "DeepgramThinkLiveProviderV1", - "DeepgramThinkProvider", - "DeepgramThinkProviderModel", - "DeepgramThinkProviderReasoningMode", - "DeleteAgentConfigurationV1Response", - "DeleteAgentVariableV1Response", - "DeleteProjectInviteV1Response", - "DeleteProjectKeyV1Response", - "DeleteProjectMemberV1Response", - "DeleteProjectV1Response", - "ElevenLabsSpeakProvider", - "ElevenLabsSpeakProviderModelId", - "ErrorResponse", - "ErrorResponseLegacyError", - "ErrorResponseModernError", - "ErrorResponseTextError", - "GetModelV1Response", - "GetModelV1ResponseBatch", - "GetModelV1ResponseMetadata", - "GetModelV1ResponseMetadataMetadata", - "GetProjectBalanceV1Response", - "GetProjectDistributionCredentialsV1Response", - "GetProjectDistributionCredentialsV1ResponseDistributionCredentials", - "GetProjectDistributionCredentialsV1ResponseMember", - "GetProjectKeyV1Response", - "GetProjectKeyV1ResponseItem", - "GetProjectKeyV1ResponseItemMember", - "GetProjectKeyV1ResponseItemMemberApiKey", - "GetProjectRequestV1Response", - "GetProjectV1Response", - "Google", - "GoogleModel", - "GoogleVersion", - "GrantV1Response", - "Groq", - "GroqReasoningMode", - "LeaveProjectV1Response", - "ListAgentConfigurationsV1Response", - "ListAgentVariablesV1Response", - "ListBillingFieldsV1Response", - "ListBillingFieldsV1ResponseDeploymentsItem", - "ListModelsV1Response", - "ListModelsV1ResponseSttModels", - "ListModelsV1ResponseTtsModels", - "ListModelsV1ResponseTtsModelsMetadata", - "ListProjectBalancesV1Response", - "ListProjectBalancesV1ResponseBalancesItem", - "ListProjectDistributionCredentialsV1Response", - "ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItem", - "ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemDistributionCredentials", - "ListProjectDistributionCredentialsV1ResponseDistributionCredentialsItemMember", - "ListProjectInvitesV1Response", - "ListProjectInvitesV1ResponseInvitesItem", - "ListProjectKeysV1Response", - "ListProjectKeysV1ResponseApiKeysItem", - "ListProjectKeysV1ResponseApiKeysItemApiKey", - "ListProjectKeysV1ResponseApiKeysItemMember", - "ListProjectMemberScopesV1Response", - "ListProjectMembersV1Response", - "ListProjectMembersV1ResponseMembersItem", - "ListProjectPurchasesV1Response", - "ListProjectPurchasesV1ResponseOrdersItem", - "ListProjectRequestsV1Response", - "ListProjectsV1Response", - "ListProjectsV1ResponseProjectsItem", - "ListenV1AcceptedResponse", - "ListenV1Callback", - "ListenV1CallbackMethod", - "ListenV1Channels", - "ListenV1DetectEntities", - "ListenV1Diarize", - "ListenV1Dictation", - "ListenV1Encoding", - "ListenV1Endpointing", - "ListenV1Extra", - "ListenV1InterimResults", - "ListenV1Keyterm", - "ListenV1Keywords", - "ListenV1Language", - "ListenV1LanguageHint", - "ListenV1MipOptOut", - "ListenV1Model", - "ListenV1Multichannel", - "ListenV1Numerals", - "ListenV1ProfanityFilter", - "ListenV1Punctuate", - "ListenV1Redact", - "ListenV1RedactUsage", - "ListenV1Replace", - "ListenV1RequestFile", - "ListenV1Response", - "ListenV1ResponseMetadata", - "ListenV1ResponseMetadataDiarizeInfo", - "ListenV1ResponseMetadataIntentsInfo", - "ListenV1ResponseMetadataSentimentInfo", - "ListenV1ResponseMetadataSummaryInfo", - "ListenV1ResponseMetadataTopicsInfo", - "ListenV1ResponseResults", - "ListenV1ResponseResultsChannels", - "ListenV1ResponseResultsChannelsItem", - "ListenV1ResponseResultsChannelsItemAlternativesItem", - "ListenV1ResponseResultsChannelsItemAlternativesItemEntitiesItem", - "ListenV1ResponseResultsChannelsItemAlternativesItemParagraphs", - "ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParagraphsItem", - "ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParagraphsItemSentencesItem", - "ListenV1ResponseResultsChannelsItemAlternativesItemSummariesItem", - "ListenV1ResponseResultsChannelsItemAlternativesItemTopicsItem", - "ListenV1ResponseResultsChannelsItemAlternativesItemWordsItem", - "ListenV1ResponseResultsChannelsItemSearchItem", - "ListenV1ResponseResultsChannelsItemSearchItemHitsItem", - "ListenV1ResponseResultsSummary", - "ListenV1ResponseResultsUtterances", - "ListenV1ResponseResultsUtterancesItem", - "ListenV1ResponseResultsUtterancesItemWordsItem", - "ListenV1SampleRate", - "ListenV1Search", - "ListenV1SmartFormat", - "ListenV1Tag", - "ListenV1UtteranceEndMs", - "ListenV1VadEvents", - "ListenV1Version", - "ListenV2ConfigureNumerals", - "ListenV2ConfigureRedactUsage", - "ListenV2EagerEotThreshold", - "ListenV2Encoding", - "ListenV2EotThreshold", - "ListenV2EotTimeoutMs", - "ListenV2Keyterm", - "ListenV2LanguageHint", - "ListenV2MipOptOut", - "ListenV2Model", - "ListenV2Numerals", - "ListenV2ProfanityFilter", - "ListenV2Redact", - "ListenV2RedactUsage", - "ListenV2SampleRate", - "ListenV2Tag", - "OpenAiSpeakProvider", - "OpenAiSpeakProviderModel", - "OpenAiSpeakProviderVoice", - "OpenAiThinkProvider", - "OpenAiThinkProviderModel", - "OpenAiThinkProviderReasoningMode", - "ProjectRequestResponse", - "ReadV1Request", - "ReadV1RequestText", - "ReadV1RequestUrl", - "ReadV1Response", - "ReadV1ResponseMetadata", - "ReadV1ResponseMetadataMetadata", - "ReadV1ResponseMetadataMetadataIntentsInfo", - "ReadV1ResponseMetadataMetadataSentimentInfo", - "ReadV1ResponseMetadataMetadataSummaryInfo", - "ReadV1ResponseMetadataMetadataTopicsInfo", - "ReadV1ResponseResults", - "ReadV1ResponseResultsSummary", - "ReadV1ResponseResultsSummaryResults", - "ReadV1ResponseResultsSummaryResultsSummary", - "SharedIntents", - "SharedIntentsSegmentsItem", - "SharedIntentsSegmentsItemIntentsItem", - "SharedSentiments", - "SharedSentimentsAverage", - "SharedSentimentsSegmentsItem", - "SharedTopics", - "SharedTopicsSegmentsItem", - "SharedTopicsSegmentsItemTopicsItem", - "SpeakSettingsV1", - "SpeakSettingsV1Endpoint", - "SpeakSettingsV1Provider", - "SpeakSettingsV1Provider_AwsPolly", - "SpeakSettingsV1Provider_Cartesia", - "SpeakSettingsV1Provider_Deepgram", - "SpeakSettingsV1Provider_ElevenLabs", - "SpeakSettingsV1Provider_OpenAi", - "SpeakV1Encoding", - "SpeakV1MipOptOut", - "SpeakV1Model", - "SpeakV1Response", - "SpeakV1SampleRate", - "SpeakV1Speed", - "SpeakV2AcceptedResponse", - "SpeakV2Encoding", - "SpeakV2Expressivity", - "SpeakV2MipOptOut", - "SpeakV2Model", - "SpeakV2NormalizeVolume", - "SpeakV2Response", - "SpeakV2SampleRate", - "SpeakV2Speed", - "SpeakV2SpeedValue", - "SpeakV2Tag", - "ThinkLiveSettingsV1", - "ThinkSettingsV1", - "ThinkSettingsV1ContextLength", - "ThinkSettingsV1Endpoint", - "ThinkSettingsV1FunctionsItem", - "ThinkSettingsV1FunctionsItemEndpoint", - "ThinkSettingsV1Provider", - "ThinkSettingsV1Provider_Anthropic", - "ThinkSettingsV1Provider_AwsBedrock", - "ThinkSettingsV1Provider_Deepgram", - "ThinkSettingsV1Provider_Google", - "ThinkSettingsV1Provider_Groq", - "ThinkSettingsV1Provider_OpenAi", - "UpdateProjectMemberScopesV1Response", - "UpdateProjectV1Response", - "UsageBreakdownV1Response", - "UsageBreakdownV1ResponseResolution", - "UsageBreakdownV1ResponseResultsItem", - "UsageBreakdownV1ResponseResultsItemGrouping", - "UsageFieldsV1Response", - "UsageFieldsV1ResponseModelsItem", - "UsageV1Response", - "UsageV1ResponseResolution", -] - -__all__.extend( - [ - "SharedIntentsResults", - "SharedIntentsResultsIntents", - "SharedIntentsResultsIntentsSegmentsItem", - "SharedIntentsResultsIntentsSegmentsItemIntentsItem", - "SharedTopicsResults", - "SharedTopicsResultsTopics", - "SharedTopicsResultsTopicsSegmentsItem", - "SharedTopicsResultsTopicsSegmentsItemTopicsItem", - "AnthropicThinkProviderModel", - "CartesiaSpeakProviderModelId", - "CartesiaSpeakProviderVoice", - "CreateKeyV1RequestOne", - "DeepgramListenProviderV2LanguageHint", - "DeepgramSpeakProviderModel", - "GoogleThinkProviderModel", - "GoogleThinkProviderVersion", - "GroqThinkProviderReasoningMode", - ] -) diff --git a/src/deepgram/types/create_key_v1request.py b/src/deepgram/types/create_key_v1request.py new file mode 100644 index 00000000..35da44aa --- /dev/null +++ b/src/deepgram/types/create_key_v1request.py @@ -0,0 +1,14 @@ +# Hand-written compatibility shim recreating `CreateKeyV1Request`, which Fern removed in the +# 2026-12-01 regen when `manage.v1.projects.keys.create` moved from a single opaque `request` +# argument to explicit keyword arguments. +# +# The type stays on the public import surface for two reasons: callers import it directly, and +# the permanently frozen `create_key_v1request_one.py` alias (which preserves an even older +# public name) imports it. Without this module that alias raises ModuleNotFoundError. +# +# The definition is byte-for-byte what the generator used to emit, so the identity assertions in +# tests/custom/test_compat_aliases.py continue to hold. + +import typing + +CreateKeyV1Request = typing.Union[typing.Any] diff --git a/src/deepgram/types/deepgram.py b/src/deepgram/types/deepgram.py index ec242762..994f7a2c 100644 --- a/src/deepgram/types/deepgram.py +++ b/src/deepgram/types/deepgram.py @@ -29,7 +29,7 @@ class Deepgram(UncheckedBaseModel): Speaking rate multiplier that adjusts the pace of generated speech while preserving natural prosody and voice quality. Aura (version v1) accepts any value from 0.7 to 1.5. Flux TTS (version v2) accepts values from 0.5 to 1.5 in 0.05 increments; a value the family does not accept ends the session with FAILED_TO_SPEAK. Not yet supported in all languages. """ - expressivity: typing.Optional[int] = pydantic.Field(default=None) + expressivity: typing.Optional[pydantic.StrictInt] = pydantic.Field(default=None) """ Delivery register of the generated speech, on a calm-to-animated axis. Flux TTS (version v2) only, on every Flux voice. Accepts the whole numbers -2 to 2, where 0 (the default) is the voice's tuned delivery and the only value validated for production, -2 the calm end of the range and 2 the animated end. Fixed for the session. Beta: behavior may change in future model versions, and non-default values increase the risk of hallucinations and pronunciation errors. See [Expressivity](/docs/tts-expressivity). """ diff --git a/src/deepgram/types/deepgram.py.bak b/src/deepgram/types/deepgram.py.bak deleted file mode 100644 index 994f7a2c..00000000 --- a/src/deepgram/types/deepgram.py.bak +++ /dev/null @@ -1,44 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .deepgram_model import DeepgramModel - - -class Deepgram(UncheckedBaseModel): - """ - Deepgram text-to-speech provider. Aura models use version v1 (default); Flux TTS uses version v2 and a flux-* model. Flux TTS is the default when agent.speak is omitted, using the flux-kit-en voice. - """ - - type: typing.Literal["deepgram"] = "deepgram" - version: typing.Optional[str] = pydantic.Field(default=None) - """ - The Deepgram text-to-speech model family. Accepted values: `v1` (Aura, the default) and `v2` (Flux TTS). Use `v1` with an aura-* model and `v2` with a flux-* model. Defaults to `v1` when omitted. - """ - - model: DeepgramModel = pydantic.Field() - """ - Deepgram TTS model. Aura models (version v1) use the aura-* voices; Flux TTS (version v2) uses the flux-{voice}-{language} voices (e.g. flux-alexis-en). Defaults to flux-kit-en when agent.speak is omitted. - """ - - speed: typing.Optional[float] = pydantic.Field(default=None) - """ - Speaking rate multiplier that adjusts the pace of generated speech while preserving natural prosody and voice quality. Aura (version v1) accepts any value from 0.7 to 1.5. Flux TTS (version v2) accepts values from 0.5 to 1.5 in 0.05 increments; a value the family does not accept ends the session with FAILED_TO_SPEAK. Not yet supported in all languages. - """ - - expressivity: typing.Optional[pydantic.StrictInt] = pydantic.Field(default=None) - """ - Delivery register of the generated speech, on a calm-to-animated axis. Flux TTS (version v2) only, on every Flux voice. Accepts the whole numbers -2 to 2, where 0 (the default) is the voice's tuned delivery and the only value validated for production, -2 the calm end of the range and 2 the animated end. Fixed for the session. Beta: behavior may change in future model versions, and non-default values increase the risk of hallucinations and pronunciation errors. See [Expressivity](/docs/tts-expressivity). - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/deepgram/types/deepgram_listen_provider_v2.py b/src/deepgram/types/deepgram_listen_provider_v2.py index f7a155fb..d24729a0 100644 --- a/src/deepgram/types/deepgram_listen_provider_v2.py +++ b/src/deepgram/types/deepgram_listen_provider_v2.py @@ -28,6 +28,12 @@ class DeepgramListenProviderV2(UncheckedBaseModel): An array of one or more BCP-47 language codes to bias the model toward specific languages. Only supported when model is flux-general-multi. Without hints, the model auto-detects the spoken language. See the Language Prompting guide for details. """ + language_hint: typing.Optional[typing.Union[str, typing.List[str]]] = pydantic.Field(default=None, exclude=True) + """ + Deprecated. Use `language_hints`. Accepted for backward compatibility and + remapped before serialization so the singular field never reaches the API. + """ + eot_threshold: typing.Optional[float] = pydantic.Field(default=None) """ End-of-turn confidence required to finish a turn. Valid range: 0.5 - 1.0. Defaults to 0.7. Set to 1.0 to fully suppress confidence-based end-of-turn detection. `eot_timeout_ms` still ends idle turns; increase it when using ForceEndTurn for full manual turn control. @@ -49,9 +55,31 @@ class DeepgramListenProviderV2(UncheckedBaseModel): """ if IS_PYDANTIC_V2: + + @pydantic.model_validator(mode="before") + @classmethod + def _migrate_language_hint(cls, values: typing.Any) -> typing.Any: + if not isinstance(values, dict) or "language_hint" not in values: + return values + values = dict(values) + hint = values.pop("language_hint") + if hint is not None and values.get("language_hints") is None: + values["language_hints"] = [hint] if isinstance(hint, str) else list(hint) + return values + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: + @pydantic.root_validator(pre=True) # type: ignore[deprecated] + def _migrate_language_hint(cls, values: typing.Any) -> typing.Any: # type: ignore[no-redef] + if not isinstance(values, dict) or "language_hint" not in values: + return values + values = dict(values) + hint = values.pop("language_hint") + if hint is not None and values.get("language_hints") is None: + values["language_hints"] = [hint] if isinstance(hint, str) else list(hint) + return values + class Config: frozen = True smart_union = True diff --git a/src/deepgram/types/deepgram_listen_provider_v2.py.bak b/src/deepgram/types/deepgram_listen_provider_v2.py.bak deleted file mode 100644 index d24729a0..00000000 --- a/src/deepgram/types/deepgram_listen_provider_v2.py.bak +++ /dev/null @@ -1,86 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel - - -class DeepgramListenProviderV2(UncheckedBaseModel): - type: typing.Literal["deepgram"] = pydantic.Field(default="deepgram") - """ - Provider type for speech-to-text - """ - - version: typing.Optional[typing.Literal["v2"]] = pydantic.Field(default=None) - """ - Specifies usage of the V2 Deepgram speech-to-text API (e.g. Flux) - """ - - model: str = pydantic.Field() - """ - Model to use for speech to text using the V2 API (e.g. flux-general-en, flux-general-multi) - """ - - language_hints: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - An array of one or more BCP-47 language codes to bias the model toward specific languages. Only supported when model is flux-general-multi. Without hints, the model auto-detects the spoken language. See the Language Prompting guide for details. - """ - - language_hint: typing.Optional[typing.Union[str, typing.List[str]]] = pydantic.Field(default=None, exclude=True) - """ - Deprecated. Use `language_hints`. Accepted for backward compatibility and - remapped before serialization so the singular field never reaches the API. - """ - - eot_threshold: typing.Optional[float] = pydantic.Field(default=None) - """ - End-of-turn confidence required to finish a turn. Valid range: 0.5 - 1.0. Defaults to 0.7. Set to 1.0 to fully suppress confidence-based end-of-turn detection. `eot_timeout_ms` still ends idle turns; increase it when using ForceEndTurn for full manual turn control. - """ - - eager_eot_threshold: typing.Optional[float] = pydantic.Field(default=None) - """ - End-of-turn confidence required to fire an eager end-of-turn event. When set, enables EagerEndOfTurn and TurnResumed events. Valid range: 0.3 - 0.9. - """ - - eot_timeout_ms: typing.Optional[int] = pydantic.Field(default=None) - """ - A turn will be finished when this much time in milliseconds has passed after speech, regardless of EOT confidence. Defaults to 5000. - """ - - keyterms: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - Prompt keyterm recognition to improve Keyword Recall Rate - """ - - if IS_PYDANTIC_V2: - - @pydantic.model_validator(mode="before") - @classmethod - def _migrate_language_hint(cls, values: typing.Any) -> typing.Any: - if not isinstance(values, dict) or "language_hint" not in values: - return values - values = dict(values) - hint = values.pop("language_hint") - if hint is not None and values.get("language_hints") is None: - values["language_hints"] = [hint] if isinstance(hint, str) else list(hint) - return values - - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - @pydantic.root_validator(pre=True) # type: ignore[deprecated] - def _migrate_language_hint(cls, values: typing.Any) -> typing.Any: # type: ignore[no-redef] - if not isinstance(values, dict) or "language_hint" not in values: - return values - values = dict(values) - hint = values.pop("language_hint") - if hint is not None and values.get("language_hints") is None: - values["language_hints"] = [hint] if isinstance(hint, str) else list(hint) - return values - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/deepgram/types/shared_intents.py b/src/deepgram/types/shared_intents.py index f03d4225..ad991bcf 100644 --- a/src/deepgram/types/shared_intents.py +++ b/src/deepgram/types/shared_intents.py @@ -5,6 +5,8 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +from .shared_intents_results import SharedIntentsResults +from .shared_intents_results_intents import SharedIntentsResultsIntents from .shared_intents_segments_item import SharedIntentsSegmentsItem @@ -15,10 +17,45 @@ class SharedIntents(UncheckedBaseModel): segments: typing.Optional[typing.List[SharedIntentsSegmentsItem]] = None + @property + def results(self) -> typing.Optional[SharedIntentsResults]: + """Deprecated facade for the pre-7.12 ``results.intents.segments`` path.""" + if self.segments is None: + return None + return SharedIntentsResults(intents=SharedIntentsResultsIntents(segments=self.segments)) + if IS_PYDANTIC_V2: + + @pydantic.model_validator(mode="before") + @classmethod + def _migrate_legacy_results(cls, values: typing.Any) -> typing.Any: + if not isinstance(values, dict) or "results" not in values: + return values + values = dict(values) + results = values.pop("results") + if "segments" in values: + return values + intents = results.get("intents") if isinstance(results, dict) else getattr(results, "intents", None) + if intents is not None: + values["segments"] = intents.get("segments") if isinstance(intents, dict) else intents.segments + return values + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: + @pydantic.root_validator(pre=True) # type: ignore[deprecated] + def _migrate_legacy_results(cls, values: typing.Any) -> typing.Any: # type: ignore[no-redef] + if not isinstance(values, dict) or "results" not in values: + return values + values = dict(values) + results = values.pop("results") + if "segments" in values: + return values + intents = results.get("intents") if isinstance(results, dict) else getattr(results, "intents", None) + if intents is not None: + values["segments"] = intents.get("segments") if isinstance(intents, dict) else intents.segments + return values + class Config: frozen = True smart_union = True diff --git a/src/deepgram/types/shared_intents.py.bak b/src/deepgram/types/shared_intents.py.bak deleted file mode 100644 index ad991bcf..00000000 --- a/src/deepgram/types/shared_intents.py.bak +++ /dev/null @@ -1,62 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .shared_intents_results import SharedIntentsResults -from .shared_intents_results_intents import SharedIntentsResultsIntents -from .shared_intents_segments_item import SharedIntentsSegmentsItem - - -class SharedIntents(UncheckedBaseModel): - """ - Output whenever `intents=true` is used - """ - - segments: typing.Optional[typing.List[SharedIntentsSegmentsItem]] = None - - @property - def results(self) -> typing.Optional[SharedIntentsResults]: - """Deprecated facade for the pre-7.12 ``results.intents.segments`` path.""" - if self.segments is None: - return None - return SharedIntentsResults(intents=SharedIntentsResultsIntents(segments=self.segments)) - - if IS_PYDANTIC_V2: - - @pydantic.model_validator(mode="before") - @classmethod - def _migrate_legacy_results(cls, values: typing.Any) -> typing.Any: - if not isinstance(values, dict) or "results" not in values: - return values - values = dict(values) - results = values.pop("results") - if "segments" in values: - return values - intents = results.get("intents") if isinstance(results, dict) else getattr(results, "intents", None) - if intents is not None: - values["segments"] = intents.get("segments") if isinstance(intents, dict) else intents.segments - return values - - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - @pydantic.root_validator(pre=True) # type: ignore[deprecated] - def _migrate_legacy_results(cls, values: typing.Any) -> typing.Any: # type: ignore[no-redef] - if not isinstance(values, dict) or "results" not in values: - return values - values = dict(values) - results = values.pop("results") - if "segments" in values: - return values - intents = results.get("intents") if isinstance(results, dict) else getattr(results, "intents", None) - if intents is not None: - values["segments"] = intents.get("segments") if isinstance(intents, dict) else intents.segments - return values - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/deepgram/types/shared_topics.py b/src/deepgram/types/shared_topics.py index 0f6a4a76..4f26c3b7 100644 --- a/src/deepgram/types/shared_topics.py +++ b/src/deepgram/types/shared_topics.py @@ -5,6 +5,8 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel +from .shared_topics_results import SharedTopicsResults +from .shared_topics_results_topics import SharedTopicsResultsTopics from .shared_topics_segments_item import SharedTopicsSegmentsItem @@ -15,10 +17,45 @@ class SharedTopics(UncheckedBaseModel): segments: typing.Optional[typing.List[SharedTopicsSegmentsItem]] = None + @property + def results(self) -> typing.Optional[SharedTopicsResults]: + """Deprecated facade for the pre-7.12 ``results.topics.segments`` path.""" + if self.segments is None: + return None + return SharedTopicsResults(topics=SharedTopicsResultsTopics(segments=self.segments)) + if IS_PYDANTIC_V2: + + @pydantic.model_validator(mode="before") + @classmethod + def _migrate_legacy_results(cls, values: typing.Any) -> typing.Any: + if not isinstance(values, dict) or "results" not in values: + return values + values = dict(values) + results = values.pop("results") + if "segments" in values: + return values + topics = results.get("topics") if isinstance(results, dict) else getattr(results, "topics", None) + if topics is not None: + values["segments"] = topics.get("segments") if isinstance(topics, dict) else topics.segments + return values + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: + @pydantic.root_validator(pre=True) # type: ignore[deprecated] + def _migrate_legacy_results(cls, values: typing.Any) -> typing.Any: # type: ignore[no-redef] + if not isinstance(values, dict) or "results" not in values: + return values + values = dict(values) + results = values.pop("results") + if "segments" in values: + return values + topics = results.get("topics") if isinstance(results, dict) else getattr(results, "topics", None) + if topics is not None: + values["segments"] = topics.get("segments") if isinstance(topics, dict) else topics.segments + return values + class Config: frozen = True smart_union = True diff --git a/src/deepgram/types/shared_topics.py.bak b/src/deepgram/types/shared_topics.py.bak deleted file mode 100644 index 4f26c3b7..00000000 --- a/src/deepgram/types/shared_topics.py.bak +++ /dev/null @@ -1,62 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .shared_topics_results import SharedTopicsResults -from .shared_topics_results_topics import SharedTopicsResultsTopics -from .shared_topics_segments_item import SharedTopicsSegmentsItem - - -class SharedTopics(UncheckedBaseModel): - """ - Output whenever `topics=true` is used - """ - - segments: typing.Optional[typing.List[SharedTopicsSegmentsItem]] = None - - @property - def results(self) -> typing.Optional[SharedTopicsResults]: - """Deprecated facade for the pre-7.12 ``results.topics.segments`` path.""" - if self.segments is None: - return None - return SharedTopicsResults(topics=SharedTopicsResultsTopics(segments=self.segments)) - - if IS_PYDANTIC_V2: - - @pydantic.model_validator(mode="before") - @classmethod - def _migrate_legacy_results(cls, values: typing.Any) -> typing.Any: - if not isinstance(values, dict) or "results" not in values: - return values - values = dict(values) - results = values.pop("results") - if "segments" in values: - return values - topics = results.get("topics") if isinstance(results, dict) else getattr(results, "topics", None) - if topics is not None: - values["segments"] = topics.get("segments") if isinstance(topics, dict) else topics.segments - return values - - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - @pydantic.root_validator(pre=True) # type: ignore[deprecated] - def _migrate_legacy_results(cls, values: typing.Any) -> typing.Any: # type: ignore[no-redef] - if not isinstance(values, dict) or "results" not in values: - return values - values = dict(values) - results = values.pop("results") - if "segments" in values: - return values - topics = results.get("topics") if isinstance(results, dict) else getattr(results, "topics", None) - if topics is not None: - values["segments"] = topics.get("segments") if isinstance(topics, dict) else topics.segments - return values - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/deepgram/types/speak_settings_v1provider.py b/src/deepgram/types/speak_settings_v1provider.py index 305cdba8..3fbef168 100644 --- a/src/deepgram/types/speak_settings_v1provider.py +++ b/src/deepgram/types/speak_settings_v1provider.py @@ -24,7 +24,7 @@ class SpeakSettingsV1Provider_Deepgram(UncheckedBaseModel): version: typing.Optional[str] = None model: DeepgramModel speed: typing.Optional[float] = None - expressivity: typing.Optional[int] = None + expressivity: typing.Optional[pydantic.StrictInt] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/deepgram/types/speak_settings_v1provider.py.bak b/src/deepgram/types/speak_settings_v1provider.py.bak deleted file mode 100644 index 3fbef168..00000000 --- a/src/deepgram/types/speak_settings_v1provider.py.bak +++ /dev/null @@ -1,117 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from __future__ import annotations - -import typing - -import pydantic -import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata -from .aws_polly_speak_provider_credentials import AwsPollySpeakProviderCredentials -from .aws_polly_speak_provider_engine import AwsPollySpeakProviderEngine -from .aws_polly_speak_provider_voice import AwsPollySpeakProviderVoice -from .cartesia_model_id import CartesiaModelId -from .cartesia_voice import CartesiaVoice -from .deepgram_model import DeepgramModel -from .eleven_labs_speak_provider_model_id import ElevenLabsSpeakProviderModelId -from .open_ai_speak_provider_model import OpenAiSpeakProviderModel -from .open_ai_speak_provider_voice import OpenAiSpeakProviderVoice - - -class SpeakSettingsV1Provider_Deepgram(UncheckedBaseModel): - type: typing.Literal["deepgram"] = "deepgram" - version: typing.Optional[str] = None - model: DeepgramModel - speed: typing.Optional[float] = None - expressivity: typing.Optional[pydantic.StrictInt] = None - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow - - -class SpeakSettingsV1Provider_ElevenLabs(UncheckedBaseModel): - type: typing.Literal["eleven_labs"] = "eleven_labs" - version: typing.Optional[typing.Literal["v1"]] = None - model_id: ElevenLabsSpeakProviderModelId - language: typing.Optional[str] = None - language_code: typing.Optional[str] = None - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow - - -class SpeakSettingsV1Provider_Cartesia(UncheckedBaseModel): - type: typing.Literal["cartesia"] = "cartesia" - version: typing.Optional[typing.Literal["2025-03-17"]] = None - model_id: CartesiaModelId - voice: CartesiaVoice - language: typing.Optional[str] = None - volume: typing.Optional[float] = None - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow - - -class SpeakSettingsV1Provider_OpenAi(UncheckedBaseModel): - type: typing.Literal["open_ai"] = "open_ai" - version: typing.Optional[typing.Literal["v1"]] = None - model: OpenAiSpeakProviderModel - voice: OpenAiSpeakProviderVoice - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow - - -class SpeakSettingsV1Provider_AwsPolly(UncheckedBaseModel): - type: typing.Literal["aws_polly"] = "aws_polly" - voice: AwsPollySpeakProviderVoice - language: str - language_code: typing.Optional[str] = None - engine: AwsPollySpeakProviderEngine - credentials: AwsPollySpeakProviderCredentials - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow - - -SpeakSettingsV1Provider = typing_extensions.Annotated[ - typing.Union[ - SpeakSettingsV1Provider_Deepgram, - SpeakSettingsV1Provider_ElevenLabs, - SpeakSettingsV1Provider_Cartesia, - SpeakSettingsV1Provider_OpenAi, - SpeakSettingsV1Provider_AwsPolly, - ], - UnionMetadata(discriminant="type"), -] diff --git a/tests/custom/test_create_key_legacy_request.py b/tests/custom/test_create_key_legacy_request.py new file mode 100644 index 00000000..6c76bcfd --- /dev/null +++ b/tests/custom/test_create_key_legacy_request.py @@ -0,0 +1,182 @@ +"""Regression coverage for the deprecated ``request`` argument on create-key. + +Through SDK 7.20, ``manage.v1.projects.keys.create`` took a single opaque ``request`` mapping, +typed ``Any``, which the SDK forwarded to the server without validating or filtering it. The +2026-12-01 Fern regeneration replaced it with explicit keyword arguments, which raises +``TypeError`` for every caller written against an earlier release. + +``_build_create_key_body`` in ``manage/v1/projects/keys/raw_client.py`` keeps the old form +working. These tests pin the parts of that behavior a future regeneration could quietly drop: +that the legacy mapping is forwarded verbatim rather than validated, that explicit keyword +arguments win over it, and that both call shapes produce the same request body on the sync, +async, and ``with_raw_response`` surfaces. +""" + +import json +import typing + +import httpx +import pytest +import respx + +from deepgram import AsyncDeepgramClient, DeepgramClient +from deepgram.environment import DeepgramClientEnvironment + +HOST = "test.deepgram.local" +BASE = f"https://{HOST}" +PROJECT = "project-id" + + +def _environment() -> DeepgramClientEnvironment: + return DeepgramClientEnvironment(base=BASE, production=BASE, agent=BASE, agent_rest=BASE) + + +def _sync_client() -> DeepgramClient: + return DeepgramClient(environment=_environment(), api_key="test_api_key") + + +def _async_client() -> AsyncDeepgramClient: + # respx cannot intercept the auto-detected aiohttp transport, so force plain httpx. + return AsyncDeepgramClient(environment=_environment(), api_key="test_api_key", httpx_client=httpx.AsyncClient()) + + +_RESPONSE = { + "api_key_id": "1234567890abcdef1234567890abcdef", + "key": "1234567890abcdef1234567890abcdef", + "comment": "a comment", + "scopes": ["member"], +} + + +def _sent_body(route: respx.Route) -> typing.Dict[str, typing.Any]: + """The JSON body of the single request recorded against ``route``.""" + assert route.call_count == 1 + request = route.calls[0].request + return typing.cast(typing.Dict[str, typing.Any], json.loads(request.content)) + + +def _route() -> respx.Route: + return respx.post(f"{BASE}/v1/projects/{PROJECT}/keys").mock(return_value=httpx.Response(200, json=_RESPONSE)) + + +def test_legacy_request_mapping_and_keyword_arguments_send_the_same_body() -> None: + """The two call shapes are interchangeable for the fields the endpoint declares.""" + with respx.mock: + route = _route() + _sync_client().manage.v1.projects.keys.create( + project_id=PROJECT, request={"comment": "a comment", "scopes": ["member"]} + ) + legacy_body = _sent_body(route) + + with respx.mock: + route = _route() + _sync_client().manage.v1.projects.keys.create(project_id=PROJECT, comment="a comment", scopes=["member"]) + current_body = _sent_body(route) + + assert legacy_body == {"comment": "a comment", "scopes": ["member"]} + assert legacy_body == current_body + + +def test_legacy_request_mapping_forwards_unknown_keys() -> None: + """The old argument was typed ``Any`` and never filtered, so unknown keys still reach the API. + + Dropping them here would silently change what the server receives for a caller who relied on + a field the spec had not caught up with. + """ + with respx.mock: + route = _route() + _sync_client().manage.v1.projects.keys.create( + project_id=PROJECT, request={"comment": "a comment", "scopes": ["member"], "not_in_the_spec": True} + ) + assert _sent_body(route) == {"comment": "a comment", "scopes": ["member"], "not_in_the_spec": True} + + +def test_legacy_request_mapping_does_not_require_any_field() -> None: + """The old call had no required fields; the server decided what a valid body was.""" + with respx.mock: + route = _route() + _sync_client().manage.v1.projects.keys.create(project_id=PROJECT, request={}) + assert _sent_body(route) == {} + + +def test_keyword_arguments_override_the_legacy_mapping() -> None: + with respx.mock: + route = _route() + _sync_client().manage.v1.projects.keys.create( + project_id=PROJECT, + request={"comment": "from the mapping", "scopes": ["member"]}, + comment="from the keyword argument", + ) + assert _sent_body(route) == {"comment": "from the keyword argument", "scopes": ["member"]} + + +def test_optional_fields_round_trip_through_the_legacy_mapping() -> None: + with respx.mock: + route = _route() + _sync_client().manage.v1.projects.keys.create( + project_id=PROJECT, + request={ + "comment": "a comment", + "scopes": ["member"], + "tags": ["tag-1"], + "time_to_live_in_seconds": 60, + }, + ) + assert _sent_body(route) == { + "comment": "a comment", + "scopes": ["member"], + "tags": ["tag-1"], + "time_to_live_in_seconds": 60, + } + + +@pytest.mark.parametrize( + "kwargs,missing", + [({}, "comment"), ({"comment": "a comment"}, "scopes")], +) +def test_neither_call_shape_supplied_raises_type_error(kwargs: typing.Dict[str, typing.Any], missing: str) -> None: + """Widening ``comment`` and ``scopes`` to optional must not let a caller omit them silently.""" + with respx.mock: + _route() + with pytest.raises(TypeError, match=missing): + _sync_client().manage.v1.projects.keys.create(project_id=PROJECT, **kwargs) + + +def test_non_mapping_request_raises_type_error() -> None: + with respx.mock: + _route() + with pytest.raises(TypeError, match="must be a mapping"): + _sync_client().manage.v1.projects.keys.create( + project_id=PROJECT, request=typing.cast(typing.Any, "a comment") + ) + + +def test_raw_response_surface_accepts_the_legacy_mapping() -> None: + with respx.mock: + route = _route() + response = _sync_client().manage.v1.projects.keys.with_raw_response.create( + project_id=PROJECT, request={"comment": "a comment", "scopes": ["member"]} + ) + assert response.data.api_key_id == _RESPONSE["api_key_id"] + assert _sent_body(route) == {"comment": "a comment", "scopes": ["member"]} + + +@pytest.mark.asyncio +async def test_async_client_accepts_the_legacy_mapping() -> None: + with respx.mock: + route = _route() + await _async_client().manage.v1.projects.keys.create( + project_id=PROJECT, request={"comment": "a comment", "scopes": ["member"]} + ) + assert _sent_body(route) == {"comment": "a comment", "scopes": ["member"]} + + +@pytest.mark.asyncio +async def test_async_raw_response_surface_accepts_the_legacy_mapping() -> None: + with respx.mock: + route = _route() + response = await _async_client().manage.v1.projects.keys.with_raw_response.create( + project_id=PROJECT, request={"comment": "a comment", "scopes": ["member"]} + ) + assert response.data.api_key_id == _RESPONSE["api_key_id"] + assert _sent_body(route) == {"comment": "a comment", "scopes": ["member"]} diff --git a/tests/wire/test_listen_v1_media.py b/tests/wire/test_listen_v1_media.py index e4264985..9998a387 100644 --- a/tests/wire/test_listen_v1_media.py +++ b/tests/wire/test_listen_v1_media.py @@ -9,3 +9,97 @@ def test_listen_v1_media_transcribe_url() -> None: url="https://dpgr.am/spacewalk.wav", ) verify_request_count(test_id, "POST", "/v1/listen", None, 1) + + +def test_listen_v1_media_transcribe_url_serializes_all_query_params() -> None: + test_id = "listen.v1.media.transcribe_url.query_params" + client = get_client(test_id) + client.listen.v1.media.transcribe_url( + callback="callback", + callback_method="POST", + extra=["extra"], + sentiment=True, + summarize="v2", + tag=["tag"], + topics=True, + custom_topic=["custom_topic"], + custom_topic_mode="extended", + intents=True, + custom_intent=["custom_intent"], + custom_intent_mode="extended", + detect_entities=True, + detect_language=True, + diarize=True, + diarize_model="latest", + dictation=True, + encoding="linear16", + filler_words=True, + keyterm=["keyterm"], + keywords=["keywords"], + language="multi", + language_hint=["en", "es"], + measurements=True, + model="nova-3", + multichannel=True, + numerals=True, + paragraphs=True, + profanity_filter=True, + punctuate=True, + redact="redact", + redact_usage=True, + replace=["replace"], + search=["search"], + smart_format=True, + utterances=True, + utt_split=1.1, + version="latest", + mip_opt_out=True, + url="https://dpgr.am/spacewalk.wav", + ) + verify_request_count( + test_id, + "POST", + "/v1/listen", + { + "callback": "callback", + "callback_method": "POST", + "extra": "extra", + "sentiment": "true", + "summarize": "v2", + "tag": "tag", + "topics": "true", + "custom_topic": "custom_topic", + "custom_topic_mode": "extended", + "intents": "true", + "custom_intent": "custom_intent", + "custom_intent_mode": "extended", + "detect_entities": "true", + "detect_language": "true", + "diarize": "true", + "diarize_model": "latest", + "dictation": "true", + "encoding": "linear16", + "filler_words": "true", + "keyterm": "keyterm", + "keywords": "keywords", + "language": "multi", + "language_hint": ["en", "es"], + "measurements": "true", + "model": "nova-3", + "multichannel": "true", + "numerals": "true", + "paragraphs": "true", + "profanity_filter": "true", + "punctuate": "true", + "redact": "redact", + "redact_usage": "true", + "replace": "replace", + "search": "search", + "smart_format": "true", + "utterances": "true", + "utt_split": "1.1", + "version": "latest", + "mip_opt_out": "true", + }, + 1, + ) diff --git a/tests/wire/test_listen_v1_media.py.bak b/tests/wire/test_listen_v1_media.py.bak deleted file mode 100644 index 9998a387..00000000 --- a/tests/wire/test_listen_v1_media.py.bak +++ /dev/null @@ -1,105 +0,0 @@ -from .conftest import get_client, verify_request_count - - -def test_listen_v1_media_transcribe_url() -> None: - """Test transcribeUrl endpoint with WireMock""" - test_id = "listen.v1.media.transcribe_url.0" - client = get_client(test_id) - client.listen.v1.media.transcribe_url( - url="https://dpgr.am/spacewalk.wav", - ) - verify_request_count(test_id, "POST", "/v1/listen", None, 1) - - -def test_listen_v1_media_transcribe_url_serializes_all_query_params() -> None: - test_id = "listen.v1.media.transcribe_url.query_params" - client = get_client(test_id) - client.listen.v1.media.transcribe_url( - callback="callback", - callback_method="POST", - extra=["extra"], - sentiment=True, - summarize="v2", - tag=["tag"], - topics=True, - custom_topic=["custom_topic"], - custom_topic_mode="extended", - intents=True, - custom_intent=["custom_intent"], - custom_intent_mode="extended", - detect_entities=True, - detect_language=True, - diarize=True, - diarize_model="latest", - dictation=True, - encoding="linear16", - filler_words=True, - keyterm=["keyterm"], - keywords=["keywords"], - language="multi", - language_hint=["en", "es"], - measurements=True, - model="nova-3", - multichannel=True, - numerals=True, - paragraphs=True, - profanity_filter=True, - punctuate=True, - redact="redact", - redact_usage=True, - replace=["replace"], - search=["search"], - smart_format=True, - utterances=True, - utt_split=1.1, - version="latest", - mip_opt_out=True, - url="https://dpgr.am/spacewalk.wav", - ) - verify_request_count( - test_id, - "POST", - "/v1/listen", - { - "callback": "callback", - "callback_method": "POST", - "extra": "extra", - "sentiment": "true", - "summarize": "v2", - "tag": "tag", - "topics": "true", - "custom_topic": "custom_topic", - "custom_topic_mode": "extended", - "intents": "true", - "custom_intent": "custom_intent", - "custom_intent_mode": "extended", - "detect_entities": "true", - "detect_language": "true", - "diarize": "true", - "diarize_model": "latest", - "dictation": "true", - "encoding": "linear16", - "filler_words": "true", - "keyterm": "keyterm", - "keywords": "keywords", - "language": "multi", - "language_hint": ["en", "es"], - "measurements": "true", - "model": "nova-3", - "multichannel": "true", - "numerals": "true", - "paragraphs": "true", - "profanity_filter": "true", - "punctuate": "true", - "redact": "redact", - "redact_usage": "true", - "replace": "replace", - "search": "search", - "smart_format": "true", - "utterances": "true", - "utt_split": "1.1", - "version": "latest", - "mip_opt_out": "true", - }, - 1, - ) diff --git a/tests/wire/test_manage_v1_projects_keys.py b/tests/wire/test_manage_v1_projects_keys.py index b7d488d9..5509b22d 100644 --- a/tests/wire/test_manage_v1_projects_keys.py +++ b/tests/wire/test_manage_v1_projects_keys.py @@ -1,5 +1,7 @@ from .conftest import get_client, verify_request_count +from deepgram.requests import CreateKeyV1RequestOneParams + def test_manage_v1_projects_keys_list_() -> None: """Test list endpoint with WireMock""" @@ -24,6 +26,20 @@ def test_manage_v1_projects_keys_create() -> None: verify_request_count(test_id, "POST", "/v1/projects/123456-7890-1234-5678-901234/keys", None, 1) +def test_manage_v1_projects_keys_create_with_legacy_request_mapping() -> None: + """The pre-2026-12 single-mapping form of create() still reaches the same request. + + The 2026-12-01 regen replaced the opaque `request` argument with explicit keyword arguments. + Callers written against every prior release pass `request=`, so that form is still unpacked; + this pins it, along with the `CreateKeyV1RequestOneParams` alias they annotate it with. + """ + test_id = "manage.v1.projects.keys.create.legacy_request" + client = get_client(test_id) + request: CreateKeyV1RequestOneParams = {"comment": "A comment", "scopes": ["admin"]} + client.manage.v1.projects.keys.create(project_id="123456-7890-1234-5678-901234", request=request) + verify_request_count(test_id, "POST", "/v1/projects/123456-7890-1234-5678-901234/keys", None, 1) + + def test_manage_v1_projects_keys_get() -> None: """Test get endpoint with WireMock""" test_id = "manage.v1.projects.keys.get.0" diff --git a/tests/wire/test_manage_v1_projects_keys.py.bak b/tests/wire/test_manage_v1_projects_keys.py.bak deleted file mode 100644 index 4b7a8100..00000000 --- a/tests/wire/test_manage_v1_projects_keys.py.bak +++ /dev/null @@ -1,59 +0,0 @@ -from .conftest import get_client, verify_request_count - -from deepgram.requests import CreateKeyV1RequestOneParams - - -def test_manage_v1_projects_keys_list_() -> None: - """Test list endpoint with WireMock""" - test_id = "manage.v1.projects.keys.list_.0" - client = get_client(test_id) - client.manage.v1.projects.keys.list( - project_id="123456-7890-1234-5678-901234", - status="active", - ) - verify_request_count(test_id, "GET", "/v1/projects/123456-7890-1234-5678-901234/keys", {"status": "active"}, 1) - - -def test_manage_v1_projects_keys_create() -> None: - """Test create endpoint with WireMock""" - test_id = "manage.v1.projects.keys.create.0" - client = get_client(test_id) - client.manage.v1.projects.keys.create( - project_id="project_id", - request={"key": "value"}, - ) - verify_request_count(test_id, "POST", "/v1/projects/project_id/keys", None, 1) - - -def test_manage_v1_projects_keys_create_with_old_request_alias() -> None: - test_id = "manage.v1.projects.keys.create.compat" - client = get_client(test_id) - request: CreateKeyV1RequestOneParams = {"key": "value"} - client.manage.v1.projects.keys.create(project_id="project_id", request=request) - verify_request_count(test_id, "POST", "/v1/projects/project_id/keys", None, 1) - - -def test_manage_v1_projects_keys_get() -> None: - """Test get endpoint with WireMock""" - test_id = "manage.v1.projects.keys.get.0" - client = get_client(test_id) - client.manage.v1.projects.keys.get( - project_id="123456-7890-1234-5678-901234", - key_id="123456789012345678901234", - ) - verify_request_count( - test_id, "GET", "/v1/projects/123456-7890-1234-5678-901234/keys/123456789012345678901234", None, 1 - ) - - -def test_manage_v1_projects_keys_delete() -> None: - """Test delete endpoint with WireMock""" - test_id = "manage.v1.projects.keys.delete.0" - client = get_client(test_id) - client.manage.v1.projects.keys.delete( - project_id="123456-7890-1234-5678-901234", - key_id="123456789012345678901234", - ) - verify_request_count( - test_id, "DELETE", "/v1/projects/123456-7890-1234-5678-901234/keys/123456789012345678901234", None, 1 - ) diff --git a/tests/wire/test_manage_v1_projects_requests.py b/tests/wire/test_manage_v1_projects_requests.py index 71a888c7..daccaba9 100644 --- a/tests/wire/test_manage_v1_projects_requests.py +++ b/tests/wire/test_manage_v1_projects_requests.py @@ -1,3 +1,5 @@ +import datetime + from .conftest import get_client, verify_request_count @@ -11,6 +13,42 @@ def test_manage_v1_projects_requests_list_() -> None: verify_request_count(test_id, "GET", "/v1/projects/12345678-90ab-cdef-1234-567890abcdef/requests", None, 1) +def test_manage_v1_projects_requests_list_serializes_all_query_params() -> None: + test_id = "manage.v1.projects.requests.list_.query_params" + client = get_client(test_id) + client.manage.v1.projects.requests.list( + project_id="12345678-90ab-cdef-1234-567890abcdef", + start=datetime.datetime.fromisoformat("2024-01-15T09:30:00+00:00"), + end=datetime.datetime.fromisoformat("2024-01-15T09:30:00+00:00"), + limit=1.1, + page=1.1, + accessor="12345678-1234-1234-1234-123456789012", + request_id="12345678-1234-1234-1234-123456789012", + deployment="hosted", + endpoint="listen", + method="sync", + status="succeeded", + ) + verify_request_count( + test_id, + "GET", + "/v1/projects/12345678-90ab-cdef-1234-567890abcdef/requests", + { + "start": "2024-01-15T09:30:00Z", + "end": "2024-01-15T09:30:00Z", + "limit": "1.1", + "page": "1.1", + "accessor": "12345678-1234-1234-1234-123456789012", + "request_id": "12345678-1234-1234-1234-123456789012", + "deployment": "hosted", + "endpoint": "listen", + "method": "sync", + "status": "succeeded", + }, + 1, + ) + + def test_manage_v1_projects_requests_get() -> None: """Test get endpoint with WireMock""" test_id = "manage.v1.projects.requests.get.0" diff --git a/tests/wire/test_manage_v1_projects_requests.py.bak b/tests/wire/test_manage_v1_projects_requests.py.bak deleted file mode 100644 index daccaba9..00000000 --- a/tests/wire/test_manage_v1_projects_requests.py.bak +++ /dev/null @@ -1,66 +0,0 @@ -import datetime - -from .conftest import get_client, verify_request_count - - -def test_manage_v1_projects_requests_list_() -> None: - """Test list endpoint with WireMock""" - test_id = "manage.v1.projects.requests.list_.0" - client = get_client(test_id) - client.manage.v1.projects.requests.list( - project_id="12345678-90ab-cdef-1234-567890abcdef", - ) - verify_request_count(test_id, "GET", "/v1/projects/12345678-90ab-cdef-1234-567890abcdef/requests", None, 1) - - -def test_manage_v1_projects_requests_list_serializes_all_query_params() -> None: - test_id = "manage.v1.projects.requests.list_.query_params" - client = get_client(test_id) - client.manage.v1.projects.requests.list( - project_id="12345678-90ab-cdef-1234-567890abcdef", - start=datetime.datetime.fromisoformat("2024-01-15T09:30:00+00:00"), - end=datetime.datetime.fromisoformat("2024-01-15T09:30:00+00:00"), - limit=1.1, - page=1.1, - accessor="12345678-1234-1234-1234-123456789012", - request_id="12345678-1234-1234-1234-123456789012", - deployment="hosted", - endpoint="listen", - method="sync", - status="succeeded", - ) - verify_request_count( - test_id, - "GET", - "/v1/projects/12345678-90ab-cdef-1234-567890abcdef/requests", - { - "start": "2024-01-15T09:30:00Z", - "end": "2024-01-15T09:30:00Z", - "limit": "1.1", - "page": "1.1", - "accessor": "12345678-1234-1234-1234-123456789012", - "request_id": "12345678-1234-1234-1234-123456789012", - "deployment": "hosted", - "endpoint": "listen", - "method": "sync", - "status": "succeeded", - }, - 1, - ) - - -def test_manage_v1_projects_requests_get() -> None: - """Test get endpoint with WireMock""" - test_id = "manage.v1.projects.requests.get.0" - client = get_client(test_id) - client.manage.v1.projects.requests.get( - project_id="12345678-90ab-cdef-1234-567890abcdef", - request_id="a3f1c9d2-4b7e-4f9a-8c3d-2e5f7b9a1c0d", - ) - verify_request_count( - test_id, - "GET", - "/v1/projects/12345678-90ab-cdef-1234-567890abcdef/requests/a3f1c9d2-4b7e-4f9a-8c3d-2e5f7b9a1c0d", - None, - 1, - ) From c1556faf3b8896dba478a0870b4ff9dd2f941546 Mon Sep 17 00:00:00 2001 From: Greg Holmes Date: Tue, 1 Dec 2026 13:49:11 +0000 Subject: [PATCH 5/6] fix(manage): stop the create-key shim narrowing a passthrough argument Two independent reviews of this branch found the same blocking defect, confirmed here by driving 7.20 and this branch through the same 15 payloads and comparing the request bytes. `_build_create_key_body` guarded the deprecated `request` argument with `isinstance(request, dict)`. That argument was annotated `Any` through 7.20 and went straight to the JSON encoder, so the guard rejected calls that used to work: MappingProxyType main: OK branch: TypeError: `request` must be a mapping, got mappingproxy abc.Mapping main: OK branch: TypeError pydantic model main: OK branch: TypeError: `request` must be a mapping, got M UserDict main: OK branch: TypeError dataclass main: OK branch: TypeError The error text refuted itself: it said "must be a mapping" while rejecting an instance of `collections.abc.Mapping`. `OrderedDict` survived only by subclassing `dict`. This is the exact regression the shim exists to prevent, and it made the minor-version claim wrong. The shim is now a total passthrough. A mapping is merged with the explicit keyword arguments applied on top; anything else is forwarded untouched, as the encoder received it before. All six arguments default to the OMIT sentinel instead of None, so an explicit `None` uniformly means a null value and `request=None` again sends the empty body it sent on 7.20, rather than being indistinguishable from an omitted argument. Verified: all 15 payload shapes now produce byte-identical requests on 7.20 and here, including the five above and `str`, `list`, `None`, nested values, unknown keys and datetime encoding. Tests rewritten, 11 cases to 40. The reviews showed 8 mutations surviving the old suite, including dropping `tags`, `expiration_date` or `time_to_live_in_seconds` from either file while every test still passed, which matters because both files are frozen and no regen can repair drift in them. All 11 mutations now fail the suite. The last to be caught was the narrowing itself: it is invisible on the passthrough path and only diverges when a non-dict mapping is combined with a keyword argument, so that case is pinned on its own. Documentation corrected alongside: - `.fernignore` named `_unpack_legacy_create_key_request`, which does not exist, and described the mapping as unpacked into the arguments rather than forwarded as the body. It also claimed wire-test coverage that only counts requests. - `client.py` docstrings disagreed with `raw_client.py` about the same mechanism. - `AGENTS.md` said the runtime TypeError replaces mypy's missing-argument check. It only does for code importing `KeysClient`/`RawKeysClient` directly: `BaseClient.manage` carries no return annotation, so `client.manage.v1.projects.keys.create` was always `Any` to mypy. - `reference.md` and `examples/51-management-keys.py` still showed only the deprecated form. - `.fern/metadata.json` regained the trailing newline the generator dropped. Gates: - mypy src/ Success: no issues found in 958 source files - mypy tests/typecheck Success: no issues found in 1 source file - pytest -q 1288 passed, 4 skipped, 1 xfailed - ruff check src/ tests/ 55, and examples/ 2, both identical to origin/main - public surface vs main 0 exports removed, 0 methods removed, 0 params newly required --- .fern/metadata.json | 2 +- .fernignore | 11 +- AGENTS.md | 2 +- examples/51-management-keys.py | 8 +- reference.md | 3 +- .../manage/v1/projects/keys/client.py | 20 +- .../manage/v1/projects/keys/raw_client.py | 95 +++-- .../custom/test_create_key_legacy_request.py | 380 +++++++++++++----- 8 files changed, 367 insertions(+), 154 deletions(-) diff --git a/.fern/metadata.json b/.fern/metadata.json index 0866c1c9..86133223 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -25,4 +25,4 @@ "originGitCommitIsDirty": true, "invokedBy": "manual", "sdkVersion": "7.20.0" -} \ No newline at end of file +} diff --git a/.fernignore b/.fernignore index f49ef25b..f9d1a292 100644 --- a/.fernignore +++ b/.fernignore @@ -125,10 +125,13 @@ src/deepgram/requests/create_key_v1request.py # Backward-compat patch for the 2026-12-01 create-key signature change. The generated create() # now takes comment/scopes/tags/expiration_date/time_to_live_in_seconds as keyword arguments, # which raises TypeError for every caller written against 7.20 and earlier. Both files carry a -# hand-added optional `request` argument plus _unpack_legacy_create_key_request, which folds the -# old mapping into the new arguments; explicit keyword arguments win when both are supplied. -# Wire coverage in tests/wire/test_manage_v1_projects_keys.py. Remove and unfreeze when the -# legacy call shape is retired in a future major. +# hand-added optional `request` argument, and raw_client.py carries _build_create_key_body, which +# forwards the legacy argument as the request body rather than unpacking it, so unknown keys still +# ship. Any object that reached the JSON encoder on 7.20 still does, Mapping or not; narrowing that +# check to `dict` is a silent breaking change. Explicit keyword arguments are merged over a mapping +# and win where both supply a key. Body-level coverage is tests/custom/test_create_key_legacy_request.py; +# the wire test only counts requests. Remove and unfreeze when the legacy call shape is retired in a +# future major. # [temporarily frozen -- manual patch described above] src/deepgram/manage/v1/projects/keys/client.py src/deepgram/manage/v1/projects/keys/raw_client.py diff --git a/AGENTS.md b/AGENTS.md index 1f0ec87b..4c0d8022 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -85,7 +85,7 @@ Current temporarily frozen files: - `src/deepgram/types/shared_topics.py`, `src/deepgram/types/shared_intents.py`, `src/deepgram/requests/shared_topics.py`, `src/deepgram/requests/shared_intents.py`, and the generated root/type/request barrels — direct Topics and Intents segments plus their generated exports remain Fern-owned, but carry the v7 deprecated `results` construction facade and Params shape for the hand-written wrappers above. The models normalize legacy `results.{topics,intents}.segments` input to direct `segments` while preserving direct fields and deprecated read facades. Freeze these generated files during the parent reconciliation; retain all direct generated segments and exports alongside the compatibility surface. - `src/deepgram/core/client_wrapper.py` — Fern's `runtime_version: true` wrapper correctly uses installed package metadata, but its `PackageNotFoundError` fallback must remain the latest published version for source checkouts, vendored copies, zipapps, and frozen bundles. The retained `7.16.0` fallback carries `# x-release-please-version`, and `.github/release-please-config.json` includes the file as a generic extra file so Release Please updates it with `pyproject.toml` and `.fern/metadata.json`. Unfreeze when Fern emits a release-managed fallback. - `src/deepgram/speak/v2/types/speak_v2warning.py`, `src/deepgram/speak/v2/requests/speak_v2warning.py`, `src/deepgram/agent/v1/types/agent_v1inject_dynamic_agent_message.py`, `src/deepgram/agent/v1/requests/agent_v1inject_dynamic_agent_message.py`, `src/deepgram/listen/v1/types/listen_v1configure_failure.py`, `src/deepgram/listen/v1/requests/listen_v1configure_failure.py` — whitespace cleanup for generated docstrings. Unfreeze when Fern emits whitespace-clean output. -- `src/deepgram/manage/v1/projects/keys/client.py`, `src/deepgram/manage/v1/projects/keys/raw_client.py` — backward-compat patch for the 2026-12-01 create-key signature change. The generated `create()` now takes `comment`/`scopes`/`tags`/`expiration_date`/`time_to_live_in_seconds` as keyword arguments, which raises `TypeError` for every caller written against 7.20 or earlier. Both files carry a hand-added optional `request` argument, and `raw_client.py` carries `_build_create_key_body`, which forwards the legacy mapping verbatim (it was typed `Any` and never validated) with explicit keyword arguments applied on top. `comment` and `scopes` had to be widened to optional to accept the legacy form, so a runtime `TypeError` replaces mypy's missing-argument check when neither shape supplies them. Coverage in `tests/custom/test_create_key_legacy_request.py` and `tests/wire/test_manage_v1_projects_keys.py`. Remove and unfreeze when the legacy call shape is retired in a future major. +- `src/deepgram/manage/v1/projects/keys/client.py`, `src/deepgram/manage/v1/projects/keys/raw_client.py` — backward-compat patch for the 2026-12-01 create-key signature change. The generated `create()` now takes `comment`/`scopes`/`tags`/`expiration_date`/`time_to_live_in_seconds` as keyword arguments, which raises `TypeError` for every caller written against 7.20 or earlier. Both files carry a hand-added optional `request` argument, and `raw_client.py` carries `_build_create_key_body`, which forwards the legacy mapping verbatim (it was typed `Any` and never validated) with explicit keyword arguments applied on top. Every argument defaults to the `OMIT` sentinel, so an explicit `None` uniformly means a null value rather than an omitted one, and `request=None` still sends the empty body it did on 7.20. `comment` and `scopes` had to be widened to optional to accept the legacy form, which costs mypy's missing-argument check, but only for code importing `KeysClient`/`RawKeysClient` directly: `BaseClient.manage` has no return annotation, so `client.manage.v1.projects.keys.create` was always `Any` to mypy. A runtime `TypeError` naming the argument covers both paths. Body-level coverage is `tests/custom/test_create_key_legacy_request.py`, which mutation-tests the merge and passthrough branches; `tests/wire/test_manage_v1_projects_keys.py` only counts requests. Remove and unfreeze when the legacy call shape is retired in a future major. - `src/deepgram/agent/v1/types/agent_v1update_listen_listen.py` — backward-compat patch for the 2026-07-31 `AgentV1UpdateListen` provider retype. The `provider` field changed from a bare `DeepgramListenProviderV2` to the required discriminated union `AgentV1UpdateListenListenProvider` (`_V1`/`_V2`, discriminant `version`). Carries a hand-added `model_validator(mode='before')` / `root_validator(pre=True)` that coerces a legacy `DeepgramListenProviderV1`/`V2` (or a dict lacking the `version` discriminant) into the new shape so existing callers keep working. Remove and unfreeze when the old provider payloads are retired in a future major. NOTE: this patch was silently lost once (it was absent from `.fernignore`, so a regen overwrote it) — keep it frozen. - `src/deepgram/agent/v1/types/agent_v1conversation_text.py`, `src/deepgram/agent/v1/requests/agent_v1conversation_text.py` — compatibility for the 2026-10 Think Live schema update that made `conversational_behavior` required. The runtime response model defaults an omitted field to `"default"` so older/self-hosted server payloads continue to parse, while the request TypedDict accepts the pre-update shape for typed callers. SDK-created runtime models still serialize the current wire-required field. Remove and unfreeze when those legacy payloads are retired. - `tests/wire/test_manage_v1_projects_keys.py` — restored wire coverage for the legacy `CreateKeyV1RequestOneParams` request alias so future regens do not silently drop that compatibility check diff --git a/examples/51-management-keys.py b/examples/51-management-keys.py index 761bad25..70491dbc 100644 --- a/examples/51-management-keys.py +++ b/examples/51-management-keys.py @@ -34,12 +34,12 @@ # Create a new API key print("\nCreating new API key...") + # Each field is its own argument. The older single-mapping form, + # `request={"comment": ..., "scopes": ...}`, still works and is deprecated. new_key = client.manage.v1.projects.keys.create( project_id=project_id, - request={ - "comment": "Example API key", - "scopes": ["usage:read"], - }, + comment="Example API key", + scopes=["usage:read"], ) print(f"Created key ID: {new_key.api_key_id}") print(f"Key: {new_key.key}") diff --git a/reference.md b/reference.md index 3c414dba..d01083f0 100644 --- a/reference.md +++ b/reference.md @@ -1503,7 +1503,8 @@ client = DeepgramClient( ) client.manage.v1.projects.keys.create( project_id="project_id", - request={"key": "value"}, + comment="A comment", + scopes=["admin"], ) ``` diff --git a/src/deepgram/manage/v1/projects/keys/client.py b/src/deepgram/manage/v1/projects/keys/client.py index 43fc26d7..b69c2735 100644 --- a/src/deepgram/manage/v1/projects/keys/client.py +++ b/src/deepgram/manage/v1/projects/keys/client.py @@ -77,12 +77,12 @@ def create( self, project_id: str, *, - comment: typing.Optional[str] = None, - scopes: typing.Optional[typing.Sequence[str]] = None, + comment: typing.Optional[str] = OMIT, + scopes: typing.Optional[typing.Sequence[str]] = OMIT, tags: typing.Optional[typing.Sequence[str]] = OMIT, expiration_date: typing.Optional[dt.datetime] = OMIT, time_to_live_in_seconds: typing.Optional[float] = OMIT, - request: typing.Optional[CreateKeyV1RequestParams] = None, + request: typing.Optional[CreateKeyV1RequestParams] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CreateKeyV1Response: """ @@ -104,8 +104,8 @@ def create( time_to_live_in_seconds : typing.Optional[float] request : typing.Optional[CreateKeyV1RequestParams] - Deprecated. The pre-2026-12 single-mapping form of this call. Its keys are unpacked - into the arguments above, which take precedence when both are supplied. + Deprecated. The pre-2026-12 single-mapping form of this call. It is forwarded as the + request body; the arguments above override the matching keys. request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -283,12 +283,12 @@ async def create( self, project_id: str, *, - comment: typing.Optional[str] = None, - scopes: typing.Optional[typing.Sequence[str]] = None, + comment: typing.Optional[str] = OMIT, + scopes: typing.Optional[typing.Sequence[str]] = OMIT, tags: typing.Optional[typing.Sequence[str]] = OMIT, expiration_date: typing.Optional[dt.datetime] = OMIT, time_to_live_in_seconds: typing.Optional[float] = OMIT, - request: typing.Optional[CreateKeyV1RequestParams] = None, + request: typing.Optional[CreateKeyV1RequestParams] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CreateKeyV1Response: """ @@ -310,8 +310,8 @@ async def create( time_to_live_in_seconds : typing.Optional[float] request : typing.Optional[CreateKeyV1RequestParams] - Deprecated. The pre-2026-12 single-mapping form of this call. Its keys are unpacked - into the arguments above, which take precedence when both are supplied. + Deprecated. The pre-2026-12 single-mapping form of this call. It is forwarded as the + request body; the arguments above override the matching keys. request_options : typing.Optional[RequestOptions] Request-specific configuration. diff --git a/src/deepgram/manage/v1/projects/keys/raw_client.py b/src/deepgram/manage/v1/projects/keys/raw_client.py index 8798769a..cd082eca 100644 --- a/src/deepgram/manage/v1/projects/keys/raw_client.py +++ b/src/deepgram/manage/v1/projects/keys/raw_client.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import collections.abc import datetime as dt import typing from json.decoder import JSONDecodeError @@ -25,44 +26,58 @@ def _build_create_key_body( - request: typing.Optional[typing.Any], - comment: typing.Optional[str], - scopes: typing.Optional[typing.Sequence[str]], - tags: typing.Optional[typing.Sequence[str]], - expiration_date: typing.Optional[dt.datetime], - time_to_live_in_seconds: typing.Optional[float], -) -> typing.Dict[str, typing.Any]: + request: typing.Any, + comment: typing.Any, + scopes: typing.Any, + tags: typing.Any, + expiration_date: typing.Any, + time_to_live_in_seconds: typing.Any, +) -> typing.Any: """Build the create-key request body from either the current or the deprecated call shape. - Through SDK 7.20 this endpoint took one opaque `request` mapping, typed `Any`, which the SDK - forwarded to the server without validating or filtering it. The 2026-12-01 regen replaced it - with explicit keyword arguments, which raises TypeError for every caller written against an - earlier release, so the old form is still accepted. + Through SDK 7.20 this endpoint took a single `request` argument annotated `Any`, which the SDK + handed to the JSON encoder without inspecting it. The 2026-12-01 regeneration replaced it with + explicit keyword arguments, which raises TypeError for every caller written against an earlier + release, so the old argument is still accepted. - The legacy path stays a passthrough on purpose: unknown keys are forwarded and no field is - required, because the server, not the SDK, decided what a valid body was. Adding validation - here would reject payloads that used to reach the API. Explicit keyword arguments are applied - on top of the mapping, so they win where both supply a key. + The legacy path is a passthrough, and deliberately a total one: any object that reached the + encoder before still reaches it, because the server, not the SDK, decided what a valid body + was. That is why a non-mapping (a pydantic model, a dataclass, even a string) is forwarded + rather than rejected, and why `request=None` still produces the empty body it always did. + Narrowing this to `dict` silently broke every caller passing a `Mapping` that was not one. + + All six arguments default to OMIT rather than None, so `None` always means "the caller asked + for a null value" and never "the caller omitted this". Explicit keyword arguments are merged + over the mapping, so they win where both supply a key. """ - body: typing.Dict[str, typing.Any] = {} - if request is not None: - if not isinstance(request, dict): - raise TypeError(f"`request` must be a mapping, got {type(request).__name__}") - body.update(request) - elif comment is None or scopes is None: - missing = "comment" if comment is None else "scopes" - raise TypeError(f"create() missing required keyword argument: {missing!r}") - if comment is not None: - body["comment"] = comment - if scopes is not None: - body["scopes"] = scopes - if tags is not OMIT: - body["tags"] = tags - if expiration_date is not OMIT: - body["expiration_date"] = expiration_date - if time_to_live_in_seconds is not OMIT: - body["time_to_live_in_seconds"] = time_to_live_in_seconds - return body + explicit: typing.Dict[str, typing.Any] = {} + for key, value in ( + ("comment", comment), + ("scopes", scopes), + ("tags", tags), + ("expiration_date", expiration_date), + ("time_to_live_in_seconds", time_to_live_in_seconds), + ): + if value is not OMIT: + explicit[key] = value + + if request is OMIT: + for key in ("comment", "scopes"): + if key not in explicit: + raise TypeError(f"create() missing required keyword argument: {key!r}") + return explicit + + if isinstance(request, collections.abc.Mapping): + body = dict(request) + body.update(explicit) + return body + + # Not a mapping, so there is nothing to merge into. Forward it exactly as 7.20 did. + if explicit: + raise TypeError( + f"`request` must be a mapping when keyword arguments are also supplied, got {type(request).__name__}" + ) + return request class RawKeysClient: @@ -138,12 +153,12 @@ def create( self, project_id: str, *, - comment: typing.Optional[str] = None, - scopes: typing.Optional[typing.Sequence[str]] = None, + comment: typing.Optional[str] = OMIT, + scopes: typing.Optional[typing.Sequence[str]] = OMIT, tags: typing.Optional[typing.Sequence[str]] = OMIT, expiration_date: typing.Optional[dt.datetime] = OMIT, time_to_live_in_seconds: typing.Optional[float] = OMIT, - request: typing.Optional[CreateKeyV1RequestParams] = None, + request: typing.Optional[CreateKeyV1RequestParams] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[CreateKeyV1Response]: """ @@ -408,12 +423,12 @@ async def create( self, project_id: str, *, - comment: typing.Optional[str] = None, - scopes: typing.Optional[typing.Sequence[str]] = None, + comment: typing.Optional[str] = OMIT, + scopes: typing.Optional[typing.Sequence[str]] = OMIT, tags: typing.Optional[typing.Sequence[str]] = OMIT, expiration_date: typing.Optional[dt.datetime] = OMIT, time_to_live_in_seconds: typing.Optional[float] = OMIT, - request: typing.Optional[CreateKeyV1RequestParams] = None, + request: typing.Optional[CreateKeyV1RequestParams] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[CreateKeyV1Response]: """ diff --git a/tests/custom/test_create_key_legacy_request.py b/tests/custom/test_create_key_legacy_request.py index 6c76bcfd..73bee324 100644 --- a/tests/custom/test_create_key_legacy_request.py +++ b/tests/custom/test_create_key_legacy_request.py @@ -1,21 +1,34 @@ """Regression coverage for the deprecated ``request`` argument on create-key. -Through SDK 7.20, ``manage.v1.projects.keys.create`` took a single opaque ``request`` mapping, -typed ``Any``, which the SDK forwarded to the server without validating or filtering it. The -2026-12-01 Fern regeneration replaced it with explicit keyword arguments, which raises -``TypeError`` for every caller written against an earlier release. - -``_build_create_key_body`` in ``manage/v1/projects/keys/raw_client.py`` keeps the old form -working. These tests pin the parts of that behavior a future regeneration could quietly drop: -that the legacy mapping is forwarded verbatim rather than validated, that explicit keyword -arguments win over it, and that both call shapes produce the same request body on the sync, -async, and ``with_raw_response`` surfaces. +Through SDK 7.20, ``manage.v1.projects.keys.create`` took a single ``request`` argument annotated +``Any``, which the SDK handed to the JSON encoder without inspecting it. The 2026-12-01 Fern +regeneration replaced it with explicit keyword arguments, which raises ``TypeError`` for every +caller written against an earlier release. + +``_build_create_key_body`` in ``manage/v1/projects/keys/raw_client.py`` keeps the old argument +working. These tests pin the parts a future regeneration could quietly drop. + +The central property is **total passthrough**: any object that reached the JSON encoder on 7.20 +still reaches it. An earlier version of the shim narrowed the check to ``isinstance(request, dict)`` +and silently broke every caller passing a ``Mapping`` that was not a ``dict``, a pydantic model, or +a dataclass. ``test_every_legacy_payload_shape_round_trips`` is the test that catches that class of +regression, so keep its parameter list broad. + +Each test asserts on the request body actually put on the wire, not on a request count, and the +keyword-argument cases are exercised on every surface so that a forwarder dropping a field is +caught rather than inferred. """ +import collections +import collections.abc +import dataclasses +import datetime as dt import json import typing +from types import MappingProxyType import httpx +import pydantic import pytest import respx @@ -25,6 +38,15 @@ HOST = "test.deepgram.local" BASE = f"https://{HOST}" PROJECT = "project-id" +UTC = dt.timezone.utc + +_RESPONSE = { + "api_key_id": "1234567890abcdef1234567890abcdef", + "key": "1234567890abcdef1234567890abcdef", + "comment": "a comment", + "scopes": ["member"], +} +_MINIMAL = {"comment": "a comment", "scopes": ["member"]} def _environment() -> DeepgramClientEnvironment: @@ -40,143 +62,315 @@ def _async_client() -> AsyncDeepgramClient: return AsyncDeepgramClient(environment=_environment(), api_key="test_api_key", httpx_client=httpx.AsyncClient()) -_RESPONSE = { - "api_key_id": "1234567890abcdef1234567890abcdef", - "key": "1234567890abcdef1234567890abcdef", - "comment": "a comment", - "scopes": ["member"], -} +def _route() -> respx.Route: + return respx.post(f"{BASE}/v1/projects/{PROJECT}/keys").mock(return_value=httpx.Response(200, json=_RESPONSE)) -def _sent_body(route: respx.Route) -> typing.Dict[str, typing.Any]: - """The JSON body of the single request recorded against ``route``.""" +def _raw_body(route: respx.Route) -> bytes: assert route.call_count == 1 - request = route.calls[0].request - return typing.cast(typing.Dict[str, typing.Any], json.loads(request.content)) + return bytes(route.calls[0].request.content) -def _route() -> respx.Route: - return respx.post(f"{BASE}/v1/projects/{PROJECT}/keys").mock(return_value=httpx.Response(200, json=_RESPONSE)) +def _body(route: respx.Route) -> typing.Any: + return json.loads(_raw_body(route)) + + +# --- the four public surfaces, as callables, so every case can run on all of them ------------- + + +def _call_sync(**kwargs: typing.Any) -> None: + _sync_client().manage.v1.projects.keys.create(project_id=PROJECT, **kwargs) + + +def _call_sync_raw(**kwargs: typing.Any) -> None: + _sync_client().manage.v1.projects.keys.with_raw_response.create(project_id=PROJECT, **kwargs) + + +def _call_async(**kwargs: typing.Any) -> None: + import asyncio + + async def run() -> None: + await _async_client().manage.v1.projects.keys.create(project_id=PROJECT, **kwargs) + + asyncio.run(run()) + +def _call_async_raw(**kwargs: typing.Any) -> None: + import asyncio -def test_legacy_request_mapping_and_keyword_arguments_send_the_same_body() -> None: - """The two call shapes are interchangeable for the fields the endpoint declares.""" + async def run() -> None: + await _async_client().manage.v1.projects.keys.with_raw_response.create(project_id=PROJECT, **kwargs) + + asyncio.run(run()) + + +SURFACES = [ + pytest.param(_call_sync, id="sync"), + pytest.param(_call_sync_raw, id="sync-raw"), + pytest.param(_call_async, id="async"), + pytest.param(_call_async_raw, id="async-raw"), +] +Caller = typing.Callable[..., None] + + +# --- payload shapes --------------------------------------------------------------------------- + + +class _Model(pydantic.BaseModel): + comment: str + scopes: typing.List[str] + + +@dataclasses.dataclass +class _Dataclass: + comment: str + scopes: typing.List[str] + + +class _Mapping(collections.abc.Mapping): + """A Mapping that is deliberately not a dict subclass.""" + + def __init__(self, data: typing.Dict[str, typing.Any]) -> None: + self._data = data + + def __getitem__(self, key: str) -> typing.Any: + return self._data[key] + + def __iter__(self) -> typing.Iterator[str]: + return iter(self._data) + + def __len__(self) -> int: + return len(self._data) + + +@pytest.mark.parametrize( + "payload", + [ + pytest.param(dict(_MINIMAL), id="dict"), + pytest.param(collections.OrderedDict(_MINIMAL), id="OrderedDict"), + pytest.param(collections.UserDict(_MINIMAL), id="UserDict"), + pytest.param(MappingProxyType(dict(_MINIMAL)), id="MappingProxyType"), + pytest.param(_Mapping(dict(_MINIMAL)), id="abc.Mapping"), + pytest.param(_Model(**_MINIMAL), id="pydantic-model"), + pytest.param(_Dataclass(**_MINIMAL), id="dataclass"), + ], +) +def test_every_legacy_payload_shape_round_trips(payload: typing.Any) -> None: + """The old argument was annotated ``Any``, so none of these may be rejected. + + Restricting the shim to ``dict`` passes a naive test suite while breaking real callers, so + this list is deliberately wider than the types the endpoint documents. + """ with respx.mock: route = _route() - _sync_client().manage.v1.projects.keys.create( - project_id=PROJECT, request={"comment": "a comment", "scopes": ["member"]} - ) - legacy_body = _sent_body(route) + _call_sync(request=payload) + assert _body(route) == _MINIMAL + + +MAPPING_TYPES = [ + pytest.param(dict, id="dict"), + pytest.param(collections.OrderedDict, id="OrderedDict"), + pytest.param(collections.UserDict, id="UserDict"), + pytest.param(MappingProxyType, id="MappingProxyType"), + pytest.param(_Mapping, id="abc.Mapping"), +] + +@pytest.mark.parametrize("mapping_type", MAPPING_TYPES) +def test_keyword_arguments_merge_into_any_mapping_type(mapping_type: typing.Any) -> None: + """Merging must work for every Mapping, not only for dict. + + The merge branch is the one place the shim has to recognise the argument as a mapping rather + than forward it untouched, so narrowing it to ``dict`` here turns a working call into a + ``TypeError`` the moment a caller combines the old argument with a new keyword one. The + passthrough path hides that, which is why this case is tested separately. + """ with respx.mock: route = _route() - _sync_client().manage.v1.projects.keys.create(project_id=PROJECT, comment="a comment", scopes=["member"]) - current_body = _sent_body(route) + _call_sync(request=mapping_type(dict(_MINIMAL)), comment="override") + assert _body(route) == {"comment": "override", "scopes": ["member"]} - assert legacy_body == {"comment": "a comment", "scopes": ["member"]} - assert legacy_body == current_body +def test_legacy_and_current_call_shapes_send_the_same_body() -> None: + with respx.mock: + route = _route() + _call_sync(request=dict(_MINIMAL)) + legacy = _body(route) -def test_legacy_request_mapping_forwards_unknown_keys() -> None: - """The old argument was typed ``Any`` and never filtered, so unknown keys still reach the API. + with respx.mock: + route = _route() + _call_sync(comment="a comment", scopes=["member"]) + current = _body(route) - Dropping them here would silently change what the server receives for a caller who relied on - a field the spec had not caught up with. - """ + assert legacy == _MINIMAL + assert legacy == current + + +def test_legacy_mapping_forwards_unknown_keys() -> None: + """The old argument was never filtered, so a key the spec has not caught up with still ships.""" with respx.mock: route = _route() - _sync_client().manage.v1.projects.keys.create( - project_id=PROJECT, request={"comment": "a comment", "scopes": ["member"], "not_in_the_spec": True} - ) - assert _sent_body(route) == {"comment": "a comment", "scopes": ["member"], "not_in_the_spec": True} + _call_sync(request={**_MINIMAL, "not_in_the_spec": True}) + assert _body(route) == {**_MINIMAL, "not_in_the_spec": True} -def test_legacy_request_mapping_does_not_require_any_field() -> None: +def test_legacy_mapping_requires_no_field() -> None: """The old call had no required fields; the server decided what a valid body was.""" with respx.mock: route = _route() - _sync_client().manage.v1.projects.keys.create(project_id=PROJECT, request={}) - assert _sent_body(route) == {} + _call_sync(request={}) + assert _body(route) == {} + + +def test_request_none_still_sends_an_empty_body() -> None: + """``request=None`` sent an empty body on 7.20, so it must not become a client-side error. + + This is why ``request`` defaults to the OMIT sentinel rather than to ``None``: the two have to + stay distinguishable. + """ + with respx.mock: + route = _route() + _call_sync(request=None) + assert _raw_body(route) == b"" + + +@pytest.mark.parametrize( + "payload,expected", + [pytest.param("a comment", b'"a comment"', id="str"), pytest.param([1, 2, 3], b"[1,2,3]", id="list")], +) +def test_non_mapping_payloads_are_forwarded_rather_than_rejected(payload: typing.Any, expected: bytes) -> None: + """These reach the server and come back a 4xx, exactly as they did on 7.20. + + Turning them into a client-side ``TypeError`` would be a nicer API and a breaking change. + """ + with respx.mock: + route = _route() + _call_sync(request=payload) + assert _raw_body(route) == expected + + +# --- merge semantics -------------------------------------------------------------------------- def test_keyword_arguments_override_the_legacy_mapping() -> None: with respx.mock: route = _route() - _sync_client().manage.v1.projects.keys.create( - project_id=PROJECT, - request={"comment": "from the mapping", "scopes": ["member"]}, - comment="from the keyword argument", - ) - assert _sent_body(route) == {"comment": "from the keyword argument", "scopes": ["member"]} + _call_sync(request={"comment": "from the mapping", "scopes": ["member"]}, comment="from the keyword argument") + assert _body(route) == {"comment": "from the keyword argument", "scopes": ["member"]} -def test_optional_fields_round_trip_through_the_legacy_mapping() -> None: +def test_keyword_arguments_override_every_field_and_keep_unknown_keys() -> None: with respx.mock: route = _route() - _sync_client().manage.v1.projects.keys.create( - project_id=PROJECT, + _call_sync( request={ - "comment": "a comment", - "scopes": ["member"], - "tags": ["tag-1"], - "time_to_live_in_seconds": 60, + "comment": "mapping", + "scopes": ["mapping"], + "tags": ["mapping"], + "time_to_live_in_seconds": 1, + "keep_me": "yes", }, + comment="keyword", + scopes=["keyword"], + tags=["keyword"], + time_to_live_in_seconds=2, + expiration_date=dt.datetime(2030, 1, 2, 3, 4, 5, tzinfo=UTC), + ) + assert _body(route) == { + "comment": "keyword", + "scopes": ["keyword"], + "tags": ["keyword"], + "time_to_live_in_seconds": 2, + "expiration_date": "2030-01-02T03:04:05Z", + "keep_me": "yes", + } + + +def test_non_mapping_payload_combined_with_keyword_arguments_raises() -> None: + """There is nothing to merge a keyword argument into, so this is rejected rather than guessed.""" + with respx.mock: + _route() + with pytest.raises(TypeError, match="must be a mapping when keyword arguments"): + _call_sync(request=typing.cast(typing.Any, "a comment"), comment="a comment") + + +# --- the explicit keyword arguments, on every surface ------------------------------------------- + + +@pytest.mark.parametrize("caller", SURFACES) +def test_every_optional_keyword_argument_reaches_the_wire(caller: Caller) -> None: + """``tags``, ``expiration_date`` and ``time_to_live_in_seconds`` are forwarded, not dropped. + + Both ``client.py`` and ``raw_client.py`` are frozen in ``.fernignore``, so a future regeneration + cannot repair drift here. Without this, a forwarder could stop passing a field and every other + test would still pass. + """ + with respx.mock: + route = _route() + caller( + comment="a comment", + scopes=["member"], + tags=["tag-1"], + expiration_date=dt.datetime(2030, 1, 2, 3, 4, 5, tzinfo=UTC), + time_to_live_in_seconds=60, ) - assert _sent_body(route) == { + assert _body(route) == { "comment": "a comment", "scopes": ["member"], "tags": ["tag-1"], + "expiration_date": "2030-01-02T03:04:05Z", "time_to_live_in_seconds": 60, } -@pytest.mark.parametrize( - "kwargs,missing", - [({}, "comment"), ({"comment": "a comment"}, "scopes")], -) -def test_neither_call_shape_supplied_raises_type_error(kwargs: typing.Dict[str, typing.Any], missing: str) -> None: - """Widening ``comment`` and ``scopes`` to optional must not let a caller omit them silently.""" +@pytest.mark.parametrize("caller", SURFACES) +def test_legacy_mapping_reaches_the_wire_on_every_surface(caller: Caller) -> None: with respx.mock: - _route() - with pytest.raises(TypeError, match=missing): - _sync_client().manage.v1.projects.keys.create(project_id=PROJECT, **kwargs) + route = _route() + caller(request=dict(_MINIMAL)) + assert _body(route) == _MINIMAL -def test_non_mapping_request_raises_type_error() -> None: +@pytest.mark.parametrize("caller", SURFACES) +def test_omitting_both_call_shapes_raises_on_every_surface(caller: Caller) -> None: + """Widening ``comment`` and ``scopes`` to optional must not let a caller omit them silently.""" with respx.mock: _route() - with pytest.raises(TypeError, match="must be a mapping"): - _sync_client().manage.v1.projects.keys.create( - project_id=PROJECT, request=typing.cast(typing.Any, "a comment") - ) + with pytest.raises(TypeError, match="comment"): + caller(scopes=["member"]) + with pytest.raises(TypeError, match="scopes"): + caller(comment="a comment") -def test_raw_response_surface_accepts_the_legacy_mapping() -> None: - with respx.mock: - route = _route() - response = _sync_client().manage.v1.projects.keys.with_raw_response.create( - project_id=PROJECT, request={"comment": "a comment", "scopes": ["member"]} - ) - assert response.data.api_key_id == _RESPONSE["api_key_id"] - assert _sent_body(route) == {"comment": "a comment", "scopes": ["member"]} +# --- values that are falsy or null --------------------------------------------------------------- -@pytest.mark.asyncio -async def test_async_client_accepts_the_legacy_mapping() -> None: +@pytest.mark.parametrize( + "kwargs,expected", + [ + pytest.param({"comment": "", "scopes": ["member"]}, {"comment": "", "scopes": ["member"]}, id="empty-comment"), + pytest.param({"comment": "a comment", "scopes": []}, {"comment": "a comment", "scopes": []}, id="empty-scopes"), + ], +) +def test_falsy_values_are_sent_rather_than_treated_as_absent( + kwargs: typing.Dict[str, typing.Any], expected: typing.Dict[str, typing.Any] +) -> None: + """A supplied-but-falsy value is a value. Testing truthiness here would silently drop it.""" with respx.mock: route = _route() - await _async_client().manage.v1.projects.keys.create( - project_id=PROJECT, request={"comment": "a comment", "scopes": ["member"]} - ) - assert _sent_body(route) == {"comment": "a comment", "scopes": ["member"]} + _call_sync(**kwargs) + assert _body(route) == expected -@pytest.mark.asyncio -async def test_async_raw_response_surface_accepts_the_legacy_mapping() -> None: +@pytest.mark.parametrize("field", ["comment", "scopes", "tags", "expiration_date", "time_to_live_in_seconds"]) +def test_explicit_none_overrides_the_mapping_uniformly(field: str) -> None: + """``None`` means a null value for all five fields, never "omitted". + + Every argument defaults to the OMIT sentinel so this stays uniform. An earlier version defaulted + ``comment`` and ``scopes`` to ``None``, which made an explicit ``None`` silently ignored for two + of the five while the other three sent JSON null. + """ with respx.mock: route = _route() - response = await _async_client().manage.v1.projects.keys.with_raw_response.create( - project_id=PROJECT, request={"comment": "a comment", "scopes": ["member"]} - ) - assert response.data.api_key_id == _RESPONSE["api_key_id"] - assert _sent_body(route) == {"comment": "a comment", "scopes": ["member"]} + _call_sync(request={**_MINIMAL, "tags": ["tag-1"]}, **{field: None}) + assert _body(route)[field] is None From dd1b0d60582e40a0f4b5d363ec960035e54c07e2 Mon Sep 17 00:00:00 2001 From: Greg Holmes Date: Wed, 2 Dec 2026 10:12:56 +0000 Subject: [PATCH 6/6] docs(manage): document create-key arguments and fix stale fallback version Add the comment, scopes, tags, expiration_date and time_to_live_in_seconds entries to the keys.create reference, mark request as deprecated, say that comment and scopes are required unless request is supplied, and correct the client_wrapper.py fallback version in AGENTS.md to 7.20.0. --- AGENTS.md | 2 +- reference.md | 45 ++++++++++++++++++- .../manage/v1/projects/keys/client.py | 4 ++ .../manage/v1/projects/keys/raw_client.py | 4 ++ 4 files changed, 53 insertions(+), 2 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 4c0d8022..5ec640ed 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -83,7 +83,7 @@ Current temporarily frozen files: - `src/deepgram/listen/v2/types/listen_v2connected.py`, `src/deepgram/listen/v2/types/listen_v2turn_info.py`, `src/deepgram/listen/v2/types/listen_v2turn_info_words_item.py`, `src/deepgram/listen/v2/types/listen_v2configure_success.py`, `src/deepgram/listen/v2/types/listen_v2configure_success_thresholds.py`, `src/deepgram/listen/v2/types/listen_v2configure_failure.py`, `src/deepgram/listen/v2/types/listen_v2fatal_error.py`, `src/deepgram/listen/v2/types/listen_v2warning.py` — read-side compatibility for the SDK 7.7 Listen V2 response retype. Through 7.6, `V2SocketClientResponse` contained `typing.Any`, so every response was returned as a raw dict; fixing the union made responses typed models and broke callers using `response["field"]`. These generated response classes inherit the hand-written base above, preserving read-only wire-key subscript access alongside canonical attribute access. Restore direct `UncheckedBaseModel` inheritance and unfreeze these files in the next major release. - `src/deepgram/types/deepgram_listen_provider_v2.py`, `src/deepgram/agent/v1/types/agent_v1settings_agent_listen_provider.py`, `src/deepgram/agent/v1/types/agent_v1settings_agent_context_listen_provider.py` — behavioural back-compat shim for the `language_hint` -> `language_hints` rename (2026-06-15 regen). The public field was historically (incorrectly) singular and accepted a str or a list; the API field is `language_hints` (a list, and the server uses `deny_unknown_fields` so the singular key is rejected on the wire). Each carries a hand-added `model_validator(mode='before')` / `root_validator(pre=True)` that remaps a legacy `language_hint=` kwarg and drops the dead singular key. Remove and unfreeze the language alias when it is retired in a future major. - `src/deepgram/types/shared_topics.py`, `src/deepgram/types/shared_intents.py`, `src/deepgram/requests/shared_topics.py`, `src/deepgram/requests/shared_intents.py`, and the generated root/type/request barrels — direct Topics and Intents segments plus their generated exports remain Fern-owned, but carry the v7 deprecated `results` construction facade and Params shape for the hand-written wrappers above. The models normalize legacy `results.{topics,intents}.segments` input to direct `segments` while preserving direct fields and deprecated read facades. Freeze these generated files during the parent reconciliation; retain all direct generated segments and exports alongside the compatibility surface. -- `src/deepgram/core/client_wrapper.py` — Fern's `runtime_version: true` wrapper correctly uses installed package metadata, but its `PackageNotFoundError` fallback must remain the latest published version for source checkouts, vendored copies, zipapps, and frozen bundles. The retained `7.16.0` fallback carries `# x-release-please-version`, and `.github/release-please-config.json` includes the file as a generic extra file so Release Please updates it with `pyproject.toml` and `.fern/metadata.json`. Unfreeze when Fern emits a release-managed fallback. +- `src/deepgram/core/client_wrapper.py` — Fern's `runtime_version: true` wrapper correctly uses installed package metadata, but its `PackageNotFoundError` fallback must remain the latest published version for source checkouts, vendored copies, zipapps, and frozen bundles. The retained `7.20.0` fallback carries `# x-release-please-version`, and `.github/release-please-config.json` includes the file as a generic extra file so Release Please updates it with `pyproject.toml` and `.fern/metadata.json`. Unfreeze when Fern emits a release-managed fallback. - `src/deepgram/speak/v2/types/speak_v2warning.py`, `src/deepgram/speak/v2/requests/speak_v2warning.py`, `src/deepgram/agent/v1/types/agent_v1inject_dynamic_agent_message.py`, `src/deepgram/agent/v1/requests/agent_v1inject_dynamic_agent_message.py`, `src/deepgram/listen/v1/types/listen_v1configure_failure.py`, `src/deepgram/listen/v1/requests/listen_v1configure_failure.py` — whitespace cleanup for generated docstrings. Unfreeze when Fern emits whitespace-clean output. - `src/deepgram/manage/v1/projects/keys/client.py`, `src/deepgram/manage/v1/projects/keys/raw_client.py` — backward-compat patch for the 2026-12-01 create-key signature change. The generated `create()` now takes `comment`/`scopes`/`tags`/`expiration_date`/`time_to_live_in_seconds` as keyword arguments, which raises `TypeError` for every caller written against 7.20 or earlier. Both files carry a hand-added optional `request` argument, and `raw_client.py` carries `_build_create_key_body`, which forwards the legacy mapping verbatim (it was typed `Any` and never validated) with explicit keyword arguments applied on top. Every argument defaults to the `OMIT` sentinel, so an explicit `None` uniformly means a null value rather than an omitted one, and `request=None` still sends the empty body it did on 7.20. `comment` and `scopes` had to be widened to optional to accept the legacy form, which costs mypy's missing-argument check, but only for code importing `KeysClient`/`RawKeysClient` directly: `BaseClient.manage` has no return annotation, so `client.manage.v1.projects.keys.create` was always `Any` to mypy. A runtime `TypeError` naming the argument covers both paths. Body-level coverage is `tests/custom/test_create_key_legacy_request.py`, which mutation-tests the merge and passthrough branches; `tests/wire/test_manage_v1_projects_keys.py` only counts requests. Remove and unfreeze when the legacy call shape is retired in a future major. - `src/deepgram/agent/v1/types/agent_v1update_listen_listen.py` — backward-compat patch for the 2026-07-31 `AgentV1UpdateListen` provider retype. The `provider` field changed from a bare `DeepgramListenProviderV2` to the required discriminated union `AgentV1UpdateListenListenProvider` (`_V1`/`_V2`, discriminant `version`). Carries a hand-added `model_validator(mode='before')` / `root_validator(pre=True)` that coerces a legacy `DeepgramListenProviderV1`/`V2` (or a dict lacking the `version` discriminant) into the new shape so existing callers keep working. Remove and unfreeze when the old provider payloads are retired in a future major. NOTE: this patch was silently lost once (it was absent from `.fernignore`, so a regen overwrote it) — keep it frozen. diff --git a/reference.md b/reference.md index d01083f0..22c7be03 100644 --- a/reference.md +++ b/reference.md @@ -1529,7 +1529,50 @@ client.manage.v1.projects.keys.create(
-**request:** `CreateKeyV1RequestOne` +
+
+ +**comment:** `typing.Optional[str]` — Required unless the deprecated `request` argument is supplied. + +
+
+ +
+
+ +**scopes:** `typing.Optional[typing.Sequence[str]]` — Required unless the deprecated `request` argument is supplied. + +
+
+ +
+
+ +**tags:** `typing.Optional[typing.Sequence[str]]` + +
+
+ +
+
+ +**expiration_date:** `typing.Optional[dt.datetime]` + +
+
+ +
+
+ +**time_to_live_in_seconds:** `typing.Optional[float]` + +
+
+ +
+
+ +**request:** `typing.Optional[CreateKeyV1RequestParams]` — Deprecated. The pre-2026-12 single-mapping form of this call. It is forwarded as the request body; the arguments above override the matching keys.
diff --git a/src/deepgram/manage/v1/projects/keys/client.py b/src/deepgram/manage/v1/projects/keys/client.py index b69c2735..1ccf2e9c 100644 --- a/src/deepgram/manage/v1/projects/keys/client.py +++ b/src/deepgram/manage/v1/projects/keys/client.py @@ -94,8 +94,10 @@ def create( The unique identifier of the project comment : typing.Optional[str] + Required unless the deprecated `request` argument is supplied. scopes : typing.Optional[typing.Sequence[str]] + Required unless the deprecated `request` argument is supplied. tags : typing.Optional[typing.Sequence[str]] @@ -300,8 +302,10 @@ async def create( The unique identifier of the project comment : typing.Optional[str] + Required unless the deprecated `request` argument is supplied. scopes : typing.Optional[typing.Sequence[str]] + Required unless the deprecated `request` argument is supplied. tags : typing.Optional[typing.Sequence[str]] diff --git a/src/deepgram/manage/v1/projects/keys/raw_client.py b/src/deepgram/manage/v1/projects/keys/raw_client.py index cd082eca..e517320d 100644 --- a/src/deepgram/manage/v1/projects/keys/raw_client.py +++ b/src/deepgram/manage/v1/projects/keys/raw_client.py @@ -170,8 +170,10 @@ def create( The unique identifier of the project comment : typing.Optional[str] + Required unless the deprecated `request` argument is supplied. scopes : typing.Optional[typing.Sequence[str]] + Required unless the deprecated `request` argument is supplied. tags : typing.Optional[typing.Sequence[str]] @@ -440,8 +442,10 @@ async def create( The unique identifier of the project comment : typing.Optional[str] + Required unless the deprecated `request` argument is supplied. scopes : typing.Optional[typing.Sequence[str]] + Required unless the deprecated `request` argument is supplied. tags : typing.Optional[typing.Sequence[str]]