assemblyai 4.12.2 → 4.13.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.
@@ -0,0 +1,23 @@
1
+ declare const StreamingErrorType: {
2
+ readonly BadSampleRate: 4000;
3
+ readonly AuthFailed: 4001;
4
+ readonly InsufficientFunds: 4002;
5
+ readonly FreeTierUser: 4003;
6
+ readonly NonexistentSessionId: 4004;
7
+ readonly SessionExpired: 4008;
8
+ readonly ClosedSession: 4010;
9
+ readonly RateLimited: 4029;
10
+ readonly UniqueSessionViolation: 4030;
11
+ readonly SessionTimeout: 4031;
12
+ readonly AudioTooShort: 4032;
13
+ readonly AudioTooLong: 4033;
14
+ readonly AudioTooSmallToTranscode: 4034;
15
+ readonly BadSchema: 4101;
16
+ readonly TooManyStreams: 4102;
17
+ readonly Reconnected: 4103;
18
+ };
19
+ type StreamingErrorTypeCodes = (typeof StreamingErrorType)[keyof typeof StreamingErrorType];
20
+ declare const StreamingErrorMessages: Record<StreamingErrorTypeCodes, string>;
21
+ declare class StreamingError extends Error {
22
+ }
23
+ export { StreamingError, StreamingErrorType, StreamingErrorTypeCodes, StreamingErrorMessages, };
package/dist/workerd.mjs CHANGED
@@ -15,7 +15,7 @@ if (typeof navigator !== "undefined" && navigator.userAgent) {
15
15
  defaultUserAgentString += navigator.userAgent;
16
16
  }
17
17
  const defaultUserAgent = {
18
- sdk: { name: "JavaScript", version: "4.12.2" },
18
+ sdk: { name: "JavaScript", version: "4.13.0" },
19
19
  };
