@deepgram/sdk 5.0.0-alpha.3 → 5.0.0-beta.1
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/LICENSE +1 -1
- package/dist/browser/index.global.js +496 -1104
- package/dist/cjs/BaseClient.d.ts +7 -7
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/Client.d.ts +1 -2
- package/dist/cjs/CustomClient.js +253 -249
- package/dist/cjs/api/resources/agent/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/agent/resources/v1/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/agent/resources/v1/client/Socket.d.ts +8 -8
- package/dist/cjs/api/resources/agent/resources/v1/client/Socket.js +9 -9
- package/dist/cjs/api/resources/agent/resources/v1/resources/settings/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/agent/resources/v1/resources/settings/resources/think/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/agent/resources/v1/resources/settings/resources/think/resources/models/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/auth/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/auth/resources/v1/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/auth/resources/v1/resources/tokens/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/listen/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/listen/resources/v1/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/listen/resources/v1/client/Client.js +29 -80
- package/dist/cjs/api/resources/listen/resources/v1/client/Socket.d.ts +4 -4
- package/dist/cjs/api/resources/listen/resources/v1/client/Socket.js +5 -5
- package/dist/cjs/api/resources/listen/resources/v1/resources/media/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/listen/resources/v1/resources/media/client/Client.js +76 -298
- package/dist/cjs/api/resources/listen/resources/v2/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/listen/resources/v2/client/Client.js +11 -26
- package/dist/cjs/api/resources/listen/resources/v2/client/Socket.d.ts +2 -2
- package/dist/cjs/api/resources/listen/resources/v2/client/Socket.js +3 -3
- package/dist/cjs/api/resources/manage/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/manage/resources/v1/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/manage/resources/v1/resources/models/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/manage/resources/v1/resources/models/client/Client.js +3 -4
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/client/Client.js +4 -7
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/billing/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/balances/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/breakdown/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/breakdown/client/Client.js +9 -27
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/fields/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/fields/client/Client.js +4 -7
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/purchases/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/purchases/client/Client.js +3 -4
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/keys/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/keys/client/Client.js +3 -4
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/members/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/members/resources/invites/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/members/resources/scopes/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/models/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/models/client/Client.js +3 -4
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/requests/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/requests/client/Client.js +12 -31
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/usage/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/usage/client/Client.js +46 -133
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/usage/resources/breakdown/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/usage/resources/breakdown/client/Client.js +47 -136
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/usage/resources/fields/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/usage/resources/fields/client/Client.js +4 -7
- package/dist/cjs/api/resources/read/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/read/resources/v1/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/read/resources/v1/resources/text/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/read/resources/v1/resources/text/client/Client.js +14 -52
- package/dist/cjs/api/resources/selfHosted/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/selfHosted/resources/v1/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/selfHosted/resources/v1/resources/distributionCredentials/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/selfHosted/resources/v1/resources/distributionCredentials/client/Client.js +4 -12
- package/dist/cjs/api/resources/speak/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/speak/resources/v1/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/speak/resources/v1/client/Client.js +6 -13
- package/dist/cjs/api/resources/speak/resources/v1/client/Socket.d.ts +4 -4
- package/dist/cjs/api/resources/speak/resources/v1/client/Socket.js +4 -4
- package/dist/cjs/api/resources/speak/resources/v1/resources/audio/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/speak/resources/v1/resources/audio/client/Client.js +11 -33
- package/dist/cjs/auth/HeaderAuthProvider.d.ts +14 -8
- package/dist/cjs/auth/HeaderAuthProvider.js +19 -9
- package/dist/cjs/core/fetcher/EndpointSupplier.d.ts +2 -2
- package/dist/cjs/core/fetcher/Fetcher.d.ts +1 -2
- package/dist/cjs/core/headers.d.ts +2 -2
- package/dist/cjs/core/websocket/ws.d.ts +1 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.d.mts +7 -7
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/Client.d.mts +1 -2
- package/dist/esm/CustomClient.mjs +254 -250
- package/dist/esm/api/resources/agent/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/agent/resources/v1/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/agent/resources/v1/client/Socket.d.mts +8 -8
- package/dist/esm/api/resources/agent/resources/v1/client/Socket.mjs +9 -9
- package/dist/esm/api/resources/agent/resources/v1/resources/settings/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/agent/resources/v1/resources/settings/resources/think/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/agent/resources/v1/resources/settings/resources/think/resources/models/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/auth/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/auth/resources/v1/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/auth/resources/v1/resources/tokens/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/listen/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/listen/resources/v1/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/listen/resources/v1/client/Client.mjs +29 -80
- package/dist/esm/api/resources/listen/resources/v1/client/Socket.d.mts +4 -4
- package/dist/esm/api/resources/listen/resources/v1/client/Socket.mjs +5 -5
- package/dist/esm/api/resources/listen/resources/v1/resources/media/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/listen/resources/v1/resources/media/client/Client.mjs +76 -298
- package/dist/esm/api/resources/listen/resources/v2/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/listen/resources/v2/client/Client.mjs +11 -26
- package/dist/esm/api/resources/listen/resources/v2/client/Socket.d.mts +2 -2
- package/dist/esm/api/resources/listen/resources/v2/client/Socket.mjs +3 -3
- package/dist/esm/api/resources/manage/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/manage/resources/v1/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/manage/resources/v1/resources/models/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/manage/resources/v1/resources/models/client/Client.mjs +3 -4
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/client/Client.mjs +4 -7
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/billing/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/balances/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/breakdown/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/breakdown/client/Client.mjs +9 -27
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/fields/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/fields/client/Client.mjs +4 -7
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/purchases/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/purchases/client/Client.mjs +3 -4
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/keys/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/keys/client/Client.mjs +3 -4
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/members/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/members/resources/invites/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/members/resources/scopes/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/models/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/models/client/Client.mjs +3 -4
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/requests/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/requests/client/Client.mjs +12 -31
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/usage/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/usage/client/Client.mjs +46 -133
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/usage/resources/breakdown/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/usage/resources/breakdown/client/Client.mjs +47 -136
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/usage/resources/fields/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/usage/resources/fields/client/Client.mjs +4 -7
- package/dist/esm/api/resources/read/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/read/resources/v1/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/read/resources/v1/resources/text/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/read/resources/v1/resources/text/client/Client.mjs +14 -52
- package/dist/esm/api/resources/selfHosted/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/selfHosted/resources/v1/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/selfHosted/resources/v1/resources/distributionCredentials/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/selfHosted/resources/v1/resources/distributionCredentials/client/Client.mjs +4 -12
- package/dist/esm/api/resources/speak/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/speak/resources/v1/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/speak/resources/v1/client/Client.mjs +6 -13
- package/dist/esm/api/resources/speak/resources/v1/client/Socket.d.mts +4 -4
- package/dist/esm/api/resources/speak/resources/v1/client/Socket.mjs +4 -4
- package/dist/esm/api/resources/speak/resources/v1/resources/audio/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/speak/resources/v1/resources/audio/client/Client.mjs +11 -33
- package/dist/esm/auth/HeaderAuthProvider.d.mts +14 -8
- package/dist/esm/auth/HeaderAuthProvider.mjs +19 -9
- package/dist/esm/core/fetcher/EndpointSupplier.d.mts +2 -2
- package/dist/esm/core/fetcher/Fetcher.d.mts +1 -2
- package/dist/esm/core/headers.d.mts +2 -2
- package/dist/esm/core/websocket/ws.d.mts +1 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +10 -7
|
@@ -2,8 +2,7 @@ import type { BaseClientOptions } from "../../../../BaseClient.js";
|
|
|
2
2
|
import { type NormalizedClientOptions } from "../../../../BaseClient.js";
|
|
3
3
|
import { V1Client } from "../resources/v1/client/Client.js";
|
|
4
4
|
export declare namespace AgentClient {
|
|
5
|
-
|
|
6
|
-
}
|
|
5
|
+
type Options = BaseClientOptions;
|
|
7
6
|
}
|
|
8
7
|
export declare class AgentClient {
|
|
9
8
|
protected readonly _options: NormalizedClientOptions<AgentClient.Options>;
|
|
@@ -3,8 +3,7 @@ import { type NormalizedClientOptions } from "../../../../../../BaseClient.js";
|
|
|
3
3
|
import { SettingsClient } from "../resources/settings/client/Client.js";
|
|
4
4
|
import { V1Socket } from "./Socket.js";
|
|
5
5
|
export declare namespace V1Client {
|
|
6
|
-
|
|
7
|
-
}
|
|
6
|
+
type Options = BaseClientOptions;
|
|
8
7
|
interface ConnectArgs {
|
|
9
8
|
Authorization: string;
|
|
10
9
|
/** Arbitrary headers to send with the websocket connect request. */
|
|
@@ -33,14 +33,14 @@ export declare class V1Socket {
|
|
|
33
33
|
* ```
|
|
34
34
|
*/
|
|
35
35
|
on<T extends keyof V1Socket.EventHandlers>(event: T, callback: V1Socket.EventHandlers[T]): void;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
36
|
+
sendSettings(message: Deepgram.agent.AgentV1Settings): void;
|
|
37
|
+
sendUpdateSpeak(message: Deepgram.agent.AgentV1UpdateSpeak): void;
|
|
38
|
+
sendInjectUserMessage(message: Deepgram.agent.AgentV1InjectUserMessage): void;
|
|
39
|
+
sendInjectAgentMessage(message: Deepgram.agent.AgentV1InjectAgentMessage): void;
|
|
40
|
+
sendFunctionCallResponse(message: Deepgram.agent.AgentV1SendFunctionCallResponse): void;
|
|
41
|
+
sendKeepAlive(message: Deepgram.agent.AgentV1KeepAlive): void;
|
|
42
|
+
sendUpdatePrompt(message: Deepgram.agent.AgentV1UpdatePrompt): void;
|
|
43
|
+
sendMedia(message: ArrayBufferLike | Blob | ArrayBufferView): void;
|
|
44
44
|
/** Connect to the websocket and register event handlers. */
|
|
45
45
|
connect(): V1Socket;
|
|
46
46
|
/** Close the websocket and unregister event handlers. */
|
|
@@ -90,37 +90,37 @@ class V1Socket {
|
|
|
90
90
|
on(event, callback) {
|
|
91
91
|
this.eventHandlers[event] = callback;
|
|
92
92
|
}
|
|
93
|
-
|
|
93
|
+
sendSettings(message) {
|
|
94
94
|
this.assertSocketIsOpen();
|
|
95
95
|
this.sendJson(message);
|
|
96
96
|
}
|
|
97
|
-
|
|
97
|
+
sendUpdateSpeak(message) {
|
|
98
98
|
this.assertSocketIsOpen();
|
|
99
99
|
this.sendJson(message);
|
|
100
100
|
}
|
|
101
|
-
|
|
101
|
+
sendInjectUserMessage(message) {
|
|
102
102
|
this.assertSocketIsOpen();
|
|
103
103
|
this.sendJson(message);
|
|
104
104
|
}
|
|
105
|
-
|
|
105
|
+
sendInjectAgentMessage(message) {
|
|
106
106
|
this.assertSocketIsOpen();
|
|
107
107
|
this.sendJson(message);
|
|
108
108
|
}
|
|
109
|
-
|
|
109
|
+
sendFunctionCallResponse(message) {
|
|
110
110
|
this.assertSocketIsOpen();
|
|
111
111
|
this.sendJson(message);
|
|
112
112
|
}
|
|
113
|
-
|
|
113
|
+
sendKeepAlive(message) {
|
|
114
114
|
this.assertSocketIsOpen();
|
|
115
115
|
this.sendJson(message);
|
|
116
116
|
}
|
|
117
|
-
|
|
117
|
+
sendUpdatePrompt(message) {
|
|
118
118
|
this.assertSocketIsOpen();
|
|
119
119
|
this.sendJson(message);
|
|
120
120
|
}
|
|
121
|
-
|
|
121
|
+
sendMedia(message) {
|
|
122
122
|
this.assertSocketIsOpen();
|
|
123
|
-
this.
|
|
123
|
+
this.sendBinary(message);
|
|
124
124
|
}
|
|
125
125
|
/** Connect to the websocket and register event handlers. */
|
|
126
126
|
connect() {
|
|
@@ -2,8 +2,7 @@ import type { BaseClientOptions } from "../../../../../../../../BaseClient.js";
|
|
|
2
2
|
import { type NormalizedClientOptions } from "../../../../../../../../BaseClient.js";
|
|
3
3
|
import { ThinkClient } from "../resources/think/client/Client.js";
|
|
4
4
|
export declare namespace SettingsClient {
|
|
5
|
-
|
|
6
|
-
}
|
|
5
|
+
type Options = BaseClientOptions;
|
|
7
6
|
}
|
|
8
7
|
export declare class SettingsClient {
|
|
9
8
|
protected readonly _options: NormalizedClientOptions<SettingsClient.Options>;
|
|
@@ -2,8 +2,7 @@ import type { BaseClientOptions } from "../../../../../../../../../../BaseClient
|
|
|
2
2
|
import { type NormalizedClientOptions } from "../../../../../../../../../../BaseClient.js";
|
|
3
3
|
import { ModelsClient } from "../resources/models/client/Client.js";
|
|
4
4
|
export declare namespace ThinkClient {
|
|
5
|
-
|
|
6
|
-
}
|
|
5
|
+
type Options = BaseClientOptions;
|
|
7
6
|
}
|
|
8
7
|
export declare class ThinkClient {
|
|
9
8
|
protected readonly _options: NormalizedClientOptions<ThinkClient.Options>;
|
|
@@ -3,8 +3,7 @@ import { type NormalizedClientOptions } from "../../../../../../../../../../../.
|
|
|
3
3
|
import * as core from "../../../../../../../../../../../../core/index.js";
|
|
4
4
|
import * as Deepgram from "../../../../../../../../../../../index.js";
|
|
5
5
|
export declare namespace ModelsClient {
|
|
6
|
-
|
|
7
|
-
}
|
|
6
|
+
type Options = BaseClientOptions;
|
|
8
7
|
interface RequestOptions extends BaseRequestOptions {
|
|
9
8
|
}
|
|
10
9
|
}
|
|
@@ -2,8 +2,7 @@ import type { BaseClientOptions } from "../../../../BaseClient.js";
|
|
|
2
2
|
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js";
|
|
3
3
|
import { V1Client } from "../resources/v1/client/Client.js";
|
|
4
4
|
export declare namespace AuthClient {
|
|
5
|
-
|
|
6
|
-
}
|
|
5
|
+
type Options = BaseClientOptions;
|
|
7
6
|
}
|
|
8
7
|
export declare class AuthClient {
|
|
9
8
|
protected readonly _options: NormalizedClientOptionsWithAuth<AuthClient.Options>;
|
|
@@ -2,8 +2,7 @@ import type { BaseClientOptions } from "../../../../../../BaseClient.js";
|
|
|
2
2
|
import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.js";
|
|
3
3
|
import { TokensClient } from "../resources/tokens/client/Client.js";
|
|
4
4
|
export declare namespace V1Client {
|
|
5
|
-
|
|
6
|
-
}
|
|
5
|
+
type Options = BaseClientOptions;
|
|
7
6
|
}
|
|
8
7
|
export declare class V1Client {
|
|
9
8
|
protected readonly _options: NormalizedClientOptionsWithAuth<V1Client.Options>;
|
|
@@ -3,8 +3,7 @@ import { type NormalizedClientOptionsWithAuth } from "../../../../../../../../Ba
|
|
|
3
3
|
import * as core from "../../../../../../../../core/index.js";
|
|
4
4
|
import * as Deepgram from "../../../../../../../index.js";
|
|
5
5
|
export declare namespace TokensClient {
|
|
6
|
-
|
|
7
|
-
}
|
|
6
|
+
type Options = BaseClientOptions;
|
|
8
7
|
interface RequestOptions extends BaseRequestOptions {
|
|
9
8
|
}
|
|
10
9
|
}
|
|
@@ -3,8 +3,7 @@ import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js"
|
|
|
3
3
|
import { V1Client } from "../resources/v1/client/Client.js";
|
|
4
4
|
import { V2Client } from "../resources/v2/client/Client.js";
|
|
5
5
|
export declare namespace ListenClient {
|
|
6
|
-
|
|
7
|
-
}
|
|
6
|
+
type Options = BaseClientOptions;
|
|
8
7
|
}
|
|
9
8
|
export declare class ListenClient {
|
|
10
9
|
protected readonly _options: NormalizedClientOptionsWithAuth<ListenClient.Options>;
|
|
@@ -3,8 +3,7 @@ import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClie
|
|
|
3
3
|
import { MediaClient } from "../resources/media/client/Client.js";
|
|
4
4
|
import { V1Socket } from "./Socket.js";
|
|
5
5
|
export declare namespace V1Client {
|
|
6
|
-
|
|
7
|
-
}
|
|
6
|
+
type Options = BaseClientOptions;
|
|
8
7
|
interface ConnectArgs {
|
|
9
8
|
callback?: string;
|
|
10
9
|
callback_method?: string;
|
|
@@ -62,86 +62,35 @@ class V1Client {
|
|
|
62
62
|
return __awaiter(this, void 0, void 0, function* () {
|
|
63
63
|
var _a, _b;
|
|
64
64
|
const { callback, callback_method: callbackMethod, channels, diarize, dictation, encoding, endpointing, extra, interim_results: interimResults, keyterm, keywords, language, mip_opt_out: mipOptOut, model, multichannel, numerals, profanity_filter: profanityFilter, punctuate, redact, replace, sample_rate: sampleRate, search, smart_format: smartFormat, tag, utterance_end_ms: utteranceEndMs, vad_events: vadEvents, version, headers, debug, reconnectAttempts, } = args;
|
|
65
|
-
const _queryParams = {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
_queryParams.keyterm = keyterm;
|
|
95
|
-
}
|
|
96
|
-
if (keywords != null) {
|
|
97
|
-
_queryParams.keywords = keywords;
|
|
98
|
-
}
|
|
99
|
-
if (language != null) {
|
|
100
|
-
_queryParams.language = language;
|
|
101
|
-
}
|
|
102
|
-
if (mipOptOut != null) {
|
|
103
|
-
_queryParams.mip_opt_out = mipOptOut;
|
|
104
|
-
}
|
|
105
|
-
_queryParams.model = model;
|
|
106
|
-
if (multichannel != null) {
|
|
107
|
-
_queryParams.multichannel = multichannel;
|
|
108
|
-
}
|
|
109
|
-
if (numerals != null) {
|
|
110
|
-
_queryParams.numerals = numerals;
|
|
111
|
-
}
|
|
112
|
-
if (profanityFilter != null) {
|
|
113
|
-
_queryParams.profanity_filter = profanityFilter;
|
|
114
|
-
}
|
|
115
|
-
if (punctuate != null) {
|
|
116
|
-
_queryParams.punctuate = punctuate;
|
|
117
|
-
}
|
|
118
|
-
if (redact != null) {
|
|
119
|
-
_queryParams.redact = redact;
|
|
120
|
-
}
|
|
121
|
-
if (replace != null) {
|
|
122
|
-
_queryParams.replace = replace;
|
|
123
|
-
}
|
|
124
|
-
if (sampleRate != null) {
|
|
125
|
-
_queryParams.sample_rate = sampleRate;
|
|
126
|
-
}
|
|
127
|
-
if (search != null) {
|
|
128
|
-
_queryParams.search = search;
|
|
129
|
-
}
|
|
130
|
-
if (smartFormat != null) {
|
|
131
|
-
_queryParams.smart_format = smartFormat;
|
|
132
|
-
}
|
|
133
|
-
if (tag != null) {
|
|
134
|
-
_queryParams.tag = tag;
|
|
135
|
-
}
|
|
136
|
-
if (utteranceEndMs != null) {
|
|
137
|
-
_queryParams.utterance_end_ms = utteranceEndMs;
|
|
138
|
-
}
|
|
139
|
-
if (vadEvents != null) {
|
|
140
|
-
_queryParams.vad_events = vadEvents;
|
|
141
|
-
}
|
|
142
|
-
if (version != null) {
|
|
143
|
-
_queryParams.version = version;
|
|
144
|
-
}
|
|
65
|
+
const _queryParams = {
|
|
66
|
+
callback,
|
|
67
|
+
callback_method: callbackMethod,
|
|
68
|
+
channels,
|
|
69
|
+
diarize,
|
|
70
|
+
dictation,
|
|
71
|
+
encoding,
|
|
72
|
+
endpointing,
|
|
73
|
+
extra,
|
|
74
|
+
interim_results: interimResults,
|
|
75
|
+
keyterm,
|
|
76
|
+
keywords,
|
|
77
|
+
language,
|
|
78
|
+
mip_opt_out: mipOptOut,
|
|
79
|
+
model,
|
|
80
|
+
multichannel,
|
|
81
|
+
numerals,
|
|
82
|
+
profanity_filter: profanityFilter,
|
|
83
|
+
punctuate,
|
|
84
|
+
redact,
|
|
85
|
+
replace,
|
|
86
|
+
sample_rate: sampleRate,
|
|
87
|
+
search,
|
|
88
|
+
smart_format: smartFormat,
|
|
89
|
+
tag,
|
|
90
|
+
utterance_end_ms: utteranceEndMs,
|
|
91
|
+
vad_events: vadEvents,
|
|
92
|
+
version,
|
|
93
|
+
};
|
|
145
94
|
const _headers = (0, headers_js_1.mergeHeaders)((0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: args.Authorization }), headers);
|
|
146
95
|
const socket = new core.ReconnectingWebSocket({
|
|
147
96
|
url: core.url.join((_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : ((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.DeepgramEnvironment.Production).production, "/v1/listen"),
|
|
@@ -33,10 +33,10 @@ export declare class V1Socket {
|
|
|
33
33
|
* ```
|
|
34
34
|
*/
|
|
35
35
|
on<T extends keyof V1Socket.EventHandlers>(event: T, callback: V1Socket.EventHandlers[T]): void;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
sendMedia(message: ArrayBufferLike | Blob | ArrayBufferView): void;
|
|
37
|
+
sendFinalize(message: Deepgram.listen.ListenV1Finalize): void;
|
|
38
|
+
sendCloseStream(message: Deepgram.listen.ListenV1CloseStream): void;
|
|
39
|
+
sendKeepAlive(message: Deepgram.listen.ListenV1KeepAlive): void;
|
|
40
40
|
/** Connect to the websocket and register event handlers. */
|
|
41
41
|
connect(): V1Socket;
|
|
42
42
|
/** Close the websocket and unregister event handlers. */
|
|
@@ -90,19 +90,19 @@ class V1Socket {
|
|
|
90
90
|
on(event, callback) {
|
|
91
91
|
this.eventHandlers[event] = callback;
|
|
92
92
|
}
|
|
93
|
-
|
|
93
|
+
sendMedia(message) {
|
|
94
94
|
this.assertSocketIsOpen();
|
|
95
|
-
this.
|
|
95
|
+
this.sendBinary(message);
|
|
96
96
|
}
|
|
97
|
-
|
|
97
|
+
sendFinalize(message) {
|
|
98
98
|
this.assertSocketIsOpen();
|
|
99
99
|
this.sendJson(message);
|
|
100
100
|
}
|
|
101
|
-
|
|
101
|
+
sendCloseStream(message) {
|
|
102
102
|
this.assertSocketIsOpen();
|
|
103
103
|
this.sendJson(message);
|
|
104
104
|
}
|
|
105
|
-
|
|
105
|
+
sendKeepAlive(message) {
|
|
106
106
|
this.assertSocketIsOpen();
|
|
107
107
|
this.sendJson(message);
|
|
108
108
|
}
|
|
@@ -3,8 +3,7 @@ import { type NormalizedClientOptionsWithAuth } from "../../../../../../../../Ba
|
|
|
3
3
|
import * as core from "../../../../../../../../core/index.js";
|
|
4
4
|
import * as Deepgram from "../../../../../../../index.js";
|
|
5
5
|
export declare namespace MediaClient {
|
|
6
|
-
|
|
7
|
-
}
|
|
6
|
+
type Options = BaseClientOptions;
|
|
8
7
|
interface RequestOptions extends BaseRequestOptions {
|
|
9
8
|
}
|
|
10
9
|
}
|