assemblyai 2.0.0-beta → 2.0.1-beta
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/README.md +148 -48
- package/dist/index.d.ts +2 -0
- package/dist/index.esm.js +218 -123
- package/dist/index.js +225 -123
- package/dist/services/base.d.ts +0 -2
- package/dist/services/index.d.ts +7 -9
- package/dist/services/lemur/index.d.ts +6 -6
- package/dist/services/realtime/factory.d.ts +10 -0
- package/dist/services/realtime/index.d.ts +2 -16
- package/dist/services/realtime/service.d.ts +22 -0
- package/dist/services/transcripts/index.d.ts +37 -20
- package/dist/types/asyncapi.generated.d.ts +87 -0
- package/dist/types/index.d.ts +3 -4
- package/dist/types/openapi.generated.d.ts +685 -0
- package/dist/types/realtime/index.d.ts +30 -11
- package/dist/types/services/abstractions.d.ts +8 -36
- package/dist/types/services/index.d.ts +2 -5
- package/dist/types/transcripts/index.d.ts +5 -0
- package/dist/utils/axios.d.ts +3 -0
- package/dist/utils/errors/realtime.d.ts +1 -4
- package/package.json +8 -5
- package/src/index.ts +3 -0
- package/src/services/base.ts +1 -3
- package/src/services/files/index.ts +4 -4
- package/src/services/index.ts +18 -35
- package/src/services/lemur/index.ts +20 -16
- package/src/services/realtime/factory.ts +32 -0
- package/src/services/realtime/index.ts +2 -106
- package/src/services/realtime/service.ts +184 -0
- package/src/services/transcripts/index.ts +85 -63
- package/src/types/asyncapi.generated.ts +124 -0
- package/src/types/index.ts +3 -4
- package/src/types/openapi.generated.ts +834 -0
- package/src/types/realtime/index.ts +53 -13
- package/src/types/services/abstractions.ts +8 -40
- package/src/types/services/index.ts +2 -6
- package/src/types/transcripts/index.ts +5 -0
- package/src/utils/axios.ts +19 -0
- package/src/utils/errors/realtime.ts +5 -18
- package/dist/services/transcripts/redactions.d.ts +0 -14
- package/dist/services/transcripts/subtitles.d.ts +0 -12
- package/dist/types/core/index.d.ts +0 -2
- package/dist/types/core/params.d.ts +0 -2
- package/dist/types/core/segments.d.ts +0 -28
- package/dist/types/core/transcript.d.ts +0 -113
- package/dist/types/lemur/index.d.ts +0 -79
- package/dist/types/models/auto_chapter.d.ts +0 -8
- package/dist/types/models/auto_highlights.d.ts +0 -11
- package/dist/types/models/content_safety.d.ts +0 -25
- package/dist/types/models/entity_detection.d.ts +0 -7
- package/dist/types/models/index.d.ts +0 -8
- package/dist/types/models/pii.d.ts +0 -3
- package/dist/types/models/sentiment_analysis.d.ts +0 -9
- package/dist/types/models/shared.d.ts +0 -3
- package/dist/types/models/summarization.d.ts +0 -3
- package/dist/types/models/topic_detection.d.ts +0 -17
- package/dist/types/shared/index.d.ts +0 -2
- package/dist/types/shared/pagination.d.ts +0 -7
- package/dist/types/shared/timestamp.d.ts +0 -5
- package/src/services/transcripts/redactions.ts +0 -27
- package/src/services/transcripts/subtitles.ts +0 -26
- package/src/types/core/index.ts +0 -2
- package/src/types/core/params.ts +0 -3
- package/src/types/core/segments.ts +0 -29
- package/src/types/core/transcript.ts +0 -159
- package/src/types/lemur/index.ts +0 -97
- package/src/types/models/auto_chapter.ts +0 -9
- package/src/types/models/auto_highlights.ts +0 -14
- package/src/types/models/content_safety.ts +0 -34
- package/src/types/models/entity_detection.ts +0 -8
- package/src/types/models/index.ts +0 -8
- package/src/types/models/pii.ts +0 -32
- package/src/types/models/sentiment_analysis.ts +0 -11
- package/src/types/models/shared.ts +0 -4
- package/src/types/models/summarization.ts +0 -10
- package/src/types/models/topic_detection.ts +0 -21
- package/src/types/shared/index.ts +0 -2
- package/src/types/shared/pagination.ts +0 -8
- package/src/types/shared/timestamp.ts +0 -6
|
@@ -0,0 +1,834 @@
|
|
|
1
|
+
// this file is generated by typescript/scripts/generate-types.ts
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
|
|
5
|
+
/** OneOf type helpers */
|
|
6
|
+
type Without<T, U> = { [P in Exclude<keyof T, keyof U>]?: never };
|
|
7
|
+
type XOR<T, U> = T | U extends object
|
|
8
|
+
? (Without<T, U> & U) | (Without<U, T> & T)
|
|
9
|
+
: T | U;
|
|
10
|
+
type OneOf<T extends any[]> = T extends [infer Only]
|
|
11
|
+
? Only
|
|
12
|
+
: T extends [infer A, infer B, ...infer Rest]
|
|
13
|
+
? OneOf<[XOR<A, B>, ...Rest]>
|
|
14
|
+
: never;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @description Will be either success, or unavailable in the rare case that the model failed.
|
|
18
|
+
* @enum {string}
|
|
19
|
+
*/
|
|
20
|
+
export type AudioIntelligenceModelStatus = "success" | "unavailable";
|
|
21
|
+
|
|
22
|
+
export type AutoHighlightResult = {
|
|
23
|
+
/** @description The total number of times the key phrase appears in the audio file */
|
|
24
|
+
count: number;
|
|
25
|
+
/**
|
|
26
|
+
* Format: float
|
|
27
|
+
* @description The total relevancy to the overall audio file of this key phrase - a greater number means more relevant
|
|
28
|
+
*/
|
|
29
|
+
rank: number;
|
|
30
|
+
/** @description The text itself of the key phrase */
|
|
31
|
+
text: string;
|
|
32
|
+
/** @description The timestamp of the of the key phrase */
|
|
33
|
+
timestamps: Timestamp[];
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* @description An array of results for the Key Phrases model, if it was enabled during the transcription request.
|
|
38
|
+
* See [Key phrases](https://www.assemblyai.com/docs/Models/key_phrases) for more information.
|
|
39
|
+
*/
|
|
40
|
+
export type AutoHighlightsResult = {
|
|
41
|
+
/** @description A temporally-sequential array of Key Phrases */
|
|
42
|
+
results: AutoHighlightResult[];
|
|
43
|
+
} | null;
|
|
44
|
+
|
|
45
|
+
/** @description Chapter of the audio file */
|
|
46
|
+
export type Chapter = {
|
|
47
|
+
/** @description The starting time, in milliseconds, for the chapter */
|
|
48
|
+
end: number;
|
|
49
|
+
/** @description An ultra-short summary (just a few words) of the content spoken in the chapter */
|
|
50
|
+
gist: string;
|
|
51
|
+
/** @description A single sentence summary of the content spoken during the chapter */
|
|
52
|
+
headline: string;
|
|
53
|
+
/** @description The starting time, in milliseconds, for the chapter */
|
|
54
|
+
start: number;
|
|
55
|
+
/** @description A one paragraph summary of the content spoken during the chapter */
|
|
56
|
+
summary: string;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export type ContentSafetyLabel = {
|
|
60
|
+
/**
|
|
61
|
+
* Format: double
|
|
62
|
+
* @description The confidence score for the topic being discussed, from 0 to 1
|
|
63
|
+
*/
|
|
64
|
+
confidence: number;
|
|
65
|
+
/** @description The label of the sensitive topic */
|
|
66
|
+
label: string;
|
|
67
|
+
/**
|
|
68
|
+
* Format: double
|
|
69
|
+
* @description How severely the topic is discussed in the section, from 0 to 1
|
|
70
|
+
*/
|
|
71
|
+
severity: number;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export type ContentSafetyLabelResult = {
|
|
75
|
+
/** @description An array of objects, one per sensitive topic that was detected in the section */
|
|
76
|
+
labels: ContentSafetyLabel[];
|
|
77
|
+
/** @description The sentence index at which the section ends */
|
|
78
|
+
sentences_idx_end: number;
|
|
79
|
+
/** @description The sentence index at which the section begins */
|
|
80
|
+
sentences_idx_start: number;
|
|
81
|
+
/** @description A summary of the Content Moderation severity results for the entire audio file */
|
|
82
|
+
severity_score_summary: {
|
|
83
|
+
[key: string]: SeverityScoreSummary;
|
|
84
|
+
};
|
|
85
|
+
/** @description A summary of the Content Moderation confidence results for the entire audio file */
|
|
86
|
+
summary: {
|
|
87
|
+
[key: string]: number;
|
|
88
|
+
};
|
|
89
|
+
/** @description The transcript of the section flagged by the Content Moderation model */
|
|
90
|
+
text: string;
|
|
91
|
+
/** @description Timestamp information for the section */
|
|
92
|
+
timestamp: Timestamp;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
export type CreateRealtimeTemporaryTokenParameters = {
|
|
96
|
+
/** @description The amount of time until the token expires in seconds. */
|
|
97
|
+
expires_in: number;
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
/** @description The parameters for creating a transcript */
|
|
101
|
+
export type CreateTranscriptOptionalParameters = {
|
|
102
|
+
/** @description The point in time, in milliseconds, to stop transcribing in your media file */
|
|
103
|
+
audio_end_at?: number;
|
|
104
|
+
/** @description The point in time, in milliseconds, to begin transcription from in your media file */
|
|
105
|
+
audio_start_from?: number;
|
|
106
|
+
/** @description Enable [Auto Chapters](https://www.assemblyai.com/docs/Models/auto_chapters), can be true or false */
|
|
107
|
+
auto_chapters?: boolean;
|
|
108
|
+
/** @description Whether Key Phrases was enabled in the transcription request, either true or false */
|
|
109
|
+
auto_highlights?: boolean;
|
|
110
|
+
/** @description The word boost parameter value, if provided in the transcription request. */
|
|
111
|
+
boost_param?: TranscriptBoostParam;
|
|
112
|
+
/** @description Enable [Content Moderation](https://www.assemblyai.com/docs/Models/content_moderation), can be true or false */
|
|
113
|
+
content_safety?: boolean;
|
|
114
|
+
/** @description Customize how words are spelled and formatted using to and from values */
|
|
115
|
+
custom_spelling?: TranscriptCustomSpelling[];
|
|
116
|
+
/** @description Whether custom topics was enabled in the transcription request, either true or false */
|
|
117
|
+
custom_topics?: boolean;
|
|
118
|
+
/** @description Transcribe Filler Words, like "umm", in your media file; can be true or false. */
|
|
119
|
+
disfluencies?: boolean;
|
|
120
|
+
/** @description Enable [Dual Channel](https://assemblyai.com/docs/Models/speech_recognition#dual-channel-transcription) transcription, can be true or false. */
|
|
121
|
+
dual_channel?: boolean;
|
|
122
|
+
/** @description Enable [Entity Detection](https://www.assemblyai.com/docs/Models/entity_detection), can be true or false */
|
|
123
|
+
entity_detection?: boolean;
|
|
124
|
+
/** @description Filter profanity from the transcribed text, can be true or false. */
|
|
125
|
+
filter_profanity?: boolean;
|
|
126
|
+
/** @description Enable Text Formatting, can be true or false. */
|
|
127
|
+
format_text?: boolean;
|
|
128
|
+
/** @description Enable [Topic Detection](https://www.assemblyai.com/docs/Models/iab_classification), can be true or false */
|
|
129
|
+
iab_categories?: boolean;
|
|
130
|
+
/**
|
|
131
|
+
* @description The language of your audio file. Possible values are found in [Supported Languages](https://www.assemblyai.com/docs/Concepts/supported_languages).
|
|
132
|
+
* The default value is 'en_us'.
|
|
133
|
+
*/
|
|
134
|
+
language_code?: TranscriptLanguageCode;
|
|
135
|
+
/** @description Whether [Automatic language detection](https://www.assemblyai.com/docs/Models/speech_recognition#automatic-language-detection) was enabled in the transcription request, either true or false. */
|
|
136
|
+
language_detection?: boolean;
|
|
137
|
+
/** @description Enable Automatic Punctuation, can be true or false. */
|
|
138
|
+
punctuate?: boolean;
|
|
139
|
+
/** @description Redact PII from the transcribed text using the Redact PII model, can be true or false */
|
|
140
|
+
redact_pii?: boolean;
|
|
141
|
+
/** @description Generate a copy of the original media file with spoken PII "beeped" out, can be true or false. See [PII redaction](https://www.assemblyai.com/docs/Models/pii_redaction) for more details. */
|
|
142
|
+
redact_pii_audio?: boolean;
|
|
143
|
+
/**
|
|
144
|
+
* @description Controls the filetype of the audio created by redact_pii_audio. Currently supports mp3 (default) and wav. See [PII redaction](https://www.assemblyai.com/docs/Models/pii_redaction) for more details.
|
|
145
|
+
* @default mp3
|
|
146
|
+
*/
|
|
147
|
+
redact_pii_audio_quality?: string;
|
|
148
|
+
/** @description The list of PII Redaction policies to enable. See [PII redaction](https://www.assemblyai.com/docs/Models/pii_redaction) for more details. */
|
|
149
|
+
redact_pii_policies?: PiiPolicy[];
|
|
150
|
+
/** @description The replacement logic for detected PII, can be "entity_type" or "hash". See [PII redaction](https://www.assemblyai.com/docs/Models/pii_redaction) for more details. */
|
|
151
|
+
redact_pii_sub?: SubstitutionPolicy;
|
|
152
|
+
/** @description Enable [Sentiment Analysis](https://www.assemblyai.com/docs/Models/sentiment_analysis), can be true or false */
|
|
153
|
+
sentiment_analysis?: boolean;
|
|
154
|
+
/** @description Enable [Speaker diarization](https://www.assemblyai.com/docs/Models/speaker_diarization), can be true or false */
|
|
155
|
+
speaker_labels?: boolean;
|
|
156
|
+
/**
|
|
157
|
+
* @description Tells the speaker label model how many speakers it should attempt to identify, up to 10. See [Speaker diarization](https://www.assemblyai.com/docs/Models/speaker_diarization) for more details.
|
|
158
|
+
* @default null
|
|
159
|
+
*/
|
|
160
|
+
speakers_expected?: number | null;
|
|
161
|
+
/**
|
|
162
|
+
* Format: float
|
|
163
|
+
* @description Reject audio files that contain less than this fraction of speech.
|
|
164
|
+
* Valid values are in the range [0, 1] inclusive.
|
|
165
|
+
*
|
|
166
|
+
* @default null
|
|
167
|
+
*/
|
|
168
|
+
speech_threshold?: number | null;
|
|
169
|
+
/** @description Enable [Summarization](https://www.assemblyai.com/docs/Models/summarization), can be true or false */
|
|
170
|
+
summarization?: boolean;
|
|
171
|
+
/**
|
|
172
|
+
* @description The model to summarize the transcript
|
|
173
|
+
* @default informative
|
|
174
|
+
*/
|
|
175
|
+
summary_model?: SummaryModel;
|
|
176
|
+
/**
|
|
177
|
+
* @description The type of summary
|
|
178
|
+
* @default bullets
|
|
179
|
+
*/
|
|
180
|
+
summary_type?: SummaryType;
|
|
181
|
+
/** @description The list of custom topics provided if custom topics was enabled in the transcription request */
|
|
182
|
+
topics?: string[];
|
|
183
|
+
/**
|
|
184
|
+
* @description The header name which should be sent back with webhook calls, if provided in the transcription request.
|
|
185
|
+
* @default null
|
|
186
|
+
*/
|
|
187
|
+
webhook_auth_header_name?: string | null;
|
|
188
|
+
/**
|
|
189
|
+
* @description Defaults to null. Optionally allows a user to specify a header name and value to send back with a webhook call for added security.
|
|
190
|
+
* @default null
|
|
191
|
+
*/
|
|
192
|
+
webhook_auth_header_value?: string | null;
|
|
193
|
+
/** @description The URL to which we send webhooks upon trancription completion, if provided in the transcription request. */
|
|
194
|
+
webhook_url?: string;
|
|
195
|
+
/** @description The list of custom vocabulary to boost transcription probability for, if provided in the transcription request. */
|
|
196
|
+
word_boost?: string[];
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
/** @description The parameters for creating a transcript */
|
|
200
|
+
export type CreateTranscriptParameters = CreateTranscriptOptionalParameters & {
|
|
201
|
+
/** @description The URL of the audio or video file to transcribe. */
|
|
202
|
+
audio_url: string;
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
/** @description A detected entity */
|
|
206
|
+
export type Entity = {
|
|
207
|
+
/** @description The ending time, in milliseconds, for the detected entity in the audio file */
|
|
208
|
+
end: number;
|
|
209
|
+
/** @description The type of entity for the detected entity */
|
|
210
|
+
entity_type: EntityType;
|
|
211
|
+
/** @description The starting time, in milliseconds, at which the detected entity appears in the audio file */
|
|
212
|
+
start: number;
|
|
213
|
+
/** @description The text for the detected entity */
|
|
214
|
+
text: string;
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* @description The type of entity for the detected entity
|
|
219
|
+
* @enum {string}
|
|
220
|
+
*/
|
|
221
|
+
export type EntityType =
|
|
222
|
+
| "banking_information"
|
|
223
|
+
| "blood_type"
|
|
224
|
+
| "credit_card_cvv"
|
|
225
|
+
| "credit_card_expiration"
|
|
226
|
+
| "credit_card_number"
|
|
227
|
+
| "date"
|
|
228
|
+
| "date_of_birth"
|
|
229
|
+
| "drivers_license"
|
|
230
|
+
| "drug"
|
|
231
|
+
| "email_address"
|
|
232
|
+
| "event"
|
|
233
|
+
| "injury"
|
|
234
|
+
| "language"
|
|
235
|
+
| "location"
|
|
236
|
+
| "medical_condition"
|
|
237
|
+
| "medical_process"
|
|
238
|
+
| "money_amount"
|
|
239
|
+
| "nationality"
|
|
240
|
+
| "occupation"
|
|
241
|
+
| "organization"
|
|
242
|
+
| "password"
|
|
243
|
+
| "person_age"
|
|
244
|
+
| "person_name"
|
|
245
|
+
| "phone_number"
|
|
246
|
+
| "political_affiliation"
|
|
247
|
+
| "religion"
|
|
248
|
+
| "time"
|
|
249
|
+
| "url"
|
|
250
|
+
| "us_social_security_number";
|
|
251
|
+
|
|
252
|
+
export type Error = {
|
|
253
|
+
/** @description Error message */
|
|
254
|
+
error: string;
|
|
255
|
+
/** @constant */
|
|
256
|
+
status?: "error";
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
export type LemurActionItemsParameters = LemurBaseParameters;
|
|
260
|
+
|
|
261
|
+
export type LemurActionItemsResponse = LemurBaseResponse & {
|
|
262
|
+
/** @description The response generated by LeMUR. */
|
|
263
|
+
response: string;
|
|
264
|
+
};
|
|
265
|
+
|
|
266
|
+
export type LemurBaseParameters = {
|
|
267
|
+
/** @description Context to provide the model. This can be a string or a free-form JSON value. */
|
|
268
|
+
context?: OneOf<
|
|
269
|
+
[
|
|
270
|
+
string,
|
|
271
|
+
{
|
|
272
|
+
[key: string]: unknown;
|
|
273
|
+
}
|
|
274
|
+
]
|
|
275
|
+
>;
|
|
276
|
+
final_model?: LemurModel;
|
|
277
|
+
/** @description Max output size in tokens. Up to 4000 allowed. */
|
|
278
|
+
max_output_size?: number;
|
|
279
|
+
/**
|
|
280
|
+
* Format: float
|
|
281
|
+
* @description The temperature to use for the model.
|
|
282
|
+
* Higher values result in answers that are more creative, lower values are more conservative.
|
|
283
|
+
* Can be any value between 0.0 and 1.0 inclusive.
|
|
284
|
+
*/
|
|
285
|
+
temperature?: number;
|
|
286
|
+
/** @description A list of completed transcripts with text. Up to 100 files max, or 100 hours max. Whichever is lower. */
|
|
287
|
+
transcript_ids: string[];
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
export type LemurBaseResponse = {
|
|
291
|
+
/** @description The ID of the LeMUR request */
|
|
292
|
+
request_id: string;
|
|
293
|
+
};
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* @description The model that is used for the final prompt after compression is performed (options: "basic" and "default").
|
|
297
|
+
*
|
|
298
|
+
* @enum {string}
|
|
299
|
+
*/
|
|
300
|
+
export type LemurModel = "default" | "basic";
|
|
301
|
+
|
|
302
|
+
export type LemurQuestion = {
|
|
303
|
+
/** @description How you want the answer to be returned. This can be any text. Can't be used with answer_options. Examples: "short sentence", "bullet points" */
|
|
304
|
+
answer_format?: string;
|
|
305
|
+
/** @description What discrete options to return. Useful for precise responses. Can't be used with answer_format. Example: ["Yes", "No"] */
|
|
306
|
+
answer_options?: string[];
|
|
307
|
+
/** @description Any context about the transcripts you wish to provide. This can be a string, or free-form JSON. */
|
|
308
|
+
context?: OneOf<
|
|
309
|
+
[
|
|
310
|
+
string,
|
|
311
|
+
{
|
|
312
|
+
[key: string]: unknown;
|
|
313
|
+
}
|
|
314
|
+
]
|
|
315
|
+
>;
|
|
316
|
+
/** @description The question you wish to ask. For more complex questions use default model. */
|
|
317
|
+
question: string;
|
|
318
|
+
};
|
|
319
|
+
|
|
320
|
+
/** @description An answer generated by LeMUR and its question. */
|
|
321
|
+
export type LemurQuestionAnswer = {
|
|
322
|
+
/** @description The answer generated by LeMUR. */
|
|
323
|
+
answer: string;
|
|
324
|
+
/** @description The question for LeMUR to answer. */
|
|
325
|
+
question: string;
|
|
326
|
+
};
|
|
327
|
+
|
|
328
|
+
export type LemurQuestionAnswerParameters = LemurBaseParameters & {
|
|
329
|
+
/** @description A list of questions to ask. */
|
|
330
|
+
questions: LemurQuestion[];
|
|
331
|
+
};
|
|
332
|
+
|
|
333
|
+
export type LemurQuestionAnswerResponse = LemurBaseResponse & {
|
|
334
|
+
/** @description The answers generated by LeMUR and their questions. */
|
|
335
|
+
response: LemurQuestionAnswer[];
|
|
336
|
+
};
|
|
337
|
+
|
|
338
|
+
export type LemurSummaryParameters = LemurBaseParameters & {
|
|
339
|
+
/** @description How you want the summary to be returned. This can be any text. Examples: "TLDR", "bullet points" */
|
|
340
|
+
answer_format?: string;
|
|
341
|
+
};
|
|
342
|
+
|
|
343
|
+
export type LemurSummaryResponse = LemurBaseResponse & {
|
|
344
|
+
/** @description The response generated by LeMUR. */
|
|
345
|
+
response: string;
|
|
346
|
+
};
|
|
347
|
+
|
|
348
|
+
export type LemurTaskParameters = LemurBaseParameters & {
|
|
349
|
+
/** @description Your text to prompt the model to produce a desired output, including any context you want to pass into the model. */
|
|
350
|
+
prompt: string;
|
|
351
|
+
};
|
|
352
|
+
|
|
353
|
+
export type LemurTaskResponse = LemurBaseResponse & {
|
|
354
|
+
/** @description The response generated by LeMUR. */
|
|
355
|
+
response: string;
|
|
356
|
+
};
|
|
357
|
+
|
|
358
|
+
export type PageDetails = {
|
|
359
|
+
current_url: string;
|
|
360
|
+
limit: number;
|
|
361
|
+
next_url?: string | null;
|
|
362
|
+
prev_url: string;
|
|
363
|
+
result_count: number;
|
|
364
|
+
};
|
|
365
|
+
|
|
366
|
+
export type ParagraphsResponse = {
|
|
367
|
+
audio_duration: number;
|
|
368
|
+
/** Format: double */
|
|
369
|
+
confidence: number;
|
|
370
|
+
id: string;
|
|
371
|
+
paragraphs: TranscriptParagraph[];
|
|
372
|
+
};
|
|
373
|
+
|
|
374
|
+
/** @enum {string} */
|
|
375
|
+
export type PiiPolicy =
|
|
376
|
+
| "medical_process"
|
|
377
|
+
| "medical_condition"
|
|
378
|
+
| "blood_type"
|
|
379
|
+
| "drug"
|
|
380
|
+
| "injury"
|
|
381
|
+
| "number_sequence"
|
|
382
|
+
| "email_address"
|
|
383
|
+
| "date_of_birth"
|
|
384
|
+
| "phone_number"
|
|
385
|
+
| "us_social_security_number"
|
|
386
|
+
| "credit_card_number"
|
|
387
|
+
| "credit_card_expiration"
|
|
388
|
+
| "credit_card_cvv"
|
|
389
|
+
| "date"
|
|
390
|
+
| "nationality"
|
|
391
|
+
| "event"
|
|
392
|
+
| "language"
|
|
393
|
+
| "location"
|
|
394
|
+
| "money_amount"
|
|
395
|
+
| "person_name"
|
|
396
|
+
| "person_age"
|
|
397
|
+
| "organization"
|
|
398
|
+
| "political_affiliation"
|
|
399
|
+
| "occupation"
|
|
400
|
+
| "religion"
|
|
401
|
+
| "drivers_license"
|
|
402
|
+
| "banking_information";
|
|
403
|
+
|
|
404
|
+
export type PurgeLemurRequestDataResponse = {
|
|
405
|
+
/** @description Whether the request data was deleted. */
|
|
406
|
+
deleted: boolean;
|
|
407
|
+
/** @description The ID of the LeMUR request */
|
|
408
|
+
request_id: string;
|
|
409
|
+
/** @description The ID of the deletion request of the LeMUR request */
|
|
410
|
+
request_id_to_purge: string;
|
|
411
|
+
};
|
|
412
|
+
|
|
413
|
+
export type RealtimeTemporaryTokenResponse = {
|
|
414
|
+
/** @description The temporary authentication token for real-time transcription */
|
|
415
|
+
token: string;
|
|
416
|
+
};
|
|
417
|
+
|
|
418
|
+
export type RedactedAudioResponse = {
|
|
419
|
+
/** @description The URL of the redacted audio file */
|
|
420
|
+
redacted_audio_url: string;
|
|
421
|
+
/** @description The status of the redacted audio */
|
|
422
|
+
status: RedactedAudioStatus;
|
|
423
|
+
};
|
|
424
|
+
|
|
425
|
+
/**
|
|
426
|
+
* @description The status of the redacted audio
|
|
427
|
+
* @enum {string}
|
|
428
|
+
*/
|
|
429
|
+
export type RedactedAudioStatus = "redacted_audio_ready";
|
|
430
|
+
|
|
431
|
+
export type SentencesResponse = {
|
|
432
|
+
audio_duration: number;
|
|
433
|
+
/** Format: double */
|
|
434
|
+
confidence: number;
|
|
435
|
+
id: string;
|
|
436
|
+
sentences: TranscriptSentence[];
|
|
437
|
+
};
|
|
438
|
+
|
|
439
|
+
/** @enum {unknown} */
|
|
440
|
+
export type Sentiment = "POSITIVE" | "NEUTRAL" | "NEGATIVE";
|
|
441
|
+
|
|
442
|
+
/** @description The result of the sentiment analysis model. */
|
|
443
|
+
export type SentimentAnalysisResult = {
|
|
444
|
+
/**
|
|
445
|
+
* Format: double
|
|
446
|
+
* @description The confidence score for the detected sentiment of the sentence, from 0 to 1
|
|
447
|
+
*/
|
|
448
|
+
confidence: number;
|
|
449
|
+
/** @description The ending time, in milliseconds, of the sentence */
|
|
450
|
+
end: number;
|
|
451
|
+
/** @description The detected sentiment for the sentence, one of POSITIVE, NEUTRAL, NEGATIVE */
|
|
452
|
+
sentiment: Sentiment;
|
|
453
|
+
/** @description The speaker of the sentence if Speaker Diarization is enabled, else null */
|
|
454
|
+
speaker?: string | null;
|
|
455
|
+
/** @description The starting time, in milliseconds, of the sentence */
|
|
456
|
+
start: number;
|
|
457
|
+
/** @description The transcript of the sentence */
|
|
458
|
+
text: string;
|
|
459
|
+
};
|
|
460
|
+
|
|
461
|
+
export type SeverityScoreSummary = {
|
|
462
|
+
/** Format: double */
|
|
463
|
+
high: number;
|
|
464
|
+
/** Format: double */
|
|
465
|
+
low: number;
|
|
466
|
+
/** Format: double */
|
|
467
|
+
medium: number;
|
|
468
|
+
};
|
|
469
|
+
|
|
470
|
+
/**
|
|
471
|
+
* @description The replacement logic for detected PII, can be "entity_type" or "hash". See [PII redaction](https://www.assemblyai.com/docs/Models/pii_redaction) for more details.
|
|
472
|
+
* @enum {string|null}
|
|
473
|
+
*/
|
|
474
|
+
export type SubstitutionPolicy = "entity_type" | "hash";
|
|
475
|
+
|
|
476
|
+
/**
|
|
477
|
+
* @description Format of the subtitles
|
|
478
|
+
* @enum {string}
|
|
479
|
+
*/
|
|
480
|
+
export type SubtitleFormat = "srt" | "vtt";
|
|
481
|
+
|
|
482
|
+
/**
|
|
483
|
+
* @description The model to summarize the transcript
|
|
484
|
+
* @default informative
|
|
485
|
+
* @enum {string}
|
|
486
|
+
*/
|
|
487
|
+
export type SummaryModel = "informative" | "conversational" | "catchy";
|
|
488
|
+
|
|
489
|
+
/**
|
|
490
|
+
* @description The type of summary
|
|
491
|
+
* @default bullets
|
|
492
|
+
* @enum {string}
|
|
493
|
+
*/
|
|
494
|
+
export type SummaryType =
|
|
495
|
+
| "bullets"
|
|
496
|
+
| "bullets_verbose"
|
|
497
|
+
| "gist"
|
|
498
|
+
| "headline"
|
|
499
|
+
| "paragraph";
|
|
500
|
+
|
|
501
|
+
/** @description Timestamp containing a start and end property in milliseconds. */
|
|
502
|
+
export type Timestamp = {
|
|
503
|
+
/** @description The end time in milliseconds */
|
|
504
|
+
end: number;
|
|
505
|
+
/** @description The start time in milliseconds */
|
|
506
|
+
start: number;
|
|
507
|
+
};
|
|
508
|
+
|
|
509
|
+
/** @description THe result of the topic detection model. */
|
|
510
|
+
export type TopicDetectionResult = {
|
|
511
|
+
labels?: {
|
|
512
|
+
/** @description The IAB taxonomical label for the label of the detected topic, where > denotes supertopic/subtopic relationship */
|
|
513
|
+
label: string;
|
|
514
|
+
/**
|
|
515
|
+
* Format: double
|
|
516
|
+
* @description How relevant the detected topic is of a detected topic
|
|
517
|
+
*/
|
|
518
|
+
relevance: number;
|
|
519
|
+
}[];
|
|
520
|
+
/** @description The text in the transcript in which a detected topic occurs */
|
|
521
|
+
text: string;
|
|
522
|
+
timestamp?: Timestamp;
|
|
523
|
+
};
|
|
524
|
+
|
|
525
|
+
/** @description A transcript object */
|
|
526
|
+
export type Transcript = {
|
|
527
|
+
/**
|
|
528
|
+
* @deprecated
|
|
529
|
+
* @description The acoustic model that was used for the transcription
|
|
530
|
+
*/
|
|
531
|
+
acoustic_model: string;
|
|
532
|
+
/**
|
|
533
|
+
* Format: float
|
|
534
|
+
* @description The duration of this transcript object's media file, in seconds
|
|
535
|
+
*/
|
|
536
|
+
audio_duration?: number | null;
|
|
537
|
+
/** @description The point in time, in milliseconds, in the file at which the transcription was terminated, if provided in the transcription request */
|
|
538
|
+
audio_end_at?: number | null;
|
|
539
|
+
/** @description The point in time, in milliseconds, in the file at which the transcription was started, if provided in the transcription request */
|
|
540
|
+
audio_start_from?: number | null;
|
|
541
|
+
/** @description The URL of the media that was transcribed */
|
|
542
|
+
audio_url: string;
|
|
543
|
+
/** @description Enable [Auto Chapters](https://www.assemblyai.com/docs/Models/auto_chapters), can be true or false */
|
|
544
|
+
auto_chapters?: boolean | null;
|
|
545
|
+
/** @description Whether Key Phrases was enabled in the transcription request, either true or false */
|
|
546
|
+
auto_highlights: boolean;
|
|
547
|
+
/**
|
|
548
|
+
* @description An array of results for the Key Phrases model, if it was enabled during the transcription request.
|
|
549
|
+
* See [Key phrases](https://www.assemblyai.com/docs/Models/key_phrases) for more information.
|
|
550
|
+
*/
|
|
551
|
+
auto_highlights_result?: AutoHighlightsResult;
|
|
552
|
+
/** @description The word boost parameter value, if provided in the transcription request */
|
|
553
|
+
boost_param?: string | null;
|
|
554
|
+
/** @description An array of temporally sequential chapters for the audio file */
|
|
555
|
+
chapters?: Chapter[] | null;
|
|
556
|
+
/**
|
|
557
|
+
* Format: double
|
|
558
|
+
* @description The confidence score for the transcript, between 0.0 (low confidence) and 1.0 (high confidence)
|
|
559
|
+
*/
|
|
560
|
+
confidence?: number | null;
|
|
561
|
+
/** @description Enable [Content Moderation](https://www.assemblyai.com/docs/Models/content_moderation), can be true or false */
|
|
562
|
+
content_safety?: boolean | null;
|
|
563
|
+
/**
|
|
564
|
+
* @description An array of results for the Content Moderation model, if it was enabled during the transcription request.
|
|
565
|
+
* See [Content moderation](https://www.assemblyai.com/docs/Models/content_moderation) for more information.
|
|
566
|
+
*/
|
|
567
|
+
content_safety_labels?: {
|
|
568
|
+
results: ContentSafetyLabelResult[];
|
|
569
|
+
/** @description Will be either success, or unavailable in the rare case that the Content Safety Labels model failed. */
|
|
570
|
+
status: AudioIntelligenceModelStatus;
|
|
571
|
+
} | null;
|
|
572
|
+
/** @description Customize how words are spelled and formatted using to and from values */
|
|
573
|
+
custom_spelling?: TranscriptCustomSpelling[] | null;
|
|
574
|
+
/** @description Whether custom topics was enabled in the transcription request, either true or false */
|
|
575
|
+
custom_topics?: boolean | null;
|
|
576
|
+
/** @description Transcribe Filler Words, like "umm", in your media file; can be true or false */
|
|
577
|
+
disfluencies?: boolean | null;
|
|
578
|
+
/** @description Whether [Dual channel transcription](https://www.assemblyai.com/docs/Models/speech_recognition#dual-channel-transcription) was enabled in the transcription request, either true or false */
|
|
579
|
+
dual_channel?: boolean | null;
|
|
580
|
+
/**
|
|
581
|
+
* @description An array of results for the Entity Detection model, if it was enabled during the transcription request.
|
|
582
|
+
* See [Entity detection](https://www.assemblyai.com/docs/Models/entity_detection) for more information.
|
|
583
|
+
*/
|
|
584
|
+
entities?: Entity[] | null;
|
|
585
|
+
/** @description Enable [Entity Detection](https://www.assemblyai.com/docs/Models/entity_detection), can be true or false */
|
|
586
|
+
entity_detection?: boolean | null;
|
|
587
|
+
/** @description Error message of why the transcript failed */
|
|
588
|
+
error?: string;
|
|
589
|
+
/** @description Whether [Profanity Filtering](https://www.assemblyai.com/docs/Models/speech_recognition#profanity-filtering) was enabled in the transcription request, either true or false */
|
|
590
|
+
filter_profanity?: boolean | null;
|
|
591
|
+
/** @description Whether Text Formatting was enabled in the transcription request, either true or false */
|
|
592
|
+
format_text?: boolean | null;
|
|
593
|
+
/** @description Enable [Topic Detection](https://www.assemblyai.com/docs/Models/iab_classification), can be true or false */
|
|
594
|
+
iab_categories?: boolean | null;
|
|
595
|
+
/**
|
|
596
|
+
* @description An array of results for the Topic Detection model, if it was enabled during the transcription request.
|
|
597
|
+
* See [Topic Detection](https://www.assemblyai.com/docs/Models/iab_classification) for more information.
|
|
598
|
+
*/
|
|
599
|
+
iab_categories_result?: {
|
|
600
|
+
/** @description An array of results for the Topic Detection model. */
|
|
601
|
+
results: TopicDetectionResult[];
|
|
602
|
+
/** @description Will be either success, or unavailable in the rare case that the Content Moderation model failed. */
|
|
603
|
+
status: AudioIntelligenceModelStatus;
|
|
604
|
+
/** @description The overall relevance of topic to the entire audio file */
|
|
605
|
+
summary: {
|
|
606
|
+
[key: string]: number;
|
|
607
|
+
};
|
|
608
|
+
} | null;
|
|
609
|
+
/** @description The unique identifier of your transcription */
|
|
610
|
+
id: string;
|
|
611
|
+
/**
|
|
612
|
+
* @description The language of your audio file.
|
|
613
|
+
* Possible values are found in [Supported Languages](https://www.assemblyai.com/docs/Concepts/supported_languages).
|
|
614
|
+
* The default value is 'en_us'.
|
|
615
|
+
*/
|
|
616
|
+
language_code?: TranscriptLanguageCode;
|
|
617
|
+
/** @description Whether [Automatic language detection](https://www.assemblyai.com/docs/Models/speech_recognition#automatic-language-detection) was enabled in the transcription request, either true or false */
|
|
618
|
+
language_detection?: boolean | null;
|
|
619
|
+
/**
|
|
620
|
+
* @deprecated
|
|
621
|
+
* @description The language model that was used for the transcription
|
|
622
|
+
*/
|
|
623
|
+
language_model: string;
|
|
624
|
+
/** @description Whether Automatic Punctuation was enabled in the transcription request, either true or false. */
|
|
625
|
+
punctuate?: boolean | null;
|
|
626
|
+
/** @description Whether [PII Redaction](https://www.assemblyai.com/docs/Models/pii_redaction) was enabled in the transcription request, either true or false */
|
|
627
|
+
redact_pii: boolean;
|
|
628
|
+
/**
|
|
629
|
+
* @description Whether a redacted version of the audio file was generated (enabled or disabled in the transcription request),
|
|
630
|
+
* either true or false. See [PII redaction](https://www.assemblyai.com/docs/Models/pii_redaction) for more information.
|
|
631
|
+
*/
|
|
632
|
+
redact_pii_audio?: boolean | null;
|
|
633
|
+
/**
|
|
634
|
+
* @description The audio quality of the PII-redacted audio file, if enabled in the transcription request.
|
|
635
|
+
* See [PII redaction](https://www.assemblyai.com/docs/Models/pii_redaction) for more information.
|
|
636
|
+
*/
|
|
637
|
+
redact_pii_audio_quality?: string | null;
|
|
638
|
+
/**
|
|
639
|
+
* @description The list of PII Redaction policies that were enabled, if PII Redaction is enabled.
|
|
640
|
+
* See [PII redaction](https://www.assemblyai.com/docs/Models/pii_redaction) for more information.
|
|
641
|
+
*/
|
|
642
|
+
redact_pii_policies?: PiiPolicy[] | null;
|
|
643
|
+
/** @description The replacement logic for detected PII, can be "entity_type" or "hash". See [PII redaction](https://www.assemblyai.com/docs/Models/pii_redaction) for more details. */
|
|
644
|
+
redact_pii_sub?: SubstitutionPolicy;
|
|
645
|
+
/** @description Enable [Sentiment Analysis](https://www.assemblyai.com/docs/Models/sentiment_analysis), can be true or false */
|
|
646
|
+
sentiment_analysis?: boolean | null;
|
|
647
|
+
/**
|
|
648
|
+
* @description An array of results for the Sentiment Analysis model, if it was enabled during the transcription request.
|
|
649
|
+
* See [Sentiment analysis](https://www.assemblyai.com/docs/Models/sentiment_analysis) for more information.
|
|
650
|
+
*/
|
|
651
|
+
sentiment_analysis_results?: SentimentAnalysisResult[] | null;
|
|
652
|
+
/** @description Enable [Speaker diarization](https://www.assemblyai.com/docs/Models/speaker_diarization), can be true or false */
|
|
653
|
+
speaker_labels?: boolean | null;
|
|
654
|
+
/** @description Defaults to null. Tells the speaker label model how many speakers it should attempt to identify, up to 10. See [Speaker diarization](https://www.assemblyai.com/docs/Models/speaker_diarization) for more details. */
|
|
655
|
+
speakers_expected?: number | null;
|
|
656
|
+
/**
|
|
657
|
+
* Format: float
|
|
658
|
+
* @description Defaults to null. Reject audio files that contain less than this fraction of speech.
|
|
659
|
+
* Valid values are in the range [0, 1] inclusive.
|
|
660
|
+
*/
|
|
661
|
+
speech_threshold?: number | null;
|
|
662
|
+
/**
|
|
663
|
+
* @deprecated
|
|
664
|
+
* @description Whether speed boost was enabled in the transcription request
|
|
665
|
+
*/
|
|
666
|
+
speed_boost?: boolean | null;
|
|
667
|
+
/** @description The status of your transcription. Possible values are queued, processing, completed, or error. */
|
|
668
|
+
status: TranscriptStatus;
|
|
669
|
+
/** @description Whether [Summarization](https://www.assemblyai.com/docs/Models/summarization) was enabled in the transcription request, either true or false */
|
|
670
|
+
summarization: boolean;
|
|
671
|
+
/** @description The generated summary of the media file, if [Summarization](https://www.assemblyai.com/docs/Models/summarization) was enabled in the transcription request */
|
|
672
|
+
summary?: string | null;
|
|
673
|
+
/**
|
|
674
|
+
* @description The Summarization model used to generate the summary,
|
|
675
|
+
* if [Summarization](https://www.assemblyai.com/docs/Models/summarization) was enabled in the transcription request
|
|
676
|
+
*/
|
|
677
|
+
summary_model?: string | null;
|
|
678
|
+
/** @description The type of summary generated, if [Summarization](https://www.assemblyai.com/docs/Models/summarization) was enabled in the transcription request */
|
|
679
|
+
summary_type?: string | null;
|
|
680
|
+
/** @description The textual transcript of your media file */
|
|
681
|
+
text?: string | null;
|
|
682
|
+
/** @description True while a request is throttled and false when a request is no longer throttled */
|
|
683
|
+
throttled?: boolean | null;
|
|
684
|
+
/** @description The list of custom topics provided if custom topics was enabled in the transcription request */
|
|
685
|
+
topics?: string[];
|
|
686
|
+
/**
|
|
687
|
+
* @description When dual_channel or speaker_labels is enabled, a list of turn-by-turn utterance objects.
|
|
688
|
+
* See [Speaker diarization](https://www.assemblyai.com/docs/Models/speaker_diarization) for more information.
|
|
689
|
+
*/
|
|
690
|
+
utterances?: TranscriptUtterance[] | null;
|
|
691
|
+
/** @description Whether webhook authentication details were provided in the transcription request */
|
|
692
|
+
webhook_auth: boolean;
|
|
693
|
+
/** @description The header name which should be sent back with webhook calls, if provided in the transcription request */
|
|
694
|
+
webhook_auth_header_name?: string | null;
|
|
695
|
+
/** @description The status code we received from your server when delivering your webhook, if a webhook URL was provided in the transcription request */
|
|
696
|
+
webhook_status_code?: number | null;
|
|
697
|
+
/** @description The URL to which we send webhooks upon trancription completion, if provided in the transcription request */
|
|
698
|
+
webhook_url?: string | null;
|
|
699
|
+
/** @description The list of custom vocabulary to boost transcription probability for, if provided in the transcription request */
|
|
700
|
+
word_boost?: string[];
|
|
701
|
+
/**
|
|
702
|
+
* @description An array of temporally-sequential word objects, one for each word in the transcript.
|
|
703
|
+
* See [Speech recognition](https://www.assemblyai.com/docs/Models/speech_recognition) for more information.
|
|
704
|
+
*/
|
|
705
|
+
words?: TranscriptWord[] | null;
|
|
706
|
+
};
|
|
707
|
+
|
|
708
|
+
/**
|
|
709
|
+
* @description The word boost parameter value, if provided in the transcription request.
|
|
710
|
+
* @enum {string}
|
|
711
|
+
*/
|
|
712
|
+
export type TranscriptBoostParam = "low" | "default" | "high";
|
|
713
|
+
|
|
714
|
+
/** @description Object containing words or phrases to replace, and the word or phrase to replace with */
|
|
715
|
+
export type TranscriptCustomSpelling = {
|
|
716
|
+
/** @description Words or phrases to replace */
|
|
717
|
+
from: string[];
|
|
718
|
+
/** @description Word or phrase to replace with */
|
|
719
|
+
to: string;
|
|
720
|
+
};
|
|
721
|
+
|
|
722
|
+
/**
|
|
723
|
+
* @description The language of your audio file. Possible values are found in [Supported Languages](https://www.assemblyai.com/docs/Concepts/supported_languages).
|
|
724
|
+
* The default value is 'en_us'.
|
|
725
|
+
*
|
|
726
|
+
* @default en_us
|
|
727
|
+
* @enum {string|null}
|
|
728
|
+
*/
|
|
729
|
+
export type TranscriptLanguageCode =
|
|
730
|
+
| "en"
|
|
731
|
+
| "en_au"
|
|
732
|
+
| "en_uk"
|
|
733
|
+
| "en_us"
|
|
734
|
+
| "es"
|
|
735
|
+
| "fr"
|
|
736
|
+
| "de"
|
|
737
|
+
| "it"
|
|
738
|
+
| "pt"
|
|
739
|
+
| "nl"
|
|
740
|
+
| "hi"
|
|
741
|
+
| "ja"
|
|
742
|
+
| "zh"
|
|
743
|
+
| "fi"
|
|
744
|
+
| "ko"
|
|
745
|
+
| "pl"
|
|
746
|
+
| "ru"
|
|
747
|
+
| "tr"
|
|
748
|
+
| "uk"
|
|
749
|
+
| "vi";
|
|
750
|
+
|
|
751
|
+
export type TranscriptList = {
|
|
752
|
+
page_details: PageDetails;
|
|
753
|
+
transcripts: TranscriptListItem[];
|
|
754
|
+
};
|
|
755
|
+
|
|
756
|
+
export type TranscriptListItem = {
|
|
757
|
+
audio_url: string;
|
|
758
|
+
completed?: Date;
|
|
759
|
+
created: Date;
|
|
760
|
+
id: string;
|
|
761
|
+
resource_url: string;
|
|
762
|
+
status: TranscriptStatus;
|
|
763
|
+
};
|
|
764
|
+
|
|
765
|
+
export type TranscriptParagraph = {
|
|
766
|
+
/** Format: double */
|
|
767
|
+
confidence: number;
|
|
768
|
+
end: number;
|
|
769
|
+
start: number;
|
|
770
|
+
text: string;
|
|
771
|
+
words: TranscriptWord[];
|
|
772
|
+
};
|
|
773
|
+
|
|
774
|
+
export type TranscriptSentence = {
|
|
775
|
+
/** Format: double */
|
|
776
|
+
confidence: number;
|
|
777
|
+
end: number;
|
|
778
|
+
start: number;
|
|
779
|
+
text: string;
|
|
780
|
+
words: TranscriptWord[];
|
|
781
|
+
};
|
|
782
|
+
|
|
783
|
+
/**
|
|
784
|
+
* @description The status of your transcription. Possible values are queued, processing, completed, or error.
|
|
785
|
+
* @enum {string}
|
|
786
|
+
*/
|
|
787
|
+
export type TranscriptStatus = "queued" | "processing" | "completed" | "error";
|
|
788
|
+
|
|
789
|
+
export type TranscriptUtterance = {
|
|
790
|
+
channel: string;
|
|
791
|
+
/** Format: double */
|
|
792
|
+
confidence: number;
|
|
793
|
+
end: number;
|
|
794
|
+
start: number;
|
|
795
|
+
text: string;
|
|
796
|
+
words: TranscriptWord[];
|
|
797
|
+
};
|
|
798
|
+
|
|
799
|
+
export type TranscriptWord = {
|
|
800
|
+
/** Format: double */
|
|
801
|
+
confidence: number;
|
|
802
|
+
end: number;
|
|
803
|
+
speaker?: string | null;
|
|
804
|
+
start: number;
|
|
805
|
+
text: string;
|
|
806
|
+
};
|
|
807
|
+
|
|
808
|
+
export type UploadedFile = {
|
|
809
|
+
/** @description A URL that points to your audio file, accessible only by AssemblyAI's servers */
|
|
810
|
+
upload_url: string;
|
|
811
|
+
};
|
|
812
|
+
|
|
813
|
+
export type WordSearchMatch = {
|
|
814
|
+
/** @description The total amount of times the word is in the transcript */
|
|
815
|
+
count: number;
|
|
816
|
+
/** @description An array of all index locations for that word within the `words` array of the completed transcript */
|
|
817
|
+
indexes: number[];
|
|
818
|
+
/** @description The matched word */
|
|
819
|
+
text: string;
|
|
820
|
+
/** @description An array of timestamps */
|
|
821
|
+
timestamps: WordSearchTimestamp[];
|
|
822
|
+
};
|
|
823
|
+
|
|
824
|
+
export type WordSearchResponse = {
|
|
825
|
+
/** @description The ID of the transcript */
|
|
826
|
+
id: string;
|
|
827
|
+
/** @description The matches of the search */
|
|
828
|
+
matches: WordSearchMatch[];
|
|
829
|
+
/** @description The total count of all matched instances. For e.g., word 1 matched 2 times, and word 2 matched 3 times, `total_count` will equal 5. */
|
|
830
|
+
total_count: number;
|
|
831
|
+
};
|
|
832
|
+
|
|
833
|
+
/** @description An array of timestamps structured as [`start_time`, `end_time`] in milliseconds */
|
|
834
|
+
export type WordSearchTimestamp = number[];
|