@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.
Files changed (71) hide show
  1. package/dist/browser/index.global.js +49 -10
  2. package/dist/cjs/BaseClient.js +2 -2
  3. package/dist/cjs/CustomClient.js +11 -9
  4. package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1ConversationText.d.ts +4 -0
  5. package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1InjectAgentMessage.d.ts +20 -0
  6. package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1InjectAgentMessage.js +14 -0
  7. package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1Settings.d.ts +22 -3
  8. package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1Settings.js +10 -0
  9. package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1SettingsAgentContextListenProvider.d.ts +34 -0
  10. package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1SettingsAgentContextListenProvider.js +3 -0
  11. package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1SettingsAgentListenProvider.d.ts +3 -23
  12. package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1SettingsAgentListenProvider.js +7 -1
  13. package/dist/cjs/api/resources/agent/resources/v1/types/index.d.ts +1 -0
  14. package/dist/cjs/api/resources/agent/resources/v1/types/index.js +1 -0
  15. package/dist/cjs/api/resources/listen/resources/v2/client/Client.d.ts +1 -0
  16. package/dist/cjs/api/resources/listen/resources/v2/client/Client.js +15 -2
  17. package/dist/cjs/api/resources/listen/resources/v2/types/ListenV2ConfigureSuccess.d.ts +2 -0
  18. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/keys/client/Client.d.ts +2 -2
  19. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/keys/client/Client.js +1 -1
  20. package/dist/cjs/api/resources/speak/resources/v1/types/SpeakV1Metadata.d.ts +4 -2
  21. package/dist/cjs/api/types/CreateKeyV1Request.d.ts +2 -0
  22. package/dist/cjs/api/types/CreateKeyV1Request.js +3 -0
  23. package/dist/cjs/api/types/Groq.d.ts +13 -0
  24. package/dist/cjs/api/types/Groq.js +12 -0
  25. package/dist/cjs/api/types/ListProjectMembersV1Response.d.ts +4 -0
  26. package/dist/cjs/api/types/ListenV2LanguageHint.d.ts +7 -0
  27. package/dist/cjs/api/types/ListenV2LanguageHint.js +3 -0
  28. package/dist/cjs/api/types/OpenAiThinkProvider.d.ts +11 -0
  29. package/dist/cjs/api/types/OpenAiThinkProvider.js +8 -0
  30. package/dist/cjs/api/types/index.d.ts +2 -1
  31. package/dist/cjs/api/types/index.js +2 -1
  32. package/dist/cjs/transport.d.ts +73 -0
  33. package/dist/cjs/transport.js +2 -0
  34. package/dist/cjs/version.d.ts +1 -1
  35. package/dist/cjs/version.js +1 -1
  36. package/dist/esm/BaseClient.mjs +2 -2
  37. package/dist/esm/CustomClient.mjs +11 -9
  38. package/dist/esm/api/resources/agent/resources/v1/types/AgentV1ConversationText.d.mts +4 -0
  39. package/dist/esm/api/resources/agent/resources/v1/types/AgentV1InjectAgentMessage.d.mts +20 -0
  40. package/dist/esm/api/resources/agent/resources/v1/types/AgentV1InjectAgentMessage.mjs +13 -1
  41. package/dist/esm/api/resources/agent/resources/v1/types/AgentV1Settings.d.mts +22 -3
  42. package/dist/esm/api/resources/agent/resources/v1/types/AgentV1Settings.mjs +10 -0
  43. package/dist/esm/api/resources/agent/resources/v1/types/AgentV1SettingsAgentContextListenProvider.d.mts +34 -0
  44. package/dist/esm/api/resources/agent/resources/v1/types/AgentV1SettingsAgentContextListenProvider.mjs +2 -0
  45. package/dist/esm/api/resources/agent/resources/v1/types/AgentV1SettingsAgentListenProvider.d.mts +3 -23
  46. package/dist/esm/api/resources/agent/resources/v1/types/AgentV1SettingsAgentListenProvider.mjs +7 -1
  47. package/dist/esm/api/resources/agent/resources/v1/types/index.d.mts +1 -0
  48. package/dist/esm/api/resources/agent/resources/v1/types/index.mjs +1 -0
  49. package/dist/esm/api/resources/listen/resources/v2/client/Client.d.mts +1 -0
  50. package/dist/esm/api/resources/listen/resources/v2/client/Client.mjs +15 -2
  51. package/dist/esm/api/resources/listen/resources/v2/types/ListenV2ConfigureSuccess.d.mts +2 -0
  52. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/keys/client/Client.d.mts +2 -2
  53. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/keys/client/Client.mjs +1 -1
  54. package/dist/esm/api/resources/speak/resources/v1/types/SpeakV1Metadata.d.mts +4 -2
  55. package/dist/esm/api/types/CreateKeyV1Request.d.mts +2 -0
  56. package/dist/esm/api/types/CreateKeyV1Request.mjs +2 -0
  57. package/dist/esm/api/types/Groq.d.mts +13 -0
  58. package/dist/esm/api/types/Groq.mjs +11 -1
  59. package/dist/esm/api/types/ListProjectMembersV1Response.d.mts +4 -0
  60. package/dist/esm/api/types/ListenV2LanguageHint.d.mts +7 -0
  61. package/dist/esm/api/types/ListenV2LanguageHint.mjs +2 -0
  62. package/dist/esm/api/types/OpenAiThinkProvider.d.mts +11 -0
  63. package/dist/esm/api/types/OpenAiThinkProvider.mjs +8 -0
  64. package/dist/esm/api/types/index.d.mts +2 -1
  65. package/dist/esm/api/types/index.mjs +2 -1
  66. package/dist/esm/transport.d.mts +73 -0
  67. package/dist/esm/transport.mjs +1 -0
  68. package/dist/esm/version.d.mts +1 -1
  69. package/dist/esm/version.mjs +1 -1
  70. package/package.json +10 -10
  71. package/reference.md +1 -1
