@deepgram/sdk 5.1.0 → 5.3.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.
Files changed (103) hide show
  1. package/dist/browser/index.global.js +74 -19
  2. package/dist/cjs/BaseClient.js +2 -2
  3. package/dist/cjs/Client.js +6 -0
  4. package/dist/cjs/CustomClient.js +11 -9
  5. package/dist/cjs/api/resources/agent/resources/v1/resources/settings/resources/think/resources/models/client/Client.js +1 -1
  6. package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1ConversationText.d.ts +4 -0
  7. package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1InjectAgentMessage.d.ts +20 -0
  8. package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1InjectAgentMessage.js +14 -0
  9. package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1Settings.d.ts +22 -3
  10. package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1Settings.js +10 -0
  11. package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1SettingsAgentContextListenProvider.d.ts +13 -0
  12. package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1SettingsAgentContextListenProvider.js +8 -0
  13. package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1SettingsAgentListenProvider.d.ts +3 -23
  14. package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1SettingsAgentListenProvider.js +7 -1
  15. package/dist/cjs/api/resources/agent/resources/v1/types/index.d.ts +1 -0
  16. package/dist/cjs/api/resources/agent/resources/v1/types/index.js +1 -0
  17. package/dist/cjs/api/resources/listen/resources/v1/resources/media/client/Client.d.ts +1 -0
  18. package/dist/cjs/api/resources/listen/resources/v1/resources/media/client/Client.js +4 -1
  19. package/dist/cjs/api/resources/listen/resources/v1/resources/media/client/requests/ListenV1RequestUrl.d.ts +3 -0
  20. package/dist/cjs/api/resources/listen/resources/v1/resources/media/client/requests/MediaTranscribeRequestOctetStream.d.ts +2 -0
  21. package/dist/cjs/api/resources/listen/resources/v1/resources/media/types/MediaTranscribeRequestDiarizeModel.d.ts +6 -0
  22. package/dist/cjs/api/resources/listen/resources/v1/resources/media/types/MediaTranscribeRequestDiarizeModel.js +9 -0
  23. package/dist/cjs/api/resources/listen/resources/v1/resources/media/types/index.d.ts +1 -0
  24. package/dist/cjs/api/resources/listen/resources/v1/resources/media/types/index.js +1 -0
  25. package/dist/cjs/api/resources/listen/resources/v2/client/Client.d.ts +1 -0
  26. package/dist/cjs/api/resources/listen/resources/v2/client/Client.js +15 -2
  27. package/dist/cjs/api/resources/listen/resources/v2/types/ListenV2ConfigureSuccess.d.ts +2 -0
  28. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/keys/client/Client.d.ts +2 -2
  29. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/keys/client/Client.js +1 -1
  30. package/dist/cjs/api/resources/speak/resources/v1/types/SpeakV1Metadata.d.ts +4 -2
  31. package/dist/cjs/api/types/CreateKeyV1Request.d.ts +2 -0
  32. package/dist/cjs/api/types/CreateKeyV1Request.js +3 -0
  33. package/dist/cjs/api/types/DeepgramListenProviderV1.d.ts +14 -0
  34. package/dist/cjs/api/types/DeepgramListenProviderV1.js +3 -0
  35. package/dist/cjs/api/types/DeepgramListenProviderV2.d.ts +18 -0
  36. package/dist/cjs/api/types/DeepgramListenProviderV2.js +3 -0
  37. package/dist/cjs/api/types/Groq.d.ts +13 -0
  38. package/dist/cjs/api/types/Groq.js +12 -0
  39. package/dist/cjs/api/types/ListProjectMembersV1Response.d.ts +4 -0
  40. package/dist/cjs/api/types/ListenV2LanguageHint.d.ts +7 -0
  41. package/dist/cjs/api/types/ListenV2LanguageHint.js +3 -0
  42. package/dist/cjs/api/types/OpenAiThinkProvider.d.ts +11 -0
  43. package/dist/cjs/api/types/OpenAiThinkProvider.js +8 -0
  44. package/dist/cjs/api/types/index.d.ts +4 -1
  45. package/dist/cjs/api/types/index.js +4 -1
  46. package/dist/cjs/environments.d.ts +4 -7
  47. package/dist/cjs/environments.js +1 -5
  48. package/dist/cjs/transport.d.ts +73 -0
  49. package/dist/cjs/transport.js +2 -0
  50. package/dist/cjs/version.d.ts +1 -1
  51. package/dist/cjs/version.js +1 -1
  52. package/dist/esm/BaseClient.mjs +2 -2
  53. package/dist/esm/Client.mjs +6 -0
  54. package/dist/esm/CustomClient.mjs +11 -9
  55. package/dist/esm/api/resources/agent/resources/v1/resources/settings/resources/think/resources/models/client/Client.mjs +1 -1
  56. package/dist/esm/api/resources/agent/resources/v1/types/AgentV1ConversationText.d.mts +4 -0
  57. package/dist/esm/api/resources/agent/resources/v1/types/AgentV1InjectAgentMessage.d.mts +20 -0
  58. package/dist/esm/api/resources/agent/resources/v1/types/AgentV1InjectAgentMessage.mjs +13 -1
  59. package/dist/esm/api/resources/agent/resources/v1/types/AgentV1Settings.d.mts +22 -3
  60. package/dist/esm/api/resources/agent/resources/v1/types/AgentV1Settings.mjs +10 -0
  61. package/dist/esm/api/resources/agent/resources/v1/types/AgentV1SettingsAgentContextListenProvider.d.mts +13 -0
  62. package/dist/esm/api/resources/agent/resources/v1/types/AgentV1SettingsAgentContextListenProvider.mjs +7 -0
  63. package/dist/esm/api/resources/agent/resources/v1/types/AgentV1SettingsAgentListenProvider.d.mts +3 -23
  64. package/dist/esm/api/resources/agent/resources/v1/types/AgentV1SettingsAgentListenProvider.mjs +7 -1
  65. package/dist/esm/api/resources/agent/resources/v1/types/index.d.mts +1 -0
  66. package/dist/esm/api/resources/agent/resources/v1/types/index.mjs +1 -0
  67. package/dist/esm/api/resources/listen/resources/v1/resources/media/client/Client.d.mts +1 -0
  68. package/dist/esm/api/resources/listen/resources/v1/resources/media/client/Client.mjs +4 -1
  69. package/dist/esm/api/resources/listen/resources/v1/resources/media/client/requests/ListenV1RequestUrl.d.mts +3 -0
  70. package/dist/esm/api/resources/listen/resources/v1/resources/media/client/requests/MediaTranscribeRequestOctetStream.d.mts +2 -0
  71. package/dist/esm/api/resources/listen/resources/v1/resources/media/types/MediaTranscribeRequestDiarizeModel.d.mts +6 -0
  72. package/dist/esm/api/resources/listen/resources/v1/resources/media/types/MediaTranscribeRequestDiarizeModel.mjs +6 -0
  73. package/dist/esm/api/resources/listen/resources/v1/resources/media/types/index.d.mts +1 -0
  74. package/dist/esm/api/resources/listen/resources/v1/resources/media/types/index.mjs +1 -0
  75. package/dist/esm/api/resources/listen/resources/v2/client/Client.d.mts +1 -0
  76. package/dist/esm/api/resources/listen/resources/v2/client/Client.mjs +15 -2
  77. package/dist/esm/api/resources/listen/resources/v2/types/ListenV2ConfigureSuccess.d.mts +2 -0
  78. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/keys/client/Client.d.mts +2 -2
  79. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/keys/client/Client.mjs +1 -1
  80. package/dist/esm/api/resources/speak/resources/v1/types/SpeakV1Metadata.d.mts +4 -2
  81. package/dist/esm/api/types/CreateKeyV1Request.d.mts +2 -0
  82. package/dist/esm/api/types/CreateKeyV1Request.mjs +2 -0
  83. package/dist/esm/api/types/DeepgramListenProviderV1.d.mts +14 -0
  84. package/dist/esm/api/types/DeepgramListenProviderV1.mjs +2 -0
  85. package/dist/esm/api/types/DeepgramListenProviderV2.d.mts +18 -0
  86. package/dist/esm/api/types/DeepgramListenProviderV2.mjs +2 -0
  87. package/dist/esm/api/types/Groq.d.mts +13 -0
  88. package/dist/esm/api/types/Groq.mjs +11 -1
  89. package/dist/esm/api/types/ListProjectMembersV1Response.d.mts +4 -0
  90. package/dist/esm/api/types/ListenV2LanguageHint.d.mts +7 -0
  91. package/dist/esm/api/types/ListenV2LanguageHint.mjs +2 -0
  92. package/dist/esm/api/types/OpenAiThinkProvider.d.mts +11 -0
  93. package/dist/esm/api/types/OpenAiThinkProvider.mjs +8 -0
  94. package/dist/esm/api/types/index.d.mts +4 -1
  95. package/dist/esm/api/types/index.mjs +4 -1
  96. package/dist/esm/environments.d.mts +4 -7
  97. package/dist/esm/environments.mjs +1 -5
  98. package/dist/esm/transport.d.mts +73 -0
  99. package/dist/esm/transport.mjs +1 -0
  100. package/dist/esm/version.d.mts +1 -1
  101. package/dist/esm/version.mjs +1 -1
  102. package/package.json +10 -10
  103. package/reference.md +2 -1
