@deepgram/sdk 5.1.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 +49 -10
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/CustomClient.js +11 -9
- package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1ConversationText.d.ts +4 -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 +22 -3
- 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 +1 -0
- package/dist/cjs/api/resources/agent/resources/v1/types/index.js +1 -0
- package/dist/cjs/api/resources/listen/resources/v2/client/Client.d.ts +1 -0
- package/dist/cjs/api/resources/listen/resources/v2/client/Client.js +15 -2
- package/dist/cjs/api/resources/listen/resources/v2/types/ListenV2ConfigureSuccess.d.ts +2 -0
- 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 +1 -1
- package/dist/cjs/api/resources/speak/resources/v1/types/SpeakV1Metadata.d.ts +4 -2
- package/dist/cjs/api/types/CreateKeyV1Request.d.ts +2 -0
- package/dist/cjs/api/types/CreateKeyV1Request.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/ListProjectMembersV1Response.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/OpenAiThinkProvider.d.ts +11 -0
- package/dist/cjs/api/types/OpenAiThinkProvider.js +8 -0
- package/dist/cjs/api/types/index.d.ts +2 -1
- package/dist/cjs/api/types/index.js +2 -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/CustomClient.mjs +11 -9
- package/dist/esm/api/resources/agent/resources/v1/types/AgentV1ConversationText.d.mts +4 -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 +22 -3
- 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 +1 -0
- package/dist/esm/api/resources/agent/resources/v1/types/index.mjs +1 -0
- package/dist/esm/api/resources/listen/resources/v2/client/Client.d.mts +1 -0
- package/dist/esm/api/resources/listen/resources/v2/client/Client.mjs +15 -2
- package/dist/esm/api/resources/listen/resources/v2/types/ListenV2ConfigureSuccess.d.mts +2 -0
- 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 +1 -1
- package/dist/esm/api/resources/speak/resources/v1/types/SpeakV1Metadata.d.mts +4 -2
- package/dist/esm/api/types/CreateKeyV1Request.d.mts +2 -0
- package/dist/esm/api/types/CreateKeyV1Request.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/ListProjectMembersV1Response.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/OpenAiThinkProvider.d.mts +11 -0
- package/dist/esm/api/types/OpenAiThinkProvider.mjs +8 -0
- package/dist/esm/api/types/index.d.mts +2 -1
- package/dist/esm/api/types/index.mjs +2 -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 +10 -10
- package/reference.md +1 -1
|
@@ -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,
|
|
@@ -208,6 +209,7 @@ var Deepgram = (() => {
|
|
|
208
209
|
Deepgram: () => Deepgram,
|
|
209
210
|
ElevenLabsSpeakProvider: () => ElevenLabsSpeakProvider,
|
|
210
211
|
Google: () => Google,
|
|
212
|
+
Groq: () => Groq,
|
|
211
213
|
ListBillingFieldsV1Response: () => ListBillingFieldsV1Response,
|
|
212
214
|
ListenV1CallbackMethod: () => ListenV1CallbackMethod,
|
|
213
215
|
ListenV1DetectEntities: () => ListenV1DetectEntities,
|
|
@@ -325,6 +327,7 @@ var Deepgram = (() => {
|
|
|
325
327
|
var agent_exports = {};
|
|
326
328
|
__export(agent_exports, {
|
|
327
329
|
AgentV1ConversationText: () => AgentV1ConversationText,
|
|
330
|
+
AgentV1InjectAgentMessage: () => AgentV1InjectAgentMessage,
|
|
328
331
|
AgentV1Settings: () => AgentV1Settings,
|
|
329
332
|
v1: () => v1_exports
|
|
330
333
|
});
|
|
@@ -333,6 +336,7 @@ var Deepgram = (() => {
|
|
|
333
336
|
var v1_exports = {};
|
|
334
337
|
__export(v1_exports, {
|
|
335
338
|
AgentV1ConversationText: () => AgentV1ConversationText,
|
|
339
|
+
AgentV1InjectAgentMessage: () => AgentV1InjectAgentMessage,
|
|
336
340
|
AgentV1Settings: () => AgentV1Settings,
|
|
337
341
|
settings: () => settings_exports
|
|
338
342
|
});
|
|
@@ -361,6 +365,15 @@ var Deepgram = (() => {
|
|
|
361
365
|
};
|
|
362
366
|
})(AgentV1ConversationText || (AgentV1ConversationText = {}));
|
|
363
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
|
+
|
|
364
377
|
// src/api/resources/agent/resources/v1/types/AgentV1Settings.ts
|
|
365
378
|
var AgentV1Settings;
|
|
366
379
|
((AgentV1Settings2) => {
|
|
@@ -387,7 +400,16 @@ var Deepgram = (() => {
|
|
|
387
400
|
Output2.Encoding = {
|
|
388
401
|
Linear16: "linear16",
|
|
389
402
|
Mulaw: "mulaw",
|
|
390
|
-
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"
|
|
391
413
|
};
|
|
392
414
|
})(Output = Audio2.Output || (Audio2.Output = {}));
|
|
393
415
|
})(Audio = AgentV1Settings2.Audio || (AgentV1Settings2.Audio = {}));
|
|
@@ -1221,6 +1243,18 @@ var Deepgram = (() => {
|
|
|
1221
1243
|
};
|
|
1222
1244
|
})(Google || (Google = {}));
|
|
1223
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
|
+
|
|
1224
1258
|
// src/api/types/ListBillingFieldsV1Response.ts
|
|
1225
1259
|
var ListBillingFieldsV1Response;
|
|
1226
1260
|
((ListBillingFieldsV1Response2) => {
|
|
@@ -1408,6 +1442,13 @@ var Deepgram = (() => {
|
|
|
1408
1442
|
Gpt4O: "gpt-4o",
|
|
1409
1443
|
Gpt4OMini: "gpt-4o-mini"
|
|
1410
1444
|
};
|
|
1445
|
+
OpenAiThinkProvider2.ReasoningMode = {
|
|
1446
|
+
None: "none",
|
|
1447
|
+
Minimal: "minimal",
|
|
1448
|
+
Low: "low",
|
|
1449
|
+
Medium: "medium",
|
|
1450
|
+
High: "high"
|
|
1451
|
+
};
|
|
1411
1452
|
})(OpenAiThinkProvider || (OpenAiThinkProvider = {}));
|
|
1412
1453
|
|
|
1413
1454
|
// src/api/types/SpeakV1Encoding.ts
|
|
@@ -3513,8 +3554,8 @@ var Deepgram = (() => {
|
|
|
3513
3554
|
{
|
|
3514
3555
|
"X-Fern-Language": "JavaScript",
|
|
3515
3556
|
"X-Fern-SDK-Name": "@deepgram/sdk",
|
|
3516
|
-
"X-Fern-SDK-Version": "5.
|
|
3517
|
-
"User-Agent": "@deepgram/sdk/5.
|
|
3557
|
+
"X-Fern-SDK-Version": "5.1.1",
|
|
3558
|
+
"User-Agent": "@deepgram/sdk/5.1.1",
|
|
3518
3559
|
"X-Fern-Runtime": RUNTIME.type,
|
|
3519
3560
|
"X-Fern-Runtime-Version": RUNTIME.version
|
|
3520
3561
|
},
|
|
@@ -4607,6 +4648,7 @@ var Deepgram = (() => {
|
|
|
4607
4648
|
eot_threshold: eotThreshold,
|
|
4608
4649
|
eot_timeout_ms: eotTimeoutMs,
|
|
4609
4650
|
keyterm,
|
|
4651
|
+
language_hint: languageHint,
|
|
4610
4652
|
mip_opt_out: mipOptOut,
|
|
4611
4653
|
tag,
|
|
4612
4654
|
protocols,
|
|
@@ -4624,7 +4666,8 @@ var Deepgram = (() => {
|
|
|
4624
4666
|
eager_eot_threshold: eagerEotThreshold != null ? typeof eagerEotThreshold === "string" ? eagerEotThreshold : toJson(eagerEotThreshold) : void 0,
|
|
4625
4667
|
eot_threshold: eotThreshold != null ? typeof eotThreshold === "string" ? eotThreshold : toJson(eotThreshold) : void 0,
|
|
4626
4668
|
eot_timeout_ms: eotTimeoutMs != null ? typeof eotTimeoutMs === "string" ? eotTimeoutMs : toJson(eotTimeoutMs) : void 0,
|
|
4627
|
-
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,
|
|
4628
4671
|
mip_opt_out: mipOptOut != null ? typeof mipOptOut === "string" ? mipOptOut : toJson(mipOptOut) : void 0,
|
|
4629
4672
|
tag: tag != null ? typeof tag === "string" ? tag : toJson(tag) : void 0
|
|
4630
4673
|
};
|
|
@@ -5260,7 +5303,7 @@ var Deepgram = (() => {
|
|
|
5260
5303
|
* Creates a new API key with specified settings for the project
|
|
5261
5304
|
*
|
|
5262
5305
|
* @param {string} project_id - The unique identifier of the project
|
|
5263
|
-
* @param {Deepgram.
|
|
5306
|
+
* @param {Deepgram.CreateKeyV1Request} [request]
|
|
5264
5307
|
* @param {KeysClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
5265
5308
|
*
|
|
5266
5309
|
* @throws {@link Deepgram.BadRequestError}
|
|
@@ -8834,11 +8877,7 @@ var Deepgram = (() => {
|
|
|
8834
8877
|
var _a, _b, _c, _d, _e, _f;
|
|
8835
8878
|
yield loadNodeWebSocket();
|
|
8836
8879
|
const authRequest = yield (_a = options.authProvider) == null ? void 0 : _a.getAuthRequest();
|
|
8837
|
-
const mergedHeaders = mergeHeaders(
|
|
8838
|
-
(_b = options.headers) != null ? _b : {},
|
|
8839
|
-
(_c = authRequest == null ? void 0 : authRequest.headers) != null ? _c : {},
|
|
8840
|
-
headers
|
|
8841
|
-
);
|
|
8880
|
+
const mergedHeaders = mergeHeaders((_b = options.headers) != null ? _b : {}, (_c = authRequest == null ? void 0 : authRequest.headers) != null ? _c : {}, headers);
|
|
8842
8881
|
const _headers = yield resolveHeaders(mergedHeaders);
|
|
8843
8882
|
const wsOptions = getWebSocketOptions(_headers);
|
|
8844
8883
|
const baseUrl = (_e = yield Supplier.get(options.baseUrl)) != null ? _e : ((_d = yield Supplier.get(options.environment)) != null ? _d : DeepgramEnvironment.Production)[environmentKey];
|
package/dist/cjs/BaseClient.js
CHANGED
|
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
|
|
|
43
43
|
const headers = (0, headers_js_1.mergeHeaders)({
|
|
44
44
|
"X-Fern-Language": "JavaScript",
|
|
45
45
|
"X-Fern-SDK-Name": "@deepgram/sdk",
|
|
46
|
-
"X-Fern-SDK-Version": "5.
|
|
47
|
-
"User-Agent": "@deepgram/sdk/5.
|
|
46
|
+
"X-Fern-SDK-Version": "5.1.1",
|
|
47
|
+
"User-Agent": "@deepgram/sdk/5.1.1",
|
|
48
48
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
49
49
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
50
50
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
package/dist/cjs/CustomClient.js
CHANGED
|
@@ -150,7 +150,9 @@ class ApiKeyAuthProviderWrapper {
|
|
|
150
150
|
// If the header doesn't already have a scheme prefix, add "Token " prefix for API keys
|
|
151
151
|
if (authHeader && typeof authHeader === "string") {
|
|
152
152
|
// Only add prefix if it doesn't already have Bearer or Token prefix
|
|
153
|
-
if (!authHeader.startsWith("Bearer ") &&
|
|
153
|
+
if (!authHeader.startsWith("Bearer ") &&
|
|
154
|
+
!authHeader.startsWith("Token ") &&
|
|
155
|
+
!authHeader.startsWith("token ")) {
|
|
154
156
|
return {
|
|
155
157
|
headers: Object.assign(Object.assign({}, authRequest.headers), { Authorization: `Token ${authHeader}` }),
|
|
156
158
|
};
|
|
@@ -509,7 +511,7 @@ class WrappedAgentV1Client extends Client_js_5.V1Client {
|
|
|
509
511
|
const socket = yield createWebSocketConnection({
|
|
510
512
|
options: this._options,
|
|
511
513
|
urlPath: "/v1/agent/converse",
|
|
512
|
-
environmentKey:
|
|
514
|
+
environmentKey: "agent",
|
|
513
515
|
queryParams: buildQueryParams(args),
|
|
514
516
|
headers,
|
|
515
517
|
debug,
|
|
@@ -562,7 +564,7 @@ class WrappedAgentV1Socket extends Socket_js_1.V1Socket {
|
|
|
562
564
|
handleOpen: socketAny.handleOpen,
|
|
563
565
|
handleMessage: socketAny.handleMessage,
|
|
564
566
|
handleClose: socketAny.handleClose,
|
|
565
|
-
handleError: socketAny.handleError
|
|
567
|
+
handleError: socketAny.handleError,
|
|
566
568
|
});
|
|
567
569
|
resetSocketConnectionState(this.socket);
|
|
568
570
|
super.connect();
|
|
@@ -586,7 +588,7 @@ class WrappedListenV1Client extends Client_js_6.V1Client {
|
|
|
586
588
|
const socket = yield createWebSocketConnection({
|
|
587
589
|
options: this._options,
|
|
588
590
|
urlPath: "/v1/listen",
|
|
589
|
-
environmentKey:
|
|
591
|
+
environmentKey: "production",
|
|
590
592
|
queryParams: buildQueryParams(args),
|
|
591
593
|
headers,
|
|
592
594
|
debug,
|
|
@@ -639,7 +641,7 @@ class WrappedListenV1Socket extends Socket_js_2.V1Socket {
|
|
|
639
641
|
handleOpen: socketAny.handleOpen,
|
|
640
642
|
handleMessage: socketAny.handleMessage,
|
|
641
643
|
handleClose: socketAny.handleClose,
|
|
642
|
-
handleError: socketAny.handleError
|
|
644
|
+
handleError: socketAny.handleError,
|
|
643
645
|
});
|
|
644
646
|
resetSocketConnectionState(this.socket);
|
|
645
647
|
super.connect();
|
|
@@ -662,7 +664,7 @@ class WrappedListenV2Client extends Client_js_7.V2Client {
|
|
|
662
664
|
const socket = yield createWebSocketConnection({
|
|
663
665
|
options: this._options,
|
|
664
666
|
urlPath: "/v2/listen",
|
|
665
|
-
environmentKey:
|
|
667
|
+
environmentKey: "production",
|
|
666
668
|
queryParams: buildQueryParams(args),
|
|
667
669
|
headers,
|
|
668
670
|
debug,
|
|
@@ -716,7 +718,7 @@ class WrappedListenV2Socket extends Socket_js_3.V2Socket {
|
|
|
716
718
|
handleOpen: socketAny.handleOpen,
|
|
717
719
|
handleMessage: socketAny.handleMessage,
|
|
718
720
|
handleClose: socketAny.handleClose,
|
|
719
|
-
handleError: socketAny.handleError
|
|
721
|
+
handleError: socketAny.handleError,
|
|
720
722
|
});
|
|
721
723
|
resetSocketConnectionState(this.socket);
|
|
722
724
|
super.connect();
|
|
@@ -769,7 +771,7 @@ class WrappedSpeakV1Client extends Client_js_8.V1Client {
|
|
|
769
771
|
const socket = yield createWebSocketConnection({
|
|
770
772
|
options: this._options,
|
|
771
773
|
urlPath: "/v1/speak",
|
|
772
|
-
environmentKey:
|
|
774
|
+
environmentKey: "production",
|
|
773
775
|
queryParams: buildQueryParams(args),
|
|
774
776
|
headers,
|
|
775
777
|
debug,
|
|
@@ -829,7 +831,7 @@ class WrappedSpeakV1Socket extends Socket_js_4.V1Socket {
|
|
|
829
831
|
handleOpen: socketAny.handleOpen,
|
|
830
832
|
handleMessage: socketAny.handleMessage,
|
|
831
833
|
handleClose: socketAny.handleClose,
|
|
832
|
-
handleError: socketAny.handleError
|
|
834
|
+
handleError: socketAny.handleError,
|
|
833
835
|
});
|
|
834
836
|
resetSocketConnectionState(this.socket);
|
|
835
837
|
super.connect();
|
|
@@ -5,6 +5,10 @@ export interface AgentV1ConversationText {
|
|
|
5
5
|
role: AgentV1ConversationText.Role;
|
|
6
6
|
/** The actual statement that was spoken */
|
|
7
7
|
content: string;
|
|
8
|
+
/** The language hints that were active at the time of the turn. Only present on user-role messages when the listen model is flux-general-multi. */
|
|
9
|
+
languages_hinted?: string[] | undefined;
|
|
10
|
+
/** Languages detected in the user's speech, sorted by word count (descending). Only present on user-role messages when the listen model is flux-general-multi. */
|
|
11
|
+
languages?: string[] | undefined;
|
|
8
12
|
}
|
|
9
13
|
export declare namespace AgentV1ConversationText {
|
|
10
14
|
/** Identifies who spoke the statement */
|
|
@@ -3,4 +3,24 @@ export interface AgentV1InjectAgentMessage {
|
|
|
3
3
|
type: "InjectAgentMessage";
|
|
4
4
|
/** The statement that the agent should say */
|
|
5
5
|
message: string;
|
|
6
|
+
/**
|
|
7
|
+
* Controls how the injection interacts with any in-progress user or agent turn.
|
|
8
|
+
*
|
|
9
|
+
* * `default` — The agent speaks only if neither the user nor the agent is mid-turn. If a turn is in progress, the server replies with `InjectionRefused`.
|
|
10
|
+
* * `queue` — The message is appended after any already-queued `ConversationText` without interrupting the current agent turn or think response. If nothing is queued, the message plays immediately.
|
|
11
|
+
*/
|
|
12
|
+
behavior?: AgentV1InjectAgentMessage.Behavior | undefined;
|
|
13
|
+
}
|
|
14
|
+
export declare namespace AgentV1InjectAgentMessage {
|
|
15
|
+
/**
|
|
16
|
+
* Controls how the injection interacts with any in-progress user or agent turn.
|
|
17
|
+
*
|
|
18
|
+
* * `default` — The agent speaks only if neither the user nor the agent is mid-turn. If a turn is in progress, the server replies with `InjectionRefused`.
|
|
19
|
+
* * `queue` — The message is appended after any already-queued `ConversationText` without interrupting the current agent turn or think response. If nothing is queued, the message plays immediately.
|
|
20
|
+
*/
|
|
21
|
+
const Behavior: {
|
|
22
|
+
readonly Default: "default";
|
|
23
|
+
readonly Queue: "queue";
|
|
24
|
+
};
|
|
25
|
+
type Behavior = (typeof Behavior)[keyof typeof Behavior] | string;
|
|
6
26
|
}
|
|
@@ -1,3 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.AgentV1InjectAgentMessage = void 0;
|
|
5
|
+
var AgentV1InjectAgentMessage;
|
|
6
|
+
(function (AgentV1InjectAgentMessage) {
|
|
7
|
+
/**
|
|
8
|
+
* Controls how the injection interacts with any in-progress user or agent turn.
|
|
9
|
+
*
|
|
10
|
+
* * `default` — The agent speaks only if neither the user nor the agent is mid-turn. If a turn is in progress, the server replies with `InjectionRefused`.
|
|
11
|
+
* * `queue` — The message is appended after any already-queued `ConversationText` without interrupting the current agent turn or think response. If nothing is queued, the message plays immediately.
|
|
12
|
+
*/
|
|
13
|
+
AgentV1InjectAgentMessage.Behavior = {
|
|
14
|
+
Default: "default",
|
|
15
|
+
Queue: "queue",
|
|
16
|
+
};
|
|
17
|
+
})(AgentV1InjectAgentMessage || (exports.AgentV1InjectAgentMessage = AgentV1InjectAgentMessage = {}));
|
|
@@ -59,8 +59,8 @@ export declare namespace AgentV1Settings {
|
|
|
59
59
|
sample_rate?: number | undefined;
|
|
60
60
|
/** Audio bitrate in bits per second */
|
|
61
61
|
bitrate?: number | undefined;
|
|
62
|
-
/** Audio container format.
|
|
63
|
-
container?:
|
|
62
|
+
/** Audio container format. */
|
|
63
|
+
container?: Output.Container | undefined;
|
|
64
64
|
}
|
|
65
65
|
namespace Output {
|
|
66
66
|
/** Audio encoding format for streaming TTS output */
|
|
@@ -68,8 +68,19 @@ export declare namespace AgentV1Settings {
|
|
|
68
68
|
readonly Linear16: "linear16";
|
|
69
69
|
readonly Mulaw: "mulaw";
|
|
70
70
|
readonly Alaw: "alaw";
|
|
71
|
+
readonly Mp3: "mp3";
|
|
72
|
+
readonly Opus: "opus";
|
|
73
|
+
readonly Flac: "flac";
|
|
74
|
+
readonly Aac: "aac";
|
|
71
75
|
};
|
|
72
76
|
type Encoding = (typeof Encoding)[keyof typeof Encoding] | string;
|
|
77
|
+
/** Audio container format. */
|
|
78
|
+
const Container: {
|
|
79
|
+
readonly None: "none";
|
|
80
|
+
readonly Wav: "wav";
|
|
81
|
+
readonly Ogg: "ogg";
|
|
82
|
+
};
|
|
83
|
+
type Container = (typeof Container)[keyof typeof Container] | string;
|
|
73
84
|
}
|
|
74
85
|
}
|
|
75
86
|
interface Agent {
|
|
@@ -121,9 +132,17 @@ export declare namespace AgentV1Settings {
|
|
|
121
132
|
}
|
|
122
133
|
}
|
|
123
134
|
interface Listen {
|
|
124
|
-
provider?: Deepgram.agent.
|
|
135
|
+
provider?: Deepgram.agent.AgentV1SettingsAgentContextListenProvider | undefined;
|
|
125
136
|
}
|
|
126
137
|
type Think = Deepgram.ThinkSettingsV1 | Deepgram.ThinkSettingsV1[];
|
|
127
138
|
type Speak = Deepgram.SpeakSettingsV1 | Deepgram.SpeakSettingsV1[];
|
|
128
139
|
}
|
|
140
|
+
/**
|
|
141
|
+
* Opt-in alias for the agent-by-ID-string variant added by the 2026-05-06
|
|
142
|
+
* regen. The canonical `Agent` type is restored to the object-only
|
|
143
|
+
* interface for back-compat; use `AgentReference` if your code needs to
|
|
144
|
+
* accept either an `Agent` settings object or a string agent ID at the
|
|
145
|
+
* type level (e.g. when targeting the agent-builder ID flow).
|
|
146
|
+
*/
|
|
147
|
+
type AgentReference = AgentV1Settings.Agent | string;
|
|
129
148
|
}
|
|
@@ -30,6 +30,16 @@ var AgentV1Settings;
|
|
|
30
30
|
Linear16: "linear16",
|
|
31
31
|
Mulaw: "mulaw",
|
|
32
32
|
Alaw: "alaw",
|
|
33
|
+
Mp3: "mp3",
|
|
34
|
+
Opus: "opus",
|
|
35
|
+
Flac: "flac",
|
|
36
|
+
Aac: "aac",
|
|
37
|
+
};
|
|
38
|
+
/** Audio container format. */
|
|
39
|
+
Output.Container = {
|
|
40
|
+
None: "none",
|
|
41
|
+
Wav: "wav",
|
|
42
|
+
Ogg: "ogg",
|
|
33
43
|
};
|
|
34
44
|
})(Output = Audio.Output || (Audio.Output = {}));
|
|
35
45
|
})(Audio = AgentV1Settings.Audio || (AgentV1Settings.Audio = {}));
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type * as Deepgram from "../../../../../index.js";
|
|
2
|
+
export type AgentV1SettingsAgentContextListenProvider = Deepgram.agent.AgentV1SettingsAgentContextListenProvider.V1 | Deepgram.agent.AgentV1SettingsAgentContextListenProvider.V2;
|
|
3
|
+
export declare namespace AgentV1SettingsAgentContextListenProvider {
|
|
4
|
+
interface V1 {
|
|
5
|
+
version: "v1";
|
|
6
|
+
/** Provider type for speech-to-text */
|
|
7
|
+
type: "deepgram";
|
|
8
|
+
/** Model to use for speech to text using the V1 API (e.g. Nova-3, Nova-2) */
|
|
9
|
+
model?: string | undefined;
|
|
10
|
+
/** Language code to use for speech-to-text. Can be a BCP-47 language tag (e.g. `en`), or `multi` for code-switching transcription */
|
|
11
|
+
language?: string | undefined;
|
|
12
|
+
/** Prompt keyterm recognition to improve Keyword Recall Rate */
|
|
13
|
+
keyterms?: string[] | undefined;
|
|
14
|
+
/** Applies smart formatting to improve transcript readability */
|
|
15
|
+
smart_format?: boolean | undefined;
|
|
16
|
+
}
|
|
17
|
+
interface V2 {
|
|
18
|
+
version: "v2";
|
|
19
|
+
/** Provider type for speech-to-text */
|
|
20
|
+
type: "deepgram";
|
|
21
|
+
/** Model to use for speech to text using the V2 API (e.g. flux-general-en, flux-general-multi) */
|
|
22
|
+
model: string;
|
|
23
|
+
/** One or more BCP-47 language codes to bias the model toward specific languages. Only supported when model is flux-general-multi. Without hints, the model auto-detects the spoken language. See the Language Prompting guide for details. */
|
|
24
|
+
language_hint?: AgentV1SettingsAgentContextListenProviderV2.LanguageHint | undefined;
|
|
25
|
+
/** Prompt keyterm recognition to improve Keyword Recall Rate */
|
|
26
|
+
keyterms?: string[] | undefined;
|
|
27
|
+
}
|
|
28
|
+
namespace AgentV1SettingsAgentContextListenProviderV2 {
|
|
29
|
+
/**
|
|
30
|
+
* One or more BCP-47 language codes to bias the model toward specific languages. Only supported when model is flux-general-multi. Without hints, the model auto-detects the spoken language. See the Language Prompting guide for details.
|
|
31
|
+
*/
|
|
32
|
+
type LanguageHint = string | string[];
|
|
33
|
+
}
|
|
34
|
+
}
|
package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1SettingsAgentListenProvider.d.ts
CHANGED
|
@@ -1,26 +1,6 @@
|
|
|
1
1
|
import type * as Deepgram from "../../../../../index.js";
|
|
2
|
-
export type AgentV1SettingsAgentListenProvider = Deepgram.agent.
|
|
2
|
+
export type AgentV1SettingsAgentListenProvider = Deepgram.agent.AgentV1SettingsAgentContextListenProvider;
|
|
3
3
|
export declare namespace AgentV1SettingsAgentListenProvider {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
/** Provider type for speech-to-text */
|
|
7
|
-
type: "deepgram";
|
|
8
|
-
/** Model to use for speech to text using the V1 API (e.g. Nova-3, Nova-2) */
|
|
9
|
-
model?: string | undefined;
|
|
10
|
-
/** Language code to use for speech-to-text. Can be a BCP-47 language tag (e.g. `en`), or `multi` for code-switching transcription */
|
|
11
|
-
language?: string | undefined;
|
|
12
|
-
/** Prompt keyterm recognition to improve Keyword Recall Rate */
|
|
13
|
-
keyterms?: string[] | undefined;
|
|
14
|
-
/** Applies smart formatting to improve transcript readability */
|
|
15
|
-
smart_format?: boolean | undefined;
|
|
16
|
-
}
|
|
17
|
-
interface V2 {
|
|
18
|
-
version: "v2";
|
|
19
|
-
/** Provider type for speech-to-text */
|
|
20
|
-
type: "deepgram";
|
|
21
|
-
/** Model to use for speech to text using the V2 API (e.g. flux-general-en) */
|
|
22
|
-
model: string;
|
|
23
|
-
/** Prompt keyterm recognition to improve Keyword Recall Rate */
|
|
24
|
-
keyterms?: string[] | undefined;
|
|
25
|
-
}
|
|
4
|
+
type V1 = Deepgram.agent.AgentV1SettingsAgentContextListenProvider.V1;
|
|
5
|
+
type V2 = Deepgram.agent.AgentV1SettingsAgentContextListenProvider.V2;
|
|
26
6
|
}
|
package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1SettingsAgentListenProvider.js
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
//
|
|
2
|
+
// Backward-compat alias for the type renamed by the 2026-05-06 regen to
|
|
3
|
+
// `AgentV1SettingsAgentContextListenProvider`. The new V2 only adds an optional
|
|
4
|
+
// `language_hint` field, so this alias is purely additive: every literal that
|
|
5
|
+
// satisfied the old V2 still satisfies the new V2, and pinned-name callers
|
|
6
|
+
// (`const p: AgentV1SettingsAgentListenProvider = ...`) keep compiling without
|
|
7
|
+
// a cast. See AGENTS.md for the patch rationale; regression coverage in
|
|
8
|
+
// tests/unit/compat-aliases.test.ts.
|
|
3
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -13,6 +13,7 @@ export * from "./AgentV1PromptUpdated.js";
|
|
|
13
13
|
export * from "./AgentV1ReceiveFunctionCallResponse.js";
|
|
14
14
|
export * from "./AgentV1SendFunctionCallResponse.js";
|
|
15
15
|
export * from "./AgentV1Settings.js";
|
|
16
|
+
export * from "./AgentV1SettingsAgentContextListenProvider.js";
|
|
16
17
|
export * from "./AgentV1SettingsAgentListenProvider.js";
|
|
17
18
|
export * from "./AgentV1SettingsApplied.js";
|
|
18
19
|
export * from "./AgentV1SpeakUpdated.js";
|
|
@@ -29,6 +29,7 @@ __exportStar(require("./AgentV1PromptUpdated.js"), exports);
|
|
|
29
29
|
__exportStar(require("./AgentV1ReceiveFunctionCallResponse.js"), exports);
|
|
30
30
|
__exportStar(require("./AgentV1SendFunctionCallResponse.js"), exports);
|
|
31
31
|
__exportStar(require("./AgentV1Settings.js"), exports);
|
|
32
|
+
__exportStar(require("./AgentV1SettingsAgentContextListenProvider.js"), exports);
|
|
32
33
|
__exportStar(require("./AgentV1SettingsAgentListenProvider.js"), exports);
|
|
33
34
|
__exportStar(require("./AgentV1SettingsApplied.js"), exports);
|
|
34
35
|
__exportStar(require("./AgentV1SpeakUpdated.js"), exports);
|
|
@@ -12,6 +12,7 @@ export declare namespace V2Client {
|
|
|
12
12
|
eot_threshold?: Deepgram.ListenV2EotThreshold | undefined;
|
|
13
13
|
eot_timeout_ms?: Deepgram.ListenV2EotTimeoutMs | undefined;
|
|
14
14
|
keyterm?: Deepgram.ListenV2Keyterm;
|
|
15
|
+
language_hint?: Deepgram.ListenV2LanguageHint;
|
|
15
16
|
mip_opt_out?: Deepgram.ListenV2MipOptOut | undefined;
|
|
16
17
|
tag?: Deepgram.ListenV2Tag | undefined;
|
|
17
18
|
Authorization: string;
|
|
@@ -57,7 +57,7 @@ class V2Client {
|
|
|
57
57
|
connect(args) {
|
|
58
58
|
return __awaiter(this, void 0, void 0, function* () {
|
|
59
59
|
var _a, _b, _c;
|
|
60
|
-
const { model, encoding, sample_rate: sampleRate, eager_eot_threshold: eagerEotThreshold, eot_threshold: eotThreshold, eot_timeout_ms: eotTimeoutMs, keyterm, mip_opt_out: mipOptOut, tag, protocols, queryParams, headers, debug, reconnectAttempts, connectionTimeoutInSeconds, abortSignal, } = args;
|
|
60
|
+
const { model, encoding, sample_rate: sampleRate, eager_eot_threshold: eagerEotThreshold, eot_threshold: eotThreshold, eot_timeout_ms: eotTimeoutMs, keyterm, language_hint: languageHint, mip_opt_out: mipOptOut, tag, protocols, queryParams, headers, debug, reconnectAttempts, connectionTimeoutInSeconds, abortSignal, } = args;
|
|
61
61
|
const _queryParams = {
|
|
62
62
|
model,
|
|
63
63
|
encoding: encoding != null ? encoding : undefined,
|
|
@@ -77,7 +77,20 @@ class V2Client {
|
|
|
77
77
|
? eotTimeoutMs
|
|
78
78
|
: (0, json_js_1.toJson)(eotTimeoutMs)
|
|
79
79
|
: undefined,
|
|
80
|
-
keyterm:
|
|
80
|
+
keyterm: Array.isArray(keyterm)
|
|
81
|
+
? keyterm.map((item) => (typeof item === "string" ? item : (0, json_js_1.toJson)(item)))
|
|
82
|
+
: keyterm != null
|
|
83
|
+
? typeof keyterm === "string"
|
|
84
|
+
? keyterm
|
|
85
|
+
: (0, json_js_1.toJson)(keyterm)
|
|
86
|
+
: undefined,
|
|
87
|
+
language_hint: Array.isArray(languageHint)
|
|
88
|
+
? languageHint.map((item) => (typeof item === "string" ? item : (0, json_js_1.toJson)(item)))
|
|
89
|
+
: languageHint != null
|
|
90
|
+
? typeof languageHint === "string"
|
|
91
|
+
? languageHint
|
|
92
|
+
: (0, json_js_1.toJson)(languageHint)
|
|
93
|
+
: undefined,
|
|
81
94
|
mip_opt_out: mipOptOut != null ? (typeof mipOptOut === "string" ? mipOptOut : (0, json_js_1.toJson)(mipOptOut)) : undefined,
|
|
82
95
|
tag: tag != null ? (typeof tag === "string" ? tag : (0, json_js_1.toJson)(tag)) : undefined,
|
|
83
96
|
};
|
|
@@ -10,6 +10,8 @@ export interface ListenV2ConfigureSuccess {
|
|
|
10
10
|
*/
|
|
11
11
|
thresholds: ListenV2ConfigureSuccess.Thresholds;
|
|
12
12
|
keyterms: Deepgram.ListenV2Keyterm;
|
|
13
|
+
/** The currently active language hints. Only applicable to the flux-general-multi model. */
|
|
14
|
+
language_hints?: string[] | undefined;
|
|
13
15
|
/**
|
|
14
16
|
* Starts at `0` and increments for each message the server sends
|
|
15
17
|
* to the client. This includes messages of other types, like
|
|
@@ -30,7 +30,7 @@ export declare class KeysClient {
|
|
|
30
30
|
* Creates a new API key with specified settings for the project
|
|
31
31
|
*
|
|
32
32
|
* @param {string} project_id - The unique identifier of the project
|
|
33
|
-
* @param {Deepgram.
|
|
33
|
+
* @param {Deepgram.CreateKeyV1Request} [request]
|
|
34
34
|
* @param {KeysClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
35
35
|
*
|
|
36
36
|
* @throws {@link Deepgram.BadRequestError}
|
|
@@ -40,7 +40,7 @@ export declare class KeysClient {
|
|
|
40
40
|
* "key": "value"
|
|
41
41
|
* })
|
|
42
42
|
*/
|
|
43
|
-
create(project_id: string, request?: Deepgram.
|
|
43
|
+
create(project_id: string, request?: Deepgram.CreateKeyV1Request, requestOptions?: KeysClient.RequestOptions): core.HttpResponsePromise<Deepgram.CreateKeyV1Response>;
|
|
44
44
|
private __create;
|
|
45
45
|
/**
|
|
46
46
|
* Retrieves information about a specified API key
|
|
@@ -118,7 +118,7 @@ class KeysClient {
|
|
|
118
118
|
* Creates a new API key with specified settings for the project
|
|
119
119
|
*
|
|
120
120
|
* @param {string} project_id - The unique identifier of the project
|
|
121
|
-
* @param {Deepgram.
|
|
121
|
+
* @param {Deepgram.CreateKeyV1Request} [request]
|
|
122
122
|
* @param {KeysClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
123
123
|
*
|
|
124
124
|
* @throws {@link Deepgram.BadRequestError}
|
|
@@ -5,8 +5,10 @@ export interface SpeakV1Metadata {
|
|
|
5
5
|
request_id: string;
|
|
6
6
|
/** Name of the model being used */
|
|
7
7
|
model_name: string;
|
|
8
|
-
/** Version of the model being used */
|
|
8
|
+
/** Version of the primary model being used */
|
|
9
9
|
model_version: string;
|
|
10
|
-
/** Unique identifier for the model */
|
|
10
|
+
/** Unique identifier for the primary model used */
|
|
11
11
|
model_uuid: string;
|
|
12
|
+
/** List of unique identifiers for any additional models used to serve the request */
|
|
13
|
+
additional_model_uuids?: string[] | undefined;
|
|
12
14
|
}
|
|
@@ -6,4 +6,17 @@ export interface Groq {
|
|
|
6
6
|
model: "openai/gpt-oss-20b";
|
|
7
7
|
/** Groq temperature (0-2) */
|
|
8
8
|
temperature?: number | undefined;
|
|
9
|
+
/** OpenAI reasoning_effort */
|
|
10
|
+
reasoning_mode?: Groq.ReasoningMode | undefined;
|
|
11
|
+
}
|
|
12
|
+
export declare namespace Groq {
|
|
13
|
+
/** OpenAI reasoning_effort */
|
|
14
|
+
const ReasoningMode: {
|
|
15
|
+
readonly None: "none";
|
|
16
|
+
readonly Minimal: "minimal";
|
|
17
|
+
readonly Low: "low";
|
|
18
|
+
readonly Medium: "medium";
|
|
19
|
+
readonly High: "high";
|
|
20
|
+
};
|
|
21
|
+
type ReasoningMode = (typeof ReasoningMode)[keyof typeof ReasoningMode] | string;
|
|
9
22
|
}
|
|
@@ -1,3 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Groq = void 0;
|
|
5
|
+
var Groq;
|
|
6
|
+
(function (Groq) {
|
|
7
|
+
/** OpenAI reasoning_effort */
|
|
8
|
+
Groq.ReasoningMode = {
|
|
9
|
+
None: "none",
|
|
10
|
+
Minimal: "minimal",
|
|
11
|
+
Low: "low",
|
|
12
|
+
Medium: "medium",
|
|
13
|
+
High: "high",
|
|
14
|
+
};
|
|
15
|
+
})(Groq || (exports.Groq = Groq = {}));
|
|
@@ -7,7 +7,11 @@ export declare namespace ListProjectMembersV1Response {
|
|
|
7
7
|
interface Item {
|
|
8
8
|
/** The unique identifier of the member */
|
|
9
9
|
member_id?: string | undefined;
|
|
10
|
+
/** The API scopes of the member */
|
|
11
|
+
scopes?: string[] | undefined;
|
|
10
12
|
email?: string | undefined;
|
|
13
|
+
first_name?: string | undefined;
|
|
14
|
+
last_name?: string | undefined;
|
|
11
15
|
}
|
|
12
16
|
}
|
|
13
17
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Language hints constrain and prioritize language detection for the
|
|
3
|
+
* flux-general-multi model. Pass multiple language_hint query parameters
|
|
4
|
+
* to specify multiple language codes. Empty values are rejected.
|
|
5
|
+
* Only valid when model is flux-general-multi.
|
|
6
|
+
*/
|
|
7
|
+
export type ListenV2LanguageHint = string | string[];
|