@deepgram/sdk 4.2.0 → 4.4.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.
@@ -1,105 +1,4 @@
1
- type AudioEncoding =
2
- | "linear16"
3
- | "flac"
4
- | "mulaw"
5
- | "amr-nb"
6
- | "amr-wb"
7
- | "Opus"
8
- | "speex"
9
- | "g729"
10
- | string;
11
-
12
- type ListenModel =
13
- | "nova-3"
14
- | "nova-3-general"
15
- | "nova-3-medical"
16
- | "nova-2"
17
- | "nova-2-meeting"
18
- | "nova-2-phonecall"
19
- | "nova-2-voicemail"
20
- | "nova-2-finance"
21
- | "nova-2-conversational"
22
- | "nova-2-video"
23
- | "nova-2-medical"
24
- | "nova-2-drivethru"
25
- | "nova-2-automotive"
26
- | "nova-2-atc"
27
- | "nova"
28
- | "nova-phonecall"
29
- | "enhanced"
30
- | "enhanced-meeting"
31
- | "enhanced-phonecall"
32
- | "enhanced-finance"
33
- | "base"
34
- | "base-meeting"
35
- | "base-phonecall"
36
- | "base-voicemail"
37
- | "base-finance"
38
- | "base-conversational"
39
- | "base-video"
40
- | "whisper-tiny"
41
- | "whisper"
42
- | "whisper-small"
43
- | "whisper-medium"
44
- | "whisper-large"
45
- | string;
46
-
47
- type SpeakModel =
48
- | "aura-asteria-en"
49
- | "aura-luna-en"
50
- | "aura-stella-en"
51
- | "aura-athena-en"
52
- | "aura-hera-en"
53
- | "aura-orion-en"
54
- | "aura-arcas-en"
55
- | "aura-perseus-en"
56
- | "aura-angus-en"
57
- | "aura-orpheus-en"
58
- | "aura-helios-en"
59
- | "aura-zeus-en"
60
- | "aura-2-amalthea-en"
61
- | "aura-2-andromeda-en"
62
- | "aura-2-apollo-en"
63
- | "aura-2-arcas-en"
64
- | "aura-2-aries-en"
65
- | "aura-2-asteria-en"
66
- | "aura-2-athena-en"
67
- | "aura-2-atlas-en"
68
- | "aura-2-aurora-en"
69
- | "aura-2-callista-en"
70
- | "aura-2-cordelia-en"
71
- | "aura-2-cora-en"
72
- | "aura-2-cressida-en"
73
- | "aura-2-delia-en"
74
- | "aura-2-draco-en"
75
- | "aura-2-electra-en"
76
- | "aura-2-harmonia-en"
77
- | "aura-2-helena-en"
78
- | "aura-2-hera-en"
79
- | "aura-2-hermes-en"
80
- | "aura-2-hyperion-en"
81
- | "aura-2-iris-en"
82
- | "aura-2-janus-en"
83
- | "aura-2-juno-en"
84
- | "aura-2-jupiter-en"
85
- | "aura-2-luna-en"
86
- | "aura-2-mars-en"
87
- | "aura-2-minerva-en"
88
- | "aura-2-neptune-en"
89
- | "aura-2-odysseus-en"
90
- | "aura-2-ophelia-en"
91
- | "aura-2-orion-en"
92
- | "aura-2-orpheus-en"
93
- | "aura-2-pandora-en"
94
- | "aura-2-phoebe-en"
95
- | "aura-2-pluto-en"
96
- | "aura-2-saturn-en"
97
- | "aura-2-selene-en"
98
- | "aura-2-thalia-en"
99
- | "aura-2-theia-en"
100
- | "aura-2-vesta-en"
101
- | "aura-2-zeus-en"
102
- | string;
1
+ type Provider = { type: string } & Record<string, unknown>;
103
2
 
104
3
  /**
105
4
  * @see https://developers.deepgram.com/reference/voicebot-api-phase-preview#settingsconfiguration
@@ -115,7 +14,7 @@ interface AgentLiveSchema extends Record<string, unknown> {
115
14
  /**
116
15
  * @default "linear16"
117
16
  */
