@deepgram/sdk 5.1.0 → 5.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/index.global.js +49 -10
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/CustomClient.js +11 -9
- package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1ConversationText.d.ts +4 -0
- package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1InjectAgentMessage.d.ts +20 -0
- package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1InjectAgentMessage.js +14 -0
- package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1Settings.d.ts +22 -3
- package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1Settings.js +10 -0
- package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1SettingsAgentContextListenProvider.d.ts +34 -0
- package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1SettingsAgentContextListenProvider.js +3 -0
- package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1SettingsAgentListenProvider.d.ts +3 -23
- package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1SettingsAgentListenProvider.js +7 -1
- package/dist/cjs/api/resources/agent/resources/v1/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/agent/resources/v1/types/index.js +1 -0
- package/dist/cjs/api/resources/listen/resources/v2/client/Client.d.ts +1 -0
- package/dist/cjs/api/resources/listen/resources/v2/client/Client.js +15 -2
- package/dist/cjs/api/resources/listen/resources/v2/types/ListenV2ConfigureSuccess.d.ts +2 -0
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/keys/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/keys/client/Client.js +1 -1
- package/dist/cjs/api/resources/speak/resources/v1/types/SpeakV1Metadata.d.ts +4 -2
- package/dist/cjs/api/types/CreateKeyV1Request.d.ts +2 -0
- package/dist/cjs/api/types/CreateKeyV1Request.js +3 -0
- package/dist/cjs/api/types/Groq.d.ts +13 -0
- package/dist/cjs/api/types/Groq.js +12 -0
- package/dist/cjs/api/types/ListProjectMembersV1Response.d.ts +4 -0
- package/dist/cjs/api/types/ListenV2LanguageHint.d.ts +7 -0
- package/dist/cjs/api/types/ListenV2LanguageHint.js +3 -0
- package/dist/cjs/api/types/OpenAiThinkProvider.d.ts +11 -0
- package/dist/cjs/api/types/OpenAiThinkProvider.js +8 -0
- package/dist/cjs/api/types/index.d.ts +2 -1
- package/dist/cjs/api/types/index.js +2 -1
- package/dist/cjs/transport.d.ts +73 -0
- package/dist/cjs/transport.js +2 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/CustomClient.mjs +11 -9
- package/dist/esm/api/resources/agent/resources/v1/types/AgentV1ConversationText.d.mts +4 -0
- package/dist/esm/api/resources/agent/resources/v1/types/AgentV1InjectAgentMessage.d.mts +20 -0
- package/dist/esm/api/resources/agent/resources/v1/types/AgentV1InjectAgentMessage.mjs +13 -1
- package/dist/esm/api/resources/agent/resources/v1/types/AgentV1Settings.d.mts +22 -3
- package/dist/esm/api/resources/agent/resources/v1/types/AgentV1Settings.mjs +10 -0
- package/dist/esm/api/resources/agent/resources/v1/types/AgentV1SettingsAgentContextListenProvider.d.mts +34 -0
- package/dist/esm/api/resources/agent/resources/v1/types/AgentV1SettingsAgentContextListenProvider.mjs +2 -0
- package/dist/esm/api/resources/agent/resources/v1/types/AgentV1SettingsAgentListenProvider.d.mts +3 -23
- package/dist/esm/api/resources/agent/resources/v1/types/AgentV1SettingsAgentListenProvider.mjs +7 -1
- package/dist/esm/api/resources/agent/resources/v1/types/index.d.mts +1 -0
- package/dist/esm/api/resources/agent/resources/v1/types/index.mjs +1 -0
- package/dist/esm/api/resources/listen/resources/v2/client/Client.d.mts +1 -0
- package/dist/esm/api/resources/listen/resources/v2/client/Client.mjs +15 -2
- package/dist/esm/api/resources/listen/resources/v2/types/ListenV2ConfigureSuccess.d.mts +2 -0
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/keys/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/keys/client/Client.mjs +1 -1
- package/dist/esm/api/resources/speak/resources/v1/types/SpeakV1Metadata.d.mts +4 -2
- package/dist/esm/api/types/CreateKeyV1Request.d.mts +2 -0
- package/dist/esm/api/types/CreateKeyV1Request.mjs +2 -0
- package/dist/esm/api/types/Groq.d.mts +13 -0
- package/dist/esm/api/types/Groq.mjs +11 -1
- package/dist/esm/api/types/ListProjectMembersV1Response.d.mts +4 -0
- package/dist/esm/api/types/ListenV2LanguageHint.d.mts +7 -0
- package/dist/esm/api/types/ListenV2LanguageHint.mjs +2 -0
- package/dist/esm/api/types/OpenAiThinkProvider.d.mts +11 -0
- package/dist/esm/api/types/OpenAiThinkProvider.mjs +8 -0
- package/dist/esm/api/types/index.d.mts +2 -1
- package/dist/esm/api/types/index.mjs +2 -1
- package/dist/esm/transport.d.mts +73 -0
- package/dist/esm/transport.mjs +1 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +10 -10
- package/reference.md +1 -1
|
@@ -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
|
}
|
|
@@ -12,4 +12,12 @@ export var OpenAiThinkProvider;
|
|
|
12
12
|
Gpt4O: "gpt-4o",
|
|
13
13
|
Gpt4OMini: "gpt-4o-mini",
|
|
14
14
|
};
|
|
15
|
+
/** OpenAI reasoning_effort */
|
|
16
|
+
OpenAiThinkProvider.ReasoningMode = {
|
|
17
|
+
None: "none",
|
|
18
|
+
Minimal: "minimal",
|
|
19
|
+
Low: "low",
|
|
20
|
+
Medium: "medium",
|
|
21
|
+
High: "high",
|
|
22
|
+
};
|
|
15
23
|
})(OpenAiThinkProvider || (OpenAiThinkProvider = {}));
|
|
@@ -7,7 +7,7 @@ export * from "./AwsPollySpeakProvider.mjs";
|
|
|
7
7
|
export * from "./BillingBreakdownV1Response.mjs";
|
|
8
8
|
export * from "./Cartesia.mjs";
|
|
9
9
|
export * from "./CreateAgentConfigurationV1Response.mjs";
|
|
10
|
-
export * from "./
|
|
10
|
+
export * from "./CreateKeyV1Request.mjs";
|
|
11
11
|
export * from "./CreateKeyV1Response.mjs";
|
|
12
12
|
export * from "./CreateProjectDistributionCredentialsV1Response.mjs";
|
|
13
13
|
export * from "./CreateProjectInviteV1Response.mjs";
|
|
@@ -79,6 +79,7 @@ export * from "./ListenV2Encoding.mjs";
|
|
|
79
79
|
export * from "./ListenV2EotThreshold.mjs";
|
|
80
80
|
export * from "./ListenV2EotTimeoutMs.mjs";
|
|
81
81
|
export * from "./ListenV2Keyterm.mjs";
|
|
82
|
+
export * from "./ListenV2LanguageHint.mjs";
|
|
82
83
|
export * from "./ListenV2MipOptOut.mjs";
|
|
83
84
|
export * from "./ListenV2Model.mjs";
|
|
84
85
|
export * from "./ListenV2SampleRate.mjs";
|
|
@@ -7,7 +7,7 @@ export * from "./AwsPollySpeakProvider.mjs";
|
|
|
7
7
|
export * from "./BillingBreakdownV1Response.mjs";
|
|
8
8
|
export * from "./Cartesia.mjs";
|
|
9
9
|
export * from "./CreateAgentConfigurationV1Response.mjs";
|
|
10
|
-
export * from "./
|
|
10
|
+
export * from "./CreateKeyV1Request.mjs";
|
|
11
11
|
export * from "./CreateKeyV1Response.mjs";
|
|
12
12
|
export * from "./CreateProjectDistributionCredentialsV1Response.mjs";
|
|
13
13
|
export * from "./CreateProjectInviteV1Response.mjs";
|
|
@@ -79,6 +79,7 @@ export * from "./ListenV2Encoding.mjs";
|
|
|
79
79
|
export * from "./ListenV2EotThreshold.mjs";
|
|
80
80
|
export * from "./ListenV2EotTimeoutMs.mjs";
|
|
81
81
|
export * from "./ListenV2Keyterm.mjs";
|
|
82
|
+
export * from "./ListenV2LanguageHint.mjs";
|
|
82
83
|
export * from "./ListenV2MipOptOut.mjs";
|
|
83
84
|
export * from "./ListenV2Model.mjs";
|
|
84
85
|
export * from "./ListenV2SampleRate.mjs";
|
|
@@ -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 @@
|
|
|
1
|
+
export {};
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "5.
|
|
1
|
+
export declare const SDK_VERSION = "5.1.1";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "5.
|
|
1
|
+
export const SDK_VERSION = "5.1.1";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepgram/sdk",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.2.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -511,20 +511,20 @@
|
|
|
511
511
|
"ws": "^8.20.0"
|
|
512
512
|
},
|
|
513
513
|
"devDependencies": {
|
|
514
|
+
"webpack": "^5.105.4",
|
|
515
|
+
"ts-loader": "^9.5.4",
|
|
516
|
+
"@types/ws": "^8.18.1",
|
|
517
|
+
"vitest": "^4.1.1",
|
|
518
|
+
"msw": "2.11.2",
|
|
519
|
+
"@types/node": "^20.17.57",
|
|
520
|
+
"typescript": "~5.9.3",
|
|
514
521
|
"@biomejs/biome": "2.4.10",
|
|
515
522
|
"@commitlint/cli": "20.5.0",
|
|
516
523
|
"@commitlint/config-conventional": "20.0.0",
|
|
517
|
-
"@types/node": "^20.17.57",
|
|
518
|
-
"@types/ws": "^8.18.1",
|
|
519
|
-
"msw": "2.11.2",
|
|
520
|
-
"playwright": "1.59.1",
|
|
521
|
-
"terser": "5.46.1",
|
|
522
|
-
"ts-loader": "^9.5.4",
|
|
523
524
|
"tsx": "4.20.6",
|
|
524
|
-
"
|
|
525
|
+
"playwright": "1.59.1",
|
|
525
526
|
"vite": "6.4.2",
|
|
526
|
-
"
|
|
527
|
-
"webpack": "^5.105.4"
|
|
527
|
+
"terser": "5.46.1"
|
|
528
528
|
},
|
|
529
529
|
"browser": {
|
|
530
530
|
"fs": false,
|