@@ -130,9 +130,9 @@ var Deepgram = (() => {
130
130
  }
131
131
  });
132
132
 
133
- // node_modules/.pnpm/ws@8.20.0/node_modules/ws/browser.js
133
+ // node_modules/.pnpm/ws@8.20.1/node_modules/ws/browser.js
134
134
  var require_browser = __commonJS({
135
- "node_modules/.pnpm/ws@8.20.0/node_modules/ws/browser.js"(exports, module) {
135
+ "node_modules/.pnpm/ws@8.20.1/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,
@@ -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 = {}));
@@ -429,6 +451,7 @@ var Deepgram = (() => {
429
451
  MediaTranscribeRequestCallbackMethod: () => MediaTranscribeRequestCallbackMethod,
430
452
  MediaTranscribeRequestCustomIntentMode: () => MediaTranscribeRequestCustomIntentMode,
431
453
  MediaTranscribeRequestCustomTopicMode: () => MediaTranscribeRequestCustomTopicMode,
454
+ MediaTranscribeRequestDiarizeModel: () => MediaTranscribeRequestDiarizeModel,
432
455
  MediaTranscribeRequestEncoding: () => MediaTranscribeRequestEncoding,
433
456
  MediaTranscribeRequestModel: () => MediaTranscribeRequestModel,
434
457
  MediaTranscribeRequestSummarize: () => MediaTranscribeRequestSummarize,
@@ -442,6 +465,7 @@ var Deepgram = (() => {
442
465
  MediaTranscribeRequestCallbackMethod: () => MediaTranscribeRequestCallbackMethod,
443
466
  MediaTranscribeRequestCustomIntentMode: () => MediaTranscribeRequestCustomIntentMode,
444
467
  MediaTranscribeRequestCustomTopicMode: () => MediaTranscribeRequestCustomTopicMode,
468
+ MediaTranscribeRequestDiarizeModel: () => MediaTranscribeRequestDiarizeModel,
445
469
  MediaTranscribeRequestEncoding: () => MediaTranscribeRequestEncoding,
446
470
  MediaTranscribeRequestModel: () => MediaTranscribeRequestModel,
447
471
  MediaTranscribeRequestSummarize: () => MediaTranscribeRequestSummarize,
@@ -466,6 +490,13 @@ var Deepgram = (() => {
466
490
  Strict: "strict"
467
491
  };
468
492
 
493
+ // src/api/resources/listen/resources/v1/resources/media/types/MediaTranscribeRequestDiarizeModel.ts
494
+ var MediaTranscribeRequestDiarizeModel = {
495
+ Latest: "latest",
496
+ V1: "v1",
497
+ V2: "v2"
498
+ };
499
+
469
500
  // src/api/resources/listen/resources/v1/resources/media/types/MediaTranscribeRequestEncoding.ts
470
501
  var MediaTranscribeRequestEncoding = {
471
502
  Linear16: "linear16",
@@ -1221,6 +1252,18 @@ var Deepgram = (() => {
1221
1252
  };
1222
1253
  })(Google || (Google = {}));
1223
1254
 
1255
+ // src/api/types/Groq.ts
1256
+ var Groq;
1257
+ ((Groq2) => {
1258
+ Groq2.ReasoningMode = {
1259
+ None: "none",
1260
+ Minimal: "minimal",
1261
+ Low: "low",
1262
+ Medium: "medium",
1263
+ High: "high"
1264
+ };
1265
+ })(Groq || (Groq = {}));
1266
+
1224
1267
  // src/api/types/ListBillingFieldsV1Response.ts
1225
1268
  var ListBillingFieldsV1Response;
1226
1269
  ((ListBillingFieldsV1Response2) => {
@@ -1408,6 +1451,13 @@ var Deepgram = (() => {
1408
1451
  Gpt4O: "gpt-4o",
1409
1452
  Gpt4OMini: "gpt-4o-mini"
1410
1453
  };
1454
+ OpenAiThinkProvider2.ReasoningMode = {
1455
+ None: "none",
1456
+ Minimal: "minimal",
1457
+ Low: "low",
1458
+ Medium: "medium",
1459
+ High: "high"
1460
+ };
1411
1461
  })(OpenAiThinkProvider || (OpenAiThinkProvider = {}));
1412
1462
 
1413
1463
  // src/api/types/SpeakV1Encoding.ts
@@ -3513,8 +3563,8 @@ var Deepgram = (() => {
3513
3563
  {
3514
3564
  "X-Fern-Language": "JavaScript",
3515
3565
  "X-Fern-SDK-Name": "@deepgram/sdk",
3516
- "X-Fern-SDK-Version": "5.0.1",
3517
- "User-Agent": "@deepgram/sdk/5.0.1",
3566
+ "X-Fern-SDK-Version": "5.2.1",
3567
+ "User-Agent": "@deepgram/sdk/5.2.1",
3518
3568
  "X-Fern-Runtime": RUNTIME.type,
3519
3569
  "X-Fern-Runtime-Version": RUNTIME.version
3520
3570
  },
@@ -3542,13 +3592,9 @@ var Deepgram = (() => {
3542
3592
  var DeepgramEnvironment = {
3543
3593
  Production: {
3544
3594
  base: "https://api.deepgram.com",
3595
+ production: "wss://api.deepgram.com",
3545
3596
  agent: "wss://agent.deepgram.com",
3546
- production: "wss://api.deepgram.com"
3547
- },
3548
- Agent: {
3549
- base: "https://agent.deepgram.com",
3550
- agent: "wss://agent.deepgram.com",
3551
- production: "wss://api.deepgram.com"
3597
+ agentRest: "https://agent.deepgram.com"
3552
3598
  }
3553
3599
  };
3554
3600
 
@@ -3608,7 +3654,7 @@ var Deepgram = (() => {
3608
3654
  const _headers = mergeHeaders((_a = this._options) == null ? void 0 : _a.headers, requestOptions == null ? void 0 : requestOptions.headers);
3609
3655
  const _response = yield ((_b = this._options.fetcher) != null ? _b : fetcher)({
3610
3656
  url: url_exports.join(
3611
- (_d = yield Supplier.get(this._options.baseUrl)) != null ? _d : ((_c = yield Supplier.get(this._options.environment)) != null ? _c : DeepgramEnvironment.Production).base,
3657
+ (_d = yield Supplier.get(this._options.baseUrl)) != null ? _d : ((_c = yield Supplier.get(this._options.environment)) != null ? _c : DeepgramEnvironment.Production).agentRest,
3612
3658
  "v1/agent/settings/think/models"
3613
3659
  ),
3614
3660
  method: "GET",
@@ -3968,6 +4014,7 @@ var Deepgram = (() => {
3968
4014
  * detect_entities: true,
3969
4015
  * detect_language: true,
3970
4016
  * diarize: true,
4017
+ * diarize_model: "latest",
3971
4018
  * dictation: true,
3972
4019
  * encoding: "linear16",
3973
4020
  * filler_words: true,
@@ -4014,6 +4061,7 @@ var Deepgram = (() => {
4014
4061
  detect_entities: detectEntities,
4015
4062
  detect_language: detectLanguage,
4016
4063
  diarize,
4064
+ diarize_model: diarizeModel,
4017
4065
  dictation,
4018
4066
  encoding,
4019
4067
  filler_words: fillerWords,
@@ -4051,6 +4099,7 @@ var Deepgram = (() => {
4051
4099
  "detect_entities",
4052
4100
  "detect_language",
4053
4101
  "diarize",
4102
+ "diarize_model",
4054
4103
  "dictation",
4055
4104
  "encoding",
4056
4105
  "filler_words",
@@ -4089,6 +4138,7 @@ var Deepgram = (() => {
4089
4138
  detect_entities: detectEntities,
4090
4139
  detect_language: detectLanguage,
4091
4140
  diarize,
4141
+ diarize_model: diarizeModel != null ? diarizeModel : void 0,
4092
4142
  dictation,
4093
4143
  encoding: encoding != null ? encoding : void 0,
4094
4144
  filler_words: fillerWords,
@@ -4190,6 +4240,7 @@ var Deepgram = (() => {
4190
4240
  detect_entities: request.detect_entities,
4191
4241
  detect_language: request.detect_language,
4192
4242
  diarize: request.diarize,
4243
+ diarize_model: request.diarize_model != null ? request.diarize_model : void 0,
4193
4244
  dictation: request.dictation,
4194
4245
  encoding: request.encoding != null ? request.encoding : void 0,
4195
4246
  filler_words: request.filler_words,
@@ -4607,6 +4658,7 @@ var Deepgram = (() => {
4607
4658
  eot_threshold: eotThreshold,
4608
4659
  eot_timeout_ms: eotTimeoutMs,
4609
4660
  keyterm,
4661
+ language_hint: languageHint,
4610
4662
  mip_opt_out: mipOptOut,
4611
4663
  tag,
4612
4664
  protocols,
@@ -4624,7 +4676,8 @@ var Deepgram = (() => {
4624
4676
  eager_eot_threshold: eagerEotThreshold != null ? typeof eagerEotThreshold === "string" ? eagerEotThreshold : toJson(eagerEotThreshold) : void 0,
4625
4677
  eot_threshold: eotThreshold != null ? typeof eotThreshold === "string" ? eotThreshold : toJson(eotThreshold) : void 0,
4626
4678
  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,
4679
+ keyterm: Array.isArray(keyterm) ? keyterm.map((item) => typeof item === "string" ? item : toJson(item)) : keyterm != null ? typeof keyterm === "string" ? keyterm : toJson(keyterm) : void 0,
4680
+ 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
4681
  mip_opt_out: mipOptOut != null ? typeof mipOptOut === "string" ? mipOptOut : toJson(mipOptOut) : void 0,
4629
4682
  tag: tag != null ? typeof tag === "string" ? tag : toJson(tag) : void 0
4630
4683
  };
@@ -5260,7 +5313,7 @@ var Deepgram = (() => {
5260
5313
  * Creates a new API key with specified settings for the project
5261
5314
  *
5262
5315
  * @param {string} project_id - The unique identifier of the project
5263
- * @param {Deepgram.CreateKeyV1RequestOne} request
5316
+ * @param {Deepgram.CreateKeyV1Request} [request]
5264
5317
  * @param {KeysClient.RequestOptions} requestOptions - Request-specific configuration.
5265
5318
  *
5266
5319
  * @throws {@link Deepgram.BadRequestError}
@@ -8528,6 +8581,12 @@ var Deepgram = (() => {
8528
8581
  input,
8529
8582
  init,
8530
8583
  {
8584
+ // Patch: the 2026-05-14 regen switched this default from `base`
8585
+ // (api.deepgram.com) to `agentRest` (agent.deepgram.com) after
8586
+ // the new agentRest slot was introduced upstream. The passthrough
8587
+ // helper is documented as the catch-all for endpoints not yet
8588
+ // supported in the SDK — it should default to the canonical
8589
+ // Deepgram REST host, not the agent host. Restoring `base`.
8531
8590
  baseUrl: (_a = this._options.baseUrl) != null ? _a : (() => __async(this, null, function* () {
8532
8591
  var _a2;
8533
8592
  const env = yield Supplier.get(this._options.environment);
@@ -8834,11 +8893,7 @@ var Deepgram = (() => {
8834
8893
  var _a, _b, _c, _d, _e, _f;
8835
8894
  yield loadNodeWebSocket();
8836
8895
  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
- );
8896
+ const mergedHeaders = mergeHeaders((_b = options.headers) != null ? _b : {}, (_c = authRequest == null ? void 0 : authRequest.headers) != null ? _c : {}, headers);
8842
8897
  const _headers = yield resolveHeaders(mergedHeaders);
8843
8898
  const wsOptions = getWebSocketOptions(_headers);
8844
8899
  const baseUrl = (_e = yield Supplier.get(options.baseUrl)) != null ? _e : ((_d = yield Supplier.get(options.environment)) != null ? _d : DeepgramEnvironment.Production)[environmentKey];
@@ -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.0.1",
47
- "User-Agent": "@deepgram/sdk/5.0.1",
46
+ "X-Fern-SDK-Version": "5.2.1",
47
+ "User-Agent": "@deepgram/sdk/5.2.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);
@@ -105,6 +105,12 @@ class DeepgramClient {
105
105
  return __awaiter(this, void 0, void 0, function* () {
106
106
  var _a;
107
107
  return core.makePassthroughRequest(input, init, {
108
+ // Patch: the 2026-05-14 regen switched this default from `base`
109
+ // (api.deepgram.com) to `agentRest` (agent.deepgram.com) after
110
+ // the new agentRest slot was introduced upstream. The passthrough
111
+ // helper is documented as the catch-all for endpoints not yet
112
+ // supported in the SDK — it should default to the canonical
113
+ // Deepgram REST host, not the agent host. Restoring `base`.
108
114
  baseUrl: (_a = this._options.baseUrl) !== null && _a !== void 0 ? _a : (() => __awaiter(this, void 0, void 0, function* () {
109
115
  var _a;
110
116
  const env = yield core.Supplier.get(this._options.environment);
@@ -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 ") && !authHeader.startsWith("Token ") && !authHeader.startsWith("token ")) {
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: 'agent',
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: 'production',
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: 'production',
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: 'production',
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();
@@ -73,7 +73,7 @@ class ModelsClient {
73
73
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
74
74
  const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
75
75
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
76
- url: core.url.join((_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : ((_d = (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.DeepgramEnvironment.Production).base, "v1/agent/settings/think/models"),
76
+ url: core.url.join((_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : ((_d = (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.DeepgramEnvironment.Production).agentRest, "v1/agent/settings/think/models"),
77
77
  method: "GET",
78
78
  headers: _headers,
79
79
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
@@ -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. If omitted, defaults to 'none' */
63
- container?: string | undefined;
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.AgentV1SettingsAgentListenProvider | undefined;
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,13 @@
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 extends Deepgram.DeepgramListenProviderV1 {
5
+ version: "v1";
6
+ }
7
+ interface V2 extends Deepgram.DeepgramListenProviderV2 {
8
+ version: "v2";
9
+ }
10
+ namespace AgentV1SettingsAgentContextListenProviderV2 {
11
+ type LanguageHint = Deepgram.DeepgramListenProviderV2.LanguageHint;
12
+ }
13
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ // Backward-compat: the 2026-05-14 regen consolidated the listen-provider sub-types
3
+ // into top-level `DeepgramListenProviderV1` / `DeepgramListenProviderV2` and dropped
4
+ // the nested `AgentV1SettingsAgentContextListenProviderV2.LanguageHint` namespace
5
+ // path. We restore the nested namespace as an alias to `DeepgramListenProviderV2.LanguageHint`
6
+ // so existing imports of the deep path still resolve.
7
+ // Regression coverage in tests/unit/compat-aliases.test.ts.
8
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,26 +1,6 @@
1
1
  import type * as Deepgram from "../../../../../index.js";
2
- export type AgentV1SettingsAgentListenProvider = Deepgram.agent.AgentV1SettingsAgentListenProvider.V1 | Deepgram.agent.AgentV1SettingsAgentListenProvider.V2;
2
+ export type AgentV1SettingsAgentListenProvider = Deepgram.agent.AgentV1SettingsAgentContextListenProvider;
3
3
  export declare namespace AgentV1SettingsAgentListenProvider {
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) */
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
  }
@@ -1,3 +1,9 @@
1
1
  "use strict";
2
- // This file was auto-generated by Fern from our API Definition.
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);
@@ -35,6 +35,7 @@ export declare class MediaClient {
35
35
  * detect_entities: true,
36
36
  * detect_language: true,
37
37
  * diarize: true,
38
+ * diarize_model: "latest",
38
39
  * dictation: true,
39
40
  * encoding: "linear16",
40
41
  * filler_words: true,
@@ -91,6 +91,7 @@ class MediaClient {
91
91
  * detect_entities: true,
92
92
  * detect_language: true,
93
93
  * diarize: true,
94
+ * diarize_model: "latest",
94
95
  * dictation: true,
95
96
  * encoding: "linear16",
96
97
  * filler_words: true,
@@ -121,7 +122,7 @@ class MediaClient {
121
122
  __transcribeUrl(request, requestOptions) {
122
123
  return __awaiter(this, void 0, void 0, function* () {
123
124
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
124
- const { callback, callback_method: callbackMethod, extra, sentiment, summarize, tag, topics, custom_topic: customTopic, custom_topic_mode: customTopicMode, intents, custom_intent: customIntent, custom_intent_mode: customIntentMode, detect_entities: detectEntities, detect_language: detectLanguage, diarize, dictation, encoding, filler_words: fillerWords, keyterm, keywords, language, measurements, model, multichannel, numerals, paragraphs, profanity_filter: profanityFilter, punctuate, redact, replace, search, smart_format: smartFormat, utterances, utt_split: uttSplit, version, mip_opt_out: mipOptOut } = request, _body = __rest(request, ["callback", "callback_method", "extra", "sentiment", "summarize", "tag", "topics", "custom_topic", "custom_topic_mode", "intents", "custom_intent", "custom_intent_mode", "detect_entities", "detect_language", "diarize", "dictation", "encoding", "filler_words", "keyterm", "keywords", "language", "measurements", "model", "multichannel", "numerals", "paragraphs", "profanity_filter", "punctuate", "redact", "replace", "search", "smart_format", "utterances", "utt_split", "version", "mip_opt_out"]);
125
+ const { callback, callback_method: callbackMethod, extra, sentiment, summarize, tag, topics, custom_topic: customTopic, custom_topic_mode: customTopicMode, intents, custom_intent: customIntent, custom_intent_mode: customIntentMode, detect_entities: detectEntities, detect_language: detectLanguage, diarize, diarize_model: diarizeModel, dictation, encoding, filler_words: fillerWords, keyterm, keywords, language, measurements, model, multichannel, numerals, paragraphs, profanity_filter: profanityFilter, punctuate, redact, replace, search, smart_format: smartFormat, utterances, utt_split: uttSplit, version, mip_opt_out: mipOptOut } = request, _body = __rest(request, ["callback", "callback_method", "extra", "sentiment", "summarize", "tag", "topics", "custom_topic", "custom_topic_mode", "intents", "custom_intent", "custom_intent_mode", "detect_entities", "detect_language", "diarize", "diarize_model", "dictation", "encoding", "filler_words", "keyterm", "keywords", "language", "measurements", "model", "multichannel", "numerals", "paragraphs", "profanity_filter", "punctuate", "redact", "replace", "search", "smart_format", "utterances", "utt_split", "version", "mip_opt_out"]);
125
126
  const _queryParams = {
126
127
  callback,
127
128
  callback_method: callbackMethod != null ? callbackMethod : undefined,
@@ -138,6 +139,7 @@ class MediaClient {
138
139
  detect_entities: detectEntities,
139
140
  detect_language: detectLanguage,
140
141
  diarize,
142
+ diarize_model: diarizeModel != null ? diarizeModel : undefined,
141
143
  dictation,
142
144
  encoding: encoding != null ? encoding : undefined,
143
145
  filler_words: fillerWords,
@@ -236,6 +238,7 @@ class MediaClient {
236
238
  detect_entities: request.detect_entities,
237
239
  detect_language: request.detect_language,
238
240
  diarize: request.diarize,
241
+ diarize_model: request.diarize_model != null ? request.diarize_model : undefined,
239
242
  dictation: request.dictation,
240
243
  encoding: request.encoding != null ? request.encoding : undefined,
241
244
  filler_words: request.filler_words,