@@ -6,6 +6,8 @@ export interface OpenAiThinkProvider {
6
6
  model: OpenAiThinkProvider.Model;
7
7
  /** OpenAI temperature (0-2) */
8
8
  temperature?: number | undefined;
9
+ /** OpenAI reasoning_effort */
10
+ reasoning_mode?: OpenAiThinkProvider.ReasoningMode | undefined;
9
11
  }
10
12
  export declare namespace OpenAiThinkProvider {
11
13
  /** OpenAI model to use */
@@ -20,4 +22,13 @@ export declare namespace OpenAiThinkProvider {
20
22
  readonly Gpt4OMini: "gpt-4o-mini";
21
23
  };
22
24
  type Model = (typeof Model)[keyof typeof Model] | string;
25
+ /** OpenAI reasoning_effort */
26
+ const ReasoningMode: {
27
+ readonly None: "none";
28
+ readonly Minimal: "minimal";
29
+ readonly Low: "low";
30
+ readonly Medium: "medium";
31
+ readonly High: "high";
32
+ };
33
+ type ReasoningMode = (typeof ReasoningMode)[keyof typeof ReasoningMode] | string;
23
34
  }
@@ -15,4 +15,12 @@ var OpenAiThinkProvider;
15
15
  Gpt4O: "gpt-4o",
16
16
  Gpt4OMini: "gpt-4o-mini",
17
17
  };
18
+ /** OpenAI reasoning_effort */
19
+ OpenAiThinkProvider.ReasoningMode = {
20
+ None: "none",
21
+ Minimal: "minimal",
22
+ Low: "low",
23
+ Medium: "medium",
24
+ High: "high",
25
+ };
18
26
  })(OpenAiThinkProvider || (exports.OpenAiThinkProvider = OpenAiThinkProvider = {}));
@@ -7,7 +7,7 @@ export * from "./AwsPollySpeakProvider.js";
7
7
  export * from "./BillingBreakdownV1Response.js";
8
8
  export * from "./Cartesia.js";
9
9
  export * from "./CreateAgentConfigurationV1Response.js";
10
- export * from "./CreateKeyV1RequestOne.js";
10
+ export * from "./CreateKeyV1Request.js";
11
11
  export * from "./CreateKeyV1Response.js";
12
12
  export * from "./CreateProjectDistributionCredentialsV1Response.js";
13
13
  export * from "./CreateProjectInviteV1Response.js";
@@ -79,6 +79,7 @@ export * from "./ListenV2Encoding.js";
79
79
  export * from "./ListenV2EotThreshold.js";
