assemblyai 4.3.1 → 4.3.3
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/CHANGELOG.md +27 -0
- package/README.md +165 -89
- package/dist/assemblyai.umd.js +62 -56
- package/dist/assemblyai.umd.min.js +1 -1
- package/dist/bun.mjs +57 -51
- package/dist/deno.mjs +57 -51
- package/dist/index.cjs +62 -56
- package/dist/index.mjs +62 -56
- package/dist/node.cjs +57 -51
- package/dist/node.mjs +57 -51
- package/dist/services/base.d.ts +1 -1
- package/dist/services/files/index.d.ts +2 -2
- package/dist/services/index.d.ts +1 -1
- package/dist/services/lemur/index.d.ts +1 -1
- package/dist/services/realtime/service.d.ts +2 -2
- package/dist/services/transcripts/index.d.ts +26 -26
- package/dist/types/asyncapi.generated.d.ts +60 -39
- package/dist/types/openapi.generated.d.ts +740 -347
- package/dist/types/services/index.d.ts +0 -1
- package/dist/types/transcripts/index.d.ts +14 -5
- package/package.json +26 -25
- package/src/polyfills/fs/index.ts +2 -2
- package/src/polyfills/fs/node.ts +1 -1
- package/src/polyfills/streams/index.ts +2 -2
- package/src/services/base.ts +3 -3
- package/src/services/files/index.ts +2 -2
- package/src/services/index.ts +1 -1
- package/src/services/lemur/index.ts +5 -5
- package/src/services/realtime/factory.ts +1 -1
- package/src/services/realtime/service.ts +7 -8
- package/src/services/transcripts/index.ts +59 -63
- package/src/types/asyncapi.generated.ts +64 -42
- package/src/types/openapi.generated.ts +748 -352
- package/src/types/services/index.ts +0 -1
- package/src/types/transcripts/index.ts +17 -7
- package/dist/types/services/abstractions.d.ts +0 -52
- package/src/types/services/abstractions.ts +0 -56
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// this file is generated by typescript/scripts/generate-types.ts
|
|
2
2
|
/* tslint:disable */
|
|
3
3
|
/* eslint-disable */
|
|
4
|
-
|
|
5
4
|
import { LiteralUnion } from "./helpers";
|
|
6
5
|
|
|
7
6
|
/** OneOf type helpers */
|
|
@@ -12,47 +11,57 @@ type XOR<T, U> = T | U extends object
|
|
|
12
11
|
type OneOf<T extends any[]> = T extends [infer Only]
|
|
13
12
|
? Only
|
|
14
13
|
: T extends [infer A, infer B, ...infer Rest]
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
? OneOf<[XOR<A, B>, ...Rest]>
|
|
15
|
+
: never;
|
|
16
|
+
|
|
17
|
+
/* eslint-enable */
|
|
17
18
|
|
|
18
19
|
/**
|
|
19
|
-
*
|
|
20
|
-
* @description Binary audio data
|
|
20
|
+
* Binary audio data
|
|
21
21
|
*/
|
|
22
22
|
export type AudioData = ArrayBufferLike;
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
26
|
-
* @
|
|
27
|
-
* @enum {string}
|
|
25
|
+
* The encoding of the audio data
|
|
26
|
+
* @defaultValue "pcm_s16"le
|
|
28
27
|
*/
|
|
29
28
|
export type AudioEncoding = "pcm_s16le" | "pcm_mulaw";
|
|
30
29
|
|
|
31
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* Configure the threshold for how long to wait before ending an utterance. Default is 700ms.
|
|
32
|
+
*/
|
|
32
33
|
export type ConfigureEndUtteranceSilenceThreshold = {
|
|
33
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* The duration threshold in milliseconds
|
|
36
|
+
*/
|
|
34
37
|
end_utterance_silence_threshold: number;
|
|
35
38
|
};
|
|
36
39
|
|
|
37
40
|
export type FinalTranscript = RealtimeBaseTranscript & {
|
|
38
41
|
/**
|
|
39
|
-
*
|
|
40
|
-
* @constant
|
|
42
|
+
* Describes the type of message
|
|
41
43
|
*/
|
|
42
44
|
message_type: "FinalTranscript";
|
|
43
|
-
/**
|
|
45
|
+
/**
|
|
46
|
+
* Whether the text is punctuated and cased
|
|
47
|
+
*/
|
|
44
48
|
punctuated: boolean;
|
|
45
|
-
/**
|
|
49
|
+
/**
|
|
50
|
+
* Whether the text is formatted, for example Dollar -> $
|
|
51
|
+
*/
|
|
46
52
|
text_formatted: boolean;
|
|
47
53
|
};
|
|
48
54
|
|
|
49
|
-
/**
|
|
55
|
+
/**
|
|
56
|
+
* Manually end an utterance
|
|
57
|
+
*/
|
|
50
58
|
export type ForceEndUtterance = {
|
|
51
|
-
/**
|
|
59
|
+
/**
|
|
60
|
+
* A boolean value to communicate that you wish to force the end of the utterance
|
|
61
|
+
*/
|
|
52
62
|
force_end_utterance: boolean;
|
|
53
63
|
};
|
|
54
64
|
|
|
55
|
-
/** @enum {string} */
|
|
56
65
|
export type MessageType =
|
|
57
66
|
| "SessionBegins"
|
|
58
67
|
| "PartialTranscript"
|
|
@@ -61,33 +70,41 @@ export type MessageType =
|
|
|
61
70
|
|
|
62
71
|
export type PartialTranscript = RealtimeBaseTranscript & {
|
|
63
72
|
/**
|
|
64
|
-
*
|
|
65
|
-
* @constant
|
|
73
|
+
* Describes the type of message
|
|
66
74
|
*/
|
|
67
75
|
message_type: "PartialTranscript";
|
|
68
76
|
};
|
|
69
77
|
|
|
70
78
|
export type RealtimeBaseMessage = {
|
|
71
|
-
/**
|
|
79
|
+
/**
|
|
80
|
+
* Describes the type of the message
|
|
81
|
+
*/
|
|
72
82
|
message_type: MessageType;
|
|
73
83
|
};
|
|
74
84
|
|
|
75
85
|
export type RealtimeBaseTranscript = {
|
|
76
|
-
/**
|
|
86
|
+
/**
|
|
87
|
+
* End time of audio sample relative to session start, in milliseconds
|
|
88
|
+
*/
|
|
77
89
|
audio_end: number;
|
|
78
|
-
/**
|
|
90
|
+
/**
|
|
91
|
+
* Start time of audio sample relative to session start, in milliseconds
|
|
92
|
+
*/
|
|
79
93
|
audio_start: number;
|
|
80
94
|
/**
|
|
81
|
-
*
|
|
82
|
-
* @description The confidence score of the entire transcription, between 0 and 1
|
|
95
|
+
* The confidence score of the entire transcription, between 0 and 1
|
|
83
96
|
*/
|
|
84
97
|
confidence: number;
|
|
85
|
-
/**
|
|
98
|
+
/**
|
|
99
|
+
* The timestamp for the partial transcript
|
|
100
|
+
*/
|
|
86
101
|
created: Date;
|
|
87
|
-
/**
|
|
102
|
+
/**
|
|
103
|
+
* The partial transcript for your audio
|
|
104
|
+
*/
|
|
88
105
|
text: string;
|
|
89
106
|
/**
|
|
90
|
-
*
|
|
107
|
+
* An array of objects, with the information for each word in the transcription text.
|
|
91
108
|
* Includes the start and end time of the word in milliseconds, the confidence score of the word, and the text, which is the word itself.
|
|
92
109
|
*/
|
|
93
110
|
words: Word[];
|
|
@@ -106,47 +123,52 @@ export type RealtimeMessage =
|
|
|
106
123
|
|
|
107
124
|
export type RealtimeTranscript = PartialTranscript | FinalTranscript;
|
|
108
125
|
|
|
109
|
-
/** @enum {string} */
|
|
110
126
|
export type RealtimeTranscriptType = "PartialTranscript" | "FinalTranscript";
|
|
111
127
|
|
|
112
128
|
export type SessionBegins = RealtimeBaseMessage & {
|
|
113
|
-
/**
|
|
129
|
+
/**
|
|
130
|
+
* Timestamp when this session will expire
|
|
131
|
+
*/
|
|
114
132
|
expires_at: Date;
|
|
115
133
|
/**
|
|
116
|
-
*
|
|
117
|
-
* @constant
|
|
134
|
+
* Describes the type of the message
|
|
118
135
|
*/
|
|
119
136
|
message_type: "SessionBegins";
|
|
120
137
|
/**
|
|
121
|
-
*
|
|
122
|
-
* @description Unique identifier for the established session
|
|
138
|
+
* Unique identifier for the established session
|
|
123
139
|
*/
|
|
124
140
|
session_id: string;
|
|
125
141
|
};
|
|
126
142
|
|
|
127
143
|
export type SessionTerminated = RealtimeBaseMessage & {
|
|
128
144
|
/**
|
|
129
|
-
*
|
|
130
|
-
* @constant
|
|
145
|
+
* Describes the type of the message
|
|
131
146
|
*/
|
|
132
147
|
message_type: "SessionTerminated";
|
|
133
148
|
};
|
|
134
149
|
|
|
135
|
-
export type TerminateSession =
|
|
136
|
-
/**
|
|
150
|
+
export type TerminateSession = {
|
|
151
|
+
/**
|
|
152
|
+
* Set to true to end your real-time session forever
|
|
153
|
+
*/
|
|
137
154
|
terminate_session: boolean;
|
|
138
155
|
};
|
|
139
156
|
|
|
140
157
|
export type Word = {
|
|
141
158
|
/**
|
|
142
|
-
*
|
|
143
|
-
* @description Confidence score of the word
|
|
159
|
+
* Confidence score of the word
|
|
144
160
|
*/
|
|
145
161
|
confidence: number;
|
|
146
|
-
/**
|
|
162
|
+
/**
|
|
163
|
+
* End time of the word in milliseconds
|
|
164
|
+
*/
|
|
147
165
|
end: number;
|
|
148
|
-
/**
|
|
166
|
+
/**
|
|
167
|
+
* Start time of the word in milliseconds
|
|
168
|
+
*/
|
|
149
169
|
start: number;
|
|
150
|
-
/**
|
|
170
|
+
/**
|
|
171
|
+
* The word itself
|
|
172
|
+
*/
|
|
151
173
|
text: string;
|
|
152
174
|
};
|