@deepgram/sdk 5.0.0 → 5.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/index.global.js +1212 -200
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/Client.d.ts +15 -0
- package/dist/cjs/Client.js +79 -0
- package/dist/cjs/CustomClient.js +11 -9
- package/dist/cjs/api/resources/agent/resources/v1/client/Client.d.ts +2 -0
- package/dist/cjs/api/resources/agent/resources/v1/client/Client.js +5 -5
- package/dist/cjs/api/resources/agent/resources/v1/client/Socket.d.ts +6 -6
- package/dist/cjs/api/resources/agent/resources/v1/client/Socket.js +6 -6
- package/dist/cjs/api/resources/agent/resources/v1/exports.d.ts +1 -0
- package/dist/cjs/api/resources/agent/resources/v1/exports.js +3 -1
- package/dist/cjs/api/resources/agent/resources/v1/resources/settings/resources/think/resources/models/client/Client.js +1 -1
- package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1ConversationText.d.ts +4 -0
- package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1FunctionCallRequest.d.ts +2 -0
- package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1History.d.ts +24 -0
- package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1History.js +3 -0
- package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1InjectAgentMessage.d.ts +20 -0
- package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1InjectAgentMessage.js +14 -0
- package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1Settings.d.ts +24 -4
- package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1Settings.js +10 -0
- package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1SettingsAgentContextListenProvider.d.ts +34 -0
- package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1SettingsAgentContextListenProvider.js +3 -0
- package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1SettingsAgentListenProvider.d.ts +3 -23
- package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1SettingsAgentListenProvider.js +7 -1
- package/dist/cjs/api/resources/agent/resources/v1/types/index.d.ts +2 -0
- package/dist/cjs/api/resources/agent/resources/v1/types/index.js +2 -0
- package/dist/cjs/api/resources/auth/resources/v1/resources/tokens/client/Client.js +1 -1
- package/dist/cjs/api/resources/index.d.ts +1 -0
- package/dist/cjs/api/resources/index.js +2 -1
- package/dist/cjs/api/resources/listen/resources/v1/client/Client.d.ts +2 -0
- package/dist/cjs/api/resources/listen/resources/v1/client/Client.js +5 -5
- package/dist/cjs/api/resources/listen/resources/v1/client/Socket.d.ts +3 -3
- package/dist/cjs/api/resources/listen/resources/v1/client/Socket.js +2 -2
- package/dist/cjs/api/resources/listen/resources/v1/exports.d.ts +1 -0
- package/dist/cjs/api/resources/listen/resources/v1/exports.js +3 -1
- package/dist/cjs/api/resources/listen/resources/v1/resources/media/client/Client.d.ts +1 -0
- package/dist/cjs/api/resources/listen/resources/v1/resources/media/client/Client.js +11 -2
- package/dist/cjs/api/resources/listen/resources/v1/resources/media/client/requests/ListenV1RequestUrl.d.ts +1 -0
- package/dist/cjs/api/resources/listen/resources/v2/client/Client.d.ts +3 -0
- package/dist/cjs/api/resources/listen/resources/v2/client/Client.js +19 -6
- package/dist/cjs/api/resources/listen/resources/v2/client/Socket.d.ts +4 -4
- package/dist/cjs/api/resources/listen/resources/v2/client/Socket.js +3 -3
- package/dist/cjs/api/resources/listen/resources/v2/exports.d.ts +1 -0
- package/dist/cjs/api/resources/listen/resources/v2/exports.js +3 -1
- package/dist/cjs/api/resources/listen/resources/v2/types/ListenV2Configure.d.ts +6 -0
- package/dist/cjs/api/resources/listen/resources/v2/types/ListenV2ConfigureSuccess.d.ts +2 -0
- package/dist/cjs/api/resources/listen/resources/v2/types/ListenV2TurnInfo.d.ts +11 -0
- package/dist/cjs/api/resources/manage/resources/v1/resources/models/client/Client.js +6 -2
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/client/Client.js +9 -5
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/balances/client/Client.js +2 -2
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/breakdown/client/Client.d.ts +2 -1
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/breakdown/client/Client.js +7 -2
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/breakdown/client/requests/BreakdownListRequest.d.ts +2 -1
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/fields/client/Client.js +5 -1
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/purchases/client/Client.js +5 -1
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/keys/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/keys/client/Client.js +9 -5
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/members/client/Client.js +2 -2
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/members/resources/invites/client/Client.js +3 -3
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/members/resources/scopes/client/Client.js +2 -2
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/models/client/Client.js +6 -2
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/requests/client/Client.js +6 -2
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/usage/client/Client.js +5 -1
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/usage/resources/breakdown/client/Client.js +5 -1
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/usage/resources/fields/client/Client.js +5 -1
- package/dist/cjs/api/resources/read/resources/v1/resources/text/client/Client.js +5 -1
- package/dist/cjs/api/resources/selfHosted/resources/v1/resources/distributionCredentials/client/Client.d.ts +1 -0
- package/dist/cjs/api/resources/selfHosted/resources/v1/resources/distributionCredentials/client/Client.js +9 -4
- package/dist/cjs/api/resources/selfHosted/resources/v1/resources/distributionCredentials/client/requests/CreateProjectDistributionCredentialsV1Request.d.ts +1 -0
- package/dist/cjs/api/resources/speak/resources/v1/client/Client.d.ts +3 -0
- package/dist/cjs/api/resources/speak/resources/v1/client/Client.js +6 -5
- package/dist/cjs/api/resources/speak/resources/v1/client/Socket.d.ts +2 -2
- package/dist/cjs/api/resources/speak/resources/v1/client/Socket.js +2 -2
- package/dist/cjs/api/resources/speak/resources/v1/exports.d.ts +1 -0
- package/dist/cjs/api/resources/speak/resources/v1/exports.js +3 -1
- package/dist/cjs/api/resources/speak/resources/v1/resources/audio/client/Client.js +7 -2
- package/dist/cjs/api/resources/speak/resources/v1/resources/audio/client/requests/SpeakV1Request.d.ts +2 -0
- package/dist/cjs/api/resources/voiceAgent/client/Client.d.ts +15 -0
- package/dist/cjs/api/resources/voiceAgent/client/Client.js +21 -0
- package/dist/cjs/api/resources/voiceAgent/exports.d.ts +3 -0
- package/dist/cjs/api/resources/voiceAgent/exports.js +22 -0
- package/dist/cjs/api/resources/voiceAgent/index.d.ts +2 -0
- package/dist/cjs/api/resources/voiceAgent/index.js +18 -0
- package/dist/cjs/api/resources/voiceAgent/resources/configurations/client/Client.d.ts +89 -0
- package/dist/cjs/api/resources/voiceAgent/resources/configurations/client/Client.js +325 -0
- package/dist/cjs/api/resources/voiceAgent/resources/configurations/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/voiceAgent/resources/configurations/client/index.js +17 -0
- package/dist/cjs/api/resources/voiceAgent/resources/configurations/client/requests/CreateAgentConfigurationV1Request.d.ts +14 -0
- package/dist/cjs/api/resources/voiceAgent/resources/configurations/client/requests/CreateAgentConfigurationV1Request.js +3 -0
- package/dist/cjs/api/resources/voiceAgent/resources/configurations/client/requests/UpdateAgentMetadataV1Request.d.ts +12 -0
- package/dist/cjs/api/resources/voiceAgent/resources/configurations/client/requests/UpdateAgentMetadataV1Request.js +3 -0
- package/dist/cjs/api/resources/voiceAgent/resources/configurations/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/resources/voiceAgent/resources/configurations/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/voiceAgent/resources/configurations/exports.d.ts +2 -0
- package/dist/cjs/api/resources/voiceAgent/resources/configurations/exports.js +21 -0
- package/dist/cjs/api/resources/voiceAgent/resources/configurations/index.d.ts +1 -0
- package/dist/cjs/api/resources/voiceAgent/resources/configurations/index.js +17 -0
- package/dist/cjs/api/resources/voiceAgent/resources/index.d.ts +4 -0
- package/dist/cjs/api/resources/voiceAgent/resources/index.js +43 -0
- package/dist/cjs/api/resources/voiceAgent/resources/variables/client/Client.d.ts +92 -0
- package/dist/cjs/api/resources/voiceAgent/resources/variables/client/Client.js +325 -0
- package/dist/cjs/api/resources/voiceAgent/resources/variables/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/voiceAgent/resources/variables/client/index.js +17 -0
- package/dist/cjs/api/resources/voiceAgent/resources/variables/client/requests/CreateAgentVariableV1Request.d.ts +16 -0
- package/dist/cjs/api/resources/voiceAgent/resources/variables/client/requests/CreateAgentVariableV1Request.js +3 -0
- package/dist/cjs/api/resources/voiceAgent/resources/variables/client/requests/UpdateAgentVariableV1Request.d.ts +11 -0
- package/dist/cjs/api/resources/voiceAgent/resources/variables/client/requests/UpdateAgentVariableV1Request.js +3 -0
- package/dist/cjs/api/resources/voiceAgent/resources/variables/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/resources/voiceAgent/resources/variables/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/voiceAgent/resources/variables/exports.d.ts +2 -0
- package/dist/cjs/api/resources/voiceAgent/resources/variables/exports.js +21 -0
- package/dist/cjs/api/resources/voiceAgent/resources/variables/index.d.ts +1 -0
- package/dist/cjs/api/resources/voiceAgent/resources/variables/index.js +17 -0
- package/dist/cjs/api/types/AgentConfigurationV1.d.ts +15 -0
- package/dist/cjs/api/types/AgentConfigurationV1.js +3 -0
- package/dist/cjs/api/types/AgentVariableV1.d.ts +14 -0
- package/dist/cjs/api/types/AgentVariableV1.js +3 -0
- package/dist/cjs/api/types/Cartesia.d.ts +2 -0
- package/dist/cjs/api/types/CreateAgentConfigurationV1Response.d.ts +8 -0
- package/dist/cjs/api/types/CreateAgentConfigurationV1Response.js +3 -0
- package/dist/cjs/api/types/CreateKeyV1Request.d.ts +2 -0
- package/dist/cjs/api/types/CreateKeyV1Request.js +3 -0
- package/dist/cjs/api/types/Deepgram.d.ts +2 -0
- package/dist/cjs/api/types/DeleteAgentConfigurationV1Response.d.ts +4 -0
- package/dist/cjs/api/types/DeleteAgentConfigurationV1Response.js +3 -0
- package/dist/cjs/api/types/DeleteAgentVariableV1Response.d.ts +4 -0
- package/dist/cjs/api/types/DeleteAgentVariableV1Response.js +3 -0
- package/dist/cjs/api/types/Groq.d.ts +13 -0
- package/dist/cjs/api/types/Groq.js +12 -0
- package/dist/cjs/api/types/ListAgentConfigurationsV1Response.d.ts +5 -0
- package/dist/cjs/api/types/ListAgentConfigurationsV1Response.js +3 -0
- package/dist/cjs/api/types/ListAgentVariablesV1Response.d.ts +5 -0
- package/dist/cjs/api/types/ListAgentVariablesV1Response.js +3 -0
- package/dist/cjs/api/types/ListProjectMembersV1Response.d.ts +4 -0
- package/dist/cjs/api/types/ListenV1Callback.d.ts +3 -0
- package/dist/cjs/api/types/ListenV1Channels.d.ts +3 -0
- package/dist/cjs/api/types/ListenV1Endpointing.d.ts +3 -0
- package/dist/cjs/api/types/ListenV1Extra.d.ts +3 -0
- package/dist/cjs/api/types/ListenV1Keyterm.d.ts +3 -0
- package/dist/cjs/api/types/ListenV1Keywords.d.ts +3 -0
- package/dist/cjs/api/types/ListenV1Language.d.ts +3 -0
- package/dist/cjs/api/types/ListenV1MipOptOut.d.ts +3 -0
- package/dist/cjs/api/types/ListenV1Replace.d.ts +3 -0
- package/dist/cjs/api/types/ListenV1SampleRate.d.ts +3 -0
- package/dist/cjs/api/types/ListenV1Search.d.ts +3 -0
- package/dist/cjs/api/types/ListenV1Tag.d.ts +3 -0
- package/dist/cjs/api/types/ListenV1UtteranceEndMs.d.ts +3 -0
- package/dist/cjs/api/types/ListenV1Version.d.ts +3 -0
- package/dist/cjs/api/types/ListenV2EagerEotThreshold.d.ts +5 -0
- package/dist/cjs/api/types/ListenV2EotThreshold.d.ts +4 -0
- package/dist/cjs/api/types/ListenV2EotTimeoutMs.d.ts +4 -0
- package/dist/cjs/api/types/ListenV2LanguageHint.d.ts +7 -0
- package/dist/cjs/api/types/ListenV2LanguageHint.js +3 -0
- package/dist/cjs/api/types/ListenV2MipOptOut.d.ts +5 -0
- package/dist/cjs/api/types/ListenV2Model.d.ts +6 -4
- package/dist/cjs/api/types/ListenV2Model.js +6 -0
- package/dist/cjs/api/types/ListenV2SampleRate.d.ts +3 -0
- package/dist/cjs/api/types/ListenV2Tag.d.ts +4 -0
- package/dist/cjs/api/types/OpenAiThinkProvider.d.ts +11 -0
- package/dist/cjs/api/types/OpenAiThinkProvider.js +8 -0
- package/dist/cjs/api/types/SpeakV1MipOptOut.d.ts +3 -0
- package/dist/cjs/api/types/SpeakV1Speed.d.ts +4 -0
- package/dist/cjs/api/types/SpeakV1Speed.js +3 -0
- package/dist/cjs/api/types/UsageBreakdownV1Response.d.ts +3 -4
- package/dist/cjs/api/types/index.d.ts +10 -1
- package/dist/cjs/api/types/index.js +10 -1
- package/dist/cjs/core/auth/BasicAuth.d.ts +2 -2
- package/dist/cjs/core/auth/BasicAuth.js +7 -1
- package/dist/cjs/core/fetcher/BinaryResponse.d.ts +1 -1
- package/dist/cjs/core/fetcher/Fetcher.d.ts +8 -0
- package/dist/cjs/core/fetcher/Fetcher.js +13 -8
- package/dist/cjs/core/fetcher/index.d.ts +2 -0
- package/dist/cjs/core/fetcher/index.js +3 -1
- package/dist/cjs/core/fetcher/makePassthroughRequest.d.ts +49 -0
- package/dist/cjs/core/fetcher/makePassthroughRequest.js +135 -0
- package/dist/cjs/core/file/file.js +3 -2
- package/dist/cjs/core/url/QueryStringBuilder.d.ts +47 -0
- package/dist/cjs/core/url/QueryStringBuilder.js +83 -0
- package/dist/cjs/core/url/index.d.ts +1 -0
- package/dist/cjs/core/url/index.js +3 -1
- package/dist/cjs/core/url/qs.d.ts +2 -1
- package/dist/cjs/core/url/qs.js +24 -12
- package/dist/cjs/core/websocket/ws.d.ts +10 -1
- package/dist/cjs/core/websocket/ws.js +19 -5
- package/dist/cjs/errors/DeepgramError.d.ts +3 -1
- package/dist/cjs/errors/DeepgramError.js +4 -1
- package/dist/cjs/errors/DeepgramTimeoutError.d.ts +4 -1
- package/dist/cjs/errors/DeepgramTimeoutError.js +4 -1
- package/dist/cjs/errors/handleNonStatusCodeError.js +4 -1
- package/dist/cjs/transport.d.ts +73 -0
- package/dist/cjs/transport.js +2 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/Client.d.mts +15 -0
- package/dist/esm/Client.mjs +46 -0
- package/dist/esm/CustomClient.mjs +11 -9
- package/dist/esm/api/resources/agent/resources/v1/client/Client.d.mts +2 -0
- package/dist/esm/api/resources/agent/resources/v1/client/Client.mjs +5 -5
- package/dist/esm/api/resources/agent/resources/v1/client/Socket.d.mts +6 -6
- package/dist/esm/api/resources/agent/resources/v1/client/Socket.mjs +6 -6
- package/dist/esm/api/resources/agent/resources/v1/exports.d.mts +1 -0
- package/dist/esm/api/resources/agent/resources/v1/exports.mjs +1 -0
- package/dist/esm/api/resources/agent/resources/v1/resources/settings/resources/think/resources/models/client/Client.mjs +1 -1
- package/dist/esm/api/resources/agent/resources/v1/types/AgentV1ConversationText.d.mts +4 -0
- package/dist/esm/api/resources/agent/resources/v1/types/AgentV1FunctionCallRequest.d.mts +2 -0
- package/dist/esm/api/resources/agent/resources/v1/types/AgentV1History.d.mts +24 -0
- package/dist/esm/api/resources/agent/resources/v1/types/AgentV1History.mjs +2 -0
- package/dist/esm/api/resources/agent/resources/v1/types/AgentV1InjectAgentMessage.d.mts +20 -0
- package/dist/esm/api/resources/agent/resources/v1/types/AgentV1InjectAgentMessage.mjs +13 -1
- package/dist/esm/api/resources/agent/resources/v1/types/AgentV1Settings.d.mts +24 -4
- package/dist/esm/api/resources/agent/resources/v1/types/AgentV1Settings.mjs +10 -0
- package/dist/esm/api/resources/agent/resources/v1/types/AgentV1SettingsAgentContextListenProvider.d.mts +34 -0
- package/dist/esm/api/resources/agent/resources/v1/types/AgentV1SettingsAgentContextListenProvider.mjs +2 -0
- package/dist/esm/api/resources/agent/resources/v1/types/AgentV1SettingsAgentListenProvider.d.mts +3 -23
- package/dist/esm/api/resources/agent/resources/v1/types/AgentV1SettingsAgentListenProvider.mjs +7 -1
- package/dist/esm/api/resources/agent/resources/v1/types/index.d.mts +2 -0
- package/dist/esm/api/resources/agent/resources/v1/types/index.mjs +2 -0
- package/dist/esm/api/resources/auth/resources/v1/resources/tokens/client/Client.mjs +1 -1
- package/dist/esm/api/resources/index.d.mts +1 -0
- package/dist/esm/api/resources/index.mjs +1 -0
- package/dist/esm/api/resources/listen/resources/v1/client/Client.d.mts +2 -0
- package/dist/esm/api/resources/listen/resources/v1/client/Client.mjs +5 -5
- package/dist/esm/api/resources/listen/resources/v1/client/Socket.d.mts +3 -3
- package/dist/esm/api/resources/listen/resources/v1/client/Socket.mjs +2 -2
- package/dist/esm/api/resources/listen/resources/v1/exports.d.mts +1 -0
- package/dist/esm/api/resources/listen/resources/v1/exports.mjs +1 -0
- package/dist/esm/api/resources/listen/resources/v1/resources/media/client/Client.d.mts +1 -0
- package/dist/esm/api/resources/listen/resources/v1/resources/media/client/Client.mjs +11 -2
- package/dist/esm/api/resources/listen/resources/v1/resources/media/client/requests/ListenV1RequestUrl.d.mts +1 -0
- package/dist/esm/api/resources/listen/resources/v2/client/Client.d.mts +3 -0
- package/dist/esm/api/resources/listen/resources/v2/client/Client.mjs +19 -6
- package/dist/esm/api/resources/listen/resources/v2/client/Socket.d.mts +4 -4
- package/dist/esm/api/resources/listen/resources/v2/client/Socket.mjs +3 -3
- package/dist/esm/api/resources/listen/resources/v2/exports.d.mts +1 -0
- package/dist/esm/api/resources/listen/resources/v2/exports.mjs +1 -0
- package/dist/esm/api/resources/listen/resources/v2/types/ListenV2Configure.d.mts +6 -0
- package/dist/esm/api/resources/listen/resources/v2/types/ListenV2ConfigureSuccess.d.mts +2 -0
- package/dist/esm/api/resources/listen/resources/v2/types/ListenV2TurnInfo.d.mts +11 -0
- package/dist/esm/api/resources/manage/resources/v1/resources/models/client/Client.mjs +6 -2
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/client/Client.mjs +9 -5
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/balances/client/Client.mjs +2 -2
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/breakdown/client/Client.d.mts +2 -1
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/breakdown/client/Client.mjs +7 -2
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/breakdown/client/requests/BreakdownListRequest.d.mts +2 -1
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/fields/client/Client.mjs +5 -1
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/purchases/client/Client.mjs +5 -1
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/keys/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/keys/client/Client.mjs +9 -5
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/members/client/Client.mjs +2 -2
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/members/resources/invites/client/Client.mjs +3 -3
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/members/resources/scopes/client/Client.mjs +2 -2
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/models/client/Client.mjs +6 -2
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/requests/client/Client.mjs +6 -2
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/usage/client/Client.mjs +5 -1
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/usage/resources/breakdown/client/Client.mjs +5 -1
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/usage/resources/fields/client/Client.mjs +5 -1
- package/dist/esm/api/resources/read/resources/v1/resources/text/client/Client.mjs +5 -1
- package/dist/esm/api/resources/selfHosted/resources/v1/resources/distributionCredentials/client/Client.d.mts +1 -0
- package/dist/esm/api/resources/selfHosted/resources/v1/resources/distributionCredentials/client/Client.mjs +9 -4
- package/dist/esm/api/resources/selfHosted/resources/v1/resources/distributionCredentials/client/requests/CreateProjectDistributionCredentialsV1Request.d.mts +1 -0
- package/dist/esm/api/resources/speak/resources/v1/client/Client.d.mts +3 -0
- package/dist/esm/api/resources/speak/resources/v1/client/Client.mjs +6 -5
- package/dist/esm/api/resources/speak/resources/v1/client/Socket.d.mts +2 -2
- package/dist/esm/api/resources/speak/resources/v1/client/Socket.mjs +2 -2
- package/dist/esm/api/resources/speak/resources/v1/exports.d.mts +1 -0
- package/dist/esm/api/resources/speak/resources/v1/exports.mjs +1 -0
- package/dist/esm/api/resources/speak/resources/v1/resources/audio/client/Client.mjs +7 -2
- package/dist/esm/api/resources/speak/resources/v1/resources/audio/client/requests/SpeakV1Request.d.mts +2 -0
- package/dist/esm/api/resources/voiceAgent/client/Client.d.mts +15 -0
- package/dist/esm/api/resources/voiceAgent/client/Client.mjs +17 -0
- package/dist/esm/api/resources/voiceAgent/client/index.d.mts +1 -0
- package/dist/esm/api/resources/voiceAgent/client/index.mjs +1 -0
- package/dist/esm/api/resources/voiceAgent/exports.d.mts +3 -0
- package/dist/esm/api/resources/voiceAgent/exports.mjs +4 -0
- package/dist/esm/api/resources/voiceAgent/index.d.mts +2 -0
- package/dist/esm/api/resources/voiceAgent/index.mjs +2 -0
- package/dist/esm/api/resources/voiceAgent/resources/configurations/client/Client.d.mts +89 -0
- package/dist/esm/api/resources/voiceAgent/resources/configurations/client/Client.mjs +288 -0
- package/dist/esm/api/resources/voiceAgent/resources/configurations/client/index.d.mts +1 -0
- package/dist/esm/api/resources/voiceAgent/resources/configurations/client/index.mjs +1 -0
- package/dist/esm/api/resources/voiceAgent/resources/configurations/client/requests/CreateAgentConfigurationV1Request.d.mts +14 -0
- package/dist/esm/api/resources/voiceAgent/resources/configurations/client/requests/CreateAgentConfigurationV1Request.mjs +2 -0
- package/dist/esm/api/resources/voiceAgent/resources/configurations/client/requests/UpdateAgentMetadataV1Request.d.mts +12 -0
- package/dist/esm/api/resources/voiceAgent/resources/configurations/client/requests/UpdateAgentMetadataV1Request.mjs +2 -0
- package/dist/esm/api/resources/voiceAgent/resources/configurations/client/requests/index.d.mts +2 -0
- package/dist/esm/api/resources/voiceAgent/resources/configurations/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/voiceAgent/resources/configurations/exports.d.mts +2 -0
- package/dist/esm/api/resources/voiceAgent/resources/configurations/exports.mjs +3 -0
- package/dist/esm/api/resources/voiceAgent/resources/configurations/index.d.mts +1 -0
- package/dist/esm/api/resources/voiceAgent/resources/configurations/index.mjs +1 -0
- package/dist/esm/api/resources/voiceAgent/resources/index.d.mts +4 -0
- package/dist/esm/api/resources/voiceAgent/resources/index.mjs +4 -0
- package/dist/esm/api/resources/voiceAgent/resources/variables/client/Client.d.mts +92 -0
- package/dist/esm/api/resources/voiceAgent/resources/variables/client/Client.mjs +288 -0
- package/dist/esm/api/resources/voiceAgent/resources/variables/client/index.d.mts +1 -0
- package/dist/esm/api/resources/voiceAgent/resources/variables/client/index.mjs +1 -0
- package/dist/esm/api/resources/voiceAgent/resources/variables/client/requests/CreateAgentVariableV1Request.d.mts +16 -0
- package/dist/esm/api/resources/voiceAgent/resources/variables/client/requests/CreateAgentVariableV1Request.mjs +2 -0
- package/dist/esm/api/resources/voiceAgent/resources/variables/client/requests/UpdateAgentVariableV1Request.d.mts +11 -0
- package/dist/esm/api/resources/voiceAgent/resources/variables/client/requests/UpdateAgentVariableV1Request.mjs +2 -0
- package/dist/esm/api/resources/voiceAgent/resources/variables/client/requests/index.d.mts +2 -0
- package/dist/esm/api/resources/voiceAgent/resources/variables/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/voiceAgent/resources/variables/exports.d.mts +2 -0
- package/dist/esm/api/resources/voiceAgent/resources/variables/exports.mjs +3 -0
- package/dist/esm/api/resources/voiceAgent/resources/variables/index.d.mts +1 -0
- package/dist/esm/api/resources/voiceAgent/resources/variables/index.mjs +1 -0
- package/dist/esm/api/types/AgentConfigurationV1.d.mts +15 -0
- package/dist/esm/api/types/AgentConfigurationV1.mjs +2 -0
- package/dist/esm/api/types/AgentVariableV1.d.mts +14 -0
- package/dist/esm/api/types/AgentVariableV1.mjs +2 -0
- package/dist/esm/api/types/Cartesia.d.mts +2 -0
- package/dist/esm/api/types/CreateAgentConfigurationV1Response.d.mts +8 -0
- package/dist/esm/api/types/CreateAgentConfigurationV1Response.mjs +2 -0
- package/dist/esm/api/types/CreateKeyV1Request.d.mts +2 -0
- package/dist/esm/api/types/CreateKeyV1Request.mjs +2 -0
- package/dist/esm/api/types/Deepgram.d.mts +2 -0
- package/dist/esm/api/types/DeleteAgentConfigurationV1Response.d.mts +4 -0
- package/dist/esm/api/types/DeleteAgentConfigurationV1Response.mjs +2 -0
- package/dist/esm/api/types/DeleteAgentVariableV1Response.d.mts +4 -0
- package/dist/esm/api/types/DeleteAgentVariableV1Response.mjs +2 -0
- package/dist/esm/api/types/Groq.d.mts +13 -0
- package/dist/esm/api/types/Groq.mjs +11 -1
- package/dist/esm/api/types/ListAgentConfigurationsV1Response.d.mts +5 -0
- package/dist/esm/api/types/ListAgentConfigurationsV1Response.mjs +2 -0
- package/dist/esm/api/types/ListAgentVariablesV1Response.d.mts +5 -0
- package/dist/esm/api/types/ListAgentVariablesV1Response.mjs +2 -0
- package/dist/esm/api/types/ListProjectMembersV1Response.d.mts +4 -0
- package/dist/esm/api/types/ListenV1Callback.d.mts +3 -0
- package/dist/esm/api/types/ListenV1Channels.d.mts +3 -0
- package/dist/esm/api/types/ListenV1Endpointing.d.mts +3 -0
- package/dist/esm/api/types/ListenV1Extra.d.mts +3 -0
- package/dist/esm/api/types/ListenV1Keyterm.d.mts +3 -0
- package/dist/esm/api/types/ListenV1Keywords.d.mts +3 -0
- package/dist/esm/api/types/ListenV1Language.d.mts +3 -0
- package/dist/esm/api/types/ListenV1MipOptOut.d.mts +3 -0
- package/dist/esm/api/types/ListenV1Replace.d.mts +3 -0
- package/dist/esm/api/types/ListenV1SampleRate.d.mts +3 -0
- package/dist/esm/api/types/ListenV1Search.d.mts +3 -0
- package/dist/esm/api/types/ListenV1Tag.d.mts +3 -0
- package/dist/esm/api/types/ListenV1UtteranceEndMs.d.mts +3 -0
- package/dist/esm/api/types/ListenV1Version.d.mts +3 -0
- package/dist/esm/api/types/ListenV2EagerEotThreshold.d.mts +5 -0
- package/dist/esm/api/types/ListenV2EotThreshold.d.mts +4 -0
- package/dist/esm/api/types/ListenV2EotTimeoutMs.d.mts +4 -0
- package/dist/esm/api/types/ListenV2LanguageHint.d.mts +7 -0
- package/dist/esm/api/types/ListenV2LanguageHint.mjs +2 -0
- package/dist/esm/api/types/ListenV2MipOptOut.d.mts +5 -0
- package/dist/esm/api/types/ListenV2Model.d.mts +6 -4
- package/dist/esm/api/types/ListenV2Model.mjs +5 -1
- package/dist/esm/api/types/ListenV2SampleRate.d.mts +3 -0
- package/dist/esm/api/types/ListenV2Tag.d.mts +4 -0
- package/dist/esm/api/types/OpenAiThinkProvider.d.mts +11 -0
- package/dist/esm/api/types/OpenAiThinkProvider.mjs +8 -0
- package/dist/esm/api/types/SpeakV1MipOptOut.d.mts +3 -0
- package/dist/esm/api/types/SpeakV1Speed.d.mts +4 -0
- package/dist/esm/api/types/SpeakV1Speed.mjs +2 -0
- package/dist/esm/api/types/UsageBreakdownV1Response.d.mts +3 -4
- package/dist/esm/api/types/index.d.mts +10 -1
- package/dist/esm/api/types/index.mjs +10 -1
- package/dist/esm/core/auth/BasicAuth.d.mts +2 -2
- package/dist/esm/core/auth/BasicAuth.mjs +7 -1
- package/dist/esm/core/fetcher/BinaryResponse.d.mts +1 -1
- package/dist/esm/core/fetcher/Fetcher.d.mts +8 -0
- package/dist/esm/core/fetcher/Fetcher.mjs +13 -8
- package/dist/esm/core/fetcher/index.d.mts +2 -0
- package/dist/esm/core/fetcher/index.mjs +1 -0
- package/dist/esm/core/fetcher/makePassthroughRequest.d.mts +49 -0
- package/dist/esm/core/fetcher/makePassthroughRequest.mjs +132 -0
- package/dist/esm/core/file/file.mjs +3 -2
- package/dist/esm/core/url/QueryStringBuilder.d.mts +47 -0
- package/dist/esm/core/url/QueryStringBuilder.mjs +80 -0
- package/dist/esm/core/url/index.d.mts +1 -0
- package/dist/esm/core/url/index.mjs +1 -0
- package/dist/esm/core/url/qs.d.mts +2 -1
- package/dist/esm/core/url/qs.mjs +24 -12
- package/dist/esm/core/websocket/ws.d.mts +10 -1
- package/dist/esm/core/websocket/ws.mjs +19 -5
- package/dist/esm/errors/DeepgramError.d.mts +3 -1
- package/dist/esm/errors/DeepgramError.mjs +4 -1
- package/dist/esm/errors/DeepgramTimeoutError.d.mts +4 -1
- package/dist/esm/errors/DeepgramTimeoutError.mjs +4 -1
- package/dist/esm/errors/handleNonStatusCodeError.mjs +4 -1
- package/dist/esm/transport.d.mts +73 -0
- package/dist/esm/transport.mjs +1 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +540 -500
- package/reference.md +732 -2
- package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1SettingsAgentSpeakEndpointProvider.d.ts +0 -201
- package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1SettingsAgentSpeakEndpointProvider.js +0 -139
- package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1SettingsAgentSpeakOneItemProvider.d.ts +0 -201
- package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1SettingsAgentSpeakOneItemProvider.js +0 -139
- package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1SettingsAgentThinkProvider.d.ts +0 -115
- package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1SettingsAgentThinkProvider.js +0 -57
- package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1UpdateSpeakSpeakProvider.d.ts +0 -201
- package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1UpdateSpeakSpeakProvider.js +0 -139
- package/dist/cjs/api/types/OpenAi.d.ts +0 -27
- package/dist/cjs/api/types/OpenAi.js +0 -21
- package/dist/cjs/middleware/adapters/express.d.ts +0 -103
- package/dist/cjs/middleware/adapters/express.js +0 -141
- package/dist/cjs/middleware/adapters/fastify.d.ts +0 -32
- package/dist/cjs/middleware/adapters/fastify.js +0 -194
- package/dist/cjs/middleware/adapters/http.d.ts +0 -153
- package/dist/cjs/middleware/adapters/http.js +0 -192
- package/dist/cjs/middleware/core/ProxyHandler.d.ts +0 -35
- package/dist/cjs/middleware/core/ProxyHandler.js +0 -225
- package/dist/cjs/middleware/core/TokenManager.d.ts +0 -29
- package/dist/cjs/middleware/core/TokenManager.js +0 -110
- package/dist/cjs/middleware/core/WebSocketProxy.d.ts +0 -32
- package/dist/cjs/middleware/core/WebSocketProxy.js +0 -169
- package/dist/cjs/middleware/core/jwt.d.ts +0 -71
- package/dist/cjs/middleware/core/jwt.js +0 -136
- package/dist/cjs/middleware/core/types.d.ts +0 -37
- package/dist/cjs/middleware/index.d.ts +0 -55
- package/dist/cjs/middleware/index.js +0 -75
- package/dist/cjs/tests/manual/test-custom-baseurl.js +0 -124
- package/dist/esm/api/resources/agent/resources/v1/types/AgentV1SettingsAgentSpeakEndpointProvider.d.mts +0 -201
- package/dist/esm/api/resources/agent/resources/v1/types/AgentV1SettingsAgentSpeakEndpointProvider.mjs +0 -136
- package/dist/esm/api/resources/agent/resources/v1/types/AgentV1SettingsAgentSpeakOneItemProvider.d.mts +0 -201
- package/dist/esm/api/resources/agent/resources/v1/types/AgentV1SettingsAgentSpeakOneItemProvider.mjs +0 -136
- package/dist/esm/api/resources/agent/resources/v1/types/AgentV1SettingsAgentThinkProvider.d.mts +0 -115
- package/dist/esm/api/resources/agent/resources/v1/types/AgentV1SettingsAgentThinkProvider.mjs +0 -54
- package/dist/esm/api/resources/agent/resources/v1/types/AgentV1UpdateSpeakSpeakProvider.d.mts +0 -201
- package/dist/esm/api/resources/agent/resources/v1/types/AgentV1UpdateSpeakSpeakProvider.mjs +0 -136
- package/dist/esm/api/types/OpenAi.d.mts +0 -27
- package/dist/esm/api/types/OpenAi.mjs +0 -18
- package/dist/esm/middleware/adapters/express.d.mts +0 -103
- package/dist/esm/middleware/adapters/express.mjs +0 -136
- package/dist/esm/middleware/adapters/fastify.d.mts +0 -32
- package/dist/esm/middleware/adapters/fastify.mjs +0 -157
- package/dist/esm/middleware/adapters/http.d.mts +0 -153
- package/dist/esm/middleware/adapters/http.mjs +0 -187
- package/dist/esm/middleware/core/ProxyHandler.d.mts +0 -35
- package/dist/esm/middleware/core/ProxyHandler.mjs +0 -218
- package/dist/esm/middleware/core/TokenManager.d.mts +0 -29
- package/dist/esm/middleware/core/TokenManager.mjs +0 -106
- package/dist/esm/middleware/core/WebSocketProxy.d.mts +0 -32
- package/dist/esm/middleware/core/WebSocketProxy.mjs +0 -162
- package/dist/esm/middleware/core/jwt.d.mts +0 -71
- package/dist/esm/middleware/core/jwt.mjs +0 -99
- package/dist/esm/middleware/core/types.d.mts +0 -37
- package/dist/esm/middleware/index.d.mts +0 -55
- package/dist/esm/middleware/index.mjs +0 -59
- /package/dist/{esm/middleware/core/types.mjs → cjs/api/resources/voiceAgent/client/index.d.ts} +0 -0
- /package/dist/cjs/{middleware/core/types.js → api/resources/voiceAgent/client/index.js} +0 -0
|
@@ -130,9 +130,9 @@ var Deepgram = (() => {
|
|
|
130
130
|
}
|
|
131
131
|
});
|
|
132
132
|
|
|
133
|
-
// node_modules/.pnpm/ws@8.
|
|
133
|
+
// node_modules/.pnpm/ws@8.20.0/node_modules/ws/browser.js
|
|
134
134
|
var require_browser = __commonJS({
|
|
135
|
-
"node_modules/.pnpm/ws@8.
|
|
135
|
+
"node_modules/.pnpm/ws@8.20.0/node_modules/ws/browser.js"(exports, module) {
|
|
136
136
|
"use strict";
|
|
137
137
|
module.exports = function() {
|
|
138
138
|
throw new Error(
|
|
@@ -164,6 +164,7 @@ var Deepgram = (() => {
|
|
|
164
164
|
DefaultDeepgramClient: () => DeepgramClient,
|
|
165
165
|
ElevenLabsSpeakProvider: () => ElevenLabsSpeakProvider,
|
|
166
166
|
Google: () => Google,
|
|
167
|
+
Groq: () => Groq,
|
|
167
168
|
ListBillingFieldsV1Response: () => ListBillingFieldsV1Response,
|
|
168
169
|
ListenV1CallbackMethod: () => ListenV1CallbackMethod,
|
|
169
170
|
ListenV1DetectEntities: () => ListenV1DetectEntities,
|
|
@@ -180,6 +181,7 @@ var Deepgram = (() => {
|
|
|
180
181
|
ListenV1SmartFormat: () => ListenV1SmartFormat,
|
|
181
182
|
ListenV1VadEvents: () => ListenV1VadEvents,
|
|
182
183
|
ListenV2Encoding: () => ListenV2Encoding,
|
|
184
|
+
ListenV2Model: () => ListenV2Model,
|
|
183
185
|
OpenAiSpeakProvider: () => OpenAiSpeakProvider,
|
|
184
186
|
OpenAiThinkProvider: () => OpenAiThinkProvider,
|
|
185
187
|
SpeakV1Encoding: () => SpeakV1Encoding,
|
|
@@ -192,7 +194,8 @@ var Deepgram = (() => {
|
|
|
192
194
|
manage: () => manage_exports,
|
|
193
195
|
read: () => read_exports,
|
|
194
196
|
selfHosted: () => selfHosted_exports,
|
|
195
|
-
speak: () => speak_exports
|
|
197
|
+
speak: () => speak_exports,
|
|
198
|
+
voiceAgent: () => voiceAgent_exports
|
|
196
199
|
});
|
|
197
200
|
|
|
198
201
|
// src/api/index.ts
|
|
@@ -206,6 +209,7 @@ var Deepgram = (() => {
|
|
|
206
209
|
Deepgram: () => Deepgram,
|
|
207
210
|
ElevenLabsSpeakProvider: () => ElevenLabsSpeakProvider,
|
|
208
211
|
Google: () => Google,
|
|
212
|
+
Groq: () => Groq,
|
|
209
213
|
ListBillingFieldsV1Response: () => ListBillingFieldsV1Response,
|
|
210
214
|
ListenV1CallbackMethod: () => ListenV1CallbackMethod,
|
|
211
215
|
ListenV1DetectEntities: () => ListenV1DetectEntities,
|
|
@@ -222,6 +226,7 @@ var Deepgram = (() => {
|
|
|
222
226
|
ListenV1SmartFormat: () => ListenV1SmartFormat,
|
|
223
227
|
ListenV1VadEvents: () => ListenV1VadEvents,
|
|
224
228
|
ListenV2Encoding: () => ListenV2Encoding,
|
|
229
|
+
ListenV2Model: () => ListenV2Model,
|
|
225
230
|
OpenAiSpeakProvider: () => OpenAiSpeakProvider,
|
|
226
231
|
OpenAiThinkProvider: () => OpenAiThinkProvider,
|
|
227
232
|
SpeakV1Encoding: () => SpeakV1Encoding,
|
|
@@ -233,7 +238,8 @@ var Deepgram = (() => {
|
|
|
233
238
|
manage: () => manage_exports,
|
|
234
239
|
read: () => read_exports,
|
|
235
240
|
selfHosted: () => selfHosted_exports,
|
|
236
|
-
speak: () => speak_exports
|
|
241
|
+
speak: () => speak_exports,
|
|
242
|
+
voiceAgent: () => voiceAgent_exports
|
|
237
243
|
});
|
|
238
244
|
|
|
239
245
|
// src/core/json.ts
|
|
@@ -250,7 +256,8 @@ var Deepgram = (() => {
|
|
|
250
256
|
message,
|
|
251
257
|
statusCode,
|
|
252
258
|
body,
|
|
253
|
-
rawResponse
|
|
259
|
+
rawResponse,
|
|
260
|
+
cause
|
|
254
261
|
}) {
|
|
255
262
|
super(buildMessage({ message, statusCode, body }));
|
|
256
263
|
Object.setPrototypeOf(this, new.target.prototype);
|
|
@@ -261,6 +268,9 @@ var Deepgram = (() => {
|
|
|
261
268
|
this.statusCode = statusCode;
|
|
262
269
|
this.body = body;
|
|
263
270
|
this.rawResponse = rawResponse;
|
|
271
|
+
if (cause != null) {
|
|
272
|
+
this.cause = cause;
|
|
273
|
+
}
|
|
264
274
|
}
|
|
265
275
|
};
|
|
266
276
|
function buildMessage({
|
|
@@ -283,13 +293,16 @@ var Deepgram = (() => {
|
|
|
283
293
|
|
|
284
294
|
// src/errors/DeepgramTimeoutError.ts
|
|
285
295
|
var DeepgramTimeoutError = class extends Error {
|
|
286
|
-
constructor(message) {
|
|
296
|
+
constructor(message, opts) {
|
|
287
297
|
super(message);
|
|
288
298
|
Object.setPrototypeOf(this, new.target.prototype);
|
|
289
299
|
if (Error.captureStackTrace) {
|
|
290
300
|
Error.captureStackTrace(this, this.constructor);
|
|
291
301
|
}
|
|
292
302
|
this.name = this.constructor.name;
|
|
303
|
+
if ((opts == null ? void 0 : opts.cause) != null) {
|
|
304
|
+
this.cause = opts.cause;
|
|
305
|
+
}
|
|
293
306
|
}
|
|
294
307
|
};
|
|
295
308
|
|
|
@@ -314,6 +327,7 @@ var Deepgram = (() => {
|
|
|
314
327
|
var agent_exports = {};
|
|
315
328
|
__export(agent_exports, {
|
|
316
329
|
AgentV1ConversationText: () => AgentV1ConversationText,
|
|
330
|
+
AgentV1InjectAgentMessage: () => AgentV1InjectAgentMessage,
|
|
317
331
|
AgentV1Settings: () => AgentV1Settings,
|
|
318
332
|
v1: () => v1_exports
|
|
319
333
|
});
|
|
@@ -322,6 +336,7 @@ var Deepgram = (() => {
|
|
|
322
336
|
var v1_exports = {};
|
|
323
337
|
__export(v1_exports, {
|
|
324
338
|
AgentV1ConversationText: () => AgentV1ConversationText,
|
|
339
|
+
AgentV1InjectAgentMessage: () => AgentV1InjectAgentMessage,
|
|
325
340
|
AgentV1Settings: () => AgentV1Settings,
|
|
326
341
|
settings: () => settings_exports
|
|
327
342
|
});
|
|
@@ -350,6 +365,15 @@ var Deepgram = (() => {
|
|
|
350
365
|
};
|
|
351
366
|
})(AgentV1ConversationText || (AgentV1ConversationText = {}));
|
|
352
367
|
|
|
368
|
+
// src/api/resources/agent/resources/v1/types/AgentV1InjectAgentMessage.ts
|
|
369
|
+
var AgentV1InjectAgentMessage;
|
|
370
|
+
((AgentV1InjectAgentMessage2) => {
|
|
371
|
+
AgentV1InjectAgentMessage2.Behavior = {
|
|
372
|
+
Default: "default",
|
|
373
|
+
Queue: "queue"
|
|
374
|
+
};
|
|
375
|
+
})(AgentV1InjectAgentMessage || (AgentV1InjectAgentMessage = {}));
|
|
376
|
+
|
|
353
377
|
// src/api/resources/agent/resources/v1/types/AgentV1Settings.ts
|
|
354
378
|
var AgentV1Settings;
|
|
355
379
|
((AgentV1Settings2) => {
|
|
@@ -376,7 +400,16 @@ var Deepgram = (() => {
|
|
|
376
400
|
Output2.Encoding = {
|
|
377
401
|
Linear16: "linear16",
|
|
378
402
|
Mulaw: "mulaw",
|
|
379
|
-
Alaw: "alaw"
|
|
403
|
+
Alaw: "alaw",
|
|
404
|
+
Mp3: "mp3",
|
|
405
|
+
Opus: "opus",
|
|
406
|
+
Flac: "flac",
|
|
407
|
+
Aac: "aac"
|
|
408
|
+
};
|
|
409
|
+
Output2.Container = {
|
|
410
|
+
None: "none",
|
|
411
|
+
Wav: "wav",
|
|
412
|
+
Ogg: "ogg"
|
|
380
413
|
};
|
|
381
414
|
})(Output = Audio2.Output || (Audio2.Output = {}));
|
|
382
415
|
})(Audio = AgentV1Settings2.Audio || (AgentV1Settings2.Audio = {}));
|
|
@@ -1045,6 +1078,19 @@ var Deepgram = (() => {
|
|
|
1045
1078
|
};
|
|
1046
1079
|
})(SpeakV1Flushed || (SpeakV1Flushed = {}));
|
|
1047
1080
|
|
|
1081
|
+
// src/api/resources/voiceAgent/index.ts
|
|
1082
|
+
var voiceAgent_exports = {};
|
|
1083
|
+
__export(voiceAgent_exports, {
|
|
1084
|
+
configurations: () => configurations_exports,
|
|
1085
|
+
variables: () => variables_exports
|
|
1086
|
+
});
|
|
1087
|
+
|
|
1088
|
+
// src/api/resources/voiceAgent/resources/configurations/index.ts
|
|
1089
|
+
var configurations_exports = {};
|
|
1090
|
+
|
|
1091
|
+
// src/api/resources/voiceAgent/resources/variables/index.ts
|
|
1092
|
+
var variables_exports = {};
|
|
1093
|
+
|
|
1048
1094
|
// src/api/types/Anthropic.ts
|
|
1049
1095
|
var Anthropic;
|
|
1050
1096
|
((Anthropic2) => {
|
|
@@ -1197,6 +1243,18 @@ var Deepgram = (() => {
|
|
|
1197
1243
|
};
|
|
1198
1244
|
})(Google || (Google = {}));
|
|
1199
1245
|
|
|
1246
|
+
// src/api/types/Groq.ts
|
|
1247
|
+
var Groq;
|
|
1248
|
+
((Groq2) => {
|
|
1249
|
+
Groq2.ReasoningMode = {
|
|
1250
|
+
None: "none",
|
|
1251
|
+
Minimal: "minimal",
|
|
1252
|
+
Low: "low",
|
|
1253
|
+
Medium: "medium",
|
|
1254
|
+
High: "high"
|
|
1255
|
+
};
|
|
1256
|
+
})(Groq || (Groq = {}));
|
|
1257
|
+
|
|
1200
1258
|
// src/api/types/ListBillingFieldsV1Response.ts
|
|
1201
1259
|
var ListBillingFieldsV1Response;
|
|
1202
1260
|
((ListBillingFieldsV1Response2) => {
|
|
@@ -1348,6 +1406,12 @@ var Deepgram = (() => {
|
|
|
1348
1406
|
OggOpus: "ogg-opus"
|
|
1349
1407
|
};
|
|
1350
1408
|
|
|
1409
|
+
// src/api/types/ListenV2Model.ts
|
|
1410
|
+
var ListenV2Model = {
|
|
1411
|
+
FluxGeneralEn: "flux-general-en",
|
|
1412
|
+
FluxGeneralMulti: "flux-general-multi"
|
|
1413
|
+
};
|
|
1414
|
+
|
|
1351
1415
|
// src/api/types/OpenAiSpeakProvider.ts
|
|
1352
1416
|
var OpenAiSpeakProvider;
|
|
1353
1417
|
((OpenAiSpeakProvider2) => {
|
|
@@ -1378,6 +1442,13 @@ var Deepgram = (() => {
|
|
|
1378
1442
|
Gpt4O: "gpt-4o",
|
|
1379
1443
|
Gpt4OMini: "gpt-4o-mini"
|
|
1380
1444
|
};
|
|
1445
|
+
OpenAiThinkProvider2.ReasoningMode = {
|
|
1446
|
+
None: "none",
|
|
1447
|
+
Minimal: "minimal",
|
|
1448
|
+
Low: "low",
|
|
1449
|
+
Medium: "medium",
|
|
1450
|
+
High: "high"
|
|
1451
|
+
};
|
|
1381
1452
|
})(OpenAiThinkProvider || (OpenAiThinkProvider = {}));
|
|
1382
1453
|
|
|
1383
1454
|
// src/api/types/SpeakV1Encoding.ts
|
|
@@ -1641,18 +1712,27 @@ var Deepgram = (() => {
|
|
|
1641
1712
|
if (value.length === 0) {
|
|
1642
1713
|
continue;
|
|
1643
1714
|
}
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1715
|
+
const effectiveFormat = options.arrayFormat;
|
|
1716
|
+
if (effectiveFormat === "comma") {
|
|
1717
|
+
const encodedKey = options.encode ? encodeURIComponent(fullKey) : fullKey;
|
|
1718
|
+
const encodedValues = value.filter((item) => item !== void 0 && item !== null).map((item) => encodeValue(item, options.encode));
|
|
1719
|
+
if (encodedValues.length > 0) {
|
|
1720
|
+
parts.push(`${encodedKey}=${encodedValues.join(",")}`);
|
|
1648
1721
|
}
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1722
|
+
} else {
|
|
1723
|
+
for (let i = 0; i < value.length; i++) {
|
|
1724
|
+
const item = value[i];
|
|
1725
|
+
if (item === void 0) {
|
|
1726
|
+
continue;
|
|
1727
|
+
}
|
|
1728
|
+
if (typeof item === "object" && !Array.isArray(item) && item !== null) {
|
|
1729
|
+
const arrayKey = effectiveFormat === "indices" ? `${fullKey}[${i}]` : fullKey;
|
|
1730
|
+
parts.push(...stringifyObject(item, arrayKey, options));
|
|
1731
|
+
} else {
|
|
1732
|
+
const arrayKey = effectiveFormat === "indices" ? `${fullKey}[${i}]` : fullKey;
|
|
1733
|
+
const encodedKey = options.encode ? encodeURIComponent(arrayKey) : arrayKey;
|
|
1734
|
+
parts.push(`${encodedKey}=${encodeValue(item, options.encode)}`);
|
|
1735
|
+
}
|
|
1656
1736
|
}
|
|
1657
1737
|
}
|
|
1658
1738
|
} else if (typeof value === "object" && value !== null) {
|
|
@@ -1805,15 +1885,15 @@ var Deepgram = (() => {
|
|
|
1805
1885
|
}
|
|
1806
1886
|
|
|
1807
1887
|
// src/core/fetcher/Headers.ts
|
|
1808
|
-
var
|
|
1888
|
+
var Headers2;
|
|
1809
1889
|
if (typeof globalThis.Headers !== "undefined") {
|
|
1810
|
-
|
|
1890
|
+
Headers2 = globalThis.Headers;
|
|
1811
1891
|
} else {
|
|
1812
|
-
|
|
1892
|
+
Headers2 = class Headers3 {
|
|
1813
1893
|
constructor(init) {
|
|
1814
1894
|
this.headers = /* @__PURE__ */ new Map();
|
|
1815
1895
|
if (init) {
|
|
1816
|
-
if (init instanceof
|
|
1896
|
+
if (init instanceof Headers3) {
|
|
1817
1897
|
init.forEach((value, key) => this.append(key, value));
|
|
1818
1898
|
} else if (Array.isArray(init)) {
|
|
1819
1899
|
for (const [key, value] of init) {
|
|
@@ -1947,7 +2027,7 @@ var Deepgram = (() => {
|
|
|
1947
2027
|
|
|
1948
2028
|
// src/core/fetcher/RawResponse.ts
|
|
1949
2029
|
var abortRawResponse = {
|
|
1950
|
-
headers: new
|
|
2030
|
+
headers: new Headers2(),
|
|
1951
2031
|
redirected: false,
|
|
1952
2032
|
status: 499,
|
|
1953
2033
|
statusText: "Client Closed Request",
|
|
@@ -1955,7 +2035,7 @@ var Deepgram = (() => {
|
|
|
1955
2035
|
url: ""
|
|
1956
2036
|
};
|
|
1957
2037
|
var unknownRawResponse = {
|
|
1958
|
-
headers: new
|
|
2038
|
+
headers: new Headers2(),
|
|
1959
2039
|
redirected: false,
|
|
1960
2040
|
status: 0,
|
|
1961
2041
|
statusText: "Unknown Error",
|
|
@@ -2050,7 +2130,7 @@ var Deepgram = (() => {
|
|
|
2050
2130
|
]);
|
|
2051
2131
|
function redactHeaders(headers) {
|
|
2052
2132
|
const filtered = {};
|
|
2053
|
-
for (const [key, value] of headers instanceof
|
|
2133
|
+
for (const [key, value] of headers instanceof Headers2 ? headers.entries() : Object.entries(headers)) {
|
|
2054
2134
|
if (SENSITIVE_HEADERS.has(key.toLowerCase())) {
|
|
2055
2135
|
filtered[key] = "[REDACTED]";
|
|
2056
2136
|
} else {
|
|
@@ -2081,15 +2161,11 @@ var Deepgram = (() => {
|
|
|
2081
2161
|
]);
|
|
2082
2162
|
function redactQueryParameters(queryParameters) {
|
|
2083
2163
|
if (queryParameters == null) {
|
|
2084
|
-
return
|
|
2164
|
+
return void 0;
|
|
2085
2165
|
}
|
|
2086
2166
|
const redacted = {};
|
|
2087
2167
|
for (const [key, value] of Object.entries(queryParameters)) {
|
|
2088
|
-
|
|
2089
|
-
redacted[key] = "[REDACTED]";
|
|
2090
|
-
} else {
|
|
2091
|
-
redacted[key] = value;
|
|
2092
|
-
}
|
|
2168
|
+
redacted[key] = SENSITIVE_QUERY_PARAMS.has(key.toLowerCase()) ? "[REDACTED]" : value;
|
|
2093
2169
|
}
|
|
2094
2170
|
return redacted;
|
|
2095
2171
|
}
|
|
@@ -2149,7 +2225,7 @@ var Deepgram = (() => {
|
|
|
2149
2225
|
function getHeaders(args) {
|
|
2150
2226
|
return __async(this, null, function* () {
|
|
2151
2227
|
var _a;
|
|
2152
|
-
const newHeaders = new
|
|
2228
|
+
const newHeaders = new Headers2();
|
|
2153
2229
|
newHeaders.set(
|
|
2154
2230
|
"Accept",
|
|
2155
2231
|
args.responseType === "json" ? "application/json" : args.responseType === "text" ? "text/plain" : args.responseType === "sse" ? "text/event-stream" : "*/*"
|
|
@@ -2177,7 +2253,12 @@ var Deepgram = (() => {
|
|
|
2177
2253
|
function fetcherImpl(args) {
|
|
2178
2254
|
return __async(this, null, function* () {
|
|
2179
2255
|
var _a, _b, _c;
|
|
2180
|
-
|
|
2256
|
+
let url = args.url;
|
|
2257
|
+
if (args.queryString != null && args.queryString.length > 0) {
|
|
2258
|
+
url = `${url}?${args.queryString}`;
|
|
2259
|
+
} else {
|
|
2260
|
+
url = createRequestUrl(args.url, args.queryParameters);
|
|
2261
|
+
}
|
|
2181
2262
|
const requestBody = yield getRequestBody({
|
|
2182
2263
|
body: args.body,
|
|
2183
2264
|
type: (_a = args.requestType) != null ? _a : "other"
|
|
@@ -2263,7 +2344,8 @@ var Deepgram = (() => {
|
|
|
2263
2344
|
ok: false,
|
|
2264
2345
|
error: {
|
|
2265
2346
|
reason: "unknown",
|
|
2266
|
-
errorMessage: "The user aborted a request"
|
|
2347
|
+
errorMessage: "The user aborted a request",
|
|
2348
|
+
cause: error
|
|
2267
2349
|
},
|
|
2268
2350
|
rawResponse: abortRawResponse
|
|
2269
2351
|
};
|
|
@@ -2279,7 +2361,8 @@ var Deepgram = (() => {
|
|
|
2279
2361
|
return {
|
|
2280
2362
|
ok: false,
|
|
2281
2363
|
error: {
|
|
2282
|
-
reason: "timeout"
|
|
2364
|
+
reason: "timeout",
|
|
2365
|
+
cause: error
|
|
2283
2366
|
},
|
|
2284
2367
|
rawResponse: abortRawResponse
|
|
2285
2368
|
};
|
|
@@ -2296,7 +2379,8 @@ var Deepgram = (() => {
|
|
|
2296
2379
|
ok: false,
|
|
2297
2380
|
error: {
|
|
2298
2381
|
reason: "unknown",
|
|
2299
|
-
errorMessage: error.message
|
|
2382
|
+
errorMessage: error.message,
|
|
2383
|
+
cause: error
|
|
2300
2384
|
},
|
|
2301
2385
|
rawResponse: unknownRawResponse
|
|
2302
2386
|
};
|
|
@@ -2313,7 +2397,8 @@ var Deepgram = (() => {
|
|
|
2313
2397
|
ok: false,
|
|
2314
2398
|
error: {
|
|
2315
2399
|
reason: "unknown",
|
|
2316
|
-
errorMessage: toJson(error)
|
|
2400
|
+
errorMessage: toJson(error),
|
|
2401
|
+
cause: error
|
|
2317
2402
|
},
|
|
2318
2403
|
rawResponse: unknownRawResponse
|
|
2319
2404
|
};
|
|
@@ -2410,6 +2495,69 @@ var Deepgram = (() => {
|
|
|
2410
2495
|
}
|
|
2411
2496
|
};
|
|
2412
2497
|
|
|
2498
|
+
// src/core/url/join.ts
|
|
2499
|
+
function join(base, ...segments) {
|
|
2500
|
+
if (!base) {
|
|
2501
|
+
return "";
|
|
2502
|
+
}
|
|
2503
|
+
if (segments.length === 0) {
|
|
2504
|
+
return base;
|
|
2505
|
+
}
|
|
2506
|
+
if (base.includes("://")) {
|
|
2507
|
+
let url;
|
|
2508
|
+
try {
|
|
2509
|
+
url = new URL(base);
|
|
2510
|
+
} catch (e) {
|
|
2511
|
+
return joinPath(base, ...segments);
|
|
2512
|
+
}
|
|
2513
|
+
const lastSegment = segments[segments.length - 1];
|
|
2514
|
+
const shouldPreserveTrailingSlash = lastSegment == null ? void 0 : lastSegment.endsWith("/");
|
|
2515
|
+
for (const segment of segments) {
|
|
2516
|
+
const cleanSegment = trimSlashes(segment);
|
|
2517
|
+
if (cleanSegment) {
|
|
2518
|
+
url.pathname = joinPathSegments(url.pathname, cleanSegment);
|
|
2519
|
+
}
|
|
2520
|
+
}
|
|
2521
|
+
if (shouldPreserveTrailingSlash && !url.pathname.endsWith("/")) {
|
|
2522
|
+
url.pathname += "/";
|
|
2523
|
+
}
|
|
2524
|
+
return url.toString();
|
|
2525
|
+
}
|
|
2526
|
+
return joinPath(base, ...segments);
|
|
2527
|
+
}
|
|
2528
|
+
function joinPath(base, ...segments) {
|
|
2529
|
+
if (segments.length === 0) {
|
|
2530
|
+
return base;
|
|
2531
|
+
}
|
|
2532
|
+
let result = base;
|
|
2533
|
+
const lastSegment = segments[segments.length - 1];
|
|
2534
|
+
const shouldPreserveTrailingSlash = lastSegment == null ? void 0 : lastSegment.endsWith("/");
|
|
2535
|
+
for (const segment of segments) {
|
|
2536
|
+
const cleanSegment = trimSlashes(segment);
|
|
2537
|
+
if (cleanSegment) {
|
|
2538
|
+
result = joinPathSegments(result, cleanSegment);
|
|
2539
|
+
}
|
|
2540
|
+
}
|
|
2541
|
+
if (shouldPreserveTrailingSlash && !result.endsWith("/")) {
|
|
2542
|
+
result += "/";
|
|
2543
|
+
}
|
|
2544
|
+
return result;
|
|
2545
|
+
}
|
|
2546
|
+
function joinPathSegments(left, right) {
|
|
2547
|
+
if (left.endsWith("/")) {
|
|
2548
|
+
return left + right;
|
|
2549
|
+
}
|
|
2550
|
+
return `${left}/${right}`;
|
|
2551
|
+
}
|
|
2552
|
+
function trimSlashes(str) {
|
|
2553
|
+
if (!str) return str;
|
|
2554
|
+
let start = 0;
|
|
2555
|
+
let end = str.length;
|
|
2556
|
+
if (str.startsWith("/")) start = 1;
|
|
2557
|
+
if (str.endsWith("/")) end = str.length - 1;
|
|
2558
|
+
return start === 0 && end === str.length ? str : str.slice(start, end);
|
|
2559
|
+
}
|
|
2560
|
+
|
|
2413
2561
|
// src/core/fetcher/Supplier.ts
|
|
2414
2562
|
var Supplier = {
|
|
2415
2563
|
get: (supplier) => __async(null, null, function* () {
|
|
@@ -2421,6 +2569,113 @@ var Deepgram = (() => {
|
|
|
2421
2569
|
})
|
|
2422
2570
|
};
|
|
2423
2571
|
|
|
2572
|
+
// src/core/fetcher/makePassthroughRequest.ts
|
|
2573
|
+
function makePassthroughRequest(input, init, clientOptions, requestOptions) {
|
|
2574
|
+
return __async(this, null, function* () {
|
|
2575
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
2576
|
+
const logger = createLogger(clientOptions.logging);
|
|
2577
|
+
let url;
|
|
2578
|
+
let effectiveInit = init;
|
|
2579
|
+
if (input instanceof Request) {
|
|
2580
|
+
url = input.url;
|
|
2581
|
+
if (init == null) {
|
|
2582
|
+
effectiveInit = {
|
|
2583
|
+
method: input.method,
|
|
2584
|
+
headers: Object.fromEntries(input.headers.entries()),
|
|
2585
|
+
body: input.body,
|
|
2586
|
+
signal: input.signal,
|
|
2587
|
+
credentials: input.credentials,
|
|
2588
|
+
cache: input.cache,
|
|
2589
|
+
redirect: input.redirect,
|
|
2590
|
+
referrer: input.referrer,
|
|
2591
|
+
integrity: input.integrity,
|
|
2592
|
+
mode: input.mode
|
|
2593
|
+
};
|
|
2594
|
+
}
|
|
2595
|
+
} else {
|
|
2596
|
+
url = input instanceof URL ? input.toString() : input;
|
|
2597
|
+
}
|
|
2598
|
+
const baseUrl = (_a = clientOptions.baseUrl != null ? yield Supplier.get(clientOptions.baseUrl) : void 0) != null ? _a : clientOptions.environment != null ? yield Supplier.get(clientOptions.environment) : void 0;
|
|
2599
|
+
let fullUrl;
|
|
2600
|
+
if (url.startsWith("http://") || url.startsWith("https://")) {
|
|
2601
|
+
fullUrl = url;
|
|
2602
|
+
} else if (baseUrl != null) {
|
|
2603
|
+
fullUrl = join(baseUrl, url);
|
|
2604
|
+
} else {
|
|
2605
|
+
fullUrl = url;
|
|
2606
|
+
}
|
|
2607
|
+
const mergedHeaders = {};
|
|
2608
|
+
if (clientOptions.headers != null) {
|
|
2609
|
+
for (const [key, value] of Object.entries(clientOptions.headers)) {
|
|
2610
|
+
const resolved = yield EndpointSupplier.get(value, { endpointMetadata: {} });
|
|
2611
|
+
if (resolved != null) {
|
|
2612
|
+
mergedHeaders[key.toLowerCase()] = `${resolved}`;
|
|
2613
|
+
}
|
|
2614
|
+
}
|
|
2615
|
+
}
|
|
2616
|
+
if (clientOptions.getAuthHeaders != null) {
|
|
2617
|
+
const authHeaders = yield clientOptions.getAuthHeaders();
|
|
2618
|
+
for (const [key, value] of Object.entries(authHeaders)) {
|
|
2619
|
+
mergedHeaders[key.toLowerCase()] = value;
|
|
2620
|
+
}
|
|
2621
|
+
}
|
|
2622
|
+
if ((effectiveInit == null ? void 0 : effectiveInit.headers) != null) {
|
|
2623
|
+
const initHeaders = effectiveInit.headers instanceof Headers ? Object.fromEntries(effectiveInit.headers.entries()) : Array.isArray(effectiveInit.headers) ? Object.fromEntries(effectiveInit.headers) : effectiveInit.headers;
|
|
2624
|
+
for (const [key, value] of Object.entries(initHeaders)) {
|
|
2625
|
+
if (value != null) {
|
|
2626
|
+
mergedHeaders[key.toLowerCase()] = value;
|
|
2627
|
+
}
|
|
2628
|
+
}
|
|
2629
|
+
}
|
|
2630
|
+
if ((requestOptions == null ? void 0 : requestOptions.headers) != null) {
|
|
2631
|
+
for (const [key, value] of Object.entries(requestOptions.headers)) {
|
|
2632
|
+
mergedHeaders[key.toLowerCase()] = value;
|
|
2633
|
+
}
|
|
2634
|
+
}
|
|
2635
|
+
const method = (_b = effectiveInit == null ? void 0 : effectiveInit.method) != null ? _b : "GET";
|
|
2636
|
+
const body = effectiveInit == null ? void 0 : effectiveInit.body;
|
|
2637
|
+
const timeoutInSeconds = (_c = requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? _c : clientOptions.timeoutInSeconds;
|
|
2638
|
+
const timeoutMs = timeoutInSeconds != null ? timeoutInSeconds * 1e3 : void 0;
|
|
2639
|
+
const maxRetries = (_d = requestOptions == null ? void 0 : requestOptions.maxRetries) != null ? _d : clientOptions.maxRetries;
|
|
2640
|
+
const abortSignal = (_f = (_e = requestOptions == null ? void 0 : requestOptions.abortSignal) != null ? _e : effectiveInit == null ? void 0 : effectiveInit.signal) != null ? _f : void 0;
|
|
2641
|
+
const fetchFn = (_g = clientOptions.fetch) != null ? _g : yield getFetchFn();
|
|
2642
|
+
if (logger.isDebug()) {
|
|
2643
|
+
logger.debug("Making passthrough HTTP request", {
|
|
2644
|
+
method,
|
|
2645
|
+
url: fullUrl,
|
|
2646
|
+
hasBody: body != null
|
|
2647
|
+
});
|
|
2648
|
+
}
|
|
2649
|
+
const response = yield requestWithRetries(
|
|
2650
|
+
() => __async(null, null, function* () {
|
|
2651
|
+
return makeRequest(
|
|
2652
|
+
fetchFn,
|
|
2653
|
+
fullUrl,
|
|
2654
|
+
method,
|
|
2655
|
+
mergedHeaders,
|
|
2656
|
+
body != null ? body : void 0,
|
|
2657
|
+
timeoutMs,
|
|
2658
|
+
abortSignal,
|
|
2659
|
+
(effectiveInit == null ? void 0 : effectiveInit.credentials) === "include",
|
|
2660
|
+
void 0,
|
|
2661
|
+
// duplex
|
|
2662
|
+
false
|
|
2663
|
+
// disableCache
|
|
2664
|
+
);
|
|
2665
|
+
}),
|
|
2666
|
+
maxRetries
|
|
2667
|
+
);
|
|
2668
|
+
if (logger.isDebug()) {
|
|
2669
|
+
logger.debug("Passthrough HTTP request completed", {
|
|
2670
|
+
method,
|
|
2671
|
+
url: fullUrl,
|
|
2672
|
+
statusCode: response.status
|
|
2673
|
+
});
|
|
2674
|
+
}
|
|
2675
|
+
return response;
|
|
2676
|
+
});
|
|
2677
|
+
}
|
|
2678
|
+
|
|
2424
2679
|
// src/core/file/index.ts
|
|
2425
2680
|
var file_exports = {};
|
|
2426
2681
|
__export(file_exports, {
|
|
@@ -2473,7 +2728,7 @@ var Deepgram = (() => {
|
|
|
2473
2728
|
}
|
|
2474
2729
|
if ("path" in file) {
|
|
2475
2730
|
const fs = yield Promise.resolve().then(() => __toESM(require_fs()));
|
|
2476
|
-
if (!fs
|
|
2731
|
+
if (!(fs == null ? void 0 : fs.createReadStream)) {
|
|
2477
2732
|
throw new Error("File path uploads are not supported in this environment.");
|
|
2478
2733
|
}
|
|
2479
2734
|
const data = fs.createReadStream(file.path);
|
|
@@ -2507,9 +2762,10 @@ var Deepgram = (() => {
|
|
|
2507
2762
|
}
|
|
2508
2763
|
function tryGetFileSizeFromPath(path) {
|
|
2509
2764
|
return __async(this, null, function* () {
|
|
2765
|
+
var _a;
|
|
2510
2766
|
try {
|
|
2511
2767
|
const fs = yield Promise.resolve().then(() => __toESM(require_fs()));
|
|
2512
|
-
if (!fs
|
|
2768
|
+
if (!((_a = fs == null ? void 0 : fs.promises) == null ? void 0 : _a.stat)) {
|
|
2513
2769
|
return void 0;
|
|
2514
2770
|
}
|
|
2515
2771
|
const fileStat = yield fs.promises.stat(path);
|
|
@@ -2677,6 +2933,7 @@ var Deepgram = (() => {
|
|
|
2677
2933
|
__export(url_exports, {
|
|
2678
2934
|
encodePathParam: () => encodePathParam,
|
|
2679
2935
|
join: () => join,
|
|
2936
|
+
queryBuilder: () => queryBuilder,
|
|
2680
2937
|
toQueryString: () => toQueryString
|
|
2681
2938
|
});
|
|
2682
2939
|
|
|
@@ -2700,68 +2957,75 @@ var Deepgram = (() => {
|
|
|
2700
2957
|
return encodeURIComponent(param);
|
|
2701
2958
|
}
|
|
2702
2959
|
|
|
2703
|
-
// src/core/url/
|
|
2704
|
-
function
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2960
|
+
// src/core/url/QueryStringBuilder.ts
|
|
2961
|
+
function queryBuilder() {
|
|
2962
|
+
return new QueryStringBuilder();
|
|
2963
|
+
}
|
|
2964
|
+
var QueryStringBuilder = class {
|
|
2965
|
+
constructor() {
|
|
2966
|
+
this.parts = /* @__PURE__ */ new Map();
|
|
2710
2967
|
}
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
url.pathname = joinPathSegments(url.pathname, cleanSegment);
|
|
2724
|
-
}
|
|
2968
|
+
/**
|
|
2969
|
+
* Adds a query parameter, serializing it immediately.
|
|
2970
|
+
*
|
|
2971
|
+
* By default arrays use "repeat" format (`key=a&key=b`).
|
|
2972
|
+
* Pass `{ style: "comma" }` for OpenAPI `explode: false` parameters
|
|
2973
|
+
* to get comma-separated values (`key=a,b,c`).
|
|
2974
|
+
*
|
|
2975
|
+
* Null / undefined values are silently skipped.
|
|
2976
|
+
*/
|
|
2977
|
+
add(key, value, options) {
|
|
2978
|
+
if (value === void 0 || value === null) {
|
|
2979
|
+
return this;
|
|
2725
2980
|
}
|
|
2726
|
-
|
|
2727
|
-
|
|
2981
|
+
const serialized = toQueryString(
|
|
2982
|
+
{ [key]: value },
|
|
2983
|
+
{ arrayFormat: (options == null ? void 0 : options.style) === "comma" ? "comma" : "repeat" }
|
|
2984
|
+
);
|
|
2985
|
+
if (serialized.length > 0) {
|
|
2986
|
+
this.parts.set(key, serialized);
|
|
2728
2987
|
}
|
|
2729
|
-
return
|
|
2730
|
-
}
|
|
2731
|
-
return joinPath(base, ...segments);
|
|
2732
|
-
}
|
|
2733
|
-
function joinPath(base, ...segments) {
|
|
2734
|
-
if (segments.length === 0) {
|
|
2735
|
-
return base;
|
|
2988
|
+
return this;
|
|
2736
2989
|
}
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2990
|
+
/**
|
|
2991
|
+
* Adds multiple query parameters at once from a record.
|
|
2992
|
+
* All parameters use the default "repeat" array format.
|
|
2993
|
+
* Null / undefined values are silently skipped.
|
|
2994
|
+
*/
|
|
2995
|
+
addMany(params) {
|
|
2996
|
+
if (params != null) {
|
|
2997
|
+
for (const [key, value] of Object.entries(params)) {
|
|
2998
|
+
this.add(key, value);
|
|
2999
|
+
}
|
|
2744
3000
|
}
|
|
3001
|
+
return this;
|
|
2745
3002
|
}
|
|
2746
|
-
|
|
2747
|
-
|
|
3003
|
+
/**
|
|
3004
|
+
* Merges additional query parameters supplied at call-time via
|
|
3005
|
+
* `requestOptions.queryParams`. Overrides existing keys (last-write-wins).
|
|
3006
|
+
*/
|
|
3007
|
+
mergeAdditional(additionalParams) {
|
|
3008
|
+
if (additionalParams != null) {
|
|
3009
|
+
for (const [key, value] of Object.entries(additionalParams)) {
|
|
3010
|
+
if (value === void 0 || value === null) {
|
|
3011
|
+
continue;
|
|
3012
|
+
}
|
|
3013
|
+
const serialized = toQueryString({ [key]: value }, { arrayFormat: "repeat" });
|
|
3014
|
+
if (serialized.length > 0) {
|
|
3015
|
+
this.parts.set(key, serialized);
|
|
3016
|
+
}
|
|
3017
|
+
}
|
|
3018
|
+
}
|
|
3019
|
+
return this;
|
|
2748
3020
|
}
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
3021
|
+
/**
|
|
3022
|
+
* Returns the assembled query string (without the leading `?`).
|
|
3023
|
+
* Returns an empty string when no parameters were added.
|
|
3024
|
+
*/
|
|
3025
|
+
build() {
|
|
3026
|
+
return [...this.parts.values()].join("&");
|
|
2754
3027
|
}
|
|
2755
|
-
|
|
2756
|
-
}
|
|
2757
|
-
function trimSlashes(str) {
|
|
2758
|
-
if (!str) return str;
|
|
2759
|
-
let start = 0;
|
|
2760
|
-
let end = str.length;
|
|
2761
|
-
if (str.startsWith("/")) start = 1;
|
|
2762
|
-
if (str.endsWith("/")) end = str.length - 1;
|
|
2763
|
-
return start === 0 && end === str.length ? str : str.slice(start, end);
|
|
2764
|
-
}
|
|
3028
|
+
};
|
|
2765
3029
|
|
|
2766
3030
|
// src/core/websocket/ws.ts
|
|
2767
3031
|
var import_ws = __toESM(require_browser());
|
|
@@ -2791,10 +3055,10 @@ var Deepgram = (() => {
|
|
|
2791
3055
|
|
|
2792
3056
|
// src/core/websocket/ws.ts
|
|
2793
3057
|
var getGlobalWebSocket = () => {
|
|
2794
|
-
if (
|
|
2795
|
-
return WebSocket;
|
|
2796
|
-
} else if (RUNTIME.type === "node") {
|
|
3058
|
+
if (RUNTIME.type === "node" || RUNTIME.type === "bun" || RUNTIME.type === "deno") {
|
|
2797
3059
|
return import_ws.WebSocket;
|
|
3060
|
+
} else if (typeof WebSocket !== "undefined") {
|
|
3061
|
+
return WebSocket;
|
|
2798
3062
|
}
|
|
2799
3063
|
return void 0;
|
|
2800
3064
|
};
|
|
@@ -2855,6 +3119,8 @@ var Deepgram = (() => {
|
|
|
2855
3119
|
this._clearTimeouts();
|
|
2856
3120
|
if (this._ws) {
|
|
2857
3121
|
this._removeListeners();
|
|
3122
|
+
this._ws.addEventListener("error", () => {
|
|
3123
|
+
});
|
|
2858
3124
|
try {
|
|
2859
3125
|
this._ws.close(1e3, "aborted");
|
|
2860
3126
|
this._handleClose(new CloseEvent(1e3, "aborted", this));
|
|
@@ -2979,7 +3245,7 @@ var Deepgram = (() => {
|
|
|
2979
3245
|
if (this._ws) {
|
|
2980
3246
|
return this._ws.readyState;
|
|
2981
3247
|
}
|
|
2982
|
-
return this._options.startClosed ? _ReconnectingWebSocket.CLOSED : _ReconnectingWebSocket.CONNECTING;
|
|
3248
|
+
return this._options.startClosed ? _ReconnectingWebSocket.ReadyState.CLOSED : _ReconnectingWebSocket.ReadyState.CONNECTING;
|
|
2983
3249
|
}
|
|
2984
3250
|
/**
|
|
2985
3251
|
* The URL as resolved by the constructor
|
|
@@ -3162,6 +3428,8 @@ var Deepgram = (() => {
|
|
|
3162
3428
|
return;
|
|
3163
3429
|
}
|
|
3164
3430
|
this._removeListeners();
|
|
3431
|
+
this._ws.addEventListener("error", () => {
|
|
3432
|
+
});
|
|
3165
3433
|
try {
|
|
3166
3434
|
this._ws.close(code, reason);
|
|
3167
3435
|
this._handleClose(new CloseEvent(code, reason, this));
|
|
@@ -3209,6 +3477,14 @@ var Deepgram = (() => {
|
|
|
3209
3477
|
_ReconnectingWebSocket.CLOSING = 2;
|
|
3210
3478
|
_ReconnectingWebSocket.CLOSED = 3;
|
|
3211
3479
|
var ReconnectingWebSocket = _ReconnectingWebSocket;
|
|
3480
|
+
((ReconnectingWebSocket2) => {
|
|
3481
|
+
ReconnectingWebSocket2.ReadyState = {
|
|
3482
|
+
CONNECTING: 0,
|
|
3483
|
+
OPEN: 1,
|
|
3484
|
+
CLOSING: 2,
|
|
3485
|
+
CLOSED: 3
|
|
3486
|
+
};
|
|
3487
|
+
})(ReconnectingWebSocket || (ReconnectingWebSocket = {}));
|
|
3212
3488
|
|
|
3213
3489
|
// src/auth/HeaderAuthProvider.ts
|
|
3214
3490
|
var PARAM_KEY = "apiKey";
|
|
@@ -3278,8 +3554,8 @@ var Deepgram = (() => {
|
|
|
3278
3554
|
{
|
|
3279
3555
|
"X-Fern-Language": "JavaScript",
|
|
3280
3556
|
"X-Fern-SDK-Name": "@deepgram/sdk",
|
|
3281
|
-
"X-Fern-SDK-Version": "
|
|
3282
|
-
"User-Agent": "@deepgram/sdk/
|
|
3557
|
+
"X-Fern-SDK-Version": "5.1.1",
|
|
3558
|
+
"User-Agent": "@deepgram/sdk/5.1.1",
|
|
3283
3559
|
"X-Fern-Runtime": RUNTIME.type,
|
|
3284
3560
|
"X-Fern-Runtime-Version": RUNTIME.version
|
|
3285
3561
|
},
|
|
@@ -3332,11 +3608,14 @@ var Deepgram = (() => {
|
|
|
3332
3608
|
rawResponse
|
|
3333
3609
|
});
|
|
3334
3610
|
case "timeout":
|
|
3335
|
-
throw new DeepgramTimeoutError(`Timeout exceeded when calling ${method} ${path}
|
|
3611
|
+
throw new DeepgramTimeoutError(`Timeout exceeded when calling ${method} ${path}.`, {
|
|
3612
|
+
cause: error.cause
|
|
3613
|
+
});
|
|
3336
3614
|
case "unknown":
|
|
3337
3615
|
throw new DeepgramError({
|
|
3338
3616
|
message: error.errorMessage,
|
|
3339
|
-
rawResponse
|
|
3617
|
+
rawResponse,
|
|
3618
|
+
cause: error.cause
|
|
3340
3619
|
});
|
|
3341
3620
|
default:
|
|
3342
3621
|
throw new DeepgramError({
|
|
@@ -3375,7 +3654,7 @@ var Deepgram = (() => {
|
|
|
3375
3654
|
),
|
|
3376
3655
|
method: "GET",
|
|
3377
3656
|
headers: _headers,
|
|
3378
|
-
|
|
3657
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions == null ? void 0 : requestOptions.queryParams).build(),
|
|
3379
3658
|
timeoutMs: ((_g = (_f = requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? _f : (_e = this._options) == null ? void 0 : _e.timeoutInSeconds) != null ? _g : 60) * 1e3,
|
|
3380
3659
|
maxRetries: (_i = requestOptions == null ? void 0 : requestOptions.maxRetries) != null ? _i : (_h = this._options) == null ? void 0 : _h.maxRetries,
|
|
3381
3660
|
abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal,
|
|
@@ -3482,10 +3761,6 @@ var Deepgram = (() => {
|
|
|
3482
3761
|
this.assertSocketIsOpen();
|
|
3483
3762
|
this.sendJson(message);
|
|
3484
3763
|
}
|
|
3485
|
-
sendUpdateThink(message) {
|
|
3486
|
-
this.assertSocketIsOpen();
|
|
3487
|
-
this.sendJson(message);
|
|
3488
|
-
}
|
|
3489
3764
|
sendInjectUserMessage(message) {
|
|
3490
3765
|
this.assertSocketIsOpen();
|
|
3491
3766
|
this.sendJson(message);
|
|
@@ -3506,6 +3781,10 @@ var Deepgram = (() => {
|
|
|
3506
3781
|
this.assertSocketIsOpen();
|
|
3507
3782
|
this.sendJson(message);
|
|
3508
3783
|
}
|
|
3784
|
+
sendUpdateThink(message) {
|
|
3785
|
+
this.assertSocketIsOpen();
|
|
3786
|
+
this.sendJson(message);
|
|
3787
|
+
}
|
|
3509
3788
|
sendMedia(message) {
|
|
3510
3789
|
this.assertSocketIsOpen();
|
|
3511
3790
|
this.sendBinary(message);
|
|
@@ -3531,7 +3810,7 @@ var Deepgram = (() => {
|
|
|
3531
3810
|
/** Returns a promise that resolves when the websocket is open. */
|
|
3532
3811
|
waitForOpen() {
|
|
3533
3812
|
return __async(this, null, function* () {
|
|
3534
|
-
if (this.socket.readyState === ReconnectingWebSocket.OPEN) {
|
|
3813
|
+
if (this.socket.readyState === ReconnectingWebSocket.ReadyState.OPEN) {
|
|
3535
3814
|
return this.socket;
|
|
3536
3815
|
}
|
|
3537
3816
|
return new Promise((resolve, reject) => {
|
|
@@ -3549,7 +3828,7 @@ var Deepgram = (() => {
|
|
|
3549
3828
|
if (!this.socket) {
|
|
3550
3829
|
throw new Error("Socket is not connected.");
|
|
3551
3830
|
}
|
|
3552
|
-
if (this.socket.readyState !== ReconnectingWebSocket.OPEN) {
|
|
3831
|
+
if (this.socket.readyState !== ReconnectingWebSocket.ReadyState.OPEN) {
|
|
3553
3832
|
throw new Error("Socket is not open.");
|
|
3554
3833
|
}
|
|
3555
3834
|
}
|
|
@@ -3575,18 +3854,19 @@ var Deepgram = (() => {
|
|
|
3575
3854
|
}
|
|
3576
3855
|
connect(args) {
|
|
3577
3856
|
return __async(this, null, function* () {
|
|
3578
|
-
var _a, _b;
|
|
3579
|
-
const { queryParams, headers, debug, reconnectAttempts, connectionTimeoutInSeconds, abortSignal } = args;
|
|
3857
|
+
var _a, _b, _c;
|
|
3858
|
+
const { protocols, queryParams, headers, debug, reconnectAttempts, connectionTimeoutInSeconds, abortSignal } = args;
|
|
3580
3859
|
const _headers = mergeHeaders(
|
|
3860
|
+
(_a = this._options) == null ? void 0 : _a.headers,
|
|
3581
3861
|
mergeOnlyDefinedHeaders({ Authorization: args.Authorization }),
|
|
3582
3862
|
headers
|
|
3583
3863
|
);
|
|
3584
3864
|
const socket = new ReconnectingWebSocket({
|
|
3585
3865
|
url: url_exports.join(
|
|
3586
|
-
(
|
|
3866
|
+
(_c = yield Supplier.get(this._options.baseUrl)) != null ? _c : ((_b = yield Supplier.get(this._options.environment)) != null ? _b : DeepgramEnvironment.Production).agent,
|
|
3587
3867
|
"/v1/agent/converse"
|
|
3588
3868
|
),
|
|
3589
|
-
protocols: [],
|
|
3869
|
+
protocols: protocols != null ? protocols : [],
|
|
3590
3870
|
queryParameters: queryParams != null ? queryParams : {},
|
|
3591
3871
|
headers: _headers,
|
|
3592
3872
|
options: {
|
|
@@ -3648,7 +3928,7 @@ var Deepgram = (() => {
|
|
|
3648
3928
|
method: "POST",
|
|
3649
3929
|
headers: _headers,
|
|
3650
3930
|
contentType: "application/json",
|
|
3651
|
-
|
|
3931
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions == null ? void 0 : requestOptions.queryParams).build(),
|
|
3652
3932
|
requestType: "json",
|
|
3653
3933
|
body: request,
|
|
3654
3934
|
timeoutMs: ((_g = (_f = requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? _f : (_e = this._options) == null ? void 0 : _e.timeoutInSeconds) != null ? _g : 60) * 1e3,
|
|
@@ -3732,6 +4012,7 @@ var Deepgram = (() => {
|
|
|
3732
4012
|
* dictation: true,
|
|
3733
4013
|
* encoding: "linear16",
|
|
3734
4014
|
* filler_words: true,
|
|
4015
|
+
* keyterm: ["keyterm"],
|
|
3735
4016
|
* keywords: "keywords",
|
|
3736
4017
|
* language: "language",
|
|
3737
4018
|
* measurements: true,
|
|
@@ -3885,7 +4166,7 @@ var Deepgram = (() => {
|
|
|
3885
4166
|
method: "POST",
|
|
3886
4167
|
headers: _headers,
|
|
3887
4168
|
contentType: "application/json",
|
|
3888
|
-
|
|
4169
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions == null ? void 0 : requestOptions.queryParams).build(),
|
|
3889
4170
|
requestType: "json",
|
|
3890
4171
|
body: _body,
|
|
3891
4172
|
timeoutMs: ((_h = (_g = requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? _g : (_f = this._options) == null ? void 0 : _f.timeoutInSeconds) != null ? _h : 60) * 1e3,
|
|
@@ -3988,7 +4269,7 @@ var Deepgram = (() => {
|
|
|
3988
4269
|
method: "POST",
|
|
3989
4270
|
headers: _headers,
|
|
3990
4271
|
contentType: "application/octet-stream",
|
|
3991
|
-
|
|
4272
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions == null ? void 0 : requestOptions.queryParams).build(),
|
|
3992
4273
|
requestType: "bytes",
|
|
3993
4274
|
duplex: "half",
|
|
3994
4275
|
body: _binaryUploadRequest.body,
|
|
@@ -4103,7 +4384,7 @@ var Deepgram = (() => {
|
|
|
4103
4384
|
/** Returns a promise that resolves when the websocket is open. */
|
|
4104
4385
|
waitForOpen() {
|
|
4105
4386
|
return __async(this, null, function* () {
|
|
4106
|
-
if (this.socket.readyState === ReconnectingWebSocket.OPEN) {
|
|
4387
|
+
if (this.socket.readyState === ReconnectingWebSocket.ReadyState.OPEN) {
|
|
4107
4388
|
return this.socket;
|
|
4108
4389
|
}
|
|
4109
4390
|
return new Promise((resolve, reject) => {
|
|
@@ -4121,7 +4402,7 @@ var Deepgram = (() => {
|
|
|
4121
4402
|
if (!this.socket) {
|
|
4122
4403
|
throw new Error("Socket is not connected.");
|
|
4123
4404
|
}
|
|
4124
|
-
if (this.socket.readyState !== ReconnectingWebSocket.OPEN) {
|
|
4405
|
+
if (this.socket.readyState !== ReconnectingWebSocket.ReadyState.OPEN) {
|
|
4125
4406
|
throw new Error("Socket is not open.");
|
|
4126
4407
|
}
|
|
4127
4408
|
}
|
|
@@ -4147,7 +4428,7 @@ var Deepgram = (() => {
|
|
|
4147
4428
|
}
|
|
4148
4429
|
connect(args) {
|
|
4149
4430
|
return __async(this, null, function* () {
|
|
4150
|
-
var _a, _b;
|
|
4431
|
+
var _a, _b, _c;
|
|
4151
4432
|
const {
|
|
4152
4433
|
callback,
|
|
4153
4434
|
callback_method: callbackMethod,
|
|
@@ -4177,6 +4458,7 @@ var Deepgram = (() => {
|
|
|
4177
4458
|
utterance_end_ms: utteranceEndMs,
|
|
4178
4459
|
vad_events: vadEvents,
|
|
4179
4460
|
version,
|
|
4461
|
+
protocols,
|
|
4180
4462
|
queryParams,
|
|
4181
4463
|
headers,
|
|
4182
4464
|
debug,
|
|
@@ -4215,15 +4497,16 @@ var Deepgram = (() => {
|
|
|
4215
4497
|
version: version != null ? typeof version === "string" ? version : toJson(version) : void 0
|
|
4216
4498
|
};
|
|
4217
4499
|
const _headers = mergeHeaders(
|
|
4500
|
+
(_a = this._options) == null ? void 0 : _a.headers,
|
|
4218
4501
|
mergeOnlyDefinedHeaders({ Authorization: args.Authorization }),
|
|
4219
4502
|
headers
|
|
4220
4503
|
);
|
|
4221
4504
|
const socket = new ReconnectingWebSocket({
|
|
4222
4505
|
url: url_exports.join(
|
|
4223
|
-
(
|
|
4506
|
+
(_c = yield Supplier.get(this._options.baseUrl)) != null ? _c : ((_b = yield Supplier.get(this._options.environment)) != null ? _b : DeepgramEnvironment.Production).production,
|
|
4224
4507
|
"/v1/listen"
|
|
4225
4508
|
),
|
|
4226
|
-
protocols: [],
|
|
4509
|
+
protocols: protocols != null ? protocols : [],
|
|
4227
4510
|
queryParameters: __spreadValues(__spreadValues({}, _queryParams), queryParams),
|
|
4228
4511
|
headers: _headers,
|
|
4229
4512
|
options: {
|
|
@@ -4291,7 +4574,7 @@ var Deepgram = (() => {
|
|
|
4291
4574
|
this.assertSocketIsOpen();
|
|
4292
4575
|
this.sendJson(message);
|
|
4293
4576
|
}
|
|
4294
|
-
|
|
4577
|
+
sendConfigure(message) {
|
|
4295
4578
|
this.assertSocketIsOpen();
|
|
4296
4579
|
this.sendJson(message);
|
|
4297
4580
|
}
|
|
@@ -4316,7 +4599,7 @@ var Deepgram = (() => {
|
|
|
4316
4599
|
/** Returns a promise that resolves when the websocket is open. */
|
|
4317
4600
|
waitForOpen() {
|
|
4318
4601
|
return __async(this, null, function* () {
|
|
4319
|
-
if (this.socket.readyState === ReconnectingWebSocket.OPEN) {
|
|
4602
|
+
if (this.socket.readyState === ReconnectingWebSocket.ReadyState.OPEN) {
|
|
4320
4603
|
return this.socket;
|
|
4321
4604
|
}
|
|
4322
4605
|
return new Promise((resolve, reject) => {
|
|
@@ -4334,7 +4617,7 @@ var Deepgram = (() => {
|
|
|
4334
4617
|
if (!this.socket) {
|
|
4335
4618
|
throw new Error("Socket is not connected.");
|
|
4336
4619
|
}
|
|
4337
|
-
if (this.socket.readyState !== ReconnectingWebSocket.OPEN) {
|
|
4620
|
+
if (this.socket.readyState !== ReconnectingWebSocket.ReadyState.OPEN) {
|
|
4338
4621
|
throw new Error("Socket is not open.");
|
|
4339
4622
|
}
|
|
4340
4623
|
}
|
|
@@ -4356,7 +4639,7 @@ var Deepgram = (() => {
|
|
|
4356
4639
|
}
|
|
4357
4640
|
connect(args) {
|
|
4358
4641
|
return __async(this, null, function* () {
|
|
4359
|
-
var _a, _b;
|
|
4642
|
+
var _a, _b, _c;
|
|
4360
4643
|
const {
|
|
4361
4644
|
model,
|
|
4362
4645
|
encoding,
|
|
@@ -4365,8 +4648,10 @@ var Deepgram = (() => {
|
|
|
4365
4648
|
eot_threshold: eotThreshold,
|
|
4366
4649
|
eot_timeout_ms: eotTimeoutMs,
|
|
4367
4650
|
keyterm,
|
|
4651
|
+
language_hint: languageHint,
|
|
4368
4652
|
mip_opt_out: mipOptOut,
|
|
4369
4653
|
tag,
|
|
4654
|
+
protocols,
|
|
4370
4655
|
queryParams,
|
|
4371
4656
|
headers,
|
|
4372
4657
|
debug,
|
|
@@ -4381,20 +4666,22 @@ var Deepgram = (() => {
|
|
|
4381
4666
|
eager_eot_threshold: eagerEotThreshold != null ? typeof eagerEotThreshold === "string" ? eagerEotThreshold : toJson(eagerEotThreshold) : void 0,
|
|
4382
4667
|
eot_threshold: eotThreshold != null ? typeof eotThreshold === "string" ? eotThreshold : toJson(eotThreshold) : void 0,
|
|
4383
4668
|
eot_timeout_ms: eotTimeoutMs != null ? typeof eotTimeoutMs === "string" ? eotTimeoutMs : toJson(eotTimeoutMs) : void 0,
|
|
4384
|
-
keyterm: keyterm != null ? typeof keyterm === "string" ? keyterm : toJson(keyterm) : void 0,
|
|
4669
|
+
keyterm: Array.isArray(keyterm) ? keyterm.map((item) => typeof item === "string" ? item : toJson(item)) : keyterm != null ? typeof keyterm === "string" ? keyterm : toJson(keyterm) : void 0,
|
|
4670
|
+
language_hint: Array.isArray(languageHint) ? languageHint.map((item) => typeof item === "string" ? item : toJson(item)) : languageHint != null ? typeof languageHint === "string" ? languageHint : toJson(languageHint) : void 0,
|
|
4385
4671
|
mip_opt_out: mipOptOut != null ? typeof mipOptOut === "string" ? mipOptOut : toJson(mipOptOut) : void 0,
|
|
4386
4672
|
tag: tag != null ? typeof tag === "string" ? tag : toJson(tag) : void 0
|
|
4387
4673
|
};
|
|
4388
4674
|
const _headers = mergeHeaders(
|
|
4675
|
+
(_a = this._options) == null ? void 0 : _a.headers,
|
|
4389
4676
|
mergeOnlyDefinedHeaders({ Authorization: args.Authorization }),
|
|
4390
4677
|
headers
|
|
4391
4678
|
);
|
|
4392
4679
|
const socket = new ReconnectingWebSocket({
|
|
4393
4680
|
url: url_exports.join(
|
|
4394
|
-
(
|
|
4681
|
+
(_c = yield Supplier.get(this._options.baseUrl)) != null ? _c : ((_b = yield Supplier.get(this._options.environment)) != null ? _b : DeepgramEnvironment.Production).production,
|
|
4395
4682
|
"/v2/listen"
|
|
4396
4683
|
),
|
|
4397
|
-
protocols: [],
|
|
4684
|
+
protocols: protocols != null ? protocols : [],
|
|
4398
4685
|
queryParameters: __spreadValues(__spreadValues({}, _queryParams), queryParams),
|
|
4399
4686
|
headers: _headers,
|
|
4400
4687
|
options: {
|
|
@@ -4465,7 +4752,7 @@ var Deepgram = (() => {
|
|
|
4465
4752
|
),
|
|
4466
4753
|
method: "GET",
|
|
4467
4754
|
headers: _headers,
|
|
4468
|
-
|
|
4755
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions == null ? void 0 : requestOptions.queryParams).build(),
|
|
4469
4756
|
timeoutMs: ((_g = (_f = requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? _f : (_e = this._options) == null ? void 0 : _e.timeoutInSeconds) != null ? _g : 60) * 1e3,
|
|
4470
4757
|
maxRetries: (_i = requestOptions == null ? void 0 : requestOptions.maxRetries) != null ? _i : (_h = this._options) == null ? void 0 : _h.maxRetries,
|
|
4471
4758
|
abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal,
|
|
@@ -4520,7 +4807,7 @@ var Deepgram = (() => {
|
|
|
4520
4807
|
),
|
|
4521
4808
|
method: "GET",
|
|
4522
4809
|
headers: _headers,
|
|
4523
|
-
|
|
4810
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions == null ? void 0 : requestOptions.queryParams).build(),
|
|
4524
4811
|
timeoutMs: ((_g = (_f = requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? _f : (_e = this._options) == null ? void 0 : _e.timeoutInSeconds) != null ? _g : 60) * 1e3,
|
|
4525
4812
|
maxRetries: (_i = requestOptions == null ? void 0 : requestOptions.maxRetries) != null ? _i : (_h = this._options) == null ? void 0 : _h.maxRetries,
|
|
4526
4813
|
abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal,
|
|
@@ -4582,7 +4869,7 @@ var Deepgram = (() => {
|
|
|
4582
4869
|
),
|
|
4583
4870
|
method: "GET",
|
|
4584
4871
|
headers: _headers,
|
|
4585
|
-
|
|
4872
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions == null ? void 0 : requestOptions.queryParams).build(),
|
|
4586
4873
|
timeoutMs: ((_g = (_f = requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? _f : (_e = this._options) == null ? void 0 : _e.timeoutInSeconds) != null ? _g : 60) * 1e3,
|
|
4587
4874
|
maxRetries: (_i = requestOptions == null ? void 0 : requestOptions.maxRetries) != null ? _i : (_h = this._options) == null ? void 0 : _h.maxRetries,
|
|
4588
4875
|
abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal,
|
|
@@ -4646,7 +4933,7 @@ var Deepgram = (() => {
|
|
|
4646
4933
|
),
|
|
4647
4934
|
method: "GET",
|
|
4648
4935
|
headers: _headers,
|
|
4649
|
-
|
|
4936
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions == null ? void 0 : requestOptions.queryParams).build(),
|
|
4650
4937
|
timeoutMs: ((_g = (_f = requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? _f : (_e = this._options) == null ? void 0 : _e.timeoutInSeconds) != null ? _g : 60) * 1e3,
|
|
4651
4938
|
maxRetries: (_i = requestOptions == null ? void 0 : requestOptions.maxRetries) != null ? _i : (_h = this._options) == null ? void 0 : _h.maxRetries,
|
|
4652
4939
|
abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal,
|
|
@@ -4699,7 +4986,8 @@ var Deepgram = (() => {
|
|
|
4699
4986
|
* accessor: "12345678-1234-1234-1234-123456789012",
|
|
4700
4987
|
* deployment: "hosted",
|
|
4701
4988
|
* tag: "tag1",
|
|
4702
|
-
* line_item: "streaming::nova-3"
|
|
4989
|
+
* line_item: "streaming::nova-3",
|
|
4990
|
+
* grouping: ["deployment", "line_item"]
|
|
4703
4991
|
* })
|
|
4704
4992
|
*/
|
|
4705
4993
|
list(project_id, request = {}, requestOptions) {
|
|
@@ -4731,7 +5019,7 @@ var Deepgram = (() => {
|
|
|
4731
5019
|
),
|
|
4732
5020
|
method: "GET",
|
|
4733
5021
|
headers: _headers,
|
|
4734
|
-
|
|
5022
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions == null ? void 0 : requestOptions.queryParams).build(),
|
|
4735
5023
|
timeoutMs: ((_g = (_f = requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? _f : (_e = this._options) == null ? void 0 : _e.timeoutInSeconds) != null ? _g : 60) * 1e3,
|
|
4736
5024
|
maxRetries: (_i = requestOptions == null ? void 0 : requestOptions.maxRetries) != null ? _i : (_h = this._options) == null ? void 0 : _h.maxRetries,
|
|
4737
5025
|
abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal,
|
|
@@ -4807,7 +5095,7 @@ var Deepgram = (() => {
|
|
|
4807
5095
|
),
|
|
4808
5096
|
method: "GET",
|
|
4809
5097
|
headers: _headers,
|
|
4810
|
-
|
|
5098
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions == null ? void 0 : requestOptions.queryParams).build(),
|
|
4811
5099
|
timeoutMs: ((_g = (_f = requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? _f : (_e = this._options) == null ? void 0 : _e.timeoutInSeconds) != null ? _g : 60) * 1e3,
|
|
4812
5100
|
maxRetries: (_i = requestOptions == null ? void 0 : requestOptions.maxRetries) != null ? _i : (_h = this._options) == null ? void 0 : _h.maxRetries,
|
|
4813
5101
|
abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal,
|
|
@@ -4881,7 +5169,7 @@ var Deepgram = (() => {
|
|
|
4881
5169
|
),
|
|
4882
5170
|
method: "GET",
|
|
4883
5171
|
headers: _headers,
|
|
4884
|
-
|
|
5172
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions == null ? void 0 : requestOptions.queryParams).build(),
|
|
4885
5173
|
timeoutMs: ((_g = (_f = requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? _f : (_e = this._options) == null ? void 0 : _e.timeoutInSeconds) != null ? _g : 60) * 1e3,
|
|
4886
5174
|
maxRetries: (_i = requestOptions == null ? void 0 : requestOptions.maxRetries) != null ? _i : (_h = this._options) == null ? void 0 : _h.maxRetries,
|
|
4887
5175
|
abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal,
|
|
@@ -4981,7 +5269,7 @@ var Deepgram = (() => {
|
|
|
4981
5269
|
),
|
|
4982
5270
|
method: "GET",
|
|
4983
5271
|
headers: _headers,
|
|
4984
|
-
|
|
5272
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions == null ? void 0 : requestOptions.queryParams).build(),
|
|
4985
5273
|
timeoutMs: ((_g = (_f = requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? _f : (_e = this._options) == null ? void 0 : _e.timeoutInSeconds) != null ? _g : 60) * 1e3,
|
|
4986
5274
|
maxRetries: (_i = requestOptions == null ? void 0 : requestOptions.maxRetries) != null ? _i : (_h = this._options) == null ? void 0 : _h.maxRetries,
|
|
4987
5275
|
abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal,
|
|
@@ -5015,7 +5303,7 @@ var Deepgram = (() => {
|
|
|
5015
5303
|
* Creates a new API key with specified settings for the project
|
|
5016
5304
|
*
|
|
5017
5305
|
* @param {string} project_id - The unique identifier of the project
|
|
5018
|
-
* @param {Deepgram.
|
|
5306
|
+
* @param {Deepgram.CreateKeyV1Request} [request]
|
|
5019
5307
|
* @param {KeysClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
5020
5308
|
*
|
|
5021
5309
|
* @throws {@link Deepgram.BadRequestError}
|
|
@@ -5045,7 +5333,7 @@ var Deepgram = (() => {
|
|
|
5045
5333
|
method: "POST",
|
|
5046
5334
|
headers: _headers,
|
|
5047
5335
|
contentType: "application/json",
|
|
5048
|
-
|
|
5336
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions == null ? void 0 : requestOptions.queryParams).build(),
|
|
5049
5337
|
requestType: "json",
|
|
5050
5338
|
body: request,
|
|
5051
5339
|
timeoutMs: ((_g = (_f = requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? _f : (_e = this._options) == null ? void 0 : _e.timeoutInSeconds) != null ? _g : 60) * 1e3,
|
|
@@ -5108,7 +5396,7 @@ var Deepgram = (() => {
|
|
|
5108
5396
|
),
|
|
5109
5397
|
method: "GET",
|
|
5110
5398
|
headers: _headers,
|
|
5111
|
-
|
|
5399
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions == null ? void 0 : requestOptions.queryParams).build(),
|
|
5112
5400
|
timeoutMs: ((_g = (_f = requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? _f : (_e = this._options) == null ? void 0 : _e.timeoutInSeconds) != null ? _g : 60) * 1e3,
|
|
5113
5401
|
maxRetries: (_i = requestOptions == null ? void 0 : requestOptions.maxRetries) != null ? _i : (_h = this._options) == null ? void 0 : _h.maxRetries,
|
|
5114
5402
|
abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal,
|
|
@@ -5169,7 +5457,7 @@ var Deepgram = (() => {
|
|
|
5169
5457
|
),
|
|
5170
5458
|
method: "DELETE",
|
|
5171
5459
|
headers: _headers,
|
|
5172
|
-
|
|
5460
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions == null ? void 0 : requestOptions.queryParams).build(),
|
|
5173
5461
|
timeoutMs: ((_g = (_f = requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? _f : (_e = this._options) == null ? void 0 : _e.timeoutInSeconds) != null ? _g : 60) * 1e3,
|
|
5174
5462
|
maxRetries: (_i = requestOptions == null ? void 0 : requestOptions.maxRetries) != null ? _i : (_h = this._options) == null ? void 0 : _h.maxRetries,
|
|
5175
5463
|
abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal,
|
|
@@ -5236,7 +5524,7 @@ var Deepgram = (() => {
|
|
|
5236
5524
|
),
|
|
5237
5525
|
method: "GET",
|
|
5238
5526
|
headers: _headers,
|
|
5239
|
-
|
|
5527
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions == null ? void 0 : requestOptions.queryParams).build(),
|
|
5240
5528
|
timeoutMs: ((_g = (_f = requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? _f : (_e = this._options) == null ? void 0 : _e.timeoutInSeconds) != null ? _g : 60) * 1e3,
|
|
5241
5529
|
maxRetries: (_i = requestOptions == null ? void 0 : requestOptions.maxRetries) != null ? _i : (_h = this._options) == null ? void 0 : _h.maxRetries,
|
|
5242
5530
|
abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal,
|
|
@@ -5304,7 +5592,7 @@ var Deepgram = (() => {
|
|
|
5304
5592
|
method: "POST",
|
|
5305
5593
|
headers: _headers,
|
|
5306
5594
|
contentType: "application/json",
|
|
5307
|
-
|
|
5595
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions == null ? void 0 : requestOptions.queryParams).build(),
|
|
5308
5596
|
requestType: "json",
|
|
5309
5597
|
body: request,
|
|
5310
5598
|
timeoutMs: ((_g = (_f = requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? _f : (_e = this._options) == null ? void 0 : _e.timeoutInSeconds) != null ? _g : 60) * 1e3,
|
|
@@ -5370,7 +5658,7 @@ var Deepgram = (() => {
|
|
|
5370
5658
|
),
|
|
5371
5659
|
method: "DELETE",
|
|
5372
5660
|
headers: _headers,
|
|
5373
|
-
|
|
5661
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions == null ? void 0 : requestOptions.queryParams).build(),
|
|
5374
5662
|
timeoutMs: ((_g = (_f = requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? _f : (_e = this._options) == null ? void 0 : _e.timeoutInSeconds) != null ? _g : 60) * 1e3,
|
|
5375
5663
|
maxRetries: (_i = requestOptions == null ? void 0 : requestOptions.maxRetries) != null ? _i : (_h = this._options) == null ? void 0 : _h.maxRetries,
|
|
5376
5664
|
abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal,
|
|
@@ -5441,7 +5729,7 @@ var Deepgram = (() => {
|
|
|
5441
5729
|
),
|
|
5442
5730
|
method: "GET",
|
|
5443
5731
|
headers: _headers,
|
|
5444
|
-
|
|
5732
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions == null ? void 0 : requestOptions.queryParams).build(),
|
|
5445
5733
|
timeoutMs: ((_g = (_f = requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? _f : (_e = this._options) == null ? void 0 : _e.timeoutInSeconds) != null ? _g : 60) * 1e3,
|
|
5446
5734
|
maxRetries: (_i = requestOptions == null ? void 0 : requestOptions.maxRetries) != null ? _i : (_h = this._options) == null ? void 0 : _h.maxRetries,
|
|
5447
5735
|
abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal,
|
|
@@ -5509,7 +5797,7 @@ var Deepgram = (() => {
|
|
|
5509
5797
|
method: "PUT",
|
|
5510
5798
|
headers: _headers,
|
|
5511
5799
|
contentType: "application/json",
|
|
5512
|
-
|
|
5800
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions == null ? void 0 : requestOptions.queryParams).build(),
|
|
5513
5801
|
requestType: "json",
|
|
5514
5802
|
body: request,
|
|
5515
5803
|
timeoutMs: ((_g = (_f = requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? _f : (_e = this._options) == null ? void 0 : _e.timeoutInSeconds) != null ? _g : 60) * 1e3,
|
|
@@ -5589,7 +5877,7 @@ var Deepgram = (() => {
|
|
|
5589
5877
|
),
|
|
5590
5878
|
method: "GET",
|
|
5591
5879
|
headers: _headers,
|
|
5592
|
-
|
|
5880
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions == null ? void 0 : requestOptions.queryParams).build(),
|
|
5593
5881
|
timeoutMs: ((_g = (_f = requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? _f : (_e = this._options) == null ? void 0 : _e.timeoutInSeconds) != null ? _g : 60) * 1e3,
|
|
5594
5882
|
maxRetries: (_i = requestOptions == null ? void 0 : requestOptions.maxRetries) != null ? _i : (_h = this._options) == null ? void 0 : _h.maxRetries,
|
|
5595
5883
|
abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal,
|
|
@@ -5653,7 +5941,7 @@ var Deepgram = (() => {
|
|
|
5653
5941
|
),
|
|
5654
5942
|
method: "DELETE",
|
|
5655
5943
|
headers: _headers,
|
|
5656
|
-
|
|
5944
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions == null ? void 0 : requestOptions.queryParams).build(),
|
|
5657
5945
|
timeoutMs: ((_g = (_f = requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? _f : (_e = this._options) == null ? void 0 : _e.timeoutInSeconds) != null ? _g : 60) * 1e3,
|
|
5658
5946
|
maxRetries: (_i = requestOptions == null ? void 0 : requestOptions.maxRetries) != null ? _i : (_h = this._options) == null ? void 0 : _h.maxRetries,
|
|
5659
5947
|
abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal,
|
|
@@ -5730,7 +6018,7 @@ var Deepgram = (() => {
|
|
|
5730
6018
|
),
|
|
5731
6019
|
method: "GET",
|
|
5732
6020
|
headers: _headers,
|
|
5733
|
-
|
|
6021
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions == null ? void 0 : requestOptions.queryParams).build(),
|
|
5734
6022
|
timeoutMs: ((_g = (_f = requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? _f : (_e = this._options) == null ? void 0 : _e.timeoutInSeconds) != null ? _g : 60) * 1e3,
|
|
5735
6023
|
maxRetries: (_i = requestOptions == null ? void 0 : requestOptions.maxRetries) != null ? _i : (_h = this._options) == null ? void 0 : _h.maxRetries,
|
|
5736
6024
|
abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal,
|
|
@@ -5791,7 +6079,7 @@ var Deepgram = (() => {
|
|
|
5791
6079
|
),
|
|
5792
6080
|
method: "GET",
|
|
5793
6081
|
headers: _headers,
|
|
5794
|
-
|
|
6082
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions == null ? void 0 : requestOptions.queryParams).build(),
|
|
5795
6083
|
timeoutMs: ((_g = (_f = requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? _f : (_e = this._options) == null ? void 0 : _e.timeoutInSeconds) != null ? _g : 60) * 1e3,
|
|
5796
6084
|
maxRetries: (_i = requestOptions == null ? void 0 : requestOptions.maxRetries) != null ? _i : (_h = this._options) == null ? void 0 : _h.maxRetries,
|
|
5797
6085
|
abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal,
|
|
@@ -5894,7 +6182,7 @@ var Deepgram = (() => {
|
|
|
5894
6182
|
),
|
|
5895
6183
|
method: "GET",
|
|
5896
6184
|
headers: _headers,
|
|
5897
|
-
|
|
6185
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions == null ? void 0 : requestOptions.queryParams).build(),
|
|
5898
6186
|
timeoutMs: ((_g = (_f = requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? _f : (_e = this._options) == null ? void 0 : _e.timeoutInSeconds) != null ? _g : 60) * 1e3,
|
|
5899
6187
|
maxRetries: (_i = requestOptions == null ? void 0 : requestOptions.maxRetries) != null ? _i : (_h = this._options) == null ? void 0 : _h.maxRetries,
|
|
5900
6188
|
abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal,
|
|
@@ -5958,7 +6246,7 @@ var Deepgram = (() => {
|
|
|
5958
6246
|
),
|
|
5959
6247
|
method: "GET",
|
|
5960
6248
|
headers: _headers,
|
|
5961
|
-
|
|
6249
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions == null ? void 0 : requestOptions.queryParams).build(),
|
|
5962
6250
|
timeoutMs: ((_g = (_f = requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? _f : (_e = this._options) == null ? void 0 : _e.timeoutInSeconds) != null ? _g : 60) * 1e3,
|
|
5963
6251
|
maxRetries: (_i = requestOptions == null ? void 0 : requestOptions.maxRetries) != null ? _i : (_h = this._options) == null ? void 0 : _h.maxRetries,
|
|
5964
6252
|
abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal,
|
|
@@ -6166,7 +6454,7 @@ var Deepgram = (() => {
|
|
|
6166
6454
|
),
|
|
6167
6455
|
method: "GET",
|
|
6168
6456
|
headers: _headers,
|
|
6169
|
-
|
|
6457
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions == null ? void 0 : requestOptions.queryParams).build(),
|
|
6170
6458
|
timeoutMs: ((_g = (_f = requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? _f : (_e = this._options) == null ? void 0 : _e.timeoutInSeconds) != null ? _g : 60) * 1e3,
|
|
6171
6459
|
maxRetries: (_i = requestOptions == null ? void 0 : requestOptions.maxRetries) != null ? _i : (_h = this._options) == null ? void 0 : _h.maxRetries,
|
|
6172
6460
|
abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal,
|
|
@@ -6242,7 +6530,7 @@ var Deepgram = (() => {
|
|
|
6242
6530
|
),
|
|
6243
6531
|
method: "GET",
|
|
6244
6532
|
headers: _headers,
|
|
6245
|
-
|
|
6533
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions == null ? void 0 : requestOptions.queryParams).build(),
|
|
6246
6534
|
timeoutMs: ((_g = (_f = requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? _f : (_e = this._options) == null ? void 0 : _e.timeoutInSeconds) != null ? _g : 60) * 1e3,
|
|
6247
6535
|
maxRetries: (_i = requestOptions == null ? void 0 : requestOptions.maxRetries) != null ? _i : (_h = this._options) == null ? void 0 : _h.maxRetries,
|
|
6248
6536
|
abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal,
|
|
@@ -6457,7 +6745,7 @@ var Deepgram = (() => {
|
|
|
6457
6745
|
),
|
|
6458
6746
|
method: "GET",
|
|
6459
6747
|
headers: _headers,
|
|
6460
|
-
|
|
6748
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions == null ? void 0 : requestOptions.queryParams).build(),
|
|
6461
6749
|
timeoutMs: ((_g = (_f = requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? _f : (_e = this._options) == null ? void 0 : _e.timeoutInSeconds) != null ? _g : 60) * 1e3,
|
|
6462
6750
|
maxRetries: (_i = requestOptions == null ? void 0 : requestOptions.maxRetries) != null ? _i : (_h = this._options) == null ? void 0 : _h.maxRetries,
|
|
6463
6751
|
abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal,
|
|
@@ -6547,7 +6835,7 @@ var Deepgram = (() => {
|
|
|
6547
6835
|
),
|
|
6548
6836
|
method: "GET",
|
|
6549
6837
|
headers: _headers,
|
|
6550
|
-
|
|
6838
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions == null ? void 0 : requestOptions.queryParams).build(),
|
|
6551
6839
|
timeoutMs: ((_g = (_f = requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? _f : (_e = this._options) == null ? void 0 : _e.timeoutInSeconds) != null ? _g : 60) * 1e3,
|
|
6552
6840
|
maxRetries: (_i = requestOptions == null ? void 0 : requestOptions.maxRetries) != null ? _i : (_h = this._options) == null ? void 0 : _h.maxRetries,
|
|
6553
6841
|
abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal,
|
|
@@ -6611,7 +6899,7 @@ var Deepgram = (() => {
|
|
|
6611
6899
|
),
|
|
6612
6900
|
method: "GET",
|
|
6613
6901
|
headers: _headers,
|
|
6614
|
-
|
|
6902
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions == null ? void 0 : requestOptions.queryParams).build(),
|
|
6615
6903
|
timeoutMs: ((_g = (_f = requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? _f : (_e = this._options) == null ? void 0 : _e.timeoutInSeconds) != null ? _g : 60) * 1e3,
|
|
6616
6904
|
maxRetries: (_i = requestOptions == null ? void 0 : requestOptions.maxRetries) != null ? _i : (_h = this._options) == null ? void 0 : _h.maxRetries,
|
|
6617
6905
|
abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal,
|
|
@@ -6666,7 +6954,7 @@ var Deepgram = (() => {
|
|
|
6666
6954
|
),
|
|
6667
6955
|
method: "DELETE",
|
|
6668
6956
|
headers: _headers,
|
|
6669
|
-
|
|
6957
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions == null ? void 0 : requestOptions.queryParams).build(),
|
|
6670
6958
|
timeoutMs: ((_g = (_f = requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? _f : (_e = this._options) == null ? void 0 : _e.timeoutInSeconds) != null ? _g : 60) * 1e3,
|
|
6671
6959
|
maxRetries: (_i = requestOptions == null ? void 0 : requestOptions.maxRetries) != null ? _i : (_h = this._options) == null ? void 0 : _h.maxRetries,
|
|
6672
6960
|
abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal,
|
|
@@ -6723,7 +7011,7 @@ var Deepgram = (() => {
|
|
|
6723
7011
|
method: "PATCH",
|
|
6724
7012
|
headers: _headers,
|
|
6725
7013
|
contentType: "application/json",
|
|
6726
|
-
|
|
7014
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions == null ? void 0 : requestOptions.queryParams).build(),
|
|
6727
7015
|
requestType: "json",
|
|
6728
7016
|
body: request,
|
|
6729
7017
|
timeoutMs: ((_g = (_f = requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? _f : (_e = this._options) == null ? void 0 : _e.timeoutInSeconds) != null ? _g : 60) * 1e3,
|
|
@@ -6780,7 +7068,7 @@ var Deepgram = (() => {
|
|
|
6780
7068
|
),
|
|
6781
7069
|
method: "DELETE",
|
|
6782
7070
|
headers: _headers,
|
|
6783
|
-
|
|
7071
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions == null ? void 0 : requestOptions.queryParams).build(),
|
|
6784
7072
|
timeoutMs: ((_g = (_f = requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? _f : (_e = this._options) == null ? void 0 : _e.timeoutInSeconds) != null ? _g : 60) * 1e3,
|
|
6785
7073
|
maxRetries: (_i = requestOptions == null ? void 0 : requestOptions.maxRetries) != null ? _i : (_h = this._options) == null ? void 0 : _h.maxRetries,
|
|
6786
7074
|
abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal,
|
|
@@ -6919,7 +7207,7 @@ var Deepgram = (() => {
|
|
|
6919
7207
|
method: "POST",
|
|
6920
7208
|
headers: _headers,
|
|
6921
7209
|
contentType: "application/json",
|
|
6922
|
-
|
|
7210
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions == null ? void 0 : requestOptions.queryParams).build(),
|
|
6923
7211
|
requestType: "json",
|
|
6924
7212
|
body: _body,
|
|
6925
7213
|
timeoutMs: ((_g = (_f = requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? _f : (_e = this._options) == null ? void 0 : _e.timeoutInSeconds) != null ? _g : 60) * 1e3,
|
|
@@ -7005,7 +7293,7 @@ var Deepgram = (() => {
|
|
|
7005
7293
|
),
|
|
7006
7294
|
method: "GET",
|
|
7007
7295
|
headers: _headers,
|
|
7008
|
-
|
|
7296
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions == null ? void 0 : requestOptions.queryParams).build(),
|
|
7009
7297
|
timeoutMs: ((_g = (_f = requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? _f : (_e = this._options) == null ? void 0 : _e.timeoutInSeconds) != null ? _g : 60) * 1e3,
|
|
7010
7298
|
maxRetries: (_i = requestOptions == null ? void 0 : requestOptions.maxRetries) != null ? _i : (_h = this._options) == null ? void 0 : _h.maxRetries,
|
|
7011
7299
|
abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal,
|
|
@@ -7049,6 +7337,7 @@ var Deepgram = (() => {
|
|
|
7049
7337
|
*
|
|
7050
7338
|
* @example
|
|
7051
7339
|
* await client.selfHosted.v1.distributionCredentials.create("123456-7890-1234-5678-901234", {
|
|
7340
|
+
* scopes: ["self-hosted:products"],
|
|
7052
7341
|
* provider: "quay"
|
|
7053
7342
|
* })
|
|
7054
7343
|
*/
|
|
@@ -7077,7 +7366,7 @@ var Deepgram = (() => {
|
|
|
7077
7366
|
method: "POST",
|
|
7078
7367
|
headers: _headers,
|
|
7079
7368
|
contentType: "application/json",
|
|
7080
|
-
|
|
7369
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions == null ? void 0 : requestOptions.queryParams).build(),
|
|
7081
7370
|
requestType: "json",
|
|
7082
7371
|
body: _body,
|
|
7083
7372
|
timeoutMs: ((_h = (_g = requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? _g : (_f = this._options) == null ? void 0 : _f.timeoutInSeconds) != null ? _h : 60) * 1e3,
|
|
@@ -7145,7 +7434,7 @@ var Deepgram = (() => {
|
|
|
7145
7434
|
),
|
|
7146
7435
|
method: "GET",
|
|
7147
7436
|
headers: _headers,
|
|
7148
|
-
|
|
7437
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions == null ? void 0 : requestOptions.queryParams).build(),
|
|
7149
7438
|
timeoutMs: ((_g = (_f = requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? _f : (_e = this._options) == null ? void 0 : _e.timeoutInSeconds) != null ? _g : 60) * 1e3,
|
|
7150
7439
|
maxRetries: (_i = requestOptions == null ? void 0 : requestOptions.maxRetries) != null ? _i : (_h = this._options) == null ? void 0 : _h.maxRetries,
|
|
7151
7440
|
abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal,
|
|
@@ -7211,7 +7500,7 @@ var Deepgram = (() => {
|
|
|
7211
7500
|
),
|
|
7212
7501
|
method: "DELETE",
|
|
7213
7502
|
headers: _headers,
|
|
7214
|
-
|
|
7503
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions == null ? void 0 : requestOptions.queryParams).build(),
|
|
7215
7504
|
timeoutMs: ((_g = (_f = requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? _f : (_e = this._options) == null ? void 0 : _e.timeoutInSeconds) != null ? _g : 60) * 1e3,
|
|
7216
7505
|
maxRetries: (_i = requestOptions == null ? void 0 : requestOptions.maxRetries) != null ? _i : (_h = this._options) == null ? void 0 : _h.maxRetries,
|
|
7217
7506
|
abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal,
|
|
@@ -7293,7 +7582,8 @@ var Deepgram = (() => {
|
|
|
7293
7582
|
container,
|
|
7294
7583
|
encoding,
|
|
7295
7584
|
model,
|
|
7296
|
-
sample_rate: sampleRate
|
|
7585
|
+
sample_rate: sampleRate,
|
|
7586
|
+
speed
|
|
7297
7587
|
} = _a, _body = __objRest(_a, [
|
|
7298
7588
|
"callback",
|
|
7299
7589
|
"callback_method",
|
|
@@ -7303,7 +7593,8 @@ var Deepgram = (() => {
|
|
|
7303
7593
|
"container",
|
|
7304
7594
|
"encoding",
|
|
7305
7595
|
"model",
|
|
7306
|
-
"sample_rate"
|
|
7596
|
+
"sample_rate",
|
|
7597
|
+
"speed"
|
|
7307
7598
|
]);
|
|
7308
7599
|
const _queryParams = {
|
|
7309
7600
|
callback,
|
|
@@ -7314,7 +7605,8 @@ var Deepgram = (() => {
|
|
|
7314
7605
|
container: container != null ? container : void 0,
|
|
7315
7606
|
encoding: encoding != null ? encoding : void 0,
|
|
7316
7607
|
model: model != null ? model : void 0,
|
|
7317
|
-
sample_rate: sampleRate
|
|
7608
|
+
sample_rate: sampleRate,
|
|
7609
|
+
speed
|
|
7318
7610
|
};
|
|
7319
7611
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
7320
7612
|
const _headers = mergeHeaders(
|
|
@@ -7330,7 +7622,7 @@ var Deepgram = (() => {
|
|
|
7330
7622
|
method: "POST",
|
|
7331
7623
|
headers: _headers,
|
|
7332
7624
|
contentType: "application/json",
|
|
7333
|
-
|
|
7625
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions == null ? void 0 : requestOptions.queryParams).build(),
|
|
7334
7626
|
requestType: "json",
|
|
7335
7627
|
body: _body,
|
|
7336
7628
|
responseType: "binary-response",
|
|
@@ -7442,7 +7734,7 @@ var Deepgram = (() => {
|
|
|
7442
7734
|
/** Returns a promise that resolves when the websocket is open. */
|
|
7443
7735
|
waitForOpen() {
|
|
7444
7736
|
return __async(this, null, function* () {
|
|
7445
|
-
if (this.socket.readyState === ReconnectingWebSocket.OPEN) {
|
|
7737
|
+
if (this.socket.readyState === ReconnectingWebSocket.ReadyState.OPEN) {
|
|
7446
7738
|
return this.socket;
|
|
7447
7739
|
}
|
|
7448
7740
|
return new Promise((resolve, reject) => {
|
|
@@ -7460,7 +7752,7 @@ var Deepgram = (() => {
|
|
|
7460
7752
|
if (!this.socket) {
|
|
7461
7753
|
throw new Error("Socket is not connected.");
|
|
7462
7754
|
}
|
|
7463
|
-
if (this.socket.readyState !== ReconnectingWebSocket.OPEN) {
|
|
7755
|
+
if (this.socket.readyState !== ReconnectingWebSocket.ReadyState.OPEN) {
|
|
7464
7756
|
throw new Error("Socket is not open.");
|
|
7465
7757
|
}
|
|
7466
7758
|
}
|
|
@@ -7486,12 +7778,14 @@ var Deepgram = (() => {
|
|
|
7486
7778
|
}
|
|
7487
7779
|
connect(args) {
|
|
7488
7780
|
return __async(this, null, function* () {
|
|
7489
|
-
var _a, _b;
|
|
7781
|
+
var _a, _b, _c;
|
|
7490
7782
|
const {
|
|
7491
7783
|
encoding,
|
|
7492
7784
|
mip_opt_out: mipOptOut,
|
|
7493
7785
|
model,
|
|
7494
7786
|
sample_rate: sampleRate,
|
|
7787
|
+
speed,
|
|
7788
|
+
protocols,
|
|
7495
7789
|
queryParams,
|
|
7496
7790
|
headers,
|
|
7497
7791
|
debug,
|
|
@@ -7503,18 +7797,20 @@ var Deepgram = (() => {
|
|
|
7503
7797
|
encoding: encoding != null ? encoding : void 0,
|
|
7504
7798
|
mip_opt_out: mipOptOut != null ? typeof mipOptOut === "string" ? mipOptOut : toJson(mipOptOut) : void 0,
|
|
7505
7799
|
model: model != null ? model : void 0,
|
|
7506
|
-
sample_rate: sampleRate != null ? sampleRate : void 0
|
|
7800
|
+
sample_rate: sampleRate != null ? sampleRate : void 0,
|
|
7801
|
+
speed
|
|
7507
7802
|
};
|
|
7508
7803
|
const _headers = mergeHeaders(
|
|
7804
|
+
(_a = this._options) == null ? void 0 : _a.headers,
|
|
7509
7805
|
mergeOnlyDefinedHeaders({ Authorization: args.Authorization }),
|
|
7510
7806
|
headers
|
|
7511
7807
|
);
|
|
7512
7808
|
const socket = new ReconnectingWebSocket({
|
|
7513
7809
|
url: url_exports.join(
|
|
7514
|
-
(
|
|
7810
|
+
(_c = yield Supplier.get(this._options.baseUrl)) != null ? _c : ((_b = yield Supplier.get(this._options.environment)) != null ? _b : DeepgramEnvironment.Production).production,
|
|
7515
7811
|
"/v1/speak"
|
|
7516
7812
|
),
|
|
7517
|
-
protocols: [],
|
|
7813
|
+
protocols: protocols != null ? protocols : [],
|
|
7518
7814
|
queryParameters: __spreadValues(__spreadValues({}, _queryParams), queryParams),
|
|
7519
7815
|
headers: _headers,
|
|
7520
7816
|
options: {
|
|
@@ -7540,30 +7836,711 @@ var Deepgram = (() => {
|
|
|
7540
7836
|
}
|
|
7541
7837
|
};
|
|
7542
7838
|
|
|
7543
|
-
// src/Client.ts
|
|
7544
|
-
var
|
|
7839
|
+
// src/api/resources/voiceAgent/resources/configurations/client/Client.ts
|
|
7840
|
+
var ConfigurationsClient = class {
|
|
7545
7841
|
constructor(options = {}) {
|
|
7546
7842
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
7547
7843
|
}
|
|
7548
|
-
|
|
7549
|
-
|
|
7550
|
-
|
|
7551
|
-
|
|
7552
|
-
|
|
7553
|
-
|
|
7554
|
-
|
|
7555
|
-
|
|
7556
|
-
|
|
7557
|
-
|
|
7558
|
-
|
|
7559
|
-
|
|
7560
|
-
|
|
7561
|
-
|
|
7562
|
-
|
|
7563
|
-
|
|
7564
|
-
|
|
7565
|
-
|
|
7566
|
-
|
|
7844
|
+
/**
|
|
7845
|
+
* Returns all agent configurations for the specified project. Configurations are returned in their uninterpolated form—template variable placeholders appear as-is rather than with their substituted values.
|
|
7846
|
+
*
|
|
7847
|
+
* @param {string} project_id - The unique identifier of the project
|
|
7848
|
+
* @param {ConfigurationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
7849
|
+
*
|
|
7850
|
+
* @throws {@link Deepgram.BadRequestError}
|
|
7851
|
+
*
|
|
7852
|
+
* @example
|
|
7853
|
+
* await client.voiceAgent.configurations.list("123456-7890-1234-5678-901234")
|
|
7854
|
+
*/
|
|
7855
|
+
list(project_id, requestOptions) {
|
|
7856
|
+
return HttpResponsePromise.fromPromise(this.__list(project_id, requestOptions));
|
|
7857
|
+
}
|
|
7858
|
+
__list(project_id, requestOptions) {
|
|
7859
|
+
return __async(this, null, function* () {
|
|
7860
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
7861
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
7862
|
+
const _headers = mergeHeaders(
|
|
7863
|
+
_authRequest.headers,
|
|
7864
|
+
(_a = this._options) == null ? void 0 : _a.headers,
|
|
7865
|
+
requestOptions == null ? void 0 : requestOptions.headers
|
|
7866
|
+
);
|
|
7867
|
+
const _response = yield ((_b = this._options.fetcher) != null ? _b : fetcher)({
|
|
7868
|
+
url: url_exports.join(
|
|
7869
|
+
(_d = yield Supplier.get(this._options.baseUrl)) != null ? _d : ((_c = yield Supplier.get(this._options.environment)) != null ? _c : DeepgramEnvironment.Production).base,
|
|
7870
|
+
`v1/projects/${url_exports.encodePathParam(project_id)}/agents`
|
|
7871
|
+
),
|
|
7872
|
+
method: "GET",
|
|
7873
|
+
headers: _headers,
|
|
7874
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions == null ? void 0 : requestOptions.queryParams).build(),
|
|
7875
|
+
timeoutMs: ((_g = (_f = requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? _f : (_e = this._options) == null ? void 0 : _e.timeoutInSeconds) != null ? _g : 60) * 1e3,
|
|
7876
|
+
maxRetries: (_i = requestOptions == null ? void 0 : requestOptions.maxRetries) != null ? _i : (_h = this._options) == null ? void 0 : _h.maxRetries,
|
|
7877
|
+
abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal,
|
|
7878
|
+
fetchFn: (_j = this._options) == null ? void 0 : _j.fetch,
|
|
7879
|
+
logging: this._options.logging
|
|
7880
|
+
});
|
|
7881
|
+
if (_response.ok) {
|
|
7882
|
+
return {
|
|
7883
|
+
data: _response.body,
|
|
7884
|
+
rawResponse: _response.rawResponse
|
|
7885
|
+
};
|
|
7886
|
+
}
|
|
7887
|
+
if (_response.error.reason === "status-code") {
|
|
7888
|
+
switch (_response.error.statusCode) {
|
|
7889
|
+
case 400:
|
|
7890
|
+
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
7891
|
+
default:
|
|
7892
|
+
throw new DeepgramError({
|
|
7893
|
+
statusCode: _response.error.statusCode,
|
|
7894
|
+
body: _response.error.body,
|
|
7895
|
+
rawResponse: _response.rawResponse
|
|
7896
|
+
});
|
|
7897
|
+
}
|
|
7898
|
+
}
|
|
7899
|
+
return handleNonStatusCodeError(
|
|
7900
|
+
_response.error,
|
|
7901
|
+
_response.rawResponse,
|
|
7902
|
+
"GET",
|
|
7903
|
+
"/v1/projects/{project_id}/agents"
|
|
7904
|
+
);
|
|
7905
|
+
});
|
|
7906
|
+
}
|
|
7907
|
+
/**
|
|
7908
|
+
* Creates a new reusable agent configuration. The `config` field must be a valid JSON string representing the `agent` block of a Settings message. The returned `agent_id` can be passed in place of the full `agent` object in future Settings messages.
|
|
7909
|
+
*
|
|
7910
|
+
* @param {string} project_id - The unique identifier of the project
|
|
7911
|
+
* @param {Deepgram.voiceAgent.CreateAgentConfigurationV1Request} request
|
|
7912
|
+
* @param {ConfigurationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
7913
|
+
*
|
|
7914
|
+
* @throws {@link Deepgram.BadRequestError}
|
|
7915
|
+
*
|
|
7916
|
+
* @example
|
|
7917
|
+
* await client.voiceAgent.configurations.create("123456-7890-1234-5678-901234", {
|
|
7918
|
+
* config: "config"
|
|
7919
|
+
* })
|
|
7920
|
+
*/
|
|
7921
|
+
create(project_id, request, requestOptions) {
|
|
7922
|
+
return HttpResponsePromise.fromPromise(this.__create(project_id, request, requestOptions));
|
|
7923
|
+
}
|
|
7924
|
+
__create(project_id, request, requestOptions) {
|
|
7925
|
+
return __async(this, null, function* () {
|
|
7926
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
7927
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
7928
|
+
const _headers = mergeHeaders(
|
|
7929
|
+
_authRequest.headers,
|
|
7930
|
+
(_a = this._options) == null ? void 0 : _a.headers,
|
|
7931
|
+
requestOptions == null ? void 0 : requestOptions.headers
|
|
7932
|
+
);
|
|
7933
|
+
const _response = yield ((_b = this._options.fetcher) != null ? _b : fetcher)({
|
|
7934
|
+
url: url_exports.join(
|
|
7935
|
+
(_d = yield Supplier.get(this._options.baseUrl)) != null ? _d : ((_c = yield Supplier.get(this._options.environment)) != null ? _c : DeepgramEnvironment.Production).base,
|
|
7936
|
+
`v1/projects/${url_exports.encodePathParam(project_id)}/agents`
|
|
7937
|
+
),
|
|
7938
|
+
method: "POST",
|
|
7939
|
+
headers: _headers,
|
|
7940
|
+
contentType: "application/json",
|
|
7941
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions == null ? void 0 : requestOptions.queryParams).build(),
|
|
7942
|
+
requestType: "json",
|
|
7943
|
+
body: request,
|
|
7944
|
+
timeoutMs: ((_g = (_f = requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? _f : (_e = this._options) == null ? void 0 : _e.timeoutInSeconds) != null ? _g : 60) * 1e3,
|
|
7945
|
+
maxRetries: (_i = requestOptions == null ? void 0 : requestOptions.maxRetries) != null ? _i : (_h = this._options) == null ? void 0 : _h.maxRetries,
|
|
7946
|
+
abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal,
|
|
7947
|
+
fetchFn: (_j = this._options) == null ? void 0 : _j.fetch,
|
|
7948
|
+
logging: this._options.logging
|
|
7949
|
+
});
|
|
7950
|
+
if (_response.ok) {
|
|
7951
|
+
return {
|
|
7952
|
+
data: _response.body,
|
|
7953
|
+
rawResponse: _response.rawResponse
|
|
7954
|
+
};
|
|
7955
|
+
}
|
|
7956
|
+
if (_response.error.reason === "status-code") {
|
|
7957
|
+
switch (_response.error.statusCode) {
|
|
7958
|
+
case 400:
|
|
7959
|
+
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
7960
|
+
default:
|
|
7961
|
+
throw new DeepgramError({
|
|
7962
|
+
statusCode: _response.error.statusCode,
|
|
7963
|
+
body: _response.error.body,
|
|
7964
|
+
rawResponse: _response.rawResponse
|
|
7965
|
+
});
|
|
7966
|
+
}
|
|
7967
|
+
}
|
|
7968
|
+
return handleNonStatusCodeError(
|
|
7969
|
+
_response.error,
|
|
7970
|
+
_response.rawResponse,
|
|
7971
|
+
"POST",
|
|
7972
|
+
"/v1/projects/{project_id}/agents"
|
|
7973
|
+
);
|
|
7974
|
+
});
|
|
7975
|
+
}
|
|
7976
|
+
/**
|
|
7977
|
+
* Returns the specified agent configuration in its uninterpolated form
|
|
7978
|
+
*
|
|
7979
|
+
* @param {string} project_id - The unique identifier of the project
|
|
7980
|
+
* @param {string} agent_id - The unique identifier of the agent configuration
|
|
7981
|
+
* @param {ConfigurationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
7982
|
+
*
|
|
7983
|
+
* @throws {@link Deepgram.BadRequestError}
|
|
7984
|
+
*
|
|
7985
|
+
* @example
|
|
7986
|
+
* await client.voiceAgent.configurations.get("123456-7890-1234-5678-901234", "a1b2c3d4-e5f6-7890-abcd-ef1234567890")
|
|
7987
|
+
*/
|
|
7988
|
+
get(project_id, agent_id, requestOptions) {
|
|
7989
|
+
return HttpResponsePromise.fromPromise(this.__get(project_id, agent_id, requestOptions));
|
|
7990
|
+
}
|
|
7991
|
+
__get(project_id, agent_id, requestOptions) {
|
|
7992
|
+
return __async(this, null, function* () {
|
|
7993
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
7994
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
7995
|
+
const _headers = mergeHeaders(
|
|
7996
|
+
_authRequest.headers,
|
|
7997
|
+
(_a = this._options) == null ? void 0 : _a.headers,
|
|
7998
|
+
requestOptions == null ? void 0 : requestOptions.headers
|
|
7999
|
+
);
|
|
8000
|
+
const _response = yield ((_b = this._options.fetcher) != null ? _b : fetcher)({
|
|
8001
|
+
url: url_exports.join(
|
|
8002
|
+
(_d = yield Supplier.get(this._options.baseUrl)) != null ? _d : ((_c = yield Supplier.get(this._options.environment)) != null ? _c : DeepgramEnvironment.Production).base,
|
|
8003
|
+
`v1/projects/${url_exports.encodePathParam(project_id)}/agents/${url_exports.encodePathParam(agent_id)}`
|
|
8004
|
+
),
|
|
8005
|
+
method: "GET",
|
|
8006
|
+
headers: _headers,
|
|
8007
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions == null ? void 0 : requestOptions.queryParams).build(),
|
|
8008
|
+
timeoutMs: ((_g = (_f = requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? _f : (_e = this._options) == null ? void 0 : _e.timeoutInSeconds) != null ? _g : 60) * 1e3,
|
|
8009
|
+
maxRetries: (_i = requestOptions == null ? void 0 : requestOptions.maxRetries) != null ? _i : (_h = this._options) == null ? void 0 : _h.maxRetries,
|
|
8010
|
+
abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal,
|
|
8011
|
+
fetchFn: (_j = this._options) == null ? void 0 : _j.fetch,
|
|
8012
|
+
logging: this._options.logging
|
|
8013
|
+
});
|
|
8014
|
+
if (_response.ok) {
|
|
8015
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
8016
|
+
}
|
|
8017
|
+
if (_response.error.reason === "status-code") {
|
|
8018
|
+
switch (_response.error.statusCode) {
|
|
8019
|
+
case 400:
|
|
8020
|
+
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
8021
|
+
default:
|
|
8022
|
+
throw new DeepgramError({
|
|
8023
|
+
statusCode: _response.error.statusCode,
|
|
8024
|
+
body: _response.error.body,
|
|
8025
|
+
rawResponse: _response.rawResponse
|
|
8026
|
+
});
|
|
8027
|
+
}
|
|
8028
|
+
}
|
|
8029
|
+
return handleNonStatusCodeError(
|
|
8030
|
+
_response.error,
|
|
8031
|
+
_response.rawResponse,
|
|
8032
|
+
"GET",
|
|
8033
|
+
"/v1/projects/{project_id}/agents/{agent_id}"
|
|
8034
|
+
);
|
|
8035
|
+
});
|
|
8036
|
+
}
|
|
8037
|
+
/**
|
|
8038
|
+
* Updates the metadata associated with an agent configuration. The config itself is immutable—to change the configuration, delete the existing agent and create a new one.
|
|
8039
|
+
*
|
|
8040
|
+
* @param {string} project_id - The unique identifier of the project
|
|
8041
|
+
* @param {string} agent_id - The unique identifier of the agent configuration
|
|
8042
|
+
* @param {Deepgram.voiceAgent.UpdateAgentMetadataV1Request} request
|
|
8043
|
+
* @param {ConfigurationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
8044
|
+
*
|
|
8045
|
+
* @throws {@link Deepgram.BadRequestError}
|
|
8046
|
+
*
|
|
8047
|
+
* @example
|
|
8048
|
+
* await client.voiceAgent.configurations.update("123456-7890-1234-5678-901234", "a1b2c3d4-e5f6-7890-abcd-ef1234567890", {
|
|
8049
|
+
* metadata: {
|
|
8050
|
+
* "key": "value"
|
|
8051
|
+
* }
|
|
8052
|
+
* })
|
|
8053
|
+
*/
|
|
8054
|
+
update(project_id, agent_id, request, requestOptions) {
|
|
8055
|
+
return HttpResponsePromise.fromPromise(this.__update(project_id, agent_id, request, requestOptions));
|
|
8056
|
+
}
|
|
8057
|
+
__update(project_id, agent_id, request, requestOptions) {
|
|
8058
|
+
return __async(this, null, function* () {
|
|
8059
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
8060
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
8061
|
+
const _headers = mergeHeaders(
|
|
8062
|
+
_authRequest.headers,
|
|
8063
|
+
(_a = this._options) == null ? void 0 : _a.headers,
|
|
8064
|
+
requestOptions == null ? void 0 : requestOptions.headers
|
|
8065
|
+
);
|
|
8066
|
+
const _response = yield ((_b = this._options.fetcher) != null ? _b : fetcher)({
|
|
8067
|
+
url: url_exports.join(
|
|
8068
|
+
(_d = yield Supplier.get(this._options.baseUrl)) != null ? _d : ((_c = yield Supplier.get(this._options.environment)) != null ? _c : DeepgramEnvironment.Production).base,
|
|
8069
|
+
`v1/projects/${url_exports.encodePathParam(project_id)}/agents/${url_exports.encodePathParam(agent_id)}`
|
|
8070
|
+
),
|
|
8071
|
+
method: "PUT",
|
|
8072
|
+
headers: _headers,
|
|
8073
|
+
contentType: "application/json",
|
|
8074
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions == null ? void 0 : requestOptions.queryParams).build(),
|
|
8075
|
+
requestType: "json",
|
|
8076
|
+
body: request,
|
|
8077
|
+
timeoutMs: ((_g = (_f = requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? _f : (_e = this._options) == null ? void 0 : _e.timeoutInSeconds) != null ? _g : 60) * 1e3,
|
|
8078
|
+
maxRetries: (_i = requestOptions == null ? void 0 : requestOptions.maxRetries) != null ? _i : (_h = this._options) == null ? void 0 : _h.maxRetries,
|
|
8079
|
+
abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal,
|
|
8080
|
+
fetchFn: (_j = this._options) == null ? void 0 : _j.fetch,
|
|
8081
|
+
logging: this._options.logging
|
|
8082
|
+
});
|
|
8083
|
+
if (_response.ok) {
|
|
8084
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
8085
|
+
}
|
|
8086
|
+
if (_response.error.reason === "status-code") {
|
|
8087
|
+
switch (_response.error.statusCode) {
|
|
8088
|
+
case 400:
|
|
8089
|
+
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
8090
|
+
default:
|
|
8091
|
+
throw new DeepgramError({
|
|
8092
|
+
statusCode: _response.error.statusCode,
|
|
8093
|
+
body: _response.error.body,
|
|
8094
|
+
rawResponse: _response.rawResponse
|
|
8095
|
+
});
|
|
8096
|
+
}
|
|
8097
|
+
}
|
|
8098
|
+
return handleNonStatusCodeError(
|
|
8099
|
+
_response.error,
|
|
8100
|
+
_response.rawResponse,
|
|
8101
|
+
"PUT",
|
|
8102
|
+
"/v1/projects/{project_id}/agents/{agent_id}"
|
|
8103
|
+
);
|
|
8104
|
+
});
|
|
8105
|
+
}
|
|
8106
|
+
/**
|
|
8107
|
+
* Deletes the specified agent configuration. Deleting an agent configuration can cause a production outage if your service references this agent UUID. Migrate all active sessions to a new configuration before deleting.
|
|
8108
|
+
*
|
|
8109
|
+
* @param {string} project_id - The unique identifier of the project
|
|
8110
|
+
* @param {string} agent_id - The unique identifier of the agent configuration
|
|
8111
|
+
* @param {ConfigurationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
8112
|
+
*
|
|
8113
|
+
* @throws {@link Deepgram.BadRequestError}
|
|
8114
|
+
*
|
|
8115
|
+
* @example
|
|
8116
|
+
* await client.voiceAgent.configurations.delete("123456-7890-1234-5678-901234", "a1b2c3d4-e5f6-7890-abcd-ef1234567890")
|
|
8117
|
+
*/
|
|
8118
|
+
delete(project_id, agent_id, requestOptions) {
|
|
8119
|
+
return HttpResponsePromise.fromPromise(this.__delete(project_id, agent_id, requestOptions));
|
|
8120
|
+
}
|
|
8121
|
+
__delete(project_id, agent_id, requestOptions) {
|
|
8122
|
+
return __async(this, null, function* () {
|
|
8123
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
8124
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
8125
|
+
const _headers = mergeHeaders(
|
|
8126
|
+
_authRequest.headers,
|
|
8127
|
+
(_a = this._options) == null ? void 0 : _a.headers,
|
|
8128
|
+
requestOptions == null ? void 0 : requestOptions.headers
|
|
8129
|
+
);
|
|
8130
|
+
const _response = yield ((_b = this._options.fetcher) != null ? _b : fetcher)({
|
|
8131
|
+
url: url_exports.join(
|
|
8132
|
+
(_d = yield Supplier.get(this._options.baseUrl)) != null ? _d : ((_c = yield Supplier.get(this._options.environment)) != null ? _c : DeepgramEnvironment.Production).base,
|
|
8133
|
+
`v1/projects/${url_exports.encodePathParam(project_id)}/agents/${url_exports.encodePathParam(agent_id)}`
|
|
8134
|
+
),
|
|
8135
|
+
method: "DELETE",
|
|
8136
|
+
headers: _headers,
|
|
8137
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions == null ? void 0 : requestOptions.queryParams).build(),
|
|
8138
|
+
timeoutMs: ((_g = (_f = requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? _f : (_e = this._options) == null ? void 0 : _e.timeoutInSeconds) != null ? _g : 60) * 1e3,
|
|
8139
|
+
maxRetries: (_i = requestOptions == null ? void 0 : requestOptions.maxRetries) != null ? _i : (_h = this._options) == null ? void 0 : _h.maxRetries,
|
|
8140
|
+
abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal,
|
|
8141
|
+
fetchFn: (_j = this._options) == null ? void 0 : _j.fetch,
|
|
8142
|
+
logging: this._options.logging
|
|
8143
|
+
});
|
|
8144
|
+
if (_response.ok) {
|
|
8145
|
+
return {
|
|
8146
|
+
data: _response.body,
|
|
8147
|
+
rawResponse: _response.rawResponse
|
|
8148
|
+
};
|
|
8149
|
+
}
|
|
8150
|
+
if (_response.error.reason === "status-code") {
|
|
8151
|
+
switch (_response.error.statusCode) {
|
|
8152
|
+
case 400:
|
|
8153
|
+
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
8154
|
+
default:
|
|
8155
|
+
throw new DeepgramError({
|
|
8156
|
+
statusCode: _response.error.statusCode,
|
|
8157
|
+
body: _response.error.body,
|
|
8158
|
+
rawResponse: _response.rawResponse
|
|
8159
|
+
});
|
|
8160
|
+
}
|
|
8161
|
+
}
|
|
8162
|
+
return handleNonStatusCodeError(
|
|
8163
|
+
_response.error,
|
|
8164
|
+
_response.rawResponse,
|
|
8165
|
+
"DELETE",
|
|
8166
|
+
"/v1/projects/{project_id}/agents/{agent_id}"
|
|
8167
|
+
);
|
|
8168
|
+
});
|
|
8169
|
+
}
|
|
8170
|
+
};
|
|
8171
|
+
|
|
8172
|
+
// src/api/resources/voiceAgent/resources/variables/client/Client.ts
|
|
8173
|
+
var VariablesClient = class {
|
|
8174
|
+
constructor(options = {}) {
|
|
8175
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
8176
|
+
}
|
|
8177
|
+
/**
|
|
8178
|
+
* Returns all template variables for the specified project
|
|
8179
|
+
*
|
|
8180
|
+
* @param {string} project_id - The unique identifier of the project
|
|
8181
|
+
* @param {VariablesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
8182
|
+
*
|
|
8183
|
+
* @throws {@link Deepgram.BadRequestError}
|
|
8184
|
+
*
|
|
8185
|
+
* @example
|
|
8186
|
+
* await client.voiceAgent.variables.list("123456-7890-1234-5678-901234")
|
|
8187
|
+
*/
|
|
8188
|
+
list(project_id, requestOptions) {
|
|
8189
|
+
return HttpResponsePromise.fromPromise(this.__list(project_id, requestOptions));
|
|
8190
|
+
}
|
|
8191
|
+
__list(project_id, requestOptions) {
|
|
8192
|
+
return __async(this, null, function* () {
|
|
8193
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
8194
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
8195
|
+
const _headers = mergeHeaders(
|
|
8196
|
+
_authRequest.headers,
|
|
8197
|
+
(_a = this._options) == null ? void 0 : _a.headers,
|
|
8198
|
+
requestOptions == null ? void 0 : requestOptions.headers
|
|
8199
|
+
);
|
|
8200
|
+
const _response = yield ((_b = this._options.fetcher) != null ? _b : fetcher)({
|
|
8201
|
+
url: url_exports.join(
|
|
8202
|
+
(_d = yield Supplier.get(this._options.baseUrl)) != null ? _d : ((_c = yield Supplier.get(this._options.environment)) != null ? _c : DeepgramEnvironment.Production).base,
|
|
8203
|
+
`v1/projects/${url_exports.encodePathParam(project_id)}/agent-variables`
|
|
8204
|
+
),
|
|
8205
|
+
method: "GET",
|
|
8206
|
+
headers: _headers,
|
|
8207
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions == null ? void 0 : requestOptions.queryParams).build(),
|
|
8208
|
+
timeoutMs: ((_g = (_f = requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? _f : (_e = this._options) == null ? void 0 : _e.timeoutInSeconds) != null ? _g : 60) * 1e3,
|
|
8209
|
+
maxRetries: (_i = requestOptions == null ? void 0 : requestOptions.maxRetries) != null ? _i : (_h = this._options) == null ? void 0 : _h.maxRetries,
|
|
8210
|
+
abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal,
|
|
8211
|
+
fetchFn: (_j = this._options) == null ? void 0 : _j.fetch,
|
|
8212
|
+
logging: this._options.logging
|
|
8213
|
+
});
|
|
8214
|
+
if (_response.ok) {
|
|
8215
|
+
return {
|
|
8216
|
+
data: _response.body,
|
|
8217
|
+
rawResponse: _response.rawResponse
|
|
8218
|
+
};
|
|
8219
|
+
}
|
|
8220
|
+
if (_response.error.reason === "status-code") {
|
|
8221
|
+
switch (_response.error.statusCode) {
|
|
8222
|
+
case 400:
|
|
8223
|
+
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
8224
|
+
default:
|
|
8225
|
+
throw new DeepgramError({
|
|
8226
|
+
statusCode: _response.error.statusCode,
|
|
8227
|
+
body: _response.error.body,
|
|
8228
|
+
rawResponse: _response.rawResponse
|
|
8229
|
+
});
|
|
8230
|
+
}
|
|
8231
|
+
}
|
|
8232
|
+
return handleNonStatusCodeError(
|
|
8233
|
+
_response.error,
|
|
8234
|
+
_response.rawResponse,
|
|
8235
|
+
"GET",
|
|
8236
|
+
"/v1/projects/{project_id}/agent-variables"
|
|
8237
|
+
);
|
|
8238
|
+
});
|
|
8239
|
+
}
|
|
8240
|
+
/**
|
|
8241
|
+
* Creates a new template variable. Variables follow the `DG_<VARIABLE_NAME>` naming format and can substitute any JSON value in an agent configuration.
|
|
8242
|
+
*
|
|
8243
|
+
* @param {string} project_id - The unique identifier of the project
|
|
8244
|
+
* @param {Deepgram.voiceAgent.CreateAgentVariableV1Request} request
|
|
8245
|
+
* @param {VariablesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
8246
|
+
*
|
|
8247
|
+
* @throws {@link Deepgram.BadRequestError}
|
|
8248
|
+
*
|
|
8249
|
+
* @example
|
|
8250
|
+
* await client.voiceAgent.variables.create("project_id", {
|
|
8251
|
+
* key: "key",
|
|
8252
|
+
* value: {
|
|
8253
|
+
* "key": "value"
|
|
8254
|
+
* }
|
|
8255
|
+
* })
|
|
8256
|
+
*/
|
|
8257
|
+
create(project_id, request, requestOptions) {
|
|
8258
|
+
return HttpResponsePromise.fromPromise(this.__create(project_id, request, requestOptions));
|
|
8259
|
+
}
|
|
8260
|
+
__create(project_id, request, requestOptions) {
|
|
8261
|
+
return __async(this, null, function* () {
|
|
8262
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
8263
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
8264
|
+
const _headers = mergeHeaders(
|
|
8265
|
+
_authRequest.headers,
|
|
8266
|
+
(_a = this._options) == null ? void 0 : _a.headers,
|
|
8267
|
+
requestOptions == null ? void 0 : requestOptions.headers
|
|
8268
|
+
);
|
|
8269
|
+
const _response = yield ((_b = this._options.fetcher) != null ? _b : fetcher)({
|
|
8270
|
+
url: url_exports.join(
|
|
8271
|
+
(_d = yield Supplier.get(this._options.baseUrl)) != null ? _d : ((_c = yield Supplier.get(this._options.environment)) != null ? _c : DeepgramEnvironment.Production).base,
|
|
8272
|
+
`v1/projects/${url_exports.encodePathParam(project_id)}/agent-variables`
|
|
8273
|
+
),
|
|
8274
|
+
method: "POST",
|
|
8275
|
+
headers: _headers,
|
|
8276
|
+
contentType: "application/json",
|
|
8277
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions == null ? void 0 : requestOptions.queryParams).build(),
|
|
8278
|
+
requestType: "json",
|
|
8279
|
+
body: request,
|
|
8280
|
+
timeoutMs: ((_g = (_f = requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? _f : (_e = this._options) == null ? void 0 : _e.timeoutInSeconds) != null ? _g : 60) * 1e3,
|
|
8281
|
+
maxRetries: (_i = requestOptions == null ? void 0 : requestOptions.maxRetries) != null ? _i : (_h = this._options) == null ? void 0 : _h.maxRetries,
|
|
8282
|
+
abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal,
|
|
8283
|
+
fetchFn: (_j = this._options) == null ? void 0 : _j.fetch,
|
|
8284
|
+
logging: this._options.logging
|
|
8285
|
+
});
|
|
8286
|
+
if (_response.ok) {
|
|
8287
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
8288
|
+
}
|
|
8289
|
+
if (_response.error.reason === "status-code") {
|
|
8290
|
+
switch (_response.error.statusCode) {
|
|
8291
|
+
case 400:
|
|
8292
|
+
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
8293
|
+
default:
|
|
8294
|
+
throw new DeepgramError({
|
|
8295
|
+
statusCode: _response.error.statusCode,
|
|
8296
|
+
body: _response.error.body,
|
|
8297
|
+
rawResponse: _response.rawResponse
|
|
8298
|
+
});
|
|
8299
|
+
}
|
|
8300
|
+
}
|
|
8301
|
+
return handleNonStatusCodeError(
|
|
8302
|
+
_response.error,
|
|
8303
|
+
_response.rawResponse,
|
|
8304
|
+
"POST",
|
|
8305
|
+
"/v1/projects/{project_id}/agent-variables"
|
|
8306
|
+
);
|
|
8307
|
+
});
|
|
8308
|
+
}
|
|
8309
|
+
/**
|
|
8310
|
+
* Returns the specified template variable
|
|
8311
|
+
*
|
|
8312
|
+
* @param {string} project_id - The unique identifier of the project
|
|
8313
|
+
* @param {string} variable_id - The unique identifier of the agent variable
|
|
8314
|
+
* @param {VariablesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
8315
|
+
*
|
|
8316
|
+
* @throws {@link Deepgram.BadRequestError}
|
|
8317
|
+
*
|
|
8318
|
+
* @example
|
|
8319
|
+
* await client.voiceAgent.variables.get("123456-7890-1234-5678-901234", "v1a2b3c4-d5e6-7890-abcd-ef1234567890")
|
|
8320
|
+
*/
|
|
8321
|
+
get(project_id, variable_id, requestOptions) {
|
|
8322
|
+
return HttpResponsePromise.fromPromise(this.__get(project_id, variable_id, requestOptions));
|
|
8323
|
+
}
|
|
8324
|
+
__get(project_id, variable_id, requestOptions) {
|
|
8325
|
+
return __async(this, null, function* () {
|
|
8326
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
8327
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
8328
|
+
const _headers = mergeHeaders(
|
|
8329
|
+
_authRequest.headers,
|
|
8330
|
+
(_a = this._options) == null ? void 0 : _a.headers,
|
|
8331
|
+
requestOptions == null ? void 0 : requestOptions.headers
|
|
8332
|
+
);
|
|
8333
|
+
const _response = yield ((_b = this._options.fetcher) != null ? _b : fetcher)({
|
|
8334
|
+
url: url_exports.join(
|
|
8335
|
+
(_d = yield Supplier.get(this._options.baseUrl)) != null ? _d : ((_c = yield Supplier.get(this._options.environment)) != null ? _c : DeepgramEnvironment.Production).base,
|
|
8336
|
+
`v1/projects/${url_exports.encodePathParam(project_id)}/agent-variables/${url_exports.encodePathParam(variable_id)}`
|
|
8337
|
+
),
|
|
8338
|
+
method: "GET",
|
|
8339
|
+
headers: _headers,
|
|
8340
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions == null ? void 0 : requestOptions.queryParams).build(),
|
|
8341
|
+
timeoutMs: ((_g = (_f = requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? _f : (_e = this._options) == null ? void 0 : _e.timeoutInSeconds) != null ? _g : 60) * 1e3,
|
|
8342
|
+
maxRetries: (_i = requestOptions == null ? void 0 : requestOptions.maxRetries) != null ? _i : (_h = this._options) == null ? void 0 : _h.maxRetries,
|
|
8343
|
+
abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal,
|
|
8344
|
+
fetchFn: (_j = this._options) == null ? void 0 : _j.fetch,
|
|
8345
|
+
logging: this._options.logging
|
|
8346
|
+
});
|
|
8347
|
+
if (_response.ok) {
|
|
8348
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
8349
|
+
}
|
|
8350
|
+
if (_response.error.reason === "status-code") {
|
|
8351
|
+
switch (_response.error.statusCode) {
|
|
8352
|
+
case 400:
|
|
8353
|
+
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
8354
|
+
default:
|
|
8355
|
+
throw new DeepgramError({
|
|
8356
|
+
statusCode: _response.error.statusCode,
|
|
8357
|
+
body: _response.error.body,
|
|
8358
|
+
rawResponse: _response.rawResponse
|
|
8359
|
+
});
|
|
8360
|
+
}
|
|
8361
|
+
}
|
|
8362
|
+
return handleNonStatusCodeError(
|
|
8363
|
+
_response.error,
|
|
8364
|
+
_response.rawResponse,
|
|
8365
|
+
"GET",
|
|
8366
|
+
"/v1/projects/{project_id}/agent-variables/{variable_id}"
|
|
8367
|
+
);
|
|
8368
|
+
});
|
|
8369
|
+
}
|
|
8370
|
+
/**
|
|
8371
|
+
* Deletes the specified template variable
|
|
8372
|
+
*
|
|
8373
|
+
* @param {string} project_id - The unique identifier of the project
|
|
8374
|
+
* @param {string} variable_id - The unique identifier of the agent variable
|
|
8375
|
+
* @param {VariablesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
8376
|
+
*
|
|
8377
|
+
* @throws {@link Deepgram.BadRequestError}
|
|
8378
|
+
*
|
|
8379
|
+
* @example
|
|
8380
|
+
* await client.voiceAgent.variables.delete("123456-7890-1234-5678-901234", "v1a2b3c4-d5e6-7890-abcd-ef1234567890")
|
|
8381
|
+
*/
|
|
8382
|
+
delete(project_id, variable_id, requestOptions) {
|
|
8383
|
+
return HttpResponsePromise.fromPromise(this.__delete(project_id, variable_id, requestOptions));
|
|
8384
|
+
}
|
|
8385
|
+
__delete(project_id, variable_id, requestOptions) {
|
|
8386
|
+
return __async(this, null, function* () {
|
|
8387
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
8388
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
8389
|
+
const _headers = mergeHeaders(
|
|
8390
|
+
_authRequest.headers,
|
|
8391
|
+
(_a = this._options) == null ? void 0 : _a.headers,
|
|
8392
|
+
requestOptions == null ? void 0 : requestOptions.headers
|
|
8393
|
+
);
|
|
8394
|
+
const _response = yield ((_b = this._options.fetcher) != null ? _b : fetcher)({
|
|
8395
|
+
url: url_exports.join(
|
|
8396
|
+
(_d = yield Supplier.get(this._options.baseUrl)) != null ? _d : ((_c = yield Supplier.get(this._options.environment)) != null ? _c : DeepgramEnvironment.Production).base,
|
|
8397
|
+
`v1/projects/${url_exports.encodePathParam(project_id)}/agent-variables/${url_exports.encodePathParam(variable_id)}`
|
|
8398
|
+
),
|
|
8399
|
+
method: "DELETE",
|
|
8400
|
+
headers: _headers,
|
|
8401
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions == null ? void 0 : requestOptions.queryParams).build(),
|
|
8402
|
+
timeoutMs: ((_g = (_f = requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? _f : (_e = this._options) == null ? void 0 : _e.timeoutInSeconds) != null ? _g : 60) * 1e3,
|
|
8403
|
+
maxRetries: (_i = requestOptions == null ? void 0 : requestOptions.maxRetries) != null ? _i : (_h = this._options) == null ? void 0 : _h.maxRetries,
|
|
8404
|
+
abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal,
|
|
8405
|
+
fetchFn: (_j = this._options) == null ? void 0 : _j.fetch,
|
|
8406
|
+
logging: this._options.logging
|
|
8407
|
+
});
|
|
8408
|
+
if (_response.ok) {
|
|
8409
|
+
return {
|
|
8410
|
+
data: _response.body,
|
|
8411
|
+
rawResponse: _response.rawResponse
|
|
8412
|
+
};
|
|
8413
|
+
}
|
|
8414
|
+
if (_response.error.reason === "status-code") {
|
|
8415
|
+
switch (_response.error.statusCode) {
|
|
8416
|
+
case 400:
|
|
8417
|
+
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
8418
|
+
default:
|
|
8419
|
+
throw new DeepgramError({
|
|
8420
|
+
statusCode: _response.error.statusCode,
|
|
8421
|
+
body: _response.error.body,
|
|
8422
|
+
rawResponse: _response.rawResponse
|
|
8423
|
+
});
|
|
8424
|
+
}
|
|
8425
|
+
}
|
|
8426
|
+
return handleNonStatusCodeError(
|
|
8427
|
+
_response.error,
|
|
8428
|
+
_response.rawResponse,
|
|
8429
|
+
"DELETE",
|
|
8430
|
+
"/v1/projects/{project_id}/agent-variables/{variable_id}"
|
|
8431
|
+
);
|
|
8432
|
+
});
|
|
8433
|
+
}
|
|
8434
|
+
/**
|
|
8435
|
+
* Updates the value of an existing template variable
|
|
8436
|
+
*
|
|
8437
|
+
* @param {string} project_id - The unique identifier of the project
|
|
8438
|
+
* @param {string} variable_id - The unique identifier of the agent variable
|
|
8439
|
+
* @param {Deepgram.voiceAgent.UpdateAgentVariableV1Request} request
|
|
8440
|
+
* @param {VariablesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
8441
|
+
*
|
|
8442
|
+
* @throws {@link Deepgram.BadRequestError}
|
|
8443
|
+
*
|
|
8444
|
+
* @example
|
|
8445
|
+
* await client.voiceAgent.variables.update("project_id", "variable_id", {
|
|
8446
|
+
* value: {
|
|
8447
|
+
* "key": "value"
|
|
8448
|
+
* }
|
|
8449
|
+
* })
|
|
8450
|
+
*/
|
|
8451
|
+
update(project_id, variable_id, request, requestOptions) {
|
|
8452
|
+
return HttpResponsePromise.fromPromise(this.__update(project_id, variable_id, request, requestOptions));
|
|
8453
|
+
}
|
|
8454
|
+
__update(project_id, variable_id, request, requestOptions) {
|
|
8455
|
+
return __async(this, null, function* () {
|
|
8456
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
8457
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
8458
|
+
const _headers = mergeHeaders(
|
|
8459
|
+
_authRequest.headers,
|
|
8460
|
+
(_a = this._options) == null ? void 0 : _a.headers,
|
|
8461
|
+
requestOptions == null ? void 0 : requestOptions.headers
|
|
8462
|
+
);
|
|
8463
|
+
const _response = yield ((_b = this._options.fetcher) != null ? _b : fetcher)({
|
|
8464
|
+
url: url_exports.join(
|
|
8465
|
+
(_d = yield Supplier.get(this._options.baseUrl)) != null ? _d : ((_c = yield Supplier.get(this._options.environment)) != null ? _c : DeepgramEnvironment.Production).base,
|
|
8466
|
+
`v1/projects/${url_exports.encodePathParam(project_id)}/agent-variables/${url_exports.encodePathParam(variable_id)}`
|
|
8467
|
+
),
|
|
8468
|
+
method: "PATCH",
|
|
8469
|
+
headers: _headers,
|
|
8470
|
+
contentType: "application/json",
|
|
8471
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions == null ? void 0 : requestOptions.queryParams).build(),
|
|
8472
|
+
requestType: "json",
|
|
8473
|
+
body: request,
|
|
8474
|
+
timeoutMs: ((_g = (_f = requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? _f : (_e = this._options) == null ? void 0 : _e.timeoutInSeconds) != null ? _g : 60) * 1e3,
|
|
8475
|
+
maxRetries: (_i = requestOptions == null ? void 0 : requestOptions.maxRetries) != null ? _i : (_h = this._options) == null ? void 0 : _h.maxRetries,
|
|
8476
|
+
abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal,
|
|
8477
|
+
fetchFn: (_j = this._options) == null ? void 0 : _j.fetch,
|
|
8478
|
+
logging: this._options.logging
|
|
8479
|
+
});
|
|
8480
|
+
if (_response.ok) {
|
|
8481
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
8482
|
+
}
|
|
8483
|
+
if (_response.error.reason === "status-code") {
|
|
8484
|
+
switch (_response.error.statusCode) {
|
|
8485
|
+
case 400:
|
|
8486
|
+
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
8487
|
+
default:
|
|
8488
|
+
throw new DeepgramError({
|
|
8489
|
+
statusCode: _response.error.statusCode,
|
|
8490
|
+
body: _response.error.body,
|
|
8491
|
+
rawResponse: _response.rawResponse
|
|
8492
|
+
});
|
|
8493
|
+
}
|
|
8494
|
+
}
|
|
8495
|
+
return handleNonStatusCodeError(
|
|
8496
|
+
_response.error,
|
|
8497
|
+
_response.rawResponse,
|
|
8498
|
+
"PATCH",
|
|
8499
|
+
"/v1/projects/{project_id}/agent-variables/{variable_id}"
|
|
8500
|
+
);
|
|
8501
|
+
});
|
|
8502
|
+
}
|
|
8503
|
+
};
|
|
8504
|
+
|
|
8505
|
+
// src/api/resources/voiceAgent/client/Client.ts
|
|
8506
|
+
var VoiceAgentClient = class {
|
|
8507
|
+
constructor(options = {}) {
|
|
8508
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
8509
|
+
}
|
|
8510
|
+
get configurations() {
|
|
8511
|
+
var _a;
|
|
8512
|
+
return (_a = this._configurations) != null ? _a : this._configurations = new ConfigurationsClient(this._options);
|
|
8513
|
+
}
|
|
8514
|
+
get variables() {
|
|
8515
|
+
var _a;
|
|
8516
|
+
return (_a = this._variables) != null ? _a : this._variables = new VariablesClient(this._options);
|
|
8517
|
+
}
|
|
8518
|
+
};
|
|
8519
|
+
|
|
8520
|
+
// src/Client.ts
|
|
8521
|
+
var DeepgramClient = class {
|
|
8522
|
+
constructor(options = {}) {
|
|
8523
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
8524
|
+
}
|
|
8525
|
+
get agent() {
|
|
8526
|
+
var _a;
|
|
8527
|
+
return (_a = this._agent) != null ? _a : this._agent = new AgentClient(this._options);
|
|
8528
|
+
}
|
|
8529
|
+
get auth() {
|
|
8530
|
+
var _a;
|
|
8531
|
+
return (_a = this._auth) != null ? _a : this._auth = new AuthClient(this._options);
|
|
8532
|
+
}
|
|
8533
|
+
get listen() {
|
|
8534
|
+
var _a;
|
|
8535
|
+
return (_a = this._listen) != null ? _a : this._listen = new ListenClient(this._options);
|
|
8536
|
+
}
|
|
8537
|
+
get manage() {
|
|
8538
|
+
var _a;
|
|
8539
|
+
return (_a = this._manage) != null ? _a : this._manage = new ManageClient(this._options);
|
|
8540
|
+
}
|
|
8541
|
+
get read() {
|
|
8542
|
+
var _a;
|
|
8543
|
+
return (_a = this._read) != null ? _a : this._read = new ReadClient(this._options);
|
|
7567
8544
|
}
|
|
7568
8545
|
get selfHosted() {
|
|
7569
8546
|
var _a;
|
|
@@ -7573,6 +8550,45 @@ var Deepgram = (() => {
|
|
|
7573
8550
|
var _a;
|
|
7574
8551
|
return (_a = this._speak) != null ? _a : this._speak = new SpeakClient(this._options);
|
|
7575
8552
|
}
|
|
8553
|
+
get voiceAgent() {
|
|
8554
|
+
var _a;
|
|
8555
|
+
return (_a = this._voiceAgent) != null ? _a : this._voiceAgent = new VoiceAgentClient(this._options);
|
|
8556
|
+
}
|
|
8557
|
+
/**
|
|
8558
|
+
* Make a passthrough request using the SDK's configured auth, retry, logging, etc.
|
|
8559
|
+
* This is useful for making requests to endpoints not yet supported in the SDK.
|
|
8560
|
+
* The input can be a URL string, URL object, or Request object. Relative paths are resolved against the configured base URL.
|
|
8561
|
+
*
|
|
8562
|
+
* @param {Request | string | URL} input - The URL, path, or Request object.
|
|
8563
|
+
* @param {RequestInit} init - Standard fetch RequestInit options.
|
|
8564
|
+
* @param {core.PassthroughRequest.RequestOptions} requestOptions - Per-request overrides (timeout, retries, headers, abort signal).
|
|
8565
|
+
* @returns {Promise<Response>} A standard Response object.
|
|
8566
|
+
*/
|
|
8567
|
+
fetch(input, init, requestOptions) {
|
|
8568
|
+
return __async(this, null, function* () {
|
|
8569
|
+
var _a;
|
|
8570
|
+
return makePassthroughRequest(
|
|
8571
|
+
input,
|
|
8572
|
+
init,
|
|
8573
|
+
{
|
|
8574
|
+
baseUrl: (_a = this._options.baseUrl) != null ? _a : (() => __async(this, null, function* () {
|
|
8575
|
+
var _a2;
|
|
8576
|
+
const env = yield Supplier.get(this._options.environment);
|
|
8577
|
+
return typeof env === "string" ? env : (_a2 = env == null ? void 0 : env.base) != null ? _a2 : DeepgramEnvironment.Production.base;
|
|
8578
|
+
})),
|
|
8579
|
+
headers: this._options.headers,
|
|
8580
|
+
timeoutInSeconds: this._options.timeoutInSeconds,
|
|
8581
|
+
maxRetries: this._options.maxRetries,
|
|
8582
|
+
fetch: this._options.fetch,
|
|
8583
|
+
logging: this._options.logging,
|
|
8584
|
+
getAuthHeaders: () => __async(this, null, function* () {
|
|
8585
|
+
return (yield this._options.authProvider.getAuthRequest()).headers;
|
|
8586
|
+
})
|
|
8587
|
+
},
|
|
8588
|
+
requestOptions
|
|
8589
|
+
);
|
|
8590
|
+
});
|
|
8591
|
+
}
|
|
7576
8592
|
};
|
|
7577
8593
|
|
|
7578
8594
|
// src/CustomClient.ts
|
|
@@ -7861,11 +8877,7 @@ var Deepgram = (() => {
|
|
|
7861
8877
|
var _a, _b, _c, _d, _e, _f;
|
|
7862
8878
|
yield loadNodeWebSocket();
|
|
7863
8879
|
const authRequest = yield (_a = options.authProvider) == null ? void 0 : _a.getAuthRequest();
|
|
7864
|
-
const mergedHeaders = mergeHeaders(
|
|
7865
|
-
(_b = options.headers) != null ? _b : {},
|
|
7866
|
-
(_c = authRequest == null ? void 0 : authRequest.headers) != null ? _c : {},
|
|
7867
|
-
headers
|
|
7868
|
-
);
|
|
8880
|
+
const mergedHeaders = mergeHeaders((_b = options.headers) != null ? _b : {}, (_c = authRequest == null ? void 0 : authRequest.headers) != null ? _c : {}, headers);
|
|
7869
8881
|
const _headers = yield resolveHeaders(mergedHeaders);
|
|
7870
8882
|
const wsOptions = getWebSocketOptions(_headers);
|
|
7871
8883
|
const baseUrl = (_e = yield Supplier.get(options.baseUrl)) != null ? _e : ((_d = yield Supplier.get(options.environment)) != null ? _d : DeepgramEnvironment.Production)[environmentKey];
|