@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.
- package/dist/browser/index.global.js +74 -19
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/Client.js +6 -0
- package/dist/cjs/CustomClient.js +11 -9
- package/dist/cjs/api/resources/agent/resources/v1/resources/settings/resources/think/resources/models/client/Client.js +1 -1
- package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1ConversationText.d.ts +4 -0
- package/dist/cjs/api/resources/agent/resources/v1/types/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 +13 -0
- package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1SettingsAgentContextListenProvider.js +8 -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/v1/resources/media/client/Client.d.ts +1 -0
- package/dist/cjs/api/resources/listen/resources/v1/resources/media/client/Client.js +4 -1
- package/dist/cjs/api/resources/listen/resources/v1/resources/media/client/requests/ListenV1RequestUrl.d.ts +3 -0
- package/dist/cjs/api/resources/listen/resources/v1/resources/media/client/requests/MediaTranscribeRequestOctetStream.d.ts +2 -0
- package/dist/cjs/api/resources/listen/resources/v1/resources/media/types/MediaTranscribeRequestDiarizeModel.d.ts +6 -0
- package/dist/cjs/api/resources/listen/resources/v1/resources/media/types/MediaTranscribeRequestDiarizeModel.js +9 -0
- package/dist/cjs/api/resources/listen/resources/v1/resources/media/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/listen/resources/v1/resources/media/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/DeepgramListenProviderV1.d.ts +14 -0
- package/dist/cjs/api/types/DeepgramListenProviderV1.js +3 -0
- package/dist/cjs/api/types/DeepgramListenProviderV2.d.ts +18 -0
- package/dist/cjs/api/types/DeepgramListenProviderV2.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 +4 -1
- package/dist/cjs/api/types/index.js +4 -1
- package/dist/cjs/environments.d.ts +4 -7
- package/dist/cjs/environments.js +1 -5
- package/dist/cjs/transport.d.ts +73 -0
- package/dist/cjs/transport.js +2 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/Client.mjs +6 -0
- package/dist/esm/CustomClient.mjs +11 -9
- package/dist/esm/api/resources/agent/resources/v1/resources/settings/resources/think/resources/models/client/Client.mjs +1 -1
- package/dist/esm/api/resources/agent/resources/v1/types/AgentV1ConversationText.d.mts +4 -0
- package/dist/esm/api/resources/agent/resources/v1/types/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 +13 -0
- package/dist/esm/api/resources/agent/resources/v1/types/AgentV1SettingsAgentContextListenProvider.mjs +7 -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/v1/resources/media/client/Client.d.mts +1 -0
- package/dist/esm/api/resources/listen/resources/v1/resources/media/client/Client.mjs +4 -1
- package/dist/esm/api/resources/listen/resources/v1/resources/media/client/requests/ListenV1RequestUrl.d.mts +3 -0
- package/dist/esm/api/resources/listen/resources/v1/resources/media/client/requests/MediaTranscribeRequestOctetStream.d.mts +2 -0
- package/dist/esm/api/resources/listen/resources/v1/resources/media/types/MediaTranscribeRequestDiarizeModel.d.mts +6 -0
- package/dist/esm/api/resources/listen/resources/v1/resources/media/types/MediaTranscribeRequestDiarizeModel.mjs +6 -0
- package/dist/esm/api/resources/listen/resources/v1/resources/media/types/index.d.mts +1 -0
- package/dist/esm/api/resources/listen/resources/v1/resources/media/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/DeepgramListenProviderV1.d.mts +14 -0
- package/dist/esm/api/types/DeepgramListenProviderV1.mjs +2 -0
- package/dist/esm/api/types/DeepgramListenProviderV2.d.mts +18 -0
- package/dist/esm/api/types/DeepgramListenProviderV2.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 +4 -1
- package/dist/esm/api/types/index.mjs +4 -1
- package/dist/esm/environments.d.mts +4 -7
- package/dist/esm/environments.mjs +1 -5
- 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 +2 -1
|
@@ -17,6 +17,7 @@ import type * as Deepgram from "../../../../../../../../index.js";
|
|
|
17
17
|
* detect_entities: true,
|
|
18
18
|
* detect_language: true,
|
|
19
19
|
* diarize: true,
|
|
20
|
+
* diarize_model: "latest",
|
|
20
21
|
* dictation: true,
|
|
21
22
|
* encoding: "linear16",
|
|
22
23
|
* filler_words: true,
|
|
@@ -72,6 +73,8 @@ export interface ListenV1RequestUrl {
|
|
|
72
73
|
detect_language?: boolean;
|
|
73
74
|
/** Recognize speaker changes. Each word in the transcript will be assigned a speaker number starting at 0 */
|
|
74
75
|
diarize?: boolean;
|
|
76
|
+
/** Select and enable a specific batch diarization model version. If specifying this parameter, you should not set the deprecated `diarize=true` parameter. Not accepted on streaming requests. */
|
|
77
|
+
diarize_model?: Deepgram.listen.v1.MediaTranscribeRequestDiarizeModel;
|
|
75
78
|
/** Dictation mode for controlling formatting with dictated speech */
|
|
76
79
|
dictation?: boolean;
|
|
77
80
|
/** Specify the expected encoding of your submitted audio */
|
|
@@ -34,6 +34,8 @@ export interface MediaTranscribeRequestOctetStream {
|
|
|
34
34
|
detect_language?: boolean;
|
|
35
35
|
/** Recognize speaker changes. Each word in the transcript will be assigned a speaker number starting at 0 */
|
|
36
36
|
diarize?: boolean;
|
|
37
|
+
/** Select and enable a specific batch diarization model version. If specifying this parameter, you should not set the deprecated `diarize=true` parameter. Not accepted on streaming requests. */
|
|
38
|
+
diarize_model?: Deepgram.listen.v1.MediaTranscribeRequestDiarizeModel;
|
|
37
39
|
/** Dictation mode for controlling formatting with dictated speech */
|
|
38
40
|
dictation?: boolean;
|
|
39
41
|
/** Specify the expected encoding of your submitted audio */
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const MediaTranscribeRequestDiarizeModel: {
|
|
2
|
+
readonly Latest: "latest";
|
|
3
|
+
readonly V1: "v1";
|
|
4
|
+
readonly V2: "v2";
|
|
5
|
+
};
|
|
6
|
+
export type MediaTranscribeRequestDiarizeModel = (typeof MediaTranscribeRequestDiarizeModel)[keyof typeof MediaTranscribeRequestDiarizeModel] | string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.MediaTranscribeRequestDiarizeModel = void 0;
|
|
5
|
+
exports.MediaTranscribeRequestDiarizeModel = {
|
|
6
|
+
Latest: "latest",
|
|
7
|
+
V1: "v1",
|
|
8
|
+
V2: "v2",
|
|
9
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from "./MediaTranscribeRequestCallbackMethod.js";
|
|
2
2
|
export * from "./MediaTranscribeRequestCustomIntentMode.js";
|
|
3
3
|
export * from "./MediaTranscribeRequestCustomTopicMode.js";
|
|
4
|
+
export * from "./MediaTranscribeRequestDiarizeModel.js";
|
|
4
5
|
export * from "./MediaTranscribeRequestEncoding.js";
|
|
5
6
|
export * from "./MediaTranscribeRequestModel.js";
|
|
6
7
|
export * from "./MediaTranscribeRequestSummarize.js";
|
|
@@ -17,6 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./MediaTranscribeRequestCallbackMethod.js"), exports);
|
|
18
18
|
__exportStar(require("./MediaTranscribeRequestCustomIntentMode.js"), exports);
|
|
19
19
|
__exportStar(require("./MediaTranscribeRequestCustomTopicMode.js"), exports);
|
|
20
|
+
__exportStar(require("./MediaTranscribeRequestDiarizeModel.js"), exports);
|
|
20
21
|
__exportStar(require("./MediaTranscribeRequestEncoding.js"), exports);
|
|
21
22
|
__exportStar(require("./MediaTranscribeRequestModel.js"), exports);
|
|
22
23
|
__exportStar(require("./MediaTranscribeRequestSummarize.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
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface DeepgramListenProviderV1 {
|
|
2
|
+
/** Provider type for speech-to-text */
|
|
3
|
+
type: "deepgram";
|
|
4
|
+
/** Specifies usage of the V1 Deepgram speech-to-text API */
|
|
5
|
+
version?: "v1" | undefined;
|
|
6
|
+
/** Model to use for speech to text using the V1 API (e.g. Nova-3, Nova-2) */
|
|
7
|
+
model?: string | undefined;
|
|
8
|
+
/** Language code to use for speech-to-text. Can be a BCP-47 language tag (e.g. `en`), or `multi` for code-switching transcription */
|
|
9
|
+
language?: string | undefined;
|
|
10
|
+
/** Prompt keyterm recognition to improve Keyword Recall Rate */
|
|
11
|
+
keyterms?: string[] | undefined;
|
|
12
|
+
/** Applies smart formatting to improve transcript readability */
|
|
13
|
+
smart_format?: boolean | undefined;
|
|
14
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface DeepgramListenProviderV2 {
|
|
2
|
+
/** Provider type for speech-to-text */
|
|
3
|
+
type: "deepgram";
|
|
4
|
+
/** Specifies usage of the V2 Deepgram speech-to-text API (e.g. Flux) */
|
|
5
|
+
version?: "v2" | undefined;
|
|
6
|
+
/** Model to use for speech to text using the V2 API (e.g. flux-general-en, flux-general-multi) */
|
|
7
|
+
model: string;
|
|
8
|
+
/** 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. */
|
|
9
|
+
language_hint?: DeepgramListenProviderV2.LanguageHint | undefined;
|
|
10
|
+
/** Prompt keyterm recognition to improve Keyword Recall Rate */
|
|
11
|
+
keyterms?: string[] | undefined;
|
|
12
|
+
}
|
|
13
|
+
export declare namespace DeepgramListenProviderV2 {
|
|
14
|
+
/**
|
|
15
|
+
* 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.
|
|
16
|
+
*/
|
|
17
|
+
type LanguageHint = string | string[];
|
|
18
|
+
}
|
|
@@ -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[];
|
|
@@ -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,11 +7,13 @@ 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 "./
|
|
10
|
+
export * from "./CreateKeyV1Request.js";
|
|
11
11
|
export * from "./CreateKeyV1Response.js";
|
|
12
12
|
export * from "./CreateProjectDistributionCredentialsV1Response.js";
|
|
13
13
|
export * from "./CreateProjectInviteV1Response.js";
|
|
14
14
|
export * from "./Deepgram.js";
|
|
15
|
+
export * from "./DeepgramListenProviderV1.js";
|
|
16
|
+
export * from "./DeepgramListenProviderV2.js";
|
|
15
17
|
export * from "./DeleteAgentConfigurationV1Response.js";
|
|
16
18
|
export * from "./DeleteAgentVariableV1Response.js";
|
|
17
19
|
export * from "./DeleteProjectInviteV1Response.js";
|
|
@@ -79,6 +81,7 @@ export * from "./ListenV2Encoding.js";
|
|
|
79
81
|
export * from "./ListenV2EotThreshold.js";
|
|
80
82
|
export * from "./ListenV2EotTimeoutMs.js";
|
|
81
83
|
export * from "./ListenV2Keyterm.js";
|
|
84
|
+
export * from "./ListenV2LanguageHint.js";
|
|
82
85
|
export * from "./ListenV2MipOptOut.js";
|
|
83
86
|
export * from "./ListenV2Model.js";
|
|
84
87
|
export * from "./ListenV2SampleRate.js";
|
|
@@ -23,11 +23,13 @@ __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("./
|
|
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);
|
|
30
30
|
__exportStar(require("./Deepgram.js"), exports);
|
|
31
|
+
__exportStar(require("./DeepgramListenProviderV1.js"), exports);
|
|
32
|
+
__exportStar(require("./DeepgramListenProviderV2.js"), exports);
|
|
31
33
|
__exportStar(require("./DeleteAgentConfigurationV1Response.js"), exports);
|
|
32
34
|
__exportStar(require("./DeleteAgentVariableV1Response.js"), exports);
|
|
33
35
|
__exportStar(require("./DeleteProjectInviteV1Response.js"), exports);
|
|
@@ -95,6 +97,7 @@ __exportStar(require("./ListenV2Encoding.js"), exports);
|
|
|
95
97
|
__exportStar(require("./ListenV2EotThreshold.js"), exports);
|
|
96
98
|
__exportStar(require("./ListenV2EotTimeoutMs.js"), exports);
|
|
97
99
|
__exportStar(require("./ListenV2Keyterm.js"), exports);
|
|
100
|
+
__exportStar(require("./ListenV2LanguageHint.js"), exports);
|
|
98
101
|
__exportStar(require("./ListenV2MipOptOut.js"), exports);
|
|
99
102
|
__exportStar(require("./ListenV2Model.js"), exports);
|
|
100
103
|
__exportStar(require("./ListenV2SampleRate.js"), exports);
|
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
export interface DeepgramEnvironmentUrls {
|
|
2
2
|
base: string;
|
|
3
|
-
agent: string;
|
|
4
3
|
production: string;
|
|
4
|
+
agent: string;
|
|
5
|
+
agentRest: string;
|
|
5
6
|
}
|
|
6
7
|
export declare const DeepgramEnvironment: {
|
|
7
8
|
readonly Production: {
|
|
8
9
|
readonly base: "https://api.deepgram.com";
|
|
9
|
-
readonly agent: "wss://agent.deepgram.com";
|
|
10
10
|
readonly production: "wss://api.deepgram.com";
|
|
11
|
-
};
|
|
12
|
-
readonly Agent: {
|
|
13
|
-
readonly base: "https://agent.deepgram.com";
|
|
14
11
|
readonly agent: "wss://agent.deepgram.com";
|
|
15
|
-
readonly
|
|
12
|
+
readonly agentRest: "https://agent.deepgram.com";
|
|
16
13
|
};
|
|
17
14
|
};
|
|
18
|
-
export type DeepgramEnvironment = typeof DeepgramEnvironment.Production
|
|
15
|
+
export type DeepgramEnvironment = typeof DeepgramEnvironment.Production;
|
package/dist/cjs/environments.js
CHANGED
|
@@ -5,12 +5,8 @@ exports.DeepgramEnvironment = void 0;
|
|
|
5
5
|
exports.DeepgramEnvironment = {
|
|
6
6
|
Production: {
|
|
7
7
|
base: "https://api.deepgram.com",
|
|
8
|
-
agent: "wss://agent.deepgram.com",
|
|
9
8
|
production: "wss://api.deepgram.com",
|
|
10
|
-
},
|
|
11
|
-
Agent: {
|
|
12
|
-
base: "https://agent.deepgram.com",
|
|
13
9
|
agent: "wss://agent.deepgram.com",
|
|
14
|
-
|
|
10
|
+
agentRest: "https://agent.deepgram.com",
|
|
15
11
|
},
|
|
16
12
|
};
|
|
@@ -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>;
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "5.
|
|
1
|
+
export declare const SDK_VERSION = "5.2.1";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/BaseClient.mjs
CHANGED
|
@@ -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.
|
|
10
|
-
"User-Agent": "@deepgram/sdk/5.
|
|
9
|
+
"X-Fern-SDK-Version": "5.2.1",
|
|
10
|
+
"User-Agent": "@deepgram/sdk/5.2.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);
|
package/dist/esm/Client.mjs
CHANGED
|
@@ -69,6 +69,12 @@ export class DeepgramClient {
|
|
|
69
69
|
return __awaiter(this, void 0, void 0, function* () {
|
|
70
70
|
var _a;
|
|
71
71
|
return core.makePassthroughRequest(input, init, {
|
|
72
|
+
// Patch: the 2026-05-14 regen switched this default from `base`
|
|
73
|
+
// (api.deepgram.com) to `agentRest` (agent.deepgram.com) after
|
|
74
|
+
// the new agentRest slot was introduced upstream. The passthrough
|
|
75
|
+
// helper is documented as the catch-all for endpoints not yet
|
|
76
|
+
// supported in the SDK — it should default to the canonical
|
|
77
|
+
// Deepgram REST host, not the agent host. Restoring `base`.
|
|
72
78
|
baseUrl: (_a = this._options.baseUrl) !== null && _a !== void 0 ? _a : (() => __awaiter(this, void 0, void 0, function* () {
|
|
73
79
|
var _a;
|
|
74
80
|
const env = yield core.Supplier.get(this._options.environment);
|
|
@@ -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 ") &&
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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();
|
|
@@ -37,7 +37,7 @@ export class ModelsClient {
|
|
|
37
37
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
38
38
|
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
39
39
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
40
|
-
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).
|
|
40
|
+
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"),
|
|
41
41
|
method: "GET",
|
|
42
42
|
headers: _headers,
|
|
43
43
|
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 */
|