80
80
  export * from "./ListenV2EotTimeoutMs.js";
81
81
  export * from "./ListenV2Keyterm.js";
82
+ export * from "./ListenV2LanguageHint.js";
82
83
  export * from "./ListenV2MipOptOut.js";
83
84
  export * from "./ListenV2Model.js";
84
85
  export * from "./ListenV2SampleRate.js";
@@ -23,7 +23,7 @@ __exportStar(require("./AwsPollySpeakProvider.js"), exports);
23
23
  __exportStar(require("./BillingBreakdownV1Response.js"), exports);
24
24
  __exportStar(require("./Cartesia.js"), exports);
25
25
  __exportStar(require("./CreateAgentConfigurationV1Response.js"), exports);
26
- __exportStar(require("./CreateKeyV1RequestOne.js"), exports);
26
+ __exportStar(require("./CreateKeyV1Request.js"), exports);
27
27
  __exportStar(require("./CreateKeyV1Response.js"), exports);
28
28
  __exportStar(require("./CreateProjectDistributionCredentialsV1Response.js"), exports);
29
29
  __exportStar(require("./CreateProjectInviteV1Response.js"), exports);
@@ -95,6 +95,7 @@ __exportStar(require("./ListenV2Encoding.js"), exports);
95
95
  __exportStar(require("./ListenV2EotThreshold.js"), exports);
96
96
  __exportStar(require("./ListenV2EotTimeoutMs.js"), exports);
97
97
  __exportStar(require("./ListenV2Keyterm.js"), exports);
98
+ __exportStar(require("./ListenV2LanguageHint.js"), exports);
98
99
  __exportStar(require("./ListenV2MipOptOut.js"), exports);
99
100
  __exportStar(require("./ListenV2Model.js"), exports);