20
20
  if (typeof process !== "undefined") {
21
21
  if (process.versions.node && defaultUserAgentString.indexOf("Node") === -1) {
@@ -197,9 +197,48 @@ const RealtimeErrorMessages = {
197
197
  class RealtimeError extends Error {
198
198
  }
199
199
 
200
+ const StreamingErrorType = {
201
+ BadSampleRate: 4000,
202
+ AuthFailed: 4001,
203
+ InsufficientFunds: 4002,
204
+ FreeTierUser: 4003,
205
+ NonexistentSessionId: 4004,
206
+ SessionExpired: 4008,
207
+ ClosedSession: 4010,
208
+ RateLimited: 4029,
209
+ UniqueSessionViolation: 4030,
210
+ SessionTimeout: 4031,
211
+ AudioTooShort: 4032,
212
+ AudioTooLong: 4033,
213
+ AudioTooSmallToTranscode: 4034,
214
+ BadSchema: 4101,
215
+ TooManyStreams: 4102,
216
+ Reconnected: 4103,
217
+ };
218
+ const StreamingErrorMessages = {
219
+ [StreamingErrorType.BadSampleRate]: "Sample rate must be a positive integer",
220
+ [StreamingErrorType.AuthFailed]: "Not Authorized",
221
+ [StreamingErrorType.InsufficientFunds]: "Insufficient funds",
222
+ [StreamingErrorType.FreeTierUser]: "This feature is paid-only and requires you to add a credit card. Please visit https://app.assemblyai.com/ to add a credit card to your account.",
223
+ [StreamingErrorType.NonexistentSessionId]: "Session ID does not exist",
224
+ [StreamingErrorType.SessionExpired]: "Session has expired",
225
+ [StreamingErrorType.ClosedSession]: "Session is closed",
226
+ [StreamingErrorType.RateLimited]: "Rate limited",
227
+ [StreamingErrorType.UniqueSessionViolation]: "Unique session violation",
228
+ [StreamingErrorType.SessionTimeout]: "Session Timeout",
229
+ [StreamingErrorType.AudioTooShort]: "Audio too short",
230
+ [StreamingErrorType.AudioTooLong]: "Audio too long",
231
+ [StreamingErrorType.AudioTooSmallToTranscode]: "Audio too small to transcode",
232
+ [StreamingErrorType.BadSchema]: "Bad schema",
233
+ [StreamingErrorType.TooManyStreams]: "Too many streams",
234
+ [StreamingErrorType.Reconnected]: "This session has been reconnected. This WebSocket is no longer valid.",
235
+ };
236
+ class StreamingError extends Error {
237
+ }
238
+
200
239
  const defaultRealtimeUrl = "wss://api.assemblyai.com/v2/realtime/ws";
201
240
  const forceEndOfUtteranceMessage = `{"force_end_utterance":true}`;
202
- const terminateSessionMessage = `{"terminate_session":true}`;
241
+ const terminateSessionMessage$1 = `{"terminate_session":true}`;
203
242
  /**
204
243
  * RealtimeTranscriber connects to the Streaming Speech-to-Text API and lets you transcribe audio in real-time.
205
244
  */
@@ -388,11 +427,11 @@ class RealtimeTranscriber {
388
427
  const sessionTerminatedPromise = new Promise((resolve) => {
389
428
  this.sessionTerminatedResolve = resolve;
390
429
  });
391
- this.socket.send(terminateSessionMessage);
430
+ this.socket.send(terminateSessionMessage$1);
392
431
  await sessionTerminatedPromise;
393
432
  }
394
433
  else {
395
- this.socket.send(terminateSessionMessage);
434
+ this.socket.send(terminateSessionMessage$1);
396
435
  }
397
436
  }
398
437
  if (this.socket?.removeAllListeners)
@@ -729,7 +768,168 @@ function dataUrlToBlob(dataUrl) {
729
768
  return new Blob([u8arr], { type: mime });
730
769
  }
731
770
 
771
+ const defaultStreamingUrl$1 = "wss://streaming.assemblyai.com/v3/ws";
772
+ const terminateSessionMessage = `{"type":"Terminate"}`;
773
+ class StreamingTranscriber {
774
+ constructor(params) {
775
+ this.listeners = {};
776
+ this.params = {
777
+ ...params,
778
+ websocketBaseUrl: params.websocketBaseUrl || defaultStreamingUrl$1,
779
+ };
780
+ if ("token" in params && params.token)
781
+ this.token = params.token;
782
+ if ("apiKey" in params && params.apiKey)
783
+ this.apiKey = params.apiKey;
784
+ if (!(this.token || this.apiKey)) {
785
+ throw new Error("API key or temporary token is required.");
786
+ }
787
+ }
788
+ connectionUrl() {
789
+ const url = new URL(this.params.websocketBaseUrl ?? "");
790
+ if (url.protocol !== "wss:") {
791
+ throw new Error("Invalid protocol, must be wss");
792
+ }
793
+ const searchParams = new URLSearchParams();
794
+ searchParams.set("sample_rate", this.params.sampleRate.toString());
795
+ if (this.params.endOfTurnConfidenceThreshold) {
796
+ searchParams.set("end_of_turn_confidence_threshold", this.params.endOfTurnConfidenceThreshold.toString());
797
+ }
798
+ if (this.params.minEndOfTurnSilenceWhenConfident) {
799
+ searchParams.set("min_end_of_turn_silence_when_confident", this.params.minEndOfTurnSilenceWhenConfident.toString());
800
+ }
801
+ if (this.params.maxTurnSilence) {
802
+ searchParams.set("max_turn_silence", this.params.maxTurnSilence.toString());
803
+ }
804
+ if (this.params.formatTurns) {
805
+ searchParams.set("format_turns", this.params.formatTurns.toString());
806
+ }
807
+ url.search = searchParams.toString();
808
+ return url;
809
+ }
810
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
811
+ on(event, listener) {
812
+ this.listeners[event] = listener;
813
+ }
814
+ connect() {
815
+ return new Promise((resolve) => {
816
+ if (this.socket) {
817
+ throw new Error("Already connected");
818
+ }
819
+ const url = this.connectionUrl();
820
+ this.socket = factory(url.toString(), {
821
+ headers: { Authorization: this.token || this.apiKey },
822
+ });
823
+ this.socket.binaryType = "arraybuffer";
824
+ this.socket.onopen = () => { };
825
+ this.socket.onclose = ({ code, reason }) => {
826
+ if (!reason) {
827
+ if (code in StreamingErrorMessages) {
828
+ reason = StreamingErrorMessages[code];
829
+ }
830
+ }
831
+ this.listeners.close?.(code, reason);
832
+ };
833
+ this.socket.onerror = (event) => {
834
+ if (event.error)
835
+ this.listeners.error?.(event.error);
836
+ else
837
+ this.listeners.error?.(new Error(event.message));
838
+ };
839
+ this.socket.onmessage = ({ data }) => {
840
+ const message = JSON.parse(data.toString());
841
+ if ("error" in message) {
842
+ this.listeners.error?.(new StreamingError(message.error));
843
+ return;
844
+ }
845
+ switch (message.type) {
846
+ case "Begin": {
847
+ resolve(message);
848
+ this.listeners.open?.(message);
849
+ break;
850
+ }
851
+ case "Turn": {
852
+ this.listeners.turn?.(message);
853
+ break;
854
+ }
855
+ case "Termination": {
856
+ this.sessionTerminatedResolve?.();
857
+ break;
858
+ }
859
+ }
860
+ };
861
+ });
862
+ }
863
+ stream() {
864
+ return new WritableStream({
865
+ write: (chunk) => {
866
+ this.sendAudio(chunk);
867
+ },
868
+ });
869
+ }
870
+ sendAudio(audio) {
871
+ this.send(audio);
872
+ }
873
+ send(data) {
874
+ if (!this.socket || this.socket.readyState !== this.socket.OPEN) {
875
+ throw new Error("Socket is not open for communication");
876
+ }
877
+ this.socket.send(data);
878
+ }
879
+ async close(waitForSessionTermination = true) {
880
+ if (this.socket) {
881
+ if (this.socket.readyState === this.socket.OPEN) {
882
+ if (waitForSessionTermination) {
883
+ const sessionTerminatedPromise = new Promise((resolve) => {
884
+ this.sessionTerminatedResolve = resolve;
885
+ });
886
+ this.socket.send(terminateSessionMessage);
887
+ await sessionTerminatedPromise;
888
+ }
889
+ else {
890
+ this.socket.send(terminateSessionMessage);
891
+ }
892
+ }
893
+ if (this.socket?.removeAllListeners)
894
+ this.socket.removeAllListeners();
895
+ this.socket.close();
896
+ }
897
+ this.listeners = {};
898
+ this.socket = undefined;
899
+ }
900
+ }
901
+
902
+ class StreamingTranscriberFactory extends BaseService {
903
+ constructor(params) {
904
+ super(params);
905
+ this.baseServiceParams = params;
906
+ }
907
+ transcriber(params) {
908
+ const serviceParams = { ...params };
909
+ if (!serviceParams.token && !serviceParams.apiKey) {
910
+ serviceParams.apiKey = this.baseServiceParams.apiKey;
911
+ }
912
+ return new StreamingTranscriber(serviceParams);
913
+ }
914
+ async createTemporaryToken(params) {
915
+ const searchParams = new URLSearchParams();
916
+ // Add each param to the search params
917
+ Object.entries(params).forEach(([key, value]) => {
918
+ if (value !== undefined && value !== null) {
919
+ searchParams.append(key, String(value));
920
+ }
921
+ });
922
+ const queryString = searchParams.toString();
923
+ const url = queryString ? `/v3/token?${queryString}` : "/v3/token";
924
+ const data = await this.fetchJson(url, {
925
+ method: "GET",
926
+ });
927
+ return data.token;
928
+ }
929
+ }
930
+
732
931
  const defaultBaseUrl = "https://api.assemblyai.com";
932
+ const defaultStreamingUrl = "https://streaming.assemblyai.com";
733
933
  class AssemblyAI {
734
934
  /**
735
935
  * Create a new AssemblyAI client.
@@ -744,7 +944,11 @@ class AssemblyAI {
744
944
  this.transcripts = new TranscriptService(params, this.files);
745
945
  this.lemur = new LemurService(params);
746
946
  this.realtime = new RealtimeTranscriberFactory(params);
947
+ this.streaming = new StreamingTranscriberFactory({
948
+ ...params,
949
+ baseUrl: params.streamingBaseUrl || defaultStreamingUrl,
950
+ });
747
951
  }
748
952
  }
749
953
 
750
- export { AssemblyAI, FileService, LemurService, RealtimeService, RealtimeServiceFactory, RealtimeTranscriber, RealtimeTranscriberFactory, TranscriptService };
954
+ export { AssemblyAI, FileService, LemurService, RealtimeService, RealtimeServiceFactory, RealtimeTranscriber, RealtimeTranscriberFactory, StreamingTranscriber, TranscriptService };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "assemblyai",
3
- "version": "4.12.2",
3
+ "version": "4.13.0",
4
4
  "description": "The AssemblyAI JavaScript SDK provides an easy-to-use interface for interacting with the AssemblyAI API, which supports async and real-time transcription, as well as the latest LeMUR models.",
5
5
  "engines": {
6
6
  "node": ">=18"
@@ -8,8 +8,10 @@ import {
8
8
  } from "./realtime";
9
9
  import { TranscriptService } from "./transcripts";
10
10
  import { FileService } from "./files";
11
+ import { StreamingTranscriber, StreamingTranscriberFactory } from "./streaming";
11
12
 
12
13
  const defaultBaseUrl = "https://api.assemblyai.com";
14
+ const defaultStreamingUrl = "https://streaming.assemblyai.com";
13
15
 
14
16
  class AssemblyAI {
15
17
  /**
@@ -32,6 +34,11 @@ class AssemblyAI {
32
34
  */
33
35
  public realtime: RealtimeTranscriberFactory;
34
36
 
37
+ /**
38
+ * The streaming service.
39
+ */
40
+ public streaming: StreamingTranscriberFactory;
41
+
35
42
  /**
36
43
  * Create a new AssemblyAI client.
37
44
  * @param params - The parameters for the service, including the API key and base URL, if any.
@@ -41,10 +48,16 @@ class AssemblyAI {
41
48
  if (params.baseUrl && params.baseUrl.endsWith("/")) {
42
49
  params.baseUrl = params.baseUrl.slice(0, -1);
43
50
  }
51
+
44
52
  this.files = new FileService(params);
45
53
  this.transcripts = new TranscriptService(params, this.files);
46
54
  this.lemur = new LemurService(params);
47
55
  this.realtime = new RealtimeTranscriberFactory(params);
56
+
57
+ this.streaming = new StreamingTranscriberFactory({
58
+ ...params,
59
+ baseUrl: params.streamingBaseUrl || defaultStreamingUrl,
60
+ });
48
61
  }
49
62
  }
50
63
 
@@ -57,4 +70,5 @@ export {
57
70
  RealtimeService,
58
71
  TranscriptService,
59
72
  FileService,
73
+ StreamingTranscriber,
60
74
  };
@@ -0,0 +1,48 @@
1
+ import {
2
+ BaseServiceParams,
3
+ StreamingTokenParams,
4
+ StreamingTranscriberParams,
5
+ StreamingTemporaryTokenResponse,
6
+ } from "../..";
7
+ import { StreamingTranscriber } from "./service";
8
+ import { BaseService } from "../base";
9
+
10
+ export class StreamingTranscriberFactory extends BaseService {
11
+ private baseServiceParams: BaseServiceParams;
12
+
13
+ constructor(params: BaseServiceParams) {
14
+ super(params);
15
+ this.baseServiceParams = params;
16
+ }
17
+
18
+ transcriber(params: StreamingTranscriberParams): StreamingTranscriber {
19
+ const serviceParams = { ...params };
20
+
21
+ if (!serviceParams.token && !serviceParams.apiKey) {
22
+ serviceParams.apiKey = this.baseServiceParams.apiKey;
23
+ }
24
+
25
+ return new StreamingTranscriber(serviceParams);
26
+ }
27
+
28
+ async createTemporaryToken(params: StreamingTokenParams) {
29
+ const searchParams = new URLSearchParams();
30
+
31
+ // Add each param to the search params
32
+ Object.entries(params).forEach(([key, value]) => {
33
+ if (value !== undefined && value !== null) {
34
+ searchParams.append(key, String(value));
35
+ }
36
+ });
37
+
38
+ const queryString = searchParams.toString();
39
+ const url = queryString ? `/v3/token?${queryString}` : "/v3/token";
40
+
41
+ const data = await this.fetchJson<StreamingTemporaryTokenResponse>(url, {
42
+ method: "GET",
43
+ });
44
+ return data.token;
45
+ }
46
+ }
47
+
48
+ export class StreamingServiceFactory extends StreamingTranscriberFactory {}
@@ -0,0 +1,2 @@
1
+ export * from "./factory";
2
+ export * from "./service";
@@ -0,0 +1,209 @@
1
+ import { WritableStream } from "#streams";
2
+ import {
3
+ PolyfillWebSocket,
4
+ factory as polyfillWebSocketFactory,
5
+ } from "#websocket";
6
+ import { ErrorEvent, MessageEvent, CloseEvent } from "ws";
7
+ import {
8
+ StreamingEvents,
9
+ StreamingListeners,
10
+ StreamingTranscriberParams,
11
+ AudioData,
12
+ BeginEvent,
13
+ StreamingEventMessage,
14
+ TurnEvent,
15
+ } from "../..";
16
+ import { StreamingError, StreamingErrorMessages } from "../../utils/errors";
17
+ import { StreamingErrorTypeCodes } from "../../utils/errors/streaming";
18
+
19
+ const defaultStreamingUrl = "wss://streaming.assemblyai.com/v3/ws";
20
+ const terminateSessionMessage = `{"type":"Terminate"}`;
21
+
22
+ type BufferLike =
23
+ | string
24
+ | Buffer
25
+ | DataView
26
+ | number
27
+ | ArrayBufferView
28
+ | Uint8Array
29
+ | ArrayBuffer
30
+ | SharedArrayBuffer
31
+ | ReadonlyArray<unknown>
32
+ | ReadonlyArray<number>
33
+ | { valueOf(): ArrayBuffer }
34
+ | { valueOf(): SharedArrayBuffer }
35
+ | { valueOf(): Uint8Array }
36
+ | { valueOf(): ReadonlyArray<number> }
37
+ | { valueOf(): string }
38
+ | { [Symbol.toPrimitive](hint: string): string };
39
+
40
+ export class StreamingTranscriber {
41
+ private apiKey?: string;
42
+ private token?: string;
43
+ private params: StreamingTranscriberParams;
44
+
45
+ private socket?: PolyfillWebSocket;
46
+ private listeners: StreamingListeners = {};
47
+ private sessionTerminatedResolve?: () => void;
48
+
49
+ constructor(params: StreamingTranscriberParams) {
50
+ this.params = {
51
+ ...params,
52
+ websocketBaseUrl: params.websocketBaseUrl || defaultStreamingUrl,
53
+ };
54
+
55
+ if ("token" in params && params.token) this.token = params.token;
56
+ if ("apiKey" in params && params.apiKey) this.apiKey = params.apiKey;
57
+
58
+ if (!(this.token || this.apiKey)) {
59
+ throw new Error("API key or temporary token is required.");
60
+ }
61
+ }
62
+
63
+ private connectionUrl(): URL {
64
+ const url = new URL(this.params.websocketBaseUrl ?? "");
65
+
66
+ if (url.protocol !== "wss:") {
67
+ throw new Error("Invalid protocol, must be wss");
68
+ }
69
+
70
+ const searchParams = new URLSearchParams();
71
+
72
+ searchParams.set("sample_rate", this.params.sampleRate.toString());
73
+
74
+ if (this.params.endOfTurnConfidenceThreshold) {
75
+ searchParams.set(
76
+ "end_of_turn_confidence_threshold",
77
+ this.params.endOfTurnConfidenceThreshold.toString(),
78
+ );
79
+ }
80
+
81
+ if (this.params.minEndOfTurnSilenceWhenConfident) {
82
+ searchParams.set(
83
+ "min_end_of_turn_silence_when_confident",
84
+ this.params.minEndOfTurnSilenceWhenConfident.toString(),
85
+ );
86
+ }
87
+
88
+ if (this.params.maxTurnSilence) {
89
+ searchParams.set(
90
+ "max_turn_silence",
91
+ this.params.maxTurnSilence.toString(),
92
+ );
93
+ }
94
+
95
+ if (this.params.formatTurns) {
96
+ searchParams.set("format_turns", this.params.formatTurns.toString());
97
+ }
98
+
99
+ url.search = searchParams.toString();
100
+
101
+ return url;
102
+ }
103
+
104
+ on(event: "open", listener: (event: BeginEvent) => void): void;
105
+ on(event: "turn", listener: (event: TurnEvent) => void): void;
106
+ on(event: "error", listener: (error: Error) => void): void;
107
+ on(event: "close", listener: (code: number, reason: string) => void): void;
108
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
109
+ on(event: StreamingEvents, listener: (...args: any[]) => void) {
110
+ this.listeners[event] = listener;
111
+ }
112
+
113
+ connect() {
114
+ return new Promise<BeginEvent>((resolve) => {
115
+ if (this.socket) {
116
+ throw new Error("Already connected");
117
+ }
118
+
119
+ const url = this.connectionUrl();
120
+
121
+ this.socket = polyfillWebSocketFactory(url.toString(), {
122
+ headers: { Authorization: this.token || this.apiKey },
123
+ });
124
+
125
+ this.socket.binaryType = "arraybuffer";
126
+
127
+ this.socket.onopen = () => {};
128
+
129
+ this.socket.onclose = ({ code, reason }: CloseEvent) => {
130
+ if (!reason) {
131
+ if (code in StreamingErrorMessages) {
132
+ reason = StreamingErrorMessages[code as StreamingErrorTypeCodes];
133
+ }
134
+ }
135
+ this.listeners.close?.(code, reason);
136
+ };
137
+
138
+ this.socket.onerror = (event: ErrorEvent) => {
139
+ if (event.error) this.listeners.error?.(event.error as Error);
140
+ else this.listeners.error?.(new Error(event.message));
141
+ };
142
+
143
+ this.socket.onmessage = ({ data }: MessageEvent) => {
144
+ const message = JSON.parse(data.toString()) as StreamingEventMessage;
145
+
146
+ if ("error" in message) {
147
+ this.listeners.error?.(new StreamingError(message.error));
148
+ return;
149
+ }
150
+
151
+ switch (message.type) {
152
+ case "Begin": {
153
+ resolve(message);
154
+ this.listeners.open?.(message);
155
+ break;
156
+ }
157
+ case "Turn": {
158
+ this.listeners.turn?.(message);
159
+ break;
160
+ }
161
+ case "Termination": {
162
+ this.sessionTerminatedResolve?.();
163
+ break;
164
+ }
165
+ }
166
+ };
167
+ });
168
+ }
169
+
170
+ stream(): WritableStream<AudioData> {
171
+ return new WritableStream<AudioData>({
172
+ write: (chunk: AudioData) => {
173
+ this.sendAudio(chunk);
174
+ },
175
+ });
176
+ }
177
+
178
+ sendAudio(audio: AudioData) {
179
+ this.send(audio);
180
+ }
181
+
182
+ private send(data: BufferLike) {
183
+ if (!this.socket || this.socket.readyState !== this.socket.OPEN) {
184
+ throw new Error("Socket is not open for communication");
185
+ }
186
+ this.socket.send(data);
187
+ }
188
+
189
+ async close(waitForSessionTermination = true) {
190
+ if (this.socket) {
191
+ if (this.socket.readyState === this.socket.OPEN) {
192
+ if (waitForSessionTermination) {
193
+ const sessionTerminatedPromise = new Promise<void>((resolve) => {
194
+ this.sessionTerminatedResolve = resolve;
195
+ });
196
+ this.socket.send(terminateSessionMessage);
197
+ await sessionTerminatedPromise;
198
+ } else {
199
+ this.socket.send(terminateSessionMessage);
200
+ }
201
+ }
202
+ if (this.socket?.removeAllListeners) this.socket.removeAllListeners();
203
+ this.socket.close();
204
+ }
205
+
206
+ this.listeners = {};
207
+ this.socket = undefined;
208
+ }
209
+ }
@@ -1,8 +1,9 @@
1
1
  export * from "./files";
2
2
  export * from "./transcripts";
3
3
  export * from "./realtime";
4
- export * from "./services";
5
4
  export * from "./asyncapi.generated";
5
+ export * from "./streaming";
6
+ export * from "./services";
6
7
  export * from "./openapi.generated";
7
8
  export * from "./deprecated";
8
9
 
@@ -3,6 +3,7 @@ import { UserAgent } from "..";
3
3
  type BaseServiceParams = {
4
4
  apiKey: string;
5
5
  baseUrl?: string;
6
+ streamingBaseUrl?: string;
6
7
  /**
7
8
  * The AssemblyAI user agent to use for requests.
8
9
  * The provided components will be merged into the default AssemblyAI user agent.