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,17 +11,20 @@ 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
|
-
* @enum {string}
|
|
20
|
+
* Either success, or unavailable in the rare case that the model failed
|
|
21
21
|
*/
|
|
22
22
|
export type AudioIntelligenceModelStatus = "success" | "unavailable";
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
|
-
* @example
|
|
25
|
+
* @example
|
|
26
|
+
* ```js
|
|
27
|
+
* {
|
|
26
28
|
* "count": 1,
|
|
27
29
|
* "rank": 0.08,
|
|
28
30
|
* "text": "air quality alerts",
|
|
@@ -33,26 +35,34 @@ export type AudioIntelligenceModelStatus = "success" | "unavailable";
|
|
|
33
35
|
* }
|
|
34
36
|
* ]
|
|
35
37
|
* }
|
|
38
|
+
* ```
|
|
36
39
|
*/
|
|
37
40
|
export type AutoHighlightResult = {
|
|
38
|
-
/**
|
|
41
|
+
/**
|
|
42
|
+
* The total number of times the key phrase appears in the audio file
|
|
43
|
+
*/
|
|
39
44
|
count: number;
|
|
40
45
|
/**
|
|
41
|
-
*
|
|
42
|
-
* @description The total relevancy to the overall audio file of this key phrase - a greater number means more relevant
|
|
46
|
+
* The total relevancy to the overall audio file of this key phrase - a greater number means more relevant
|
|
43
47
|
*/
|
|
44
48
|
rank: number;
|
|
45
|
-
/**
|
|
49
|
+
/**
|
|
50
|
+
* The text itself of the key phrase
|
|
51
|
+
*/
|
|
46
52
|
text: string;
|
|
47
|
-
/**
|
|
53
|
+
/**
|
|
54
|
+
* The timestamp of the of the key phrase
|
|
55
|
+
*/
|
|
48
56
|
timestamps: Timestamp[];
|
|
49
57
|
};
|
|
50
58
|
|
|
51
59
|
/**
|
|
52
|
-
*
|
|
53
|
-
* See
|
|
60
|
+
* An array of results for the Key Phrases model, if it is enabled.
|
|
61
|
+
* See {@link https://www.assemblyai.com/docs/models/key-phrases | Key phrases } for more information.
|
|
54
62
|
*
|
|
55
|
-
* @example
|
|
63
|
+
* @example
|
|
64
|
+
* ```js
|
|
65
|
+
* {
|
|
56
66
|
* "status": "success",
|
|
57
67
|
* "results": [
|
|
58
68
|
* {
|
|
@@ -254,59 +264,80 @@ export type AutoHighlightResult = {
|
|
|
254
264
|
* }
|
|
255
265
|
* ]
|
|
256
266
|
* }
|
|
267
|
+
* ```
|
|
257
268
|
*/
|
|
258
269
|
export type AutoHighlightsResult = {
|
|
259
|
-
/**
|
|
270
|
+
/**
|
|
271
|
+
* A temporally-sequential array of Key Phrases
|
|
272
|
+
*/
|
|
260
273
|
results: AutoHighlightResult[];
|
|
261
274
|
};
|
|
262
275
|
|
|
263
276
|
/**
|
|
264
|
-
*
|
|
265
|
-
* @example
|
|
277
|
+
* Chapter of the audio file
|
|
278
|
+
* @example
|
|
279
|
+
* ```js
|
|
280
|
+
* {
|
|
266
281
|
* "summary": "Smoke from hundreds of wildfires in Canada is triggering air quality alerts throughout the US. Skylines from Maine to Maryland to Minnesota are gray and smoggy. In some places, the air quality warnings include the warning to stay inside.",
|
|
267
282
|
* "gist": "Smoggy air quality alerts across US",
|
|
268
283
|
* "headline": "Smoke from hundreds of wildfires in Canada is triggering air quality alerts across US",
|
|
269
284
|
* "start": 250,
|
|
270
285
|
* "end": 28840
|
|
271
286
|
* }
|
|
287
|
+
* ```
|
|
272
288
|
*/
|
|
273
289
|
export type Chapter = {
|
|
274
|
-
/**
|
|
290
|
+
/**
|
|
291
|
+
* The starting time, in milliseconds, for the chapter
|
|
292
|
+
*/
|
|
275
293
|
end: number;
|
|
276
|
-
/**
|
|
294
|
+
/**
|
|
295
|
+
* An ultra-short summary (just a few words) of the content spoken in the chapter
|
|
296
|
+
*/
|
|
277
297
|
gist: string;
|
|
278
|
-
/**
|
|
298
|
+
/**
|
|
299
|
+
* A single sentence summary of the content spoken during the chapter
|
|
300
|
+
*/
|
|
279
301
|
headline: string;
|
|
280
|
-
/**
|
|
302
|
+
/**
|
|
303
|
+
* The starting time, in milliseconds, for the chapter
|
|
304
|
+
*/
|
|
281
305
|
start: number;
|
|
282
|
-
/**
|
|
306
|
+
/**
|
|
307
|
+
* A one paragraph summary of the content spoken during the chapter
|
|
308
|
+
*/
|
|
283
309
|
summary: string;
|
|
284
310
|
};
|
|
285
311
|
|
|
286
312
|
/**
|
|
287
|
-
* @example
|
|
313
|
+
* @example
|
|
314
|
+
* ```js
|
|
315
|
+
* {
|
|
288
316
|
* "label": "disasters",
|
|
289
317
|
* "confidence": 0.8142836093902588,
|
|
290
318
|
* "severity": 0.4093044400215149
|
|
291
319
|
* }
|
|
320
|
+
* ```
|
|
292
321
|
*/
|
|
293
322
|
export type ContentSafetyLabel = {
|
|
294
323
|
/**
|
|
295
|
-
*
|
|
296
|
-
* @description The confidence score for the topic being discussed, from 0 to 1
|
|
324
|
+
* The confidence score for the topic being discussed, from 0 to 1
|
|
297
325
|
*/
|
|
298
326
|
confidence: number;
|
|
299
|
-
/**
|
|
327
|
+
/**
|
|
328
|
+
* The label of the sensitive topic
|
|
329
|
+
*/
|
|
300
330
|
label: string;
|
|
301
331
|
/**
|
|
302
|
-
*
|
|
303
|
-
* @description How severely the topic is discussed in the section, from 0 to 1
|
|
332
|
+
* How severely the topic is discussed in the section, from 0 to 1
|
|
304
333
|
*/
|
|
305
334
|
severity: number;
|
|
306
335
|
};
|
|
307
336
|
|
|
308
337
|
/**
|
|
309
|
-
* @example
|
|
338
|
+
* @example
|
|
339
|
+
* ```js
|
|
340
|
+
* {
|
|
310
341
|
* "text": "Smoke from hundreds of wildfires in Canada is triggering air quality alerts throughout the US. Skylines from Maine to Maryland to Minnesota are gray and smoggy. And in some places, the air quality warnings include the warning to stay inside. We wanted to better understand what's happening here and why, so we called Peter de Carlo, an associate professor in the Department of Environmental Health and Engineering at Johns Hopkins University Varsity. Good morning, professor. Good morning.",
|
|
311
342
|
* "labels": [
|
|
312
343
|
* {
|
|
@@ -322,25 +353,38 @@ export type ContentSafetyLabel = {
|
|
|
322
353
|
* "end": 28840
|
|
323
354
|
* }
|
|
324
355
|
* }
|
|
356
|
+
* ```
|
|
325
357
|
*/
|
|
326
358
|
export type ContentSafetyLabelResult = {
|
|
327
|
-
/**
|
|
359
|
+
/**
|
|
360
|
+
* An array of safety labels, one per sensitive topic that was detected in the section
|
|
361
|
+
*/
|
|
328
362
|
labels: ContentSafetyLabel[];
|
|
329
|
-
/**
|
|
363
|
+
/**
|
|
364
|
+
* The sentence index at which the section ends
|
|
365
|
+
*/
|
|
330
366
|
sentences_idx_end: number;
|
|
331
|
-
/**
|
|
367
|
+
/**
|
|
368
|
+
* The sentence index at which the section begins
|
|
369
|
+
*/
|
|
332
370
|
sentences_idx_start: number;
|
|
333
|
-
/**
|
|
371
|
+
/**
|
|
372
|
+
* The transcript of the section flagged by the Content Moderation model
|
|
373
|
+
*/
|
|
334
374
|
text: string;
|
|
335
|
-
/**
|
|
375
|
+
/**
|
|
376
|
+
* Timestamp information for the section
|
|
377
|
+
*/
|
|
336
378
|
timestamp: Timestamp;
|
|
337
379
|
};
|
|
338
380
|
|
|
339
381
|
/**
|
|
340
|
-
*
|
|
341
|
-
* See
|
|
382
|
+
* An array of results for the Content Moderation model, if it is enabled.
|
|
383
|
+
* See {@link https://www.assemblyai.com/docs/models/content-moderation | Content moderation } for more information.
|
|
342
384
|
*
|
|
343
|
-
* @example
|
|
385
|
+
* @example
|
|
386
|
+
* ```js
|
|
387
|
+
* {
|
|
344
388
|
* "status": "success",
|
|
345
389
|
* "results": [
|
|
346
390
|
* {
|
|
@@ -377,54 +421,76 @@ export type ContentSafetyLabelResult = {
|
|
|
377
421
|
* }
|
|
378
422
|
* }
|
|
379
423
|
* }
|
|
424
|
+
* ```
|
|
380
425
|
*/
|
|
381
426
|
export type ContentSafetyLabelsResult = {
|
|
382
427
|
results: ContentSafetyLabelResult[];
|
|
383
|
-
/**
|
|
428
|
+
/**
|
|
429
|
+
* A summary of the Content Moderation severity results for the entire audio file
|
|
430
|
+
*/
|
|
384
431
|
severity_score_summary: {
|
|
385
432
|
[key: string]: SeverityScoreSummary;
|
|
386
433
|
};
|
|
387
|
-
/**
|
|
434
|
+
/**
|
|
435
|
+
* The status of the Content Moderation model. Either success, or unavailable in the rare case that the model failed.
|
|
436
|
+
*/
|
|
388
437
|
status: AudioIntelligenceModelStatus;
|
|
389
|
-
/**
|
|
438
|
+
/**
|
|
439
|
+
* A summary of the Content Moderation confidence results for the entire audio file
|
|
440
|
+
*/
|
|
390
441
|
summary: {
|
|
391
442
|
[key: string]: number;
|
|
392
443
|
};
|
|
393
444
|
};
|
|
394
445
|
|
|
395
446
|
/**
|
|
396
|
-
* @example
|
|
447
|
+
* @example
|
|
448
|
+
* ```js
|
|
449
|
+
* {
|
|
397
450
|
* "expires_in": 480
|
|
398
451
|
* }
|
|
452
|
+
* ```
|
|
399
453
|
*/
|
|
400
454
|
export type CreateRealtimeTemporaryTokenParams = {
|
|
401
|
-
/**
|
|
455
|
+
/**
|
|
456
|
+
* The amount of time until the token expires in seconds
|
|
457
|
+
*/
|
|
402
458
|
expires_in: number;
|
|
403
459
|
};
|
|
404
460
|
|
|
405
461
|
/**
|
|
406
|
-
*
|
|
407
|
-
* @example
|
|
462
|
+
* A detected entity
|
|
463
|
+
* @example
|
|
464
|
+
* ```js
|
|
465
|
+
* {
|
|
408
466
|
* "entity_type": "location",
|
|
409
467
|
* "text": "Canada",
|
|
410
468
|
* "start": 2548,
|
|
411
469
|
* "end": 3130
|
|
412
470
|
* }
|
|
471
|
+
* ```
|
|
413
472
|
*/
|
|
414
473
|
export type Entity = {
|
|
415
|
-
/**
|
|
474
|
+
/**
|
|
475
|
+
* The ending time, in milliseconds, for the detected entity in the audio file
|
|
476
|
+
*/
|
|
416
477
|
end: number;
|
|
417
|
-
/**
|
|
478
|
+
/**
|
|
479
|
+
* The type of entity for the detected entity
|
|
480
|
+
*/
|
|
418
481
|
entity_type: EntityType;
|
|
419
|
-
/**
|
|
482
|
+
/**
|
|
483
|
+
* The starting time, in milliseconds, at which the detected entity appears in the audio file
|
|
484
|
+
*/
|
|
420
485
|
start: number;
|
|
421
|
-
/**
|
|
486
|
+
/**
|
|
487
|
+
* The text for the detected entity
|
|
488
|
+
*/
|
|
422
489
|
text: string;
|
|
423
490
|
};
|
|
424
491
|
|
|
425
492
|
/**
|
|
426
|
-
*
|
|
427
|
-
* @enum {string}
|
|
493
|
+
* The type of entity for the detected entity
|
|
428
494
|
*/
|
|
429
495
|
export type EntityType =
|
|
430
496
|
| "banking_information"
|
|
@@ -458,19 +524,25 @@ export type EntityType =
|
|
|
458
524
|
| "us_social_security_number";
|
|
459
525
|
|
|
460
526
|
/**
|
|
461
|
-
* @example
|
|
527
|
+
* @example
|
|
528
|
+
* ```js
|
|
529
|
+
* {
|
|
462
530
|
* "error": "format_text must be a Boolean"
|
|
463
531
|
* }
|
|
532
|
+
* ```
|
|
464
533
|
*/
|
|
465
534
|
export type Error = {
|
|
466
|
-
/**
|
|
535
|
+
/**
|
|
536
|
+
* Error message
|
|
537
|
+
*/
|
|
467
538
|
error: string;
|
|
468
|
-
/** @constant */
|
|
469
539
|
status?: "error";
|
|
470
540
|
};
|
|
471
541
|
|
|
472
542
|
/**
|
|
473
|
-
* @example
|
|
543
|
+
* @example
|
|
544
|
+
* ```js
|
|
545
|
+
* {
|
|
474
546
|
* "transcript_ids": [
|
|
475
547
|
* "64nygnr62k-405c-4ae8-8a6b-d90b40ff3cce"
|
|
476
548
|
* ],
|
|
@@ -480,30 +552,38 @@ export type Error = {
|
|
|
480
552
|
* "temperature": 0,
|
|
481
553
|
* "max_output_size": 3000
|
|
482
554
|
* }
|
|
555
|
+
* ```
|
|
483
556
|
*/
|
|
484
557
|
export type LemurActionItemsParams = LemurBaseParams & {
|
|
485
558
|
/**
|
|
486
|
-
*
|
|
559
|
+
* How you want the action items to be returned. This can be any text.
|
|
487
560
|
* Defaults to "Bullet Points".
|
|
488
561
|
*
|
|
489
|
-
* @
|
|
562
|
+
* @defaultValue "Bullet Points
|
|
490
563
|
*/
|
|
491
564
|
answer_format?: string;
|
|
492
565
|
};
|
|
493
566
|
|
|
494
567
|
/**
|
|
495
|
-
* @example
|
|
496
|
-
*
|
|
568
|
+
* @example
|
|
569
|
+
* ```js
|
|
570
|
+
* {
|
|
571
|
+
* "request_id": "5"e1b27c2-691f-4414-8bc5-f14678442f9e",
|
|
497
572
|
* "response": "Here are some potential action items based on the transcript:\n\n- Monitor air quality levels in affected areas and issue warnings as needed.\n\n- Advise vulnerable populations like children, the elderly, and those with respiratory conditions to limit time outdoors.\n\n- Have schools cancel outdoor activities when air quality is poor.\n\n- Educate the public on health impacts of smoke inhalation and precautions to take.\n\n- Track progression of smoke plumes using weather and air quality monitoring systems.\n\n- Coordinate cross-regionally to manage smoke exposure as air masses shift.\n\n- Plan for likely increase in such events due to climate change. Expand monitoring and forecasting capabilities.\n\n- Conduct research to better understand health impacts of wildfire smoke and mitigation strategies.\n\n- Develop strategies to prevent and manage wildfires to limit air quality impacts.\n"
|
|
498
573
|
* }
|
|
574
|
+
* ```
|
|
499
575
|
*/
|
|
500
576
|
export type LemurActionItemsResponse = LemurBaseResponse & {
|
|
501
|
-
/**
|
|
577
|
+
/**
|
|
578
|
+
* The response generated by LeMUR
|
|
579
|
+
*/
|
|
502
580
|
response: string;
|
|
503
581
|
};
|
|
504
582
|
|
|
505
583
|
/**
|
|
506
|
-
* @example
|
|
584
|
+
* @example
|
|
585
|
+
* ```js
|
|
586
|
+
* {
|
|
507
587
|
* "transcript_ids": [
|
|
508
588
|
* "64nygnr62k-405c-4ae8-8a6b-d90b40ff3cce"
|
|
509
589
|
* ],
|
|
@@ -512,62 +592,67 @@ export type LemurActionItemsResponse = LemurBaseResponse & {
|
|
|
512
592
|
* "temperature": 0,
|
|
513
593
|
* "max_output_size": 3000
|
|
514
594
|
* }
|
|
595
|
+
* ```
|
|
515
596
|
*/
|
|
516
597
|
export type LemurBaseParams = {
|
|
517
|
-
/**
|
|
598
|
+
/**
|
|
599
|
+
* Context to provide the model. This can be a string or a free-form JSON value.
|
|
600
|
+
*/
|
|
518
601
|
context?: OneOf<
|
|
519
602
|
[
|
|
520
603
|
string,
|
|
521
604
|
{
|
|
522
605
|
[key: string]: unknown;
|
|
523
|
-
}
|
|
606
|
+
},
|
|
524
607
|
]
|
|
525
608
|
>;
|
|
526
609
|
/**
|
|
527
|
-
*
|
|
610
|
+
* The model that is used for the final prompt after compression is performed.
|
|
528
611
|
* Defaults to "default".
|
|
529
612
|
*
|
|
530
|
-
* @
|
|
613
|
+
* @defaultValue "default
|
|
531
614
|
*/
|
|
532
615
|
final_model?: LiteralUnion<LemurModel, string>;
|
|
533
616
|
/**
|
|
534
|
-
*
|
|
617
|
+
* Custom formatted transcript data. Maximum size is the context limit of the selected model, which defaults to 100000".
|
|
535
618
|
* Use either transcript_ids or input_text as input into LeMUR.
|
|
536
619
|
*/
|
|
537
620
|
input_text?: string;
|
|
538
|
-
/**
|
|
621
|
+
/**
|
|
622
|
+
* Max output size in tokens, up to 4000
|
|
623
|
+
*/
|
|
539
624
|
max_output_size?: number;
|
|
540
625
|
/**
|
|
541
|
-
*
|
|
542
|
-
* @description The temperature to use for the model.
|
|
626
|
+
* The temperature to use for the model.
|
|
543
627
|
* Higher values result in answers that are more creative, lower values are more conservative.
|
|
544
628
|
* Can be any value between 0.0 and 1.0 inclusive.
|
|
545
629
|
*/
|
|
546
630
|
temperature?: number;
|
|
547
631
|
/**
|
|
548
|
-
*
|
|
632
|
+
* A list of completed transcripts with text. Up to a maximum of 100 files or 100 hours, whichever is lower.
|
|
549
633
|
* Use either transcript_ids or input_text as input into LeMUR.
|
|
550
634
|
*/
|
|
551
635
|
transcript_ids?: string[];
|
|
552
636
|
};
|
|
553
637
|
|
|
554
638
|
/**
|
|
555
|
-
* @example
|
|
639
|
+
* @example
|
|
640
|
+
* ```js
|
|
641
|
+
* {
|
|
556
642
|
* "request_id": "5e1b27c2-691f-4414-8bc5-f14678442f9e"
|
|
557
643
|
* }
|
|
644
|
+
* ```
|
|
558
645
|
*/
|
|
559
646
|
export type LemurBaseResponse = {
|
|
560
647
|
/**
|
|
561
|
-
*
|
|
562
|
-
* @description The ID of the LeMUR request
|
|
648
|
+
* The ID of the LeMUR request
|
|
563
649
|
*/
|
|
564
650
|
request_id: string;
|
|
565
651
|
};
|
|
566
652
|
|
|
567
653
|
/**
|
|
568
|
-
*
|
|
654
|
+
* The model that is used for the final prompt after compression is performed.
|
|
569
655
|
*
|
|
570
|
-
* @enum {string}
|
|
571
656
|
*/
|
|
572
657
|
export type LemurModel =
|
|
573
658
|
| "default"
|
|
@@ -576,45 +661,65 @@ export type LemurModel =
|
|
|
576
661
|
| "anthropic/claude-2-1";
|
|
577
662
|
|
|
578
663
|
/**
|
|
579
|
-
* @example
|
|
664
|
+
* @example
|
|
665
|
+
* ```js
|
|
666
|
+
* {
|
|
580
667
|
* "question": "Where are there wildfires?",
|
|
581
668
|
* "answer_format": "List of countries in ISO 3166-1 alpha-2 format"
|
|
582
669
|
* }
|
|
670
|
+
* ```
|
|
583
671
|
*/
|
|
584
672
|
export type LemurQuestion = {
|
|
585
|
-
/**
|
|
673
|
+
/**
|
|
674
|
+
* 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"
|
|
675
|
+
*/
|
|
586
676
|
answer_format?: string;
|
|
587
|
-
/**
|
|
677
|
+
/**
|
|
678
|
+
* What discrete options to return. Useful for precise responses. Can't be used with answer_format. Example: ["Yes", "No"]
|
|
679
|
+
*/
|
|
588
680
|
answer_options?: string[];
|
|
589
|
-
/**
|
|
681
|
+
/**
|
|
682
|
+
* Any context about the transcripts you wish to provide. This can be a string or any object.
|
|
683
|
+
*/
|
|
590
684
|
context?: OneOf<
|
|
591
685
|
[
|
|
592
686
|
string,
|
|
593
687
|
{
|
|
594
688
|
[key: string]: unknown;
|
|
595
|
-
}
|
|
689
|
+
},
|
|
596
690
|
]
|
|
597
691
|
>;
|
|
598
|
-
/**
|
|
692
|
+
/**
|
|
693
|
+
* The question you wish to ask. For more complex questions use default model.
|
|
694
|
+
*/
|
|
599
695
|
question: string;
|
|
600
696
|
};
|
|
601
697
|
|
|
602
698
|
/**
|
|
603
|
-
*
|
|
604
|
-
* @example
|
|
699
|
+
* An answer generated by LeMUR and its question
|
|
700
|
+
* @example
|
|
701
|
+
* ```js
|
|
702
|
+
* {
|
|
605
703
|
* "answer": "CA, US",
|
|
606
704
|
* "question": "Where are there wildfires?"
|
|
607
705
|
* }
|
|
706
|
+
* ```
|
|
608
707
|
*/
|
|
609
708
|
export type LemurQuestionAnswer = {
|
|
610
|
-
/**
|
|
709
|
+
/**
|
|
710
|
+
* The answer generated by LeMUR
|
|
711
|
+
*/
|
|
611
712
|
answer: string;
|
|
612
|
-
/**
|
|
713
|
+
/**
|
|
714
|
+
* The question for LeMUR to answer
|
|
715
|
+
*/
|
|
613
716
|
question: string;
|
|
614
717
|
};
|
|
615
718
|
|
|
616
719
|
/**
|
|
617
|
-
* @example
|
|
720
|
+
* @example
|
|
721
|
+
* ```js
|
|
722
|
+
* {
|
|
618
723
|
* "transcript_ids": [
|
|
619
724
|
* "64nygnr62k-405c-4ae8-8a6b-d90b40ff3cce"
|
|
620
725
|
* ],
|
|
@@ -640,14 +745,19 @@ export type LemurQuestionAnswer = {
|
|
|
640
745
|
* "temperature": 0,
|
|
641
746
|
* "max_output_size": 3000
|
|
642
747
|
* }
|
|
748
|
+
* ```
|
|
643
749
|
*/
|
|
644
750
|
export type LemurQuestionAnswerParams = LemurBaseParams & {
|
|
645
|
-
/**
|
|
751
|
+
/**
|
|
752
|
+
* A list of questions to ask
|
|
753
|
+
*/
|
|
646
754
|
questions: LemurQuestion[];
|
|
647
755
|
};
|
|
648
756
|
|
|
649
757
|
/**
|
|
650
|
-
* @example
|
|
758
|
+
* @example
|
|
759
|
+
* ```js
|
|
760
|
+
* {
|
|
651
761
|
* "request_id": "5e1b27c2-691f-4414-8bc5-f14678442f9e",
|
|
652
762
|
* "response": [
|
|
653
763
|
* {
|
|
@@ -660,14 +770,19 @@ export type LemurQuestionAnswerParams = LemurBaseParams & {
|
|
|
660
770
|
* }
|
|
661
771
|
* ]
|
|
662
772
|
* }
|
|
773
|
+
* ```
|
|
663
774
|
*/
|
|
664
775
|
export type LemurQuestionAnswerResponse = LemurBaseResponse & {
|
|
665
|
-
/**
|
|
776
|
+
/**
|
|
777
|
+
* The answers generated by LeMUR and their questions
|
|
778
|
+
*/
|
|
666
779
|
response: LemurQuestionAnswer[];
|
|
667
780
|
};
|
|
668
781
|
|
|
669
782
|
/**
|
|
670
|
-
* @example
|
|
783
|
+
* @example
|
|
784
|
+
* ```js
|
|
785
|
+
* {
|
|
671
786
|
* "transcript_ids": [
|
|
672
787
|
* "64nygnr62k-405c-4ae8-8a6b-d90b40ff3cce"
|
|
673
788
|
* ],
|
|
@@ -676,25 +791,35 @@ export type LemurQuestionAnswerResponse = LemurBaseResponse & {
|
|
|
676
791
|
* "temperature": 0,
|
|
677
792
|
* "max_output_size": 3000
|
|
678
793
|
* }
|
|
794
|
+
* ```
|
|
679
795
|
*/
|
|
680
796
|
export type LemurSummaryParams = LemurBaseParams & {
|
|
681
|
-
/**
|
|
797
|
+
/**
|
|
798
|
+
* How you want the summary to be returned. This can be any text. Examples: "TLDR", "bullet points"
|
|
799
|
+
*/
|
|
682
800
|
answer_format?: string;
|
|
683
801
|
};
|
|
684
802
|
|
|
685
803
|
/**
|
|
686
|
-
* @example
|
|
804
|
+
* @example
|
|
805
|
+
* ```js
|
|
806
|
+
* {
|
|
687
807
|
* "request_id": "5e1b27c2-691f-4414-8bc5-f14678442f9e",
|
|
688
808
|
* "response": "- Wildfires in Canada are sending smoke and air pollution across parts of the US, triggering air quality alerts from Maine to Minnesota. Concentrations of particulate matter have exceeded safety levels.\n\n- Weather systems are channeling the smoke through Pennsylvania into the Mid-Atlantic and Northeast regions. New York City has canceled outdoor activities to keep children and vulnerable groups indoors.\n\n- Very small particulate matter can enter the lungs and impact respiratory, cardiovascular and neurological health. Young children, the elderly and those with preexisting conditions are most at risk.\n\n- The conditions causing the poor air quality could get worse or shift to different areas in coming days depending on weather patterns. More wildfires may also contribute to higher concentrations.\n\n- Climate change is leading to longer and more severe fire seasons. Events of smoke traveling long distances and affecting air quality over wide areas will likely become more common in the future.\"\n"
|
|
689
809
|
* }
|
|
810
|
+
* ```
|
|
690
811
|
*/
|
|
691
812
|
export type LemurSummaryResponse = LemurBaseResponse & {
|
|
692
|
-
/**
|
|
813
|
+
/**
|
|
814
|
+
* The response generated by LeMUR
|
|
815
|
+
*/
|
|
693
816
|
response: string;
|
|
694
817
|
};
|
|
695
818
|
|
|
696
819
|
/**
|
|
697
|
-
* @example
|
|
820
|
+
* @example
|
|
821
|
+
* ```js
|
|
822
|
+
* {
|
|
698
823
|
* "transcript_ids": [
|
|
699
824
|
* "64nygnr62k-405c-4ae8-8a6b-d90b40ff3cce"
|
|
700
825
|
* ],
|
|
@@ -704,25 +829,35 @@ export type LemurSummaryResponse = LemurBaseResponse & {
|
|
|
704
829
|
* "temperature": 0,
|
|
705
830
|
* "max_output_size": 3000
|
|
706
831
|
* }
|
|
832
|
+
* ```
|
|
707
833
|
*/
|
|
708
834
|
export type LemurTaskParams = LemurBaseParams & {
|
|
709
|
-
/**
|
|
835
|
+
/**
|
|
836
|
+
* Your text to prompt the model to produce a desired output, including any context you want to pass into the model.
|
|
837
|
+
*/
|
|
710
838
|
prompt: string;
|
|
711
839
|
};
|
|
712
840
|
|
|
713
841
|
/**
|
|
714
|
-
* @example
|
|
842
|
+
* @example
|
|
843
|
+
* ```js
|
|
844
|
+
* {
|
|
715
845
|
* "request_id": "5e1b27c2-691f-4414-8bc5-f14678442f9e",
|
|
716
846
|
* "response": "Based on the transcript, the following locations were mentioned as being affected by wildfire smoke from Canada:\n\n- Maine\n- Maryland\n- Minnesota\n- Mid Atlantic region\n- Northeast region\n- New York City\n- Baltimore\n"
|
|
717
847
|
* }
|
|
848
|
+
* ```
|
|
718
849
|
*/
|
|
719
850
|
export type LemurTaskResponse = LemurBaseResponse & {
|
|
720
|
-
/**
|
|
851
|
+
/**
|
|
852
|
+
* The response generated by LeMUR.
|
|
853
|
+
*/
|
|
721
854
|
response: string;
|
|
722
855
|
};
|
|
723
856
|
|
|
724
857
|
/**
|
|
725
|
-
* @example
|
|
858
|
+
* @example
|
|
859
|
+
* ```js
|
|
860
|
+
* {
|
|
726
861
|
* "after_id": "a7c5cafd-2c2e-4bdd-b0b2-69dade2f7a1b",
|
|
727
862
|
* "before_id": "9ea68fd3-f953-42c1-9742-976c447fb463",
|
|
728
863
|
* "created_on": "2023-11-03",
|
|
@@ -730,43 +865,47 @@ export type LemurTaskResponse = LemurBaseResponse & {
|
|
|
730
865
|
* "status": "completed",
|
|
731
866
|
* "throttled_only": false
|
|
732
867
|
* }
|
|
868
|
+
* ```
|
|
733
869
|
*/
|
|
734
870
|
export type ListTranscriptParams = {
|
|
735
871
|
/**
|
|
736
|
-
*
|
|
737
|
-
* @description Get transcripts that were created after this transcript ID
|
|
872
|
+
* Get transcripts that were created after this transcript ID
|
|
738
873
|
*/
|
|
739
874
|
after_id?: string;
|
|
740
875
|
/**
|
|
741
|
-
*
|
|
742
|
-
* @description Get transcripts that were created before this transcript ID
|
|
876
|
+
* Get transcripts that were created before this transcript ID
|
|
743
877
|
*/
|
|
744
878
|
before_id?: string;
|
|
745
879
|
/**
|
|
746
|
-
*
|
|
747
|
-
* @description Only get transcripts created on this date
|
|
880
|
+
* Only get transcripts created on this date
|
|
748
881
|
*/
|
|
749
882
|
created_on?: string;
|
|
750
883
|
/**
|
|
751
|
-
*
|
|
752
|
-
* @
|
|
753
|
-
* @default 10
|
|
884
|
+
* Maximum amount of transcripts to retrieve
|
|
885
|
+
* @defaultValue 10
|
|
754
886
|
*/
|
|
755
887
|
limit?: number;
|
|
756
|
-
/**
|
|
888
|
+
/**
|
|
889
|
+
* Filter by transcript status
|
|
890
|
+
*/
|
|
757
891
|
status?: TranscriptStatus;
|
|
758
|
-
/**
|
|
892
|
+
/**
|
|
893
|
+
* Only get throttled transcripts, overrides the status filter
|
|
894
|
+
*/
|
|
759
895
|
throttled_only?: boolean;
|
|
760
896
|
};
|
|
761
897
|
|
|
762
898
|
/**
|
|
763
|
-
* @example
|
|
899
|
+
* @example
|
|
900
|
+
* ```js
|
|
901
|
+
* {
|
|
764
902
|
* "limit": 10,
|
|
765
903
|
* "result_count": 10,
|
|
766
904
|
* "current_url": "https://api.assemblyai.com/v2/transcript?limit=10",
|
|
767
905
|
* "prev_url": "https://api.assemblyai.com/v2/transcript?limit=10&before_id=62npeahu2b-a8ea-4112-854c-69542c20d90c",
|
|
768
906
|
* "next_url": "https://api.assemblyai.com/v2/transcript?limit=10&after_id=62nfw3mlar-01ad-4631-92f6-629929496eed"
|
|
769
907
|
* }
|
|
908
|
+
* ```
|
|
770
909
|
*/
|
|
771
910
|
export type PageDetails = {
|
|
772
911
|
current_url: string;
|
|
@@ -777,7 +916,9 @@ export type PageDetails = {
|
|
|
777
916
|
};
|
|
778
917
|
|
|
779
918
|
/**
|
|
780
|
-
* @example
|
|
919
|
+
* @example
|
|
920
|
+
* ```js
|
|
921
|
+
* {
|
|
781
922
|
* "paragraphs": [
|
|
782
923
|
* {
|
|
783
924
|
* "text": "Smoke from hundreds of wildfires in Canada is triggering air quality alerts throughout the US. Skylines from Maine to Maryland to Minnesota are gray and smoggy. And in some places, the air quality warnings include the warning to stay inside. We wanted to better understand what's happening here and why, so we called Peter Decarlo, an associate professor in the Department of Environmental Health and Engineering at Johns Hopkins University. Good morning, professor.",
|
|
@@ -849,17 +990,15 @@ export type PageDetails = {
|
|
|
849
990
|
* "confidence": 0.9578730257009361,
|
|
850
991
|
* "audio_duration": 281
|
|
851
992
|
* }
|
|
993
|
+
* ```
|
|
852
994
|
*/
|
|
853
995
|
export type ParagraphsResponse = {
|
|
854
996
|
audio_duration: number;
|
|
855
|
-
/** Format: double */
|
|
856
997
|
confidence: number;
|
|
857
|
-
/** Format: uuid */
|
|
858
998
|
id: string;
|
|
859
999
|
paragraphs: TranscriptParagraph[];
|
|
860
1000
|
};
|
|
861
1001
|
|
|
862
|
-
/** @enum {string} */
|
|
863
1002
|
export type PiiPolicy =
|
|
864
1003
|
| "medical_process"
|
|
865
1004
|
| "medical_condition"
|
|
@@ -890,66 +1029,81 @@ export type PiiPolicy =
|
|
|
890
1029
|
| "banking_information";
|
|
891
1030
|
|
|
892
1031
|
/**
|
|
893
|
-
* @example
|
|
1032
|
+
* @example
|
|
1033
|
+
* ```js
|
|
1034
|
+
* {
|
|
894
1035
|
* "request_id": "914fe7e4-f10a-4364-8946-34614c2873f6",
|
|
895
1036
|
* "request_id_to_purge": "b7eb03ec-1650-4181-949b-75d9de317de1",
|
|
896
1037
|
* "deleted": true
|
|
897
1038
|
* }
|
|
1039
|
+
* ```
|
|
898
1040
|
*/
|
|
899
1041
|
export type PurgeLemurRequestDataResponse = {
|
|
900
|
-
/**
|
|
1042
|
+
/**
|
|
1043
|
+
* Whether the request data was deleted
|
|
1044
|
+
*/
|
|
901
1045
|
deleted: boolean;
|
|
902
1046
|
/**
|
|
903
|
-
*
|
|
904
|
-
* @description The ID of the deletion request of the LeMUR request
|
|
1047
|
+
* The ID of the deletion request of the LeMUR request
|
|
905
1048
|
*/
|
|
906
1049
|
request_id: string;
|
|
907
1050
|
/**
|
|
908
|
-
*
|
|
909
|
-
* @description The ID of the LeMUR request to purge the data for
|
|
1051
|
+
* The ID of the LeMUR request to purge the data for
|
|
910
1052
|
*/
|
|
911
1053
|
request_id_to_purge: string;
|
|
912
1054
|
};
|
|
913
1055
|
|
|
914
1056
|
/**
|
|
915
|
-
* @example
|
|
1057
|
+
* @example
|
|
1058
|
+
* ```js
|
|
1059
|
+
* {
|
|
916
1060
|
* "token": "fe4145dd1e7a2e149488dcd2d553a8018a89833fc5084837d66fd1bcf5a105d4"
|
|
917
1061
|
* }
|
|
1062
|
+
* ```
|
|
918
1063
|
*/
|
|
919
1064
|
export type RealtimeTemporaryTokenResponse = {
|
|
920
|
-
/**
|
|
1065
|
+
/**
|
|
1066
|
+
* The temporary authentication token for real-time transcription
|
|
1067
|
+
*/
|
|
921
1068
|
token: string;
|
|
922
1069
|
};
|
|
923
1070
|
|
|
924
1071
|
/**
|
|
925
|
-
* @example
|
|
1072
|
+
* @example
|
|
1073
|
+
* ```js
|
|
1074
|
+
* {
|
|
926
1075
|
* "redacted_audio_url": "https://s3.us-west-2.amazonaws.com/api.assembly.ai.usw2/redacted-audio/785efd9e-0e20-45e1-967b-3db17770ed9f.wav?AWSAccessKeyId=ASIAVASQFLPGLUP5JD7Y&Signature=z1r2MOA46esiiAmk%2FreBkL8rl6g%3D&x-amz-security-token=IQoJb3JpZ2luX2VjEPv%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaCXVzLXdlc3QtMiJHMEUCIHxKoUJdd5P%2Fdy4WlfvRNppQtauTy7OuAb5azR2OIoYSAiEA8iPx4xAx0pbZztT4e7fGnzPS4phvNCnYKflIijUoxDsq%2BwMIMxAEGgwzNDQ4MzkyNDg4NDQiDJxsCgo0cDg789FV0CrYAwPK3CHbRHoNPFiQ%2FO6EdHZ4OSFRcS%2FDvDyHQRNnYNSwG4JB2mUMWEVw808JWTya%2But4wEcmPiUCVJMTvh70cxhILAxP84CBTuWGM%2Fszbj4tn1thjVsqovf9YZmP17OCFa77Bc9%2F9RwtRaABEqJ2eb6%2Bsir7w0MMzhe1z%2F%2B1PUKxicJAZasBv3Ova%2BTY2eNkPZHQ4Njie4X5sh05b%2BrKnz58E7GTQ1sHZQDYHZecwb5fP0B3LR0vuqNtK%2BdpMAxw5H7BinQ4rdccLmsLLMQeVn8jdRDZNEvsdmoeQL0y0qD%2BUcyGMJoAjMT4FnXhBhVxc3bgkVUbHlZMn48FNCYcmzM8UB9wGmSnr6iQoqEaFElfQVbvAzsW7lnlfLROZxMvGXyliobPYPSaYZlVYgHcIxeWuOAXRtEtmL2jbaX4ghCVgJBVO3BBzTgub2jB0KPU6lYZLLM4kf%2B8hKX8iyxSRc6ZVEefTcyruoDppjB028pA9q75hLH1CZwhfLoM%2F3z5f0aFCl05zQnaa10nbcKj0hERELf4FXqS8yWbSutlRcd7Rr9o8jN31QGUscpsuIvl%2FpyJcZmItX8nO%2FF0s1QjrIi11DLYD9YoOh7eVkN8eKKn5w4cHldVI2sw4NCPqgY6pQE%2BM9va2ad1%2BNrXeQ9t8K41lojTN0BFmM8ERD5fF77xcTlW8VdV%2FiJeLLHDvnYYWVKcga9hSROlmsqvMyn3Tmhz7KQbIepSAOKhcHM%2FyUaLfErvCtjXGwo8nsKForL7SKiGkaRCBmwfQtkSVP6m4tGT50YdGxakh54f8uyC55SbkElknRbpl5haiZ%2F82UddFBkdPcM3t0s7vwbEy%2BbilYyetOr6htc%3D&Expires=1698966551",
|
|
927
1076
|
* "status": "redacted_audio_ready"
|
|
928
1077
|
* }
|
|
1078
|
+
* ```
|
|
929
1079
|
*/
|
|
930
1080
|
export type RedactedAudioResponse = {
|
|
931
|
-
/**
|
|
1081
|
+
/**
|
|
1082
|
+
* The URL of the redacted audio file
|
|
1083
|
+
*/
|
|
932
1084
|
redacted_audio_url: string;
|
|
933
|
-
/**
|
|
1085
|
+
/**
|
|
1086
|
+
* The status of the redacted audio
|
|
1087
|
+
*/
|
|
934
1088
|
status: RedactedAudioStatus;
|
|
935
1089
|
};
|
|
936
1090
|
|
|
937
1091
|
/**
|
|
938
|
-
*
|
|
939
|
-
* @enum {string}
|
|
1092
|
+
* The status of the redacted audio
|
|
940
1093
|
*/
|
|
941
1094
|
export type RedactedAudioStatus = "redacted_audio_ready";
|
|
942
1095
|
|
|
943
1096
|
/**
|
|
944
|
-
*
|
|
945
|
-
* @
|
|
946
|
-
* @example mp3
|
|
947
|
-
* @enum {string}
|
|
1097
|
+
* Controls the filetype of the audio created by redact_pii_audio. Currently supports mp3 (default) and wav. See {@link https://www.assemblyai.com/docs/models/pii-redaction | PII redaction } for more details.
|
|
1098
|
+
* @defaultValue "mp3"
|
|
1099
|
+
* @example "mp3"
|
|
948
1100
|
*/
|
|
949
1101
|
export type RedactPiiAudioQuality = "mp3" | "wav";
|
|
950
1102
|
|
|
951
1103
|
/**
|
|
952
|
-
* @example
|
|
1104
|
+
* @example
|
|
1105
|
+
* ```js
|
|
1106
|
+
* {
|
|
953
1107
|
* "sentences": [
|
|
954
1108
|
* {
|
|
955
1109
|
* "text": "Smoke from hundreds of wildfires in Canada is triggering air quality alerts throughout the US.",
|
|
@@ -1044,22 +1198,22 @@ export type RedactPiiAudioQuality = "mp3" | "wav";
|
|
|
1044
1198
|
* "confidence": 0.9579390654205628,
|
|
1045
1199
|
* "audio_duration": 281
|
|
1046
1200
|
* }
|
|
1201
|
+
* ```
|
|
1047
1202
|
*/
|
|
1048
1203
|
export type SentencesResponse = {
|
|
1049
1204
|
audio_duration: number;
|
|
1050
|
-
/** Format: double */
|
|
1051
1205
|
confidence: number;
|
|
1052
|
-
/** Format: uuid */
|
|
1053
1206
|
id: string;
|
|
1054
1207
|
sentences: TranscriptSentence[];
|
|
1055
1208
|
};
|
|
1056
1209
|
|
|
1057
|
-
/** @enum {unknown} */
|
|
1058
1210
|
export type Sentiment = "POSITIVE" | "NEUTRAL" | "NEGATIVE";
|
|
1059
1211
|
|
|
1060
1212
|
/**
|
|
1061
|
-
*
|
|
1062
|
-
* @example
|
|
1213
|
+
* The result of the sentiment analysis model
|
|
1214
|
+
* @example
|
|
1215
|
+
* ```js
|
|
1216
|
+
* {
|
|
1063
1217
|
* "text": "Smoke from hundreds of wildfires in Canada is triggering air quality alerts throughout the US.",
|
|
1064
1218
|
* "start": 250,
|
|
1065
1219
|
* "end": 6350,
|
|
@@ -1067,70 +1221,75 @@ export type Sentiment = "POSITIVE" | "NEUTRAL" | "NEGATIVE";
|
|
|
1067
1221
|
* "confidence": 0.8181032538414001,
|
|
1068
1222
|
* "speaker": null
|
|
1069
1223
|
* }
|
|
1224
|
+
* ```
|
|
1070
1225
|
*/
|
|
1071
1226
|
export type SentimentAnalysisResult = {
|
|
1072
1227
|
/**
|
|
1073
|
-
*
|
|
1074
|
-
* @description The confidence score for the detected sentiment of the sentence, from 0 to 1
|
|
1228
|
+
* The confidence score for the detected sentiment of the sentence, from 0 to 1
|
|
1075
1229
|
*/
|
|
1076
1230
|
confidence: number;
|
|
1077
|
-
/**
|
|
1231
|
+
/**
|
|
1232
|
+
* The ending time, in milliseconds, of the sentence
|
|
1233
|
+
*/
|
|
1078
1234
|
end: number;
|
|
1079
|
-
/**
|
|
1235
|
+
/**
|
|
1236
|
+
* The detected sentiment for the sentence, one of POSITIVE, NEUTRAL, NEGATIVE
|
|
1237
|
+
*/
|
|
1080
1238
|
sentiment: Sentiment;
|
|
1081
|
-
/**
|
|
1239
|
+
/**
|
|
1240
|
+
* The speaker of the sentence if {@link https://www.assemblyai.com/docs/models/speaker-diarization | Speaker Diarization } is enabled, else null
|
|
1241
|
+
*/
|
|
1082
1242
|
speaker?: string | null;
|
|
1083
|
-
/**
|
|
1243
|
+
/**
|
|
1244
|
+
* The starting time, in milliseconds, of the sentence
|
|
1245
|
+
*/
|
|
1084
1246
|
start: number;
|
|
1085
|
-
/**
|
|
1247
|
+
/**
|
|
1248
|
+
* The transcript of the sentence
|
|
1249
|
+
*/
|
|
1086
1250
|
text: string;
|
|
1087
1251
|
};
|
|
1088
1252
|
|
|
1089
1253
|
/**
|
|
1090
|
-
* @example
|
|
1254
|
+
* @example
|
|
1255
|
+
* ```js
|
|
1256
|
+
* {
|
|
1091
1257
|
* "low": 0.5733263024656846,
|
|
1092
1258
|
* "medium": 0.42667369753431533,
|
|
1093
1259
|
* "high": 0
|
|
1094
1260
|
* }
|
|
1261
|
+
* ```
|
|
1095
1262
|
*/
|
|
1096
1263
|
export type SeverityScoreSummary = {
|
|
1097
|
-
/** Format: double */
|
|
1098
1264
|
high: number;
|
|
1099
|
-
/** Format: double */
|
|
1100
1265
|
low: number;
|
|
1101
|
-
/** Format: double */
|
|
1102
1266
|
medium: number;
|
|
1103
1267
|
};
|
|
1104
1268
|
|
|
1105
1269
|
/**
|
|
1106
|
-
*
|
|
1107
|
-
* @enum {string}
|
|
1270
|
+
* The speech model to use for the transcription.
|
|
1108
1271
|
*/
|
|
1109
|
-
export type SpeechModel = "nano";
|
|
1272
|
+
export type SpeechModel = "nano" | "conformer-2";
|
|
1110
1273
|
|
|
1111
1274
|
/**
|
|
1112
|
-
*
|
|
1113
|
-
* @enum {string}
|
|
1275
|
+
* The replacement logic for detected PII, can be "entity_type" or "hash". See {@link https://www.assemblyai.com/docs/models/pii-redaction | PII redaction } for more details.
|
|
1114
1276
|
*/
|
|
1115
1277
|
export type SubstitutionPolicy = "entity_type" | "hash";
|
|
1116
1278
|
|
|
1117
1279
|
/**
|
|
1118
|
-
*
|
|
1119
|
-
* @enum {string}
|
|
1280
|
+
* Format of the subtitles
|
|
1120
1281
|
*/
|
|
1121
1282
|
export type SubtitleFormat = "srt" | "vtt";
|
|
1122
1283
|
|
|
1123
1284
|
/**
|
|
1124
|
-
*
|
|
1125
|
-
* @
|
|
1126
|
-
* @enum {string}
|
|
1285
|
+
* The model to summarize the transcript
|
|
1286
|
+
* @defaultValue "informative
|
|
1127
1287
|
*/
|
|
1128
1288
|
export type SummaryModel = "informative" | "conversational" | "catchy";
|
|
1129
1289
|
|
|
1130
1290
|
/**
|
|
1131
|
-
*
|
|
1132
|
-
* @
|
|
1133
|
-
* @enum {string}
|
|
1291
|
+
* The type of summary
|
|
1292
|
+
* @defaultValue bullets
|
|
1134
1293
|
*/
|
|
1135
1294
|
export type SummaryType =
|
|
1136
1295
|
| "bullets"
|
|
@@ -1140,24 +1299,33 @@ export type SummaryType =
|
|
|
1140
1299
|
| "paragraph";
|
|
1141
1300
|
|
|
1142
1301
|
/**
|
|
1143
|
-
*
|
|
1144
|
-
* @example
|
|
1145
|
-
*
|
|
1302
|
+
* Timestamp containing a start and end property in milliseconds
|
|
1303
|
+
* @example
|
|
1304
|
+
* ```js
|
|
1305
|
+
* {
|
|
1306
|
+
* "start": 3978",
|
|
1146
1307
|
* "end": 5114
|
|
1147
1308
|
* }
|
|
1309
|
+
* ```
|
|
1148
1310
|
*/
|
|
1149
1311
|
export type Timestamp = {
|
|
1150
|
-
/**
|
|
1312
|
+
/**
|
|
1313
|
+
* The end time in milliseconds
|
|
1314
|
+
*/
|
|
1151
1315
|
end: number;
|
|
1152
|
-
/**
|
|
1316
|
+
/**
|
|
1317
|
+
* The start time in milliseconds
|
|
1318
|
+
*/
|
|
1153
1319
|
start: number;
|
|
1154
1320
|
};
|
|
1155
1321
|
|
|
1156
1322
|
/**
|
|
1157
|
-
*
|
|
1158
|
-
* See
|
|
1323
|
+
* The result of the Topic Detection model, if it is enabled.
|
|
1324
|
+
* See {@link https://www.assemblyai.com/docs/models/topic-detection | Topic Detection } for more information.
|
|
1159
1325
|
*
|
|
1160
|
-
* @example
|
|
1326
|
+
* @example
|
|
1327
|
+
* ```js
|
|
1328
|
+
* {
|
|
1161
1329
|
* "status": "success",
|
|
1162
1330
|
* "results": [
|
|
1163
1331
|
* {
|
|
@@ -1233,21 +1401,30 @@ export type Timestamp = {
|
|
|
1233
1401
|
* "MedicalHealth>DiseasesAndConditions>Injuries>FirstAid": 0.0004885646631009877
|
|
1234
1402
|
* }
|
|
1235
1403
|
* }
|
|
1404
|
+
* ```
|
|
1236
1405
|
*/
|
|
1237
1406
|
export type TopicDetectionModelResult = {
|
|
1238
|
-
/**
|
|
1407
|
+
/**
|
|
1408
|
+
* An array of results for the Topic Detection model
|
|
1409
|
+
*/
|
|
1239
1410
|
results: TopicDetectionResult[];
|
|
1240
|
-
/**
|
|
1411
|
+
/**
|
|
1412
|
+
* The status of the Topic Detection model. Either success, or unavailable in the rare case that the model failed.
|
|
1413
|
+
*/
|
|
1241
1414
|
status: AudioIntelligenceModelStatus;
|
|
1242
|
-
/**
|
|
1415
|
+
/**
|
|
1416
|
+
* The overall relevance of topic to the entire audio file
|
|
1417
|
+
*/
|
|
1243
1418
|
summary: {
|
|
1244
1419
|
[key: string]: number;
|
|
1245
1420
|
};
|
|
1246
1421
|
};
|
|
1247
1422
|
|
|
1248
1423
|
/**
|
|
1249
|
-
*
|
|
1250
|
-
* @example
|
|
1424
|
+
* The result of the topic detection model
|
|
1425
|
+
* @example
|
|
1426
|
+
* ```js
|
|
1427
|
+
* {
|
|
1251
1428
|
* "text": "Smoke from hundreds of wildfires in Canada is triggering air quality alerts throughout the US. Skylines from Maine to Maryland to Minnesota are gray and smoggy. And in some places, the air quality warnings include the warning to stay inside. We wanted to better understand what's happening here and why, so we called Peter de Carlo, an associate professor in the Department of Environmental Health and Engineering at Johns Hopkins University Varsity. Good morning, professor. Good morning.",
|
|
1252
1429
|
* "labels": [
|
|
1253
1430
|
* {
|
|
@@ -1296,25 +1473,31 @@ export type TopicDetectionModelResult = {
|
|
|
1296
1473
|
* "end": 28840
|
|
1297
1474
|
* }
|
|
1298
1475
|
* }
|
|
1476
|
+
* ```
|
|
1299
1477
|
*/
|
|
1300
1478
|
export type TopicDetectionResult = {
|
|
1301
1479
|
labels?: {
|
|
1302
|
-
/**
|
|
1480
|
+
/**
|
|
1481
|
+
* The IAB taxonomical label for the label of the detected topic, where > denotes supertopic/subtopic relationship
|
|
1482
|
+
*/
|
|
1303
1483
|
label: string;
|
|
1304
1484
|
/**
|
|
1305
|
-
*
|
|
1306
|
-
* @description How relevant the detected topic is of a detected topic
|
|
1485
|
+
* How relevant the detected topic is of a detected topic
|
|
1307
1486
|
*/
|
|
1308
1487
|
relevance: number;
|
|
1309
1488
|
}[];
|
|
1310
|
-
/**
|
|
1489
|
+
/**
|
|
1490
|
+
* The text in the transcript in which a detected topic occurs
|
|
1491
|
+
*/
|
|
1311
1492
|
text: string;
|
|
1312
1493
|
timestamp?: Timestamp;
|
|
1313
1494
|
};
|
|
1314
1495
|
|
|
1315
1496
|
/**
|
|
1316
|
-
*
|
|
1317
|
-
* @example
|
|
1497
|
+
* A transcript object
|
|
1498
|
+
* @example
|
|
1499
|
+
* ```js
|
|
1500
|
+
* {
|
|
1318
1501
|
* "id": "9ea68fd3-f953-42c1-9742-976c447fb463",
|
|
1319
1502
|
* "speech_model": null,
|
|
1320
1503
|
* "language_model": "assemblyai_default",
|
|
@@ -1998,212 +2181,286 @@ export type TopicDetectionResult = {
|
|
|
1998
2181
|
* "summary": "- Smoke from hundreds of wildfires in Canada is triggering air quality alerts throughout the US. Skylines from Maine to Maryland to Minnesota are gray and smoggy. In some places, the air quality warnings include the warning to stay inside.\\n- Air pollution levels in Baltimore are considered unhealthy. Exposure to high levels can lead to a host of health problems. With climate change, we are seeing more wildfires. Will we be seeing more of these kinds of wide ranging air quality consequences?",
|
|
1999
2182
|
* "speakers_expected": 2
|
|
2000
2183
|
* }
|
|
2184
|
+
* ```
|
|
2001
2185
|
*/
|
|
2002
2186
|
export type Transcript = {
|
|
2003
2187
|
/**
|
|
2004
2188
|
* @deprecated
|
|
2005
|
-
*
|
|
2189
|
+
* The acoustic model that was used for the transcript
|
|
2006
2190
|
*/
|
|
2007
2191
|
acoustic_model: string;
|
|
2008
2192
|
/**
|
|
2009
|
-
*
|
|
2010
|
-
* @description The duration of this transcript object's media file, in seconds
|
|
2193
|
+
* The duration of this transcript object's media file, in seconds
|
|
2011
2194
|
*/
|
|
2012
2195
|
audio_duration?: number | null;
|
|
2013
|
-
/**
|
|
2196
|
+
/**
|
|
2197
|
+
* The point in time, in milliseconds, in the file at which the transcription was terminated
|
|
2198
|
+
*/
|
|
2014
2199
|
audio_end_at?: number | null;
|
|
2015
|
-
/**
|
|
2200
|
+
/**
|
|
2201
|
+
* The point in time, in milliseconds, in the file at which the transcription was started
|
|
2202
|
+
*/
|
|
2016
2203
|
audio_start_from?: number | null;
|
|
2017
|
-
/**
|
|
2204
|
+
/**
|
|
2205
|
+
* The URL of the media that was transcribed
|
|
2206
|
+
*/
|
|
2018
2207
|
audio_url: string;
|
|
2019
|
-
/**
|
|
2208
|
+
/**
|
|
2209
|
+
* Whether {@link https://www.assemblyai.com/docs/models/auto-chapters | Auto Chapters } is enabled, can be true or false
|
|
2210
|
+
*/
|
|
2020
2211
|
auto_chapters?: boolean | null;
|
|
2021
|
-
/**
|
|
2212
|
+
/**
|
|
2213
|
+
* Whether Key Phrases is enabled, either true or false
|
|
2214
|
+
*/
|
|
2022
2215
|
auto_highlights: boolean;
|
|
2023
2216
|
/**
|
|
2024
|
-
*
|
|
2025
|
-
* See
|
|
2217
|
+
* An array of results for the Key Phrases model, if it is enabled.
|
|
2218
|
+
* See {@link https://www.assemblyai.com/docs/models/key-phrases | Key phrases } for more information.
|
|
2026
2219
|
*/
|
|
2027
2220
|
auto_highlights_result?: AutoHighlightsResult | null;
|
|
2028
|
-
/**
|
|
2221
|
+
/**
|
|
2222
|
+
* The word boost parameter value
|
|
2223
|
+
*/
|
|
2029
2224
|
boost_param?: string | null;
|
|
2030
|
-
/**
|
|
2225
|
+
/**
|
|
2226
|
+
* An array of temporally sequential chapters for the audio file
|
|
2227
|
+
*/
|
|
2031
2228
|
chapters?: Chapter[] | null;
|
|
2032
2229
|
/**
|
|
2033
|
-
*
|
|
2034
|
-
* @description The confidence score for the transcript, between 0.0 (low confidence) and 1.0 (high confidence)
|
|
2230
|
+
* The confidence score for the transcript, between 0.0 (low confidence) and 1.0 (high confidence)
|
|
2035
2231
|
*/
|
|
2036
2232
|
confidence?: number | null;
|
|
2037
|
-
/**
|
|
2233
|
+
/**
|
|
2234
|
+
* Whether {@link https://www.assemblyai.com/docs/models/content-moderation | Content Moderation } is enabled, can be true or false
|
|
2235
|
+
*/
|
|
2038
2236
|
content_safety?: boolean | null;
|
|
2039
2237
|
/**
|
|
2040
|
-
*
|
|
2041
|
-
* See
|
|
2238
|
+
* An array of results for the Content Moderation model, if it is enabled.
|
|
2239
|
+
* See {@link https://www.assemblyai.com/docs/models/content-moderation | Content moderation } for more information.
|
|
2042
2240
|
*/
|
|
2043
2241
|
content_safety_labels?: ContentSafetyLabelsResult | null;
|
|
2044
|
-
/**
|
|
2242
|
+
/**
|
|
2243
|
+
* Customize how words are spelled and formatted using to and from values
|
|
2244
|
+
*/
|
|
2045
2245
|
custom_spelling?: TranscriptCustomSpelling[] | null;
|
|
2046
|
-
/**
|
|
2246
|
+
/**
|
|
2247
|
+
* Whether custom topics is enabled, either true or false
|
|
2248
|
+
*/
|
|
2047
2249
|
custom_topics?: boolean | null;
|
|
2048
|
-
/**
|
|
2250
|
+
/**
|
|
2251
|
+
* Transcribe Filler Words, like "umm", in your media file; can be true or false
|
|
2252
|
+
*/
|
|
2049
2253
|
disfluencies?: boolean | null;
|
|
2050
|
-
/**
|
|
2254
|
+
/**
|
|
2255
|
+
* Whether {@link https://www.assemblyai.com/docs/models/speech-recognition#dual-channel-transcription | Dual channel transcription } was enabled in the transcription request, either true or false
|
|
2256
|
+
*/
|
|
2051
2257
|
dual_channel?: boolean | null;
|
|
2052
2258
|
/**
|
|
2053
|
-
*
|
|
2054
|
-
* See
|
|
2259
|
+
* An array of results for the Entity Detection model, if it is enabled.
|
|
2260
|
+
* See {@link https://www.assemblyai.com/docs/models/entity-detection | Entity detection } for more information.
|
|
2055
2261
|
*/
|
|
2056
2262
|
entities?: Entity[] | null;
|
|
2057
|
-
/**
|
|
2263
|
+
/**
|
|
2264
|
+
* Whether {@link https://www.assemblyai.com/docs/models/entity-detection | Entity Detection } is enabled, can be true or false
|
|
2265
|
+
*/
|
|
2058
2266
|
entity_detection?: boolean | null;
|
|
2059
|
-
/**
|
|
2267
|
+
/**
|
|
2268
|
+
* Error message of why the transcript failed
|
|
2269
|
+
*/
|
|
2060
2270
|
error?: string;
|
|
2061
|
-
/**
|
|
2271
|
+
/**
|
|
2272
|
+
* Whether {@link https://www.assemblyai.com/docs/models/speech-recognition#profanity-filtering | Profanity Filtering } is enabled, either true or false
|
|
2273
|
+
*/
|
|
2062
2274
|
filter_profanity?: boolean | null;
|
|
2063
|
-
/**
|
|
2275
|
+
/**
|
|
2276
|
+
* Whether Text Formatting is enabled, either true or false
|
|
2277
|
+
*/
|
|
2064
2278
|
format_text?: boolean | null;
|
|
2065
|
-
/**
|
|
2279
|
+
/**
|
|
2280
|
+
* Whether {@link https://www.assemblyai.com/docs/models/topic-detection | Topic Detection } is enabled, can be true or false
|
|
2281
|
+
*/
|
|
2066
2282
|
iab_categories?: boolean | null;
|
|
2067
2283
|
/**
|
|
2068
|
-
*
|
|
2069
|
-
* See
|
|
2284
|
+
* The result of the Topic Detection model, if it is enabled.
|
|
2285
|
+
* See {@link https://www.assemblyai.com/docs/models/topic-detection | Topic Detection } for more information.
|
|
2070
2286
|
*/
|
|
2071
2287
|
iab_categories_result?: TopicDetectionModelResult | null;
|
|
2072
2288
|
/**
|
|
2073
|
-
*
|
|
2074
|
-
* @description The unique identifier of your transcript
|
|
2289
|
+
* The unique identifier of your transcript
|
|
2075
2290
|
*/
|
|
2076
2291
|
id: string;
|
|
2077
2292
|
/**
|
|
2078
|
-
*
|
|
2079
|
-
* Possible values are found in
|
|
2293
|
+
* The language of your audio file.
|
|
2294
|
+
* Possible values are found in {@link https://www.assemblyai.com/docs/concepts/supported-languages | Supported Languages }.
|
|
2080
2295
|
* The default value is 'en_us'.
|
|
2081
2296
|
*/
|
|
2082
|
-
language_code?: TranscriptLanguageCode
|
|
2083
|
-
/**
|
|
2297
|
+
language_code?: LiteralUnion<TranscriptLanguageCode, string>;
|
|
2298
|
+
/**
|
|
2299
|
+
* Whether {@link https://www.assemblyai.com/docs/models/speech-recognition#automatic-language-detection | Automatic language detection } is enabled, either true or false
|
|
2300
|
+
*/
|
|
2084
2301
|
language_detection?: boolean | null;
|
|
2085
2302
|
/**
|
|
2086
2303
|
* @deprecated
|
|
2087
|
-
*
|
|
2304
|
+
* The language model that was used for the transcript
|
|
2088
2305
|
*/
|
|
2089
2306
|
language_model: string;
|
|
2090
|
-
/**
|
|
2307
|
+
/**
|
|
2308
|
+
* Whether Automatic Punctuation is enabled, either true or false
|
|
2309
|
+
*/
|
|
2091
2310
|
punctuate?: boolean | null;
|
|
2092
|
-
/**
|
|
2311
|
+
/**
|
|
2312
|
+
* Whether {@link https://www.assemblyai.com/docs/models/pii-redaction | PII Redaction } is enabled, either true or false
|
|
2313
|
+
*/
|
|
2093
2314
|
redact_pii: boolean;
|
|
2094
2315
|
/**
|
|
2095
|
-
*
|
|
2096
|
-
* either true or false. See
|
|
2316
|
+
* Whether a redacted version of the audio file was generated,
|
|
2317
|
+
* either true or false. See {@link https://www.assemblyai.com/docs/models/pii-redaction | PII redaction } for more information.
|
|
2097
2318
|
*/
|
|
2098
2319
|
redact_pii_audio?: boolean | null;
|
|
2099
2320
|
/**
|
|
2100
|
-
*
|
|
2101
|
-
* See
|
|
2321
|
+
* The audio quality of the PII-redacted audio file, if redact_pii_audio is enabled.
|
|
2322
|
+
* See {@link https://www.assemblyai.com/docs/models/pii-redaction | PII redaction } for more information.
|
|
2102
2323
|
*/
|
|
2103
2324
|
redact_pii_audio_quality?: RedactPiiAudioQuality | null;
|
|
2104
2325
|
/**
|
|
2105
|
-
*
|
|
2106
|
-
* See
|
|
2326
|
+
* The list of PII Redaction policies that were enabled, if PII Redaction is enabled.
|
|
2327
|
+
* See {@link https://www.assemblyai.com/docs/models/pii-redaction | PII redaction } for more information.
|
|
2107
2328
|
*/
|
|
2108
2329
|
redact_pii_policies?: PiiPolicy[] | null;
|
|
2109
|
-
/**
|
|
2330
|
+
/**
|
|
2331
|
+
* The replacement logic for detected PII, can be "entity_type" or "hash". See {@link https://www.assemblyai.com/docs/models/pii-redaction | PII redaction } for more details.
|
|
2332
|
+
*/
|
|
2110
2333
|
redact_pii_sub?: SubstitutionPolicy;
|
|
2111
|
-
/**
|
|
2334
|
+
/**
|
|
2335
|
+
* Whether {@link https://www.assemblyai.com/docs/models/sentiment-analysis | Sentiment Analysis } is enabled, can be true or false
|
|
2336
|
+
*/
|
|
2112
2337
|
sentiment_analysis?: boolean | null;
|
|
2113
2338
|
/**
|
|
2114
|
-
*
|
|
2115
|
-
* See
|
|
2339
|
+
* An array of results for the Sentiment Analysis model, if it is enabled.
|
|
2340
|
+
* See {@link https://www.assemblyai.com/docs/models/sentiment-analysis | Sentiment analysis } for more information.
|
|
2116
2341
|
*/
|
|
2117
2342
|
sentiment_analysis_results?: SentimentAnalysisResult[] | null;
|
|
2118
|
-
/**
|
|
2343
|
+
/**
|
|
2344
|
+
* Whether {@link https://www.assemblyai.com/docs/models/speaker-diarization | Speaker diarization } is enabled, can be true or false
|
|
2345
|
+
*/
|
|
2119
2346
|
speaker_labels?: boolean | null;
|
|
2120
|
-
/**
|
|
2347
|
+
/**
|
|
2348
|
+
* Tell the speaker label model how many speakers it should attempt to identify, up to 10. See {@link https://www.assemblyai.com/docs/models/speaker-diarization | Speaker diarization } for more details.
|
|
2349
|
+
*/
|
|
2121
2350
|
speakers_expected?: number | null;
|
|
2122
2351
|
/**
|
|
2123
|
-
*
|
|
2124
|
-
* @
|
|
2352
|
+
* The speech model used for the transcription. When `null`, the default model is used.
|
|
2353
|
+
* @defaultValue "null
|
|
2125
2354
|
*/
|
|
2126
2355
|
speech_model: SpeechModel | null;
|
|
2127
2356
|
/**
|
|
2128
|
-
*
|
|
2129
|
-
*
|
|
2130
|
-
* Valid values are in the range [0, 1] inclusive.
|
|
2357
|
+
* Defaults to null. Reject audio files that contain less than this fraction of speech.
|
|
2358
|
+
* Valid values are in the range [0", 1] inclusive.
|
|
2131
2359
|
*/
|
|
2132
2360
|
speech_threshold?: number | null;
|
|
2133
2361
|
/**
|
|
2134
2362
|
* @deprecated
|
|
2135
|
-
*
|
|
2363
|
+
* Whether speed boost is enabled
|
|
2136
2364
|
*/
|
|
2137
2365
|
speed_boost?: boolean | null;
|
|
2138
|
-
/**
|
|
2366
|
+
/**
|
|
2367
|
+
* The status of your transcript. Possible values are queued, processing, completed, or error.
|
|
2368
|
+
*/
|
|
2139
2369
|
status: TranscriptStatus;
|
|
2140
|
-
/**
|
|
2370
|
+
/**
|
|
2371
|
+
* Whether {@link https://www.assemblyai.com/docs/models/summarization | Summarization } is enabled, either true or false
|
|
2372
|
+
*/
|
|
2141
2373
|
summarization: boolean;
|
|
2142
|
-
/**
|
|
2374
|
+
/**
|
|
2375
|
+
* The generated summary of the media file, if {@link https://www.assemblyai.com/docs/models/summarization | Summarization } is enabled
|
|
2376
|
+
*/
|
|
2143
2377
|
summary?: string | null;
|
|
2144
2378
|
/**
|
|
2145
|
-
*
|
|
2146
|
-
* if
|
|
2379
|
+
* The Summarization model used to generate the summary,
|
|
2380
|
+
* if {@link https://www.assemblyai.com/docs/models/summarization | Summarization } is enabled
|
|
2147
2381
|
*/
|
|
2148
2382
|
summary_model?: string | null;
|
|
2149
|
-
/**
|
|
2383
|
+
/**
|
|
2384
|
+
* The type of summary generated, if {@link https://www.assemblyai.com/docs/models/summarization | Summarization } is enabled
|
|
2385
|
+
*/
|
|
2150
2386
|
summary_type?: string | null;
|
|
2151
|
-
/**
|
|
2387
|
+
/**
|
|
2388
|
+
* The textual transcript of your media file
|
|
2389
|
+
*/
|
|
2152
2390
|
text?: string | null;
|
|
2153
|
-
/**
|
|
2391
|
+
/**
|
|
2392
|
+
* True while a request is throttled and false when a request is no longer throttled
|
|
2393
|
+
*/
|
|
2154
2394
|
throttled?: boolean | null;
|
|
2155
|
-
/**
|
|
2395
|
+
/**
|
|
2396
|
+
* The list of custom topics provided if custom topics is enabled
|
|
2397
|
+
*/
|
|
2156
2398
|
topics?: string[];
|
|
2157
2399
|
/**
|
|
2158
|
-
*
|
|
2159
|
-
* See
|
|
2400
|
+
* When dual_channel or speaker_labels is enabled, a list of turn-by-turn utterance objects.
|
|
2401
|
+
* See {@link https://www.assemblyai.com/docs/models/speaker-diarization | Speaker diarization } for more information.
|
|
2160
2402
|
*/
|
|
2161
2403
|
utterances?: TranscriptUtterance[] | null;
|
|
2162
|
-
/**
|
|
2404
|
+
/**
|
|
2405
|
+
* Whether webhook authentication details were provided
|
|
2406
|
+
*/
|
|
2163
2407
|
webhook_auth: boolean;
|
|
2164
|
-
/**
|
|
2408
|
+
/**
|
|
2409
|
+
* The header name which should be sent back with webhook calls
|
|
2410
|
+
*/
|
|
2165
2411
|
webhook_auth_header_name?: string | null;
|
|
2166
|
-
/**
|
|
2412
|
+
/**
|
|
2413
|
+
* The status code we received from your server when delivering your webhook, if a webhook URL was provided
|
|
2414
|
+
*/
|
|
2167
2415
|
webhook_status_code?: number | null;
|
|
2168
|
-
/**
|
|
2416
|
+
/**
|
|
2417
|
+
* The URL to which we send webhooks upon trancription completion
|
|
2418
|
+
*/
|
|
2169
2419
|
webhook_url?: string | null;
|
|
2170
|
-
/**
|
|
2420
|
+
/**
|
|
2421
|
+
* The list of custom vocabulary to boost transcription probability for
|
|
2422
|
+
*/
|
|
2171
2423
|
word_boost?: string[];
|
|
2172
2424
|
/**
|
|
2173
|
-
*
|
|
2174
|
-
* See
|
|
2425
|
+
* An array of temporally-sequential word objects, one for each word in the transcript.
|
|
2426
|
+
* See {@link https://www.assemblyai.com/docs/models/speech-recognition | Speech recognition } for more information.
|
|
2175
2427
|
*/
|
|
2176
2428
|
words?: TranscriptWord[] | null;
|
|
2177
2429
|
};
|
|
2178
2430
|
|
|
2179
2431
|
/**
|
|
2180
|
-
*
|
|
2181
|
-
* @enum {string}
|
|
2432
|
+
* The word boost parameter value
|
|
2182
2433
|
*/
|
|
2183
2434
|
export type TranscriptBoostParam = "low" | "default" | "high";
|
|
2184
2435
|
|
|
2185
2436
|
/**
|
|
2186
|
-
*
|
|
2187
|
-
* @example
|
|
2437
|
+
* Object containing words or phrases to replace, and the word or phrase to replace with
|
|
2438
|
+
* @example
|
|
2439
|
+
* ```js
|
|
2440
|
+
* {
|
|
2188
2441
|
* "from": [
|
|
2189
2442
|
* "dicarlo"
|
|
2190
2443
|
* ],
|
|
2191
2444
|
* "to": "Decarlo"
|
|
2192
2445
|
* }
|
|
2446
|
+
* ```
|
|
2193
2447
|
*/
|
|
2194
2448
|
export type TranscriptCustomSpelling = {
|
|
2195
|
-
/**
|
|
2449
|
+
/**
|
|
2450
|
+
* Words or phrases to replace
|
|
2451
|
+
*/
|
|
2196
2452
|
from: string[];
|
|
2197
|
-
/**
|
|
2453
|
+
/**
|
|
2454
|
+
* Word or phrase to replace with
|
|
2455
|
+
*/
|
|
2198
2456
|
to: string;
|
|
2199
2457
|
};
|
|
2200
2458
|
|
|
2201
2459
|
/**
|
|
2202
|
-
*
|
|
2460
|
+
* The language of your audio file. Possible values are found in {@link https://www.assemblyai.com/docs/concepts/supported-languages | Supported Languages }.
|
|
2203
2461
|
* The default value is 'en_us'.
|
|
2204
2462
|
*
|
|
2205
|
-
* @
|
|
2206
|
-
* @enum {string}
|
|
2463
|
+
* @defaultValue "en_us
|
|
2207
2464
|
*/
|
|
2208
2465
|
export type TranscriptLanguageCode =
|
|
2209
2466
|
| "en"
|
|
@@ -2228,9 +2485,11 @@ export type TranscriptLanguageCode =
|
|
|
2228
2485
|
| "vi";
|
|
2229
2486
|
|
|
2230
2487
|
/**
|
|
2231
|
-
* @example
|
|
2488
|
+
* @example
|
|
2489
|
+
* ```js
|
|
2490
|
+
* {
|
|
2232
2491
|
* "page_details": {
|
|
2233
|
-
* "limit": 2,
|
|
2492
|
+
* "limit": 2",
|
|
2234
2493
|
* "result_count": 2,
|
|
2235
2494
|
* "current_url": "https://api.assemblyai.com/v2/transcript?limit=2",
|
|
2236
2495
|
* "prev_url": "https://api.assemblyai.com/v2/transcript?limit=2&before_id=62npeahu2b-a8ea-4112-854c-69542c20d90c",
|
|
@@ -2255,6 +2514,7 @@ export type TranscriptLanguageCode =
|
|
|
2255
2514
|
* }
|
|
2256
2515
|
* ]
|
|
2257
2516
|
* }
|
|
2517
|
+
* ```
|
|
2258
2518
|
*/
|
|
2259
2519
|
export type TranscriptList = {
|
|
2260
2520
|
page_details: PageDetails;
|
|
@@ -2262,7 +2522,9 @@ export type TranscriptList = {
|
|
|
2262
2522
|
};
|
|
2263
2523
|
|
|
2264
2524
|
/**
|
|
2265
|
-
* @example
|
|
2525
|
+
* @example
|
|
2526
|
+
* ```js
|
|
2527
|
+
* {
|
|
2266
2528
|
* "id": "9ea68fd3-f953-42c1-9742-976c447fb463",
|
|
2267
2529
|
* "resource_url": "https://api.assemblyai.com/v2/transcript/9ea68fd3-f953-42c1-9742-976c447fb463",
|
|
2268
2530
|
* "status": "completed",
|
|
@@ -2270,20 +2532,22 @@ export type TranscriptList = {
|
|
|
2270
2532
|
* "completed": "2023-11-02T21:49:25.586965",
|
|
2271
2533
|
* "audio_url": "https://github.com/AssemblyAI-Examples/audio-examples/raw/main/20230607_me_canadian_wildfires.mp3"
|
|
2272
2534
|
* }
|
|
2535
|
+
* ```
|
|
2273
2536
|
*/
|
|
2274
2537
|
export type TranscriptListItem = {
|
|
2275
2538
|
audio_url: string;
|
|
2276
2539
|
completed: Date | null;
|
|
2277
2540
|
created: Date;
|
|
2278
|
-
/** Format: uuid */
|
|
2279
2541
|
id: string;
|
|
2280
2542
|
resource_url: string;
|
|
2281
2543
|
status: TranscriptStatus;
|
|
2282
2544
|
};
|
|
2283
2545
|
|
|
2284
2546
|
/**
|
|
2285
|
-
*
|
|
2286
|
-
* @example
|
|
2547
|
+
* The parameters for creating a transcript
|
|
2548
|
+
* @example
|
|
2549
|
+
* ```js
|
|
2550
|
+
* {
|
|
2287
2551
|
* "speech_model": null,
|
|
2288
2552
|
* "language_code": "en_us",
|
|
2289
2553
|
* "punctuate": true,
|
|
@@ -2327,116 +2591,172 @@ export type TranscriptListItem = {
|
|
|
2327
2591
|
* "custom_topics": true,
|
|
2328
2592
|
* "topics": []
|
|
2329
2593
|
* }
|
|
2594
|
+
* ```
|
|
2330
2595
|
*/
|
|
2331
2596
|
export type TranscriptOptionalParams = {
|
|
2332
|
-
/**
|
|
2597
|
+
/**
|
|
2598
|
+
* The point in time, in milliseconds, to stop transcribing in your media file
|
|
2599
|
+
*/
|
|
2333
2600
|
audio_end_at?: number;
|
|
2334
|
-
/**
|
|
2601
|
+
/**
|
|
2602
|
+
* The point in time, in milliseconds, to begin transcribing in your media file
|
|
2603
|
+
*/
|
|
2335
2604
|
audio_start_from?: number;
|
|
2336
|
-
/**
|
|
2605
|
+
/**
|
|
2606
|
+
* Enable {@link https://www.assemblyai.com/docs/models/auto-chapters | Auto Chapters }, can be true or false
|
|
2607
|
+
*/
|
|
2337
2608
|
auto_chapters?: boolean;
|
|
2338
|
-
/**
|
|
2609
|
+
/**
|
|
2610
|
+
* Whether Key Phrases is enabled, either true or false
|
|
2611
|
+
*/
|
|
2339
2612
|
auto_highlights?: boolean;
|
|
2340
|
-
/**
|
|
2613
|
+
/**
|
|
2614
|
+
* The word boost parameter value
|
|
2615
|
+
*/
|
|
2341
2616
|
boost_param?: TranscriptBoostParam;
|
|
2342
|
-
/**
|
|
2617
|
+
/**
|
|
2618
|
+
* Enable {@link https://www.assemblyai.com/docs/models/content-moderation | Content Moderation }, can be true or false
|
|
2619
|
+
*/
|
|
2343
2620
|
content_safety?: boolean;
|
|
2344
|
-
/**
|
|
2621
|
+
/**
|
|
2622
|
+
* The confidence threshold for content moderation. Values must be between 25 and 100.
|
|
2623
|
+
*/
|
|
2345
2624
|
content_safety_confidence?: number;
|
|
2346
|
-
/**
|
|
2625
|
+
/**
|
|
2626
|
+
* Customize how words are spelled and formatted using to and from values
|
|
2627
|
+
*/
|
|
2347
2628
|
custom_spelling?: TranscriptCustomSpelling[];
|
|
2348
|
-
/**
|
|
2629
|
+
/**
|
|
2630
|
+
* Whether custom topics is enabled, either true or false
|
|
2631
|
+
*/
|
|
2349
2632
|
custom_topics?: boolean;
|
|
2350
|
-
/**
|
|
2633
|
+
/**
|
|
2634
|
+
* Transcribe Filler Words, like "umm", in your media file; can be true or false
|
|
2635
|
+
*/
|
|
2351
2636
|
disfluencies?: boolean;
|
|
2352
|
-
/**
|
|
2637
|
+
/**
|
|
2638
|
+
* Enable {@link https://www.assemblyai.com/docs/models/speech-recognition#dual-channel-transcription | Dual Channel } transcription, can be true or false.
|
|
2639
|
+
*/
|
|
2353
2640
|
dual_channel?: boolean;
|
|
2354
|
-
/**
|
|
2641
|
+
/**
|
|
2642
|
+
* Enable {@link https://www.assemblyai.com/docs/models/entity-detection | Entity Detection }, can be true or false
|
|
2643
|
+
*/
|
|
2355
2644
|
entity_detection?: boolean;
|
|
2356
|
-
/**
|
|
2645
|
+
/**
|
|
2646
|
+
* Filter profanity from the transcribed text, can be true or false
|
|
2647
|
+
*/
|
|
2357
2648
|
filter_profanity?: boolean;
|
|
2358
|
-
/**
|
|
2649
|
+
/**
|
|
2650
|
+
* Enable Text Formatting, can be true or false
|
|
2651
|
+
*/
|
|
2359
2652
|
format_text?: boolean;
|
|
2360
|
-
/**
|
|
2653
|
+
/**
|
|
2654
|
+
* Enable {@link https://www.assemblyai.com/docs/models/topic-detection | Topic Detection }, can be true or false
|
|
2655
|
+
*/
|
|
2361
2656
|
iab_categories?: boolean;
|
|
2362
2657
|
/**
|
|
2363
|
-
*
|
|
2658
|
+
* The language of your audio file. Possible values are found in {@link https://www.assemblyai.com/docs/concepts/supported-languages | Supported Languages }.
|
|
2364
2659
|
* The default value is 'en_us'.
|
|
2365
2660
|
*/
|
|
2366
|
-
language_code?: TranscriptLanguageCode | null;
|
|
2367
|
-
/**
|
|
2661
|
+
language_code?: LiteralUnion<TranscriptLanguageCode, string> | null;
|
|
2662
|
+
/**
|
|
2663
|
+
* Whether {@link https://www.assemblyai.com/docs/models/speech-recognition#automatic-language-detection | Automatic language detection } was enabled in the transcription request, either true or false.
|
|
2664
|
+
*/
|
|
2368
2665
|
language_detection?: boolean;
|
|
2369
|
-
/**
|
|
2666
|
+
/**
|
|
2667
|
+
* Enable Automatic Punctuation, can be true or false
|
|
2668
|
+
*/
|
|
2370
2669
|
punctuate?: boolean;
|
|
2371
|
-
/**
|
|
2670
|
+
/**
|
|
2671
|
+
* Redact PII from the transcribed text using the Redact PII model, can be true or false
|
|
2672
|
+
*/
|
|
2372
2673
|
redact_pii?: boolean;
|
|
2373
|
-
/**
|
|
2674
|
+
/**
|
|
2675
|
+
* Generate a copy of the original media file with spoken PII "beeped" out, can be true or false. See {@link https://www.assemblyai.com/docs/models/pii-redaction | PII redaction } for more details.
|
|
2676
|
+
*/
|
|
2374
2677
|
redact_pii_audio?: boolean;
|
|
2375
2678
|
/**
|
|
2376
|
-
*
|
|
2377
|
-
* @
|
|
2679
|
+
* Controls the filetype of the audio created by redact_pii_audio. Currently supports mp3 (default) and wav. See {@link https://www.assemblyai.com/docs/models/pii-redaction | PII redaction } for more details.
|
|
2680
|
+
* @defaultValue "mp3"
|
|
2378
2681
|
*/
|
|
2379
2682
|
redact_pii_audio_quality?: RedactPiiAudioQuality;
|
|
2380
|
-
/**
|
|
2683
|
+
/**
|
|
2684
|
+
* The list of PII Redaction policies to enable. See {@link https://www.assemblyai.com/docs/models/pii-redaction | PII redaction } for more details.
|
|
2685
|
+
*/
|
|
2381
2686
|
redact_pii_policies?: PiiPolicy[];
|
|
2382
|
-
/**
|
|
2687
|
+
/**
|
|
2688
|
+
* The replacement logic for detected PII, can be "entity_type" or "hash". See {@link https://www.assemblyai.com/docs/models/pii-redaction | PII redaction } for more details.
|
|
2689
|
+
*/
|
|
2383
2690
|
redact_pii_sub?: SubstitutionPolicy | null;
|
|
2384
|
-
/**
|
|
2691
|
+
/**
|
|
2692
|
+
* Enable {@link https://www.assemblyai.com/docs/models/sentiment-analysis | Sentiment Analysis }, can be true or false
|
|
2693
|
+
*/
|
|
2385
2694
|
sentiment_analysis?: boolean;
|
|
2386
|
-
/**
|
|
2695
|
+
/**
|
|
2696
|
+
* Enable {@link https://www.assemblyai.com/docs/models/speaker-diarization | Speaker diarization }, can be true or false
|
|
2697
|
+
*/
|
|
2387
2698
|
speaker_labels?: boolean;
|
|
2388
2699
|
/**
|
|
2389
|
-
*
|
|
2390
|
-
* @
|
|
2700
|
+
* Tells the speaker label model how many speakers it should attempt to identify, up to 10. See {@link https://www.assemblyai.com/docs/models/speaker-diarization | Speaker diarization } for more details.
|
|
2701
|
+
* @defaultValue "null
|
|
2391
2702
|
*/
|
|
2392
2703
|
speakers_expected?: number | null;
|
|
2393
2704
|
/**
|
|
2394
|
-
*
|
|
2395
|
-
* @
|
|
2705
|
+
* The speech model to use for the transcription. When `null`, the default model is used.
|
|
2706
|
+
* @defaultValue null
|
|
2396
2707
|
*/
|
|
2397
2708
|
speech_model?: SpeechModel | null;
|
|
2398
2709
|
/**
|
|
2399
|
-
*
|
|
2400
|
-
*
|
|
2401
|
-
* Valid values are in the range [0, 1] inclusive.
|
|
2710
|
+
* Reject audio files that contain less than this fraction of speech.
|
|
2711
|
+
* Valid values are in the range [0", 1] inclusive.
|
|
2402
2712
|
*
|
|
2403
|
-
* @
|
|
2713
|
+
* @defaultValue "null
|
|
2404
2714
|
*/
|
|
2405
2715
|
speech_threshold?: number | null;
|
|
2406
|
-
/**
|
|
2716
|
+
/**
|
|
2717
|
+
* Enable {@link https://www.assemblyai.com/docs/models/summarization | Summarization }, can be true or false
|
|
2718
|
+
*/
|
|
2407
2719
|
summarization?: boolean;
|
|
2408
2720
|
/**
|
|
2409
|
-
*
|
|
2410
|
-
* @
|
|
2721
|
+
* The model to summarize the transcript
|
|
2722
|
+
* @defaultValue informative
|
|
2411
2723
|
*/
|
|
2412
2724
|
summary_model?: SummaryModel;
|
|
2413
2725
|
/**
|
|
2414
|
-
*
|
|
2415
|
-
* @
|
|
2726
|
+
* The type of summary
|
|
2727
|
+
* @defaultValue bullets
|
|
2416
2728
|
*/
|
|
2417
2729
|
summary_type?: SummaryType;
|
|
2418
|
-
/**
|
|
2730
|
+
/**
|
|
2731
|
+
* The list of custom topics provided, if custom topics is enabled
|
|
2732
|
+
*/
|
|
2419
2733
|
topics?: string[];
|
|
2420
2734
|
/**
|
|
2421
|
-
*
|
|
2422
|
-
* @
|
|
2735
|
+
* The header name which should be sent back with webhook calls
|
|
2736
|
+
* @defaultValue null
|
|
2423
2737
|
*/
|
|
2424
2738
|
webhook_auth_header_name?: string | null;
|
|
2425
2739
|
/**
|
|
2426
|
-
*
|
|
2427
|
-
* @
|
|
2740
|
+
* Specify a header name and value to send back with a webhook call for added security
|
|
2741
|
+
* @defaultValue null
|
|
2428
2742
|
*/
|
|
2429
2743
|
webhook_auth_header_value?: string | null;
|
|
2430
|
-
/**
|
|
2744
|
+
/**
|
|
2745
|
+
* The URL to which AssemblyAI send webhooks upon trancription completion
|
|
2746
|
+
*/
|
|
2431
2747
|
webhook_url?: string;
|
|
2432
|
-
/**
|
|
2748
|
+
/**
|
|
2749
|
+
* The list of custom vocabulary to boost transcription probability for
|
|
2750
|
+
*/
|
|
2433
2751
|
word_boost?: string[];
|
|
2434
2752
|
};
|
|
2435
2753
|
|
|
2436
2754
|
/**
|
|
2437
|
-
* @example
|
|
2755
|
+
* @example
|
|
2756
|
+
* ```js
|
|
2757
|
+
* {
|
|
2438
2758
|
* "text": "Smoke from hundreds of wildfires in Canada is triggering air quality alerts throughout the US. Skylines from Maine to Maryland to Minnesota are gray and smoggy. And in some places, the air quality warnings include the warning to stay inside. We wanted to better understand what's happening here and why, so we called Peter Decarlo, an associate professor in the Department of Environmental Health and Engineering at Johns Hopkins University. Good morning, professor.",
|
|
2439
|
-
* "start": 250,
|
|
2759
|
+
* "start": 250",
|
|
2440
2760
|
* "end": 26950,
|
|
2441
2761
|
* "confidence": 0.73033,
|
|
2442
2762
|
* "words": [
|
|
@@ -2470,26 +2790,60 @@ export type TranscriptOptionalParams = {
|
|
|
2470
2790
|
* }
|
|
2471
2791
|
* ]
|
|
2472
2792
|
* }
|
|
2793
|
+
* ```
|
|
2473
2794
|
*/
|
|
2474
2795
|
export type TranscriptParagraph = {
|
|
2475
|
-
/** Format: double */
|
|
2476
2796
|
confidence: number;
|
|
2477
2797
|
end: number;
|
|
2478
|
-
/**
|
|
2798
|
+
/**
|
|
2799
|
+
* The speaker of the sentence if {@link https://www.assemblyai.com/docs/models/speaker-diarization | Speaker Diarization } is enabled, else null
|
|
2800
|
+
*/
|
|
2479
2801
|
speaker?: string | null;
|
|
2480
2802
|
start: number;
|
|
2481
2803
|
text: string;
|
|
2482
2804
|
words: TranscriptWord[];
|
|
2483
2805
|
};
|
|
2484
2806
|
|
|
2485
|
-
/**
|
|
2807
|
+
/**
|
|
2808
|
+
* The parameters for creating a transcript
|
|
2809
|
+
*/
|
|
2486
2810
|
export type TranscriptParams = TranscriptOptionalParams & {
|
|
2487
|
-
/**
|
|
2811
|
+
/**
|
|
2812
|
+
* The URL of the audio or video file to transcribe.
|
|
2813
|
+
*/
|
|
2488
2814
|
audio_url: string;
|
|
2489
2815
|
};
|
|
2490
2816
|
|
|
2491
2817
|
/**
|
|
2492
|
-
*
|
|
2818
|
+
* The notification when the transcript status is completed or error.
|
|
2819
|
+
* @example
|
|
2820
|
+
* ```js
|
|
2821
|
+
* {
|
|
2822
|
+
* "transcript_id": "9ea68fd3-f953-42c1-9742-976c447fb463",
|
|
2823
|
+
* "status": "completed"
|
|
2824
|
+
* }
|
|
2825
|
+
* ```
|
|
2826
|
+
*/
|
|
2827
|
+
export type TranscriptReadyNotification = {
|
|
2828
|
+
/**
|
|
2829
|
+
* The status of the transcript. Either completed or error.
|
|
2830
|
+
*/
|
|
2831
|
+
status: TranscriptReadyStatus;
|
|
2832
|
+
/**
|
|
2833
|
+
* The ID of the transcript
|
|
2834
|
+
*/
|
|
2835
|
+
transcript_id: string;
|
|
2836
|
+
};
|
|
2837
|
+
|
|
2838
|
+
/**
|
|
2839
|
+
* The status of the transcript. Either completed or error.
|
|
2840
|
+
*/
|
|
2841
|
+
export type TranscriptReadyStatus = "completed" | "error";
|
|
2842
|
+
|
|
2843
|
+
/**
|
|
2844
|
+
* @example
|
|
2845
|
+
* ```js
|
|
2846
|
+
* {
|
|
2493
2847
|
* "text": "Smoke from hundreds of wildfires in Canada is triggering air quality alerts throughout the US.",
|
|
2494
2848
|
* "start": 250,
|
|
2495
2849
|
* "end": 6350,
|
|
@@ -2526,12 +2880,14 @@ export type TranscriptParams = TranscriptOptionalParams & {
|
|
|
2526
2880
|
* ],
|
|
2527
2881
|
* "speaker": null
|
|
2528
2882
|
* }
|
|
2883
|
+
* ```
|
|
2529
2884
|
*/
|
|
2530
2885
|
export type TranscriptSentence = {
|
|
2531
|
-
/** Format: double */
|
|
2532
2886
|
confidence: number;
|
|
2533
2887
|
end: number;
|
|
2534
|
-
/**
|
|
2888
|
+
/**
|
|
2889
|
+
* The speaker of the sentence if {@link https://www.assemblyai.com/docs/models/speaker-diarization | Speaker Diarization } is enabled, else null
|
|
2890
|
+
*/
|
|
2535
2891
|
speaker?: string | null;
|
|
2536
2892
|
start: number;
|
|
2537
2893
|
text: string;
|
|
@@ -2539,13 +2895,14 @@ export type TranscriptSentence = {
|
|
|
2539
2895
|
};
|
|
2540
2896
|
|
|
2541
2897
|
/**
|
|
2542
|
-
*
|
|
2543
|
-
* @enum {string}
|
|
2898
|
+
* The status of your transcript. Possible values are queued, processing, completed, or error.
|
|
2544
2899
|
*/
|
|
2545
2900
|
export type TranscriptStatus = "queued" | "processing" | "completed" | "error";
|
|
2546
2901
|
|
|
2547
2902
|
/**
|
|
2548
|
-
* @example
|
|
2903
|
+
* @example
|
|
2904
|
+
* ```js
|
|
2905
|
+
* {
|
|
2549
2906
|
* "confidence": 0.9359033333333334,
|
|
2550
2907
|
* "end": 26950,
|
|
2551
2908
|
* "speaker": "A",
|
|
@@ -2659,56 +3016,77 @@ export type TranscriptStatus = "queued" | "processing" | "completed" | "error";
|
|
|
2659
3016
|
* }
|
|
2660
3017
|
* ]
|
|
2661
3018
|
* }
|
|
3019
|
+
* ```
|
|
2662
3020
|
*/
|
|
2663
3021
|
export type TranscriptUtterance = {
|
|
2664
3022
|
/**
|
|
2665
|
-
*
|
|
2666
|
-
* @description The confidence score for the transcript of this utterance
|
|
3023
|
+
* The confidence score for the transcript of this utterance
|
|
2667
3024
|
*/
|
|
2668
3025
|
confidence: number;
|
|
2669
|
-
/**
|
|
3026
|
+
/**
|
|
3027
|
+
* The ending time, in milliseconds, of the utterance in the audio file
|
|
3028
|
+
*/
|
|
2670
3029
|
end: number;
|
|
2671
|
-
/**
|
|
3030
|
+
/**
|
|
3031
|
+
* The speaker of this utterance, where each speaker is assigned a sequential capital letter - e.g. "A" for Speaker A, "B" for Speaker B, etc.
|
|
3032
|
+
*/
|
|
2672
3033
|
speaker: string;
|
|
2673
|
-
/**
|
|
3034
|
+
/**
|
|
3035
|
+
* The starting time, in milliseconds, of the utterance in the audio file
|
|
3036
|
+
*/
|
|
2674
3037
|
start: number;
|
|
2675
|
-
/**
|
|
3038
|
+
/**
|
|
3039
|
+
* The text for this utterance
|
|
3040
|
+
*/
|
|
2676
3041
|
text: string;
|
|
2677
|
-
/**
|
|
3042
|
+
/**
|
|
3043
|
+
* The words in the utterance.
|
|
3044
|
+
*/
|
|
2678
3045
|
words: TranscriptWord[];
|
|
2679
3046
|
};
|
|
2680
3047
|
|
|
2681
3048
|
/**
|
|
2682
|
-
* @example
|
|
3049
|
+
* @example
|
|
3050
|
+
* ```js
|
|
3051
|
+
* {
|
|
2683
3052
|
* "text": "Smoke",
|
|
2684
3053
|
* "start": 250,
|
|
2685
3054
|
* "end": 650,
|
|
2686
3055
|
* "confidence": 0.97465,
|
|
2687
3056
|
* "speaker": null
|
|
2688
3057
|
* }
|
|
3058
|
+
* ```
|
|
2689
3059
|
*/
|
|
2690
3060
|
export type TranscriptWord = {
|
|
2691
|
-
/** Format: double */
|
|
2692
3061
|
confidence: number;
|
|
2693
3062
|
end: number;
|
|
2694
|
-
/**
|
|
3063
|
+
/**
|
|
3064
|
+
* The speaker of the sentence if {@link https://www.assemblyai.com/docs/models/speaker-diarization | Speaker Diarization } is enabled, else null
|
|
3065
|
+
*/
|
|
2695
3066
|
speaker?: string | null;
|
|
2696
3067
|
start: number;
|
|
2697
3068
|
text: string;
|
|
2698
3069
|
};
|
|
2699
3070
|
|
|
2700
3071
|
/**
|
|
2701
|
-
* @example
|
|
3072
|
+
* @example
|
|
3073
|
+
* ```js
|
|
3074
|
+
* {
|
|
2702
3075
|
* "upload_url": "https://cdn.assemblyai.com/upload/f756988d-47e2-4ca3-96ce-04bb168f8f2a"
|
|
2703
3076
|
* }
|
|
3077
|
+
* ```
|
|
2704
3078
|
*/
|
|
2705
3079
|
export type UploadedFile = {
|
|
2706
|
-
/**
|
|
3080
|
+
/**
|
|
3081
|
+
* A URL that points to your audio file, accessible only by AssemblyAI's servers
|
|
3082
|
+
*/
|
|
2707
3083
|
upload_url: string;
|
|
2708
3084
|
};
|
|
2709
3085
|
|
|
2710
3086
|
/**
|
|
2711
|
-
* @example
|
|
3087
|
+
* @example
|
|
3088
|
+
* ```js
|
|
3089
|
+
* {
|
|
2712
3090
|
* "text": "smoke",
|
|
2713
3091
|
* "count": 6,
|
|
2714
3092
|
* "timestamps": [
|
|
@@ -2746,20 +3124,31 @@ export type UploadedFile = {
|
|
|
2746
3124
|
* 698
|
|
2747
3125
|
* ]
|
|
2748
3126
|
* }
|
|
3127
|
+
* ```
|
|
2749
3128
|
*/
|
|
2750
3129
|
export type WordSearchMatch = {
|
|
2751
|
-
/**
|
|
3130
|
+
/**
|
|
3131
|
+
* The total amount of times the word is in the transcript
|
|
3132
|
+
*/
|
|
2752
3133
|
count: number;
|
|
2753
|
-
/**
|
|
3134
|
+
/**
|
|
3135
|
+
* An array of all index locations for that word within the `words` array of the completed transcript
|
|
3136
|
+
*/
|
|
2754
3137
|
indexes: number[];
|
|
2755
|
-
/**
|
|
3138
|
+
/**
|
|
3139
|
+
* The matched word
|
|
3140
|
+
*/
|
|
2756
3141
|
text: string;
|
|
2757
|
-
/**
|
|
3142
|
+
/**
|
|
3143
|
+
* An array of timestamps
|
|
3144
|
+
*/
|
|
2758
3145
|
timestamps: WordSearchTimestamp[];
|
|
2759
3146
|
};
|
|
2760
3147
|
|
|
2761
3148
|
/**
|
|
2762
|
-
* @example
|
|
3149
|
+
* @example
|
|
3150
|
+
* ```js
|
|
3151
|
+
* {
|
|
2763
3152
|
* "id": "d5a3d302-066e-43fb-b63b-8f57baf185db",
|
|
2764
3153
|
* "total_count": 10,
|
|
2765
3154
|
* "matches": [
|
|
@@ -2831,24 +3220,31 @@ export type WordSearchMatch = {
|
|
|
2831
3220
|
* }
|
|
2832
3221
|
* ]
|
|
2833
3222
|
* }
|
|
3223
|
+
* ```
|
|
2834
3224
|
*/
|
|
2835
3225
|
export type WordSearchResponse = {
|
|
2836
3226
|
/**
|
|
2837
|
-
*
|
|
2838
|
-
* @description The ID of the transcript
|
|
3227
|
+
* The ID of the transcript
|
|
2839
3228
|
*/
|
|
2840
3229
|
id: string;
|
|
2841
|
-
/**
|
|
3230
|
+
/**
|
|
3231
|
+
* The matches of the search
|
|
3232
|
+
*/
|
|
2842
3233
|
matches: WordSearchMatch[];
|
|
2843
|
-
/**
|
|
3234
|
+
/**
|
|
3235
|
+
* 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.
|
|
3236
|
+
*/
|
|
2844
3237
|
total_count: number;
|
|
2845
3238
|
};
|
|
2846
3239
|
|
|
2847
3240
|
/**
|
|
2848
|
-
*
|
|
2849
|
-
* @example
|
|
3241
|
+
* An array of timestamps structured as [`start_time`, `end_time`] in milliseconds
|
|
3242
|
+
* @example
|
|
3243
|
+
* ```js
|
|
3244
|
+
* [
|
|
2850
3245
|
* 250,
|
|
2851
3246
|
* 650
|
|
2852
3247
|
* ]
|
|
3248
|
+
* ```
|
|
2853
3249
|
*/
|
|
2854
3250
|
export type WordSearchTimestamp = number[];
|