118
- encoding: AudioEncoding;
17
+ encoding: string;
119
18
  /**
120
19
  * @default 16000
121
20
  */
@@ -141,46 +40,10 @@ interface AgentLiveSchema extends Record<string, unknown> {
141
40
  */
142
41
  language?: string;
143
42
  listen?: {
144
- provider: {
145
- type: "deepgram";
146
- /**
147
- * @see https://developers.deepgram.com/docs/model
148
- */
149
- model: ListenModel;
150
- /**
151
- * Only available for Nova 3.
152
- * @see https://developers.deepgram.com/docs/keyterm
153
- */
154
- keyterms?: string[];
155
- };
43
+ provider: Provider;
156
44
  };
157
45
  speak?: {
158
- provider: {
159
- type: "deepgram" | "eleven_labs" | "cartesia" | "open_ai" | string;
160
- /**
161
- * Deepgram OR OpenAI model to use.
162
- */
163
- model?: SpeakModel;
164
- /**
165
- * Eleven Labs OR Cartesia model to use.
166
- */
167
- model_id?: string;
168
- /**
169
- * Cartesia voice configuration.
170
- */
171
- voice?: {
172
- mode: string;
173
- id: string;
174
- };
175
- /**
176
- * Optional Cartesia language.
177
- */
178
- language?: string;
179
- /**
180
- * Optional Eleven Labs voice.
181
- */
182
- language_code?: string;
183
- };
46
+ provider: Provider;
184
47
  endpoint?: {
185
48
  url: string;
186
49
  headers?: Record<string, string>;
@@ -190,14 +53,7 @@ interface AgentLiveSchema extends Record<string, unknown> {
190
53
  * @see https://developers.deepgram.com/reference/voicebot-api-phase-preview#supported-llm-providers-and-models
191
54
  */
192
55
  think?: {
193
- provider: {
194
- type: "deepgram" | "open_ai" | "anthropic" | "x_ai" | string;
195
- model: string;
196
- /**
197
- * 0-2 for OpenAI, 0-1 for Anthropic.
198
- */
199
- temperature?: number;
200
- };
56
+ provider: Provider;
201
57
  /**
202
58
  * Optional ONLY if LLM provider is OpenAI or Anthropic.
203
59
  */
@@ -216,6 +72,7 @@ interface AgentLiveSchema extends Record<string, unknown> {
216
72
  };
217
73
  }[];
218
74
  prompt?: string;
75
+ context_length?: number | "max";
219
76
  };
220
77
  /**
221
78
  * Optional message the agent will say at the start of the connection.
@@ -224,4 +81,4 @@ interface AgentLiveSchema extends Record<string, unknown> {
224
81
  };
225
82
  }
226
83
 
227
- export type { AgentLiveSchema, SpeakModel };
84
+ export type { AgentLiveSchema };
@@ -1 +1 @@
1
- export const version = "4.2.0";
1
+ export const version = "4.4.0";
@@ -1,6 +1,5 @@
1
1
  import { DEFAULT_AGENT_URL } from "../lib/constants";
2
2
  import { AgentEvents } from "../lib/enums/AgentEvents";
3
- import { DeepgramError } from "../lib/errors";
4
3
  import type { AgentLiveSchema, DeepgramClientOptions, FunctionCallResponse } from "../lib/types";
5
4
  import { AbstractLiveClient } from "./AbstractLiveClient";
6
5
 
@@ -102,12 +101,6 @@ export class AgentLiveClient extends AbstractLiveClient {
102
101
  * @param options - The SettingsConfiguration object.
103
102
  */
104
103
  public configure(options: AgentLiveSchema): void {
105
- if (
106
- !options.agent.listen?.provider.model.startsWith("nova-3") &&
107
- options.agent.listen?.provider.keyterms?.length
108
- ) {
109
- throw new DeepgramError("Keyterms are only supported with the Nova 3 models.");
110
- }
111
104
  const string = JSON.stringify({
112
105
  type: "Settings",
113
106
  ...options,