100
101
  __exportStar(require("./ListenV2SampleRate.js"), exports);
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Message payloads exchanged over Deepgram streaming transports.
3
+ *
4
+ * A transport can carry JSON control messages as strings and audio or synthesized
5
+ * audio as binary payloads.
6
+ */
7
+ export type DeepgramTransportMessage = string | ArrayBuffer | Blob | ArrayBufferView;
8
+ /** Close metadata reported by a custom transport. */
9
+ export interface DeepgramTransportCloseEvent {
10
+ code?: number;
11
+ reason?: string;
12
+ }
13
+ /**
14
+ * Metadata passed to a transport factory when a streaming connection is created.
15
+ *
16
+ * The first two factory arguments intentionally match the Python and Java SDKs:
17
+ * `factory(url, headers)`. JavaScript also passes this third metadata object so
18
+ * custom transports can inspect the target streaming API and connection settings.
19
+ */
20
+ export interface DeepgramTransportRequest {
21
+ /** Full Deepgram websocket URL including query parameters. */
22
+ url: string;
23
+ /** Resolved request headers including auth and session headers. */
24
+ headers: Record<string, string>;
25
+ /** Requested websocket subprotocols, if any. */
26
+ protocols: string[];
27
+ /** Deepgram websocket path (for example `/v1/listen`). */
28
+ path: string;
29
+ /** Streaming API being targeted. */
30
+ service: "agent.v1" | "listen.v1" | "listen.v2" | "speak.v1";
31
+ /** Query parameters before they are encoded into the URL. */
32
+ queryParams: Record<string, unknown>;
33
+ /** Whether debug logging was requested for the connection. */
34
+ debug: boolean;
35
+ /** Requested reconnect attempts for this connection. */
36
+ reconnectAttempts: number;
37
+ /** Optional connection timeout in seconds. */
38
+ connectionTimeoutInSeconds?: number;
39
+ /** Optional abort signal for the connection attempt. */
40
+ abortSignal?: AbortSignal;
41
+ }
42
+ /**
43
+ * Transport interface for replacing the SDK's default websocket transport.
44
+ *
45
+ * This is the seam used by SageMaker support and other non-websocket streaming
46
+ * implementations. The SDK adapts this transport to its existing socket APIs, so
47
+ * callers still use `client.listen.v1.createConnection()` and related methods.
48
+ */
49
+ export interface DeepgramTransport {
50
+ /** Send either a JSON string or binary payload to the transport. */
51
+ send(data: DeepgramTransportMessage): void | Promise<void>;
52
+ /** Register a listener fired once the transport is ready to exchange messages. */
53
+ onOpen(listener: () => void): void;
54
+ /** Register a listener for inbound text or binary messages. */
55
+ onMessage(listener: (message: DeepgramTransportMessage) => void): void;
56
+ /** Register a listener for transport-level errors. */
57
+ onError(listener: (error: Error) => void): void;
58
+ /** Register a listener for transport close events. */
59
+ onClose(listener: (event: DeepgramTransportCloseEvent) => void): void;
60
+ /** Returns true while the transport is open and able to send data. */
61
+ isOpen(): boolean;
62
+ /** Close the transport gracefully. */
63
+ close(code?: number, reason?: string): void | Promise<void>;
64
+ /** Optional ping hook for transports that expose an explicit keepalive primitive. */
65
+ ping?(data?: string | ArrayBuffer | Blob | ArrayBufferView): void | Promise<void>;
66
+ }
67
+ /**
68
+ * Factory for creating custom streaming transports.
69
+ *
70
+ * The first two arguments mirror the Python and Java SDKs. JavaScript also passes
71
+ * a third metadata argument for transports that need more connection context.
72
+ */
73
+ export type DeepgramTransportFactory = (url: string, headers: Record<string, string>, request: DeepgramTransportRequest) => DeepgramTransport | Promise<DeepgramTransport>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "5.0.1";
1
+ export declare const SDK_VERSION = "5.1.1";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "5.0.1";
4
+ exports.SDK_VERSION = "5.1.1";
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
6
6
  const headers = mergeHeaders({
7
7
  "X-Fern-Language": "JavaScript",
8
8
  "X-Fern-SDK-Name": "@deepgram/sdk",
9
- "X-Fern-SDK-Version": "5.0.1",
10
- "User-Agent": "@deepgram/sdk/5.0.1",
9
+ "X-Fern-SDK-Version": "5.1.1",
10
+ "User-Agent": "@deepgram/sdk/5.1.1",
11
11
  "X-Fern-Runtime": core.RUNTIME.type,
12
12
  "X-Fern-Runtime-Version": core.RUNTIME.version,
13
13
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -114,7 +114,9 @@ class ApiKeyAuthProviderWrapper {
114
114
  // If the header doesn't already have a scheme prefix, add "Token " prefix for API keys
115
115
  if (authHeader && typeof authHeader === "string") {
116
116
  // Only add prefix if it doesn't already have Bearer or Token prefix
117
- if (!authHeader.startsWith("Bearer ") && !authHeader.startsWith("Token ") && !authHeader.startsWith("token ")) {
117
+ if (!authHeader.startsWith("Bearer ") &&
118
+ !authHeader.startsWith("Token ") &&
119
+ !authHeader.startsWith("token ")) {
118
120
  return {
119
121
  headers: Object.assign(Object.assign({}, authRequest.headers), { Authorization: `Token ${authHeader}` }),
120
122
  };
@@ -472,7 +474,7 @@ class WrappedAgentV1Client extends AgentV1Client {
472
474
  const socket = yield createWebSocketConnection({
473
475
  options: this._options,
474
476
  urlPath: "/v1/agent/converse",
475
- environmentKey: 'agent',
477
+ environmentKey: "agent",
476
478
  queryParams: buildQueryParams(args),
477
479
  headers,
478
480
  debug,
@@ -525,7 +527,7 @@ class WrappedAgentV1Socket extends AgentV1Socket {
525
527
  handleOpen: socketAny.handleOpen,
526
528
  handleMessage: socketAny.handleMessage,
527
529
  handleClose: socketAny.handleClose,
528
- handleError: socketAny.handleError
530
+ handleError: socketAny.handleError,
529
531
  });
530
532
  resetSocketConnectionState(this.socket);
531
533
  super.connect();
@@ -549,7 +551,7 @@ class WrappedListenV1Client extends ListenV1Client {
549
551
  const socket = yield createWebSocketConnection({
550
552
  options: this._options,
551
553
  urlPath: "/v1/listen",
552
- environmentKey: 'production',
554
+ environmentKey: "production",
553
555
  queryParams: buildQueryParams(args),
554
556
  headers,
555
557
  debug,
@@ -602,7 +604,7 @@ class WrappedListenV1Socket extends ListenV1Socket {
602
604
  handleOpen: socketAny.handleOpen,
603
605
  handleMessage: socketAny.handleMessage,
604
606
  handleClose: socketAny.handleClose,
605
- handleError: socketAny.handleError
607
+ handleError: socketAny.handleError,
606
608
  });
607
609
  resetSocketConnectionState(this.socket);
608
610
  super.connect();
@@ -625,7 +627,7 @@ class WrappedListenV2Client extends ListenV2Client {
625
627
  const socket = yield createWebSocketConnection({
626
628
  options: this._options,
627
629
  urlPath: "/v2/listen",
628
- environmentKey: 'production',
630
+ environmentKey: "production",
629
631
  queryParams: buildQueryParams(args),
630
632
  headers,
631
633
  debug,
@@ -679,7 +681,7 @@ class WrappedListenV2Socket extends ListenV2Socket {
679
681
  handleOpen: socketAny.handleOpen,
680
682
  handleMessage: socketAny.handleMessage,
681
683
  handleClose: socketAny.handleClose,
682
- handleError: socketAny.handleError
684
+ handleError: socketAny.handleError,
683
685
  });
684
686
  resetSocketConnectionState(this.socket);
685
687
  super.connect();
@@ -732,7 +734,7 @@ class WrappedSpeakV1Client extends SpeakV1Client {
732
734
  const socket = yield createWebSocketConnection({
733
735
  options: this._options,
734
736
  urlPath: "/v1/speak",
735
- environmentKey: 'production',
737
+ environmentKey: "production",
736
738
  queryParams: buildQueryParams(args),
737
739
  headers,
738
740
  debug,
@@ -792,7 +794,7 @@ class WrappedSpeakV1Socket extends SpeakV1Socket {
792
794
  handleOpen: socketAny.handleOpen,
793
795
  handleMessage: socketAny.handleMessage,
794
796
  handleClose: socketAny.handleClose,
795
- handleError: socketAny.handleError
797
+ handleError: socketAny.handleError,
796
798
  });
797
799
  resetSocketConnectionState(this.socket);
798
800
  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,2 +1,14 @@
1
1
  // This file was auto-generated by Fern from our API Definition.
2
- export {};
2
+ export var AgentV1InjectAgentMessage;
3
+ (function (AgentV1InjectAgentMessage) {
4
+ /**
5
+ * Controls how the injection interacts with any in-progress user or agent turn.
6
+ *
7
+ * * `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`.
8
+ * * `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.
9
+ */
10
+ AgentV1InjectAgentMessage.Behavior = {
11
+ Default: "default",
12
+ Queue: "queue",
13
+ };
14
+ })(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
  }
@@ -27,6 +27,16 @@ export var AgentV1Settings;
27
27
  Linear16: "linear16",
28
28
  Mulaw: "mulaw",
29
29
  Alaw: "alaw",
30
+ Mp3: "mp3",
31
+ Opus: "opus",
32
+ Flac: "flac",
33
+ Aac: "aac",
34
+ };
35
+ /** Audio container format. */
36
+ Output.Container = {
37
+ None: "none",
38
+ Wav: "wav",
39
+ Ogg: "ogg",
30
40
  };
31
41
  })(Output = Audio.Output || (Audio.Output = {}));
32
42
  })(Audio = AgentV1Settings.Audio || (AgentV1Settings.Audio = {}));
@@ -0,0 +1,34 @@
1
+ import type * as Deepgram from "../../../../../index.mjs";
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
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -1,26 +1,6 @@
1
1
  import type * as Deepgram from "../../../../../index.mjs";
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,2 +1,8 @@
1
- // This file was auto-generated by Fern from our API Definition.
1
+ // Backward-compat alias for the type renamed by the 2026-05-06 regen to
2
+ // `AgentV1SettingsAgentContextListenProvider`. The new V2 only adds an optional
3
+ // `language_hint` field, so this alias is purely additive: every literal that
4
+ // satisfied the old V2 still satisfies the new V2, and pinned-name callers
5
+ // (`const p: AgentV1SettingsAgentListenProvider = ...`) keep compiling without
6
+ // a cast. See AGENTS.md for the patch rationale; regression coverage in
7
+ // tests/unit/compat-aliases.test.ts.
2
8
  export {};
@@ -13,6 +13,7 @@ export * from "./AgentV1PromptUpdated.mjs";
13
13
  export * from "./AgentV1ReceiveFunctionCallResponse.mjs";
14
14
  export * from "./AgentV1SendFunctionCallResponse.mjs";
15
15
  export * from "./AgentV1Settings.mjs";
16
+ export * from "./AgentV1SettingsAgentContextListenProvider.mjs";
16
17
  export * from "./AgentV1SettingsAgentListenProvider.mjs";
17
18
  export * from "./AgentV1SettingsApplied.mjs";
18
19
  export * from "./AgentV1SpeakUpdated.mjs";
@@ -13,6 +13,7 @@ export * from "./AgentV1PromptUpdated.mjs";
13
13
  export * from "./AgentV1ReceiveFunctionCallResponse.mjs";
14
14
  export * from "./AgentV1SendFunctionCallResponse.mjs";
15
15
  export * from "./AgentV1Settings.mjs";
16
+ export * from "./AgentV1SettingsAgentContextListenProvider.mjs";
16
17
  export * from "./AgentV1SettingsAgentListenProvider.mjs";
17
18
  export * from "./AgentV1SettingsApplied.mjs";
18
19
  export * from "./AgentV1SpeakUpdated.mjs";
@@ -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;
@@ -21,7 +21,7 @@ export class V2Client {
21
21
  connect(args) {
22
22
  return __awaiter(this, void 0, void 0, function* () {
23
23
  var _a, _b, _c;
24
- 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;
24
+ 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;
25
25
  const _queryParams = {
26
26
  model,
27
27
  encoding: encoding != null ? encoding : undefined,
@@ -41,7 +41,20 @@ export class V2Client {
41
41
  ? eotTimeoutMs
42
42
  : toJson(eotTimeoutMs)
43
43
  : undefined,
44
- keyterm: keyterm != null ? (typeof keyterm === "string" ? keyterm : toJson(keyterm)) : undefined,
44
+ keyterm: Array.isArray(keyterm)
45
+ ? keyterm.map((item) => (typeof item === "string" ? item : toJson(item)))
46
+ : keyterm != null
47
+ ? typeof keyterm === "string"
48
+ ? keyterm
49
+ : toJson(keyterm)
50
+ : undefined,
51
+ language_hint: Array.isArray(languageHint)
52
+ ? languageHint.map((item) => (typeof item === "string" ? item : toJson(item)))
53
+ : languageHint != null
54
+ ? typeof languageHint === "string"
55
+ ? languageHint
56
+ : toJson(languageHint)
57
+ : undefined,
45
58
  mip_opt_out: mipOptOut != null ? (typeof mipOptOut === "string" ? mipOptOut : toJson(mipOptOut)) : undefined,
46
59
  tag: tag != null ? (typeof tag === "string" ? tag : toJson(tag)) : undefined,
47
60
  };
@@ -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.CreateKeyV1RequestOne} request
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.CreateKeyV1RequestOne, requestOptions?: KeysClient.RequestOptions): core.HttpResponsePromise<Deepgram.CreateKeyV1Response>;
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
@@ -82,7 +82,7 @@ export class KeysClient {
82
82
  * Creates a new API key with specified settings for the project
83
83
  *
84
84
  * @param {string} project_id - The unique identifier of the project
85
- * @param {Deepgram.CreateKeyV1RequestOne} request
85
+ * @param {Deepgram.CreateKeyV1Request} [request]
86
86
  * @param {KeysClient.RequestOptions} requestOptions - Request-specific configuration.
87
87
  *
88
88
  * @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
  }
@@ -0,0 +1,2 @@
1
+ export type CreateKeyV1Request = unknown;
2
+ export type CreateKeyV1RequestOne = CreateKeyV1Request;
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -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,2 +1,12 @@
1
1
  // This file was auto-generated by Fern from our API Definition.
2
- export {};
2
+ export var Groq;
3
+ (function (Groq) {
4
+ /** OpenAI reasoning_effort */
5
+ Groq.ReasoningMode = {
6
+ None: "none",
7
+ Minimal: "minimal",
8
+ Low: "low",
9
+ Medium: "medium",
10
+ High: "high",
11
+ };
12
+ })(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[];