assemblyai 4.7.0 → 4.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/README.md +4 -4
- package/dist/assemblyai.streaming.umd.js +5 -1
- package/dist/assemblyai.streaming.umd.min.js +1 -1
- package/dist/assemblyai.umd.js +12 -6
- package/dist/assemblyai.umd.min.js +1 -1
- package/dist/browser.mjs +11 -5
- package/dist/bun.mjs +1 -6
- package/dist/deno.mjs +1 -6
- package/dist/index.cjs +8 -6
- package/dist/index.mjs +8 -6
- package/dist/node.cjs +1 -6
- package/dist/node.mjs +1 -6
- package/dist/polyfills/websocket/index.d.ts +1 -0
- package/dist/streaming.browser.mjs +4 -0
- package/dist/streaming.cjs +1 -1
- package/dist/streaming.mjs +1 -1
- package/dist/types/openapi.generated.d.ts +193 -36
- package/dist/utils/conditions/browser.d.ts +2 -0
- package/dist/utils/conditions/bun.d.ts +2 -0
- package/dist/utils/conditions/conditions.d.ts +10 -0
- package/dist/utils/conditions/default.d.ts +2 -0
- package/dist/utils/conditions/deno.d.ts +2 -0
- package/dist/utils/conditions/node.d.ts +2 -0
- package/dist/utils/conditions/react-native.d.ts +2 -0
- package/dist/utils/conditions/workerd.d.ts +2 -0
- package/dist/workerd.mjs +1 -6
- package/package.json +36 -23
- package/src/services/base.ts +7 -4
- package/src/services/realtime/service.ts +8 -0
- package/src/types/openapi.generated.ts +193 -36
- package/src/utils/conditions/browser.ts +12 -0
- package/src/utils/conditions/bun.ts +12 -0
- package/src/utils/conditions/conditions.ts +10 -0
- package/src/utils/conditions/default.ts +12 -0
- package/src/utils/conditions/deno.ts +12 -0
- package/src/utils/conditions/node.ts +12 -0
- package/src/utils/conditions/react-native.ts +12 -0
- package/src/utils/conditions/workerd.ts +12 -0
|
@@ -411,6 +411,9 @@ export type ContentSafetyLabelResult = {
|
|
|
411
411
|
* ```
|
|
412
412
|
*/
|
|
413
413
|
export type ContentSafetyLabelsResult = {
|
|
414
|
+
/**
|
|
415
|
+
* An array of results for the Content Moderation model
|
|
416
|
+
*/
|
|
414
417
|
results: ContentSafetyLabelResult[];
|
|
415
418
|
/**
|
|
416
419
|
* A summary of the Content Moderation severity results for the entire audio file
|
|
@@ -491,6 +494,7 @@ export type Error = {
|
|
|
491
494
|
*/
|
|
492
495
|
error: string;
|
|
493
496
|
status?: "error";
|
|
497
|
+
[key: string]: unknown;
|
|
494
498
|
};
|
|
495
499
|
/**
|
|
496
500
|
* @example
|
|
@@ -501,7 +505,7 @@ export type Error = {
|
|
|
501
505
|
* ],
|
|
502
506
|
* "context": "This is an interview about wildfires.",
|
|
503
507
|
* "answer_format": "Bullet Points",
|
|
504
|
-
* "final_model": "
|
|
508
|
+
* "final_model": "anthropic/claude-3-5-sonnet",
|
|
505
509
|
* "temperature": 0,
|
|
506
510
|
* "max_output_size": 3000
|
|
507
511
|
* }
|
|
@@ -539,7 +543,7 @@ export type LemurActionItemsResponse = LemurStringResponse;
|
|
|
539
543
|
* "7c3acd18-df4d-4432-88f5-1e89f8827eea"
|
|
540
544
|
* ],
|
|
541
545
|
* "context": "This is an interview about wildfires.",
|
|
542
|
-
* "final_model": "
|
|
546
|
+
* "final_model": "anthropic/claude-3-5-sonnet",
|
|
543
547
|
* "temperature": 0,
|
|
544
548
|
* "max_output_size": 3000
|
|
545
549
|
* }
|
|
@@ -568,12 +572,15 @@ export type LemurBaseParams = {
|
|
|
568
572
|
input_text?: string;
|
|
569
573
|
/**
|
|
570
574
|
* Max output size in tokens, up to 4000
|
|
575
|
+
* @defaultValue 2000
|
|
571
576
|
*/
|
|
572
577
|
max_output_size?: number;
|
|
573
578
|
/**
|
|
574
579
|
* The temperature to use for the model.
|
|
575
580
|
* Higher values result in answers that are more creative, lower values are more conservative.
|
|
576
581
|
* Can be any value between 0.0 and 1.0 inclusive.
|
|
582
|
+
*
|
|
583
|
+
* @defaultValue 0
|
|
577
584
|
*/
|
|
578
585
|
temperature?: number;
|
|
579
586
|
/**
|
|
@@ -686,7 +693,7 @@ export type LemurQuestionAnswer = {
|
|
|
686
693
|
* ]
|
|
687
694
|
* }
|
|
688
695
|
* ],
|
|
689
|
-
* "final_model": "
|
|
696
|
+
* "final_model": "anthropic/claude-3-5-sonnet",
|
|
690
697
|
* "temperature": 0,
|
|
691
698
|
* "max_output_size": 3000
|
|
692
699
|
* }
|
|
@@ -754,7 +761,7 @@ export type LemurStringResponse = {
|
|
|
754
761
|
* "47b95ba5-8889-44d8-bc80-5de38306e582"
|
|
755
762
|
* ],
|
|
756
763
|
* "context": "This is an interview about wildfires.",
|
|
757
|
-
* "final_model": "
|
|
764
|
+
* "final_model": "anthropic/claude-3-5-sonnet",
|
|
758
765
|
* "temperature": 0,
|
|
759
766
|
* "max_output_size": 3000
|
|
760
767
|
* }
|
|
@@ -789,7 +796,7 @@ export type LemurSummaryResponse = LemurStringResponse;
|
|
|
789
796
|
* ],
|
|
790
797
|
* "prompt": "List all the locations affected by wildfires.",
|
|
791
798
|
* "context": "This is an interview about wildfires.",
|
|
792
|
-
* "final_model": "
|
|
799
|
+
* "final_model": "anthropic/claude-3-5-sonnet",
|
|
793
800
|
* "temperature": 0,
|
|
794
801
|
* "max_output_size": 3000
|
|
795
802
|
* }
|
|
@@ -865,6 +872,7 @@ export type ListTranscriptParams = {
|
|
|
865
872
|
status?: TranscriptStatus;
|
|
866
873
|
/**
|
|
867
874
|
* Only get throttled transcripts, overrides the status filter
|
|
875
|
+
* @defaultValue false
|
|
868
876
|
*/
|
|
869
877
|
throttled_only?: boolean;
|
|
870
878
|
};
|
|
@@ -981,9 +989,21 @@ export type PageDetails = {
|
|
|
981
989
|
* ```
|
|
982
990
|
*/
|
|
983
991
|
export type ParagraphsResponse = {
|
|
992
|
+
/**
|
|
993
|
+
* The duration of the audio file in seconds
|
|
994
|
+
*/
|
|
984
995
|
audio_duration: number;
|
|
996
|
+
/**
|
|
997
|
+
* The confidence score for the transcript
|
|
998
|
+
*/
|
|
985
999
|
confidence: number;
|
|
1000
|
+
/**
|
|
1001
|
+
* The unique identifier of your transcript
|
|
1002
|
+
*/
|
|
986
1003
|
id: string;
|
|
1004
|
+
/**
|
|
1005
|
+
* An array of paragraphs in the transcript
|
|
1006
|
+
*/
|
|
987
1007
|
paragraphs: TranscriptParagraph[];
|
|
988
1008
|
};
|
|
989
1009
|
/**
|
|
@@ -1036,7 +1056,7 @@ export type RedactedAudioNotification = RedactedAudioResponse;
|
|
|
1036
1056
|
* @example
|
|
1037
1057
|
* ```js
|
|
1038
1058
|
* {
|
|
1039
|
-
* "redacted_audio_url": "https://s3.us-west-2.amazonaws.com/api.assembly.ai.usw2/redacted-audio/785efd9e-0e20-45e1-967b-3db17770ed9f.wav?AWSAccessKeyId=
|
|
1059
|
+
* "redacted_audio_url": "https://s3.us-west-2.amazonaws.com/api.assembly.ai.usw2/redacted-audio/785efd9e-0e20-45e1-967b-3db17770ed9f.wav?AWSAccessKeyId=aws-access-key0id&Signature=signature&x-amz-security-token=security-token&Expires=1698966551",
|
|
1040
1060
|
* "status": "redacted_audio_ready"
|
|
1041
1061
|
* }
|
|
1042
1062
|
* ```
|
|
@@ -1057,7 +1077,6 @@ export type RedactedAudioResponse = {
|
|
|
1057
1077
|
export type RedactedAudioStatus = "redacted_audio_ready";
|
|
1058
1078
|
/**
|
|
1059
1079
|
* 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.
|
|
1060
|
-
* @defaultValue "mp3"
|
|
1061
1080
|
* @example "mp3"
|
|
1062
1081
|
*/
|
|
1063
1082
|
export type RedactPiiAudioQuality = "mp3" | "wav";
|
|
@@ -1162,9 +1181,21 @@ export type RedactPiiAudioQuality = "mp3" | "wav";
|
|
|
1162
1181
|
* ```
|
|
1163
1182
|
*/
|
|
1164
1183
|
export type SentencesResponse = {
|
|
1184
|
+
/**
|
|
1185
|
+
* The duration of the audio file in seconds
|
|
1186
|
+
*/
|
|
1165
1187
|
audio_duration: number;
|
|
1188
|
+
/**
|
|
1189
|
+
* The confidence score for the transcript
|
|
1190
|
+
*/
|
|
1166
1191
|
confidence: number;
|
|
1192
|
+
/**
|
|
1193
|
+
* The unique identifier for the transcript
|
|
1194
|
+
*/
|
|
1167
1195
|
id: string;
|
|
1196
|
+
/**
|
|
1197
|
+
* An array of sentences in the transcript
|
|
1198
|
+
*/
|
|
1168
1199
|
sentences: TranscriptSentence[];
|
|
1169
1200
|
};
|
|
1170
1201
|
export type Sentiment = "POSITIVE" | "NEUTRAL" | "NEGATIVE";
|
|
@@ -1183,6 +1214,10 @@ export type Sentiment = "POSITIVE" | "NEUTRAL" | "NEGATIVE";
|
|
|
1183
1214
|
* ```
|
|
1184
1215
|
*/
|
|
1185
1216
|
export type SentimentAnalysisResult = {
|
|
1217
|
+
/**
|
|
1218
|
+
* The channel of this utterance. The left and right channels are channels 1 and 2. Additional channels increment the channel number sequentially.
|
|
1219
|
+
*/
|
|
1220
|
+
channel?: string | null;
|
|
1186
1221
|
/**
|
|
1187
1222
|
* The confidence score for the detected sentiment of the sentence, from 0 to 1
|
|
1188
1223
|
*/
|
|
@@ -1198,7 +1233,7 @@ export type SentimentAnalysisResult = {
|
|
|
1198
1233
|
/**
|
|
1199
1234
|
* The speaker of the sentence if {@link https://www.assemblyai.com/docs/models/speaker-diarization | Speaker Diarization } is enabled, else null
|
|
1200
1235
|
*/
|
|
1201
|
-
speaker
|
|
1236
|
+
speaker: string | null;
|
|
1202
1237
|
/**
|
|
1203
1238
|
* The starting time, in milliseconds, of the sentence
|
|
1204
1239
|
*/
|
|
@@ -1237,12 +1272,10 @@ export type SubstitutionPolicy = "entity_name" | "hash";
|
|
|
1237
1272
|
export type SubtitleFormat = "srt" | "vtt";
|
|
1238
1273
|
/**
|
|
1239
1274
|
* The model to summarize the transcript
|
|
1240
|
-
* @defaultValue "informative
|
|
1241
1275
|
*/
|
|
1242
1276
|
export type SummaryModel = "informative" | "conversational" | "catchy";
|
|
1243
1277
|
/**
|
|
1244
1278
|
* The type of summary
|
|
1245
|
-
* @defaultValue bullets
|
|
1246
1279
|
*/
|
|
1247
1280
|
export type SummaryType = "bullets" | "bullets_verbose" | "gist" | "headline" | "paragraph";
|
|
1248
1281
|
/**
|
|
@@ -1250,7 +1283,7 @@ export type SummaryType = "bullets" | "bullets_verbose" | "gist" | "headline" |
|
|
|
1250
1283
|
* @example
|
|
1251
1284
|
* ```js
|
|
1252
1285
|
* {
|
|
1253
|
-
* "start": 3978
|
|
1286
|
+
* "start": 3978,
|
|
1254
1287
|
* "end": 5114
|
|
1255
1288
|
* }
|
|
1256
1289
|
* ```
|
|
@@ -1421,6 +1454,9 @@ export type TopicDetectionModelResult = {
|
|
|
1421
1454
|
* ```
|
|
1422
1455
|
*/
|
|
1423
1456
|
export type TopicDetectionResult = {
|
|
1457
|
+
/**
|
|
1458
|
+
* An array of detected topics in the text
|
|
1459
|
+
*/
|
|
1424
1460
|
labels?: {
|
|
1425
1461
|
/**
|
|
1426
1462
|
* The IAB taxonomical label for the label of the detected topic, where > denotes supertopic/subtopic relationship
|
|
@@ -1447,8 +1483,11 @@ export type TopicDetectionResult = {
|
|
|
1447
1483
|
* "language_model": "assemblyai_default",
|
|
1448
1484
|
* "acoustic_model": "assemblyai_default",
|
|
1449
1485
|
* "language_code": "en_us",
|
|
1486
|
+
* "language_detection": true,
|
|
1487
|
+
* "language_confidence_threshold": 0.7,
|
|
1488
|
+
* "language_confidence": 0.9959,
|
|
1450
1489
|
* "status": "completed",
|
|
1451
|
-
* "audio_url": "https://
|
|
1490
|
+
* "audio_url": "https://assembly.ai/wildfires.mp3",
|
|
1452
1491
|
* "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. What is it about the conditions right now that have caused this round of wildfires to affect so many people so far away? Well, there's a couple of things. The season has been pretty dry already. And then the fact that we're getting hit in the US. Is because there's a couple of weather systems that are essentially channeling the smoke from those Canadian wildfires through Pennsylvania into the Mid Atlantic and the Northeast and kind of just dropping the smoke there. So what is it in this haze that makes it harmful? And I'm assuming it is harmful. It is. The levels outside right now in Baltimore are considered unhealthy. And most of that is due to what's called particulate matter, which are tiny particles, microscopic smaller than the width of your hair that can get into your lungs and impact your respiratory system, your cardiovascular system, and even your neurological your brain. What makes this particularly harmful? Is it the volume of particulant? Is it something in particular? What is it exactly? Can you just drill down on that a little bit more? Yeah. So the concentration of particulate matter I was looking at some of the monitors that we have was reaching levels of what are, in science, big 150 micrograms per meter cubed, which is more than ten times what the annual average should be and about four times higher than what you're supposed to have on a 24 hours average. And so the concentrations of these particles in the air are just much, much higher than we typically see. And exposure to those high levels can lead to a host of health problems. And who is most vulnerable? I noticed that in New York City, for example, they're canceling outdoor activities. And so here it is in the early days of summer, and they have to keep all the kids inside. So who tends to be vulnerable in a situation like this? It's the youngest. So children, obviously, whose bodies are still developing. The elderly, who are their bodies are more in decline and they're more susceptible to the health impacts of breathing, the poor air quality. And then people who have preexisting health conditions, people with respiratory conditions or heart conditions can be triggered by high levels of air pollution. Could this get worse? That's a good question. In some areas, it's much worse than others. And it just depends on kind of where the smoke is concentrated. I think New York has some of the higher concentrations right now, but that's going to change as that air moves away from the New York area. But over the course of the next few days, we will see different areas being hit at different times with the highest concentrations. I was going to ask you about more fires start burning. I don't expect the concentrations to go up too much higher. I was going to ask you how and you started to answer this, but how much longer could this last? Or forgive me if I'm asking you to speculate, but what do you think? Well, I think the fires are going to burn for a little bit longer, but the key for us in the US. Is the weather system changing. And so right now, it's kind of the weather systems that are pulling that air into our mid Atlantic and Northeast region. As those weather systems change and shift, we'll see that smoke going elsewhere and not impact us in this region as much. And so I think that's going to be the defining factor. And I think the next couple of days we're going to see a shift in that weather pattern and start to push the smoke away from where we are. And finally, with the impacts of climate change, we are seeing more wildfires. Will we be seeing more of these kinds of wide ranging air quality consequences or circumstances? I mean, that is one of the predictions for climate change. Looking into the future, the fire season is starting earlier and lasting longer, and we're seeing more frequent fires. So, yeah, this is probably something that we'll be seeing more frequently. This tends to be much more of an issue in the Western US. So the eastern US. Getting hit right now is a little bit new. But yeah, I think with climate change moving forward, this is something that is going to happen more frequently. That's Peter De Carlo, associate professor in the Department of Environmental Health and Engineering at Johns Hopkins University. Sergeant Carlo, thanks so much for joining us and sharing this expertise with us. Thank you for having me.",
|
|
1453
1492
|
* "words": [
|
|
1454
1493
|
* {
|
|
@@ -1677,6 +1716,7 @@ export type TopicDetectionResult = {
|
|
|
1677
1716
|
* "audio_duration": 281,
|
|
1678
1717
|
* "punctuate": true,
|
|
1679
1718
|
* "format_text": true,
|
|
1719
|
+
* "multichannel": false,
|
|
1680
1720
|
* "dual_channel": false,
|
|
1681
1721
|
* "webhook_url": "https://your-webhook-url.tld/path",
|
|
1682
1722
|
* "webhook_status_code": 200,
|
|
@@ -2018,7 +2058,6 @@ export type TopicDetectionResult = {
|
|
|
2018
2058
|
* "MedicalHealth>DiseasesAndConditions>Injuries>FirstAid": 0.0004885646631009877
|
|
2019
2059
|
* }
|
|
2020
2060
|
* },
|
|
2021
|
-
* "language_detection": false,
|
|
2022
2061
|
* "custom_spelling": null,
|
|
2023
2062
|
* "throttled": null,
|
|
2024
2063
|
* "auto_chapters": true,
|
|
@@ -2133,6 +2172,10 @@ export type Transcript = {
|
|
|
2133
2172
|
* The acoustic model that was used for the transcript
|
|
2134
2173
|
*/
|
|
2135
2174
|
acoustic_model: string;
|
|
2175
|
+
/**
|
|
2176
|
+
* The number of audio channels in the audio file. This is only present when multichannel is enabled.
|
|
2177
|
+
*/
|
|
2178
|
+
audio_channels?: number;
|
|
2136
2179
|
/**
|
|
2137
2180
|
* The duration of this transcript object's media file, in seconds
|
|
2138
2181
|
*/
|
|
@@ -2196,6 +2239,7 @@ export type Transcript = {
|
|
|
2196
2239
|
*/
|
|
2197
2240
|
disfluencies?: boolean | null;
|
|
2198
2241
|
/**
|
|
2242
|
+
* @deprecated
|
|
2199
2243
|
* 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
|
|
2200
2244
|
*/
|
|
2201
2245
|
dual_channel?: boolean | null;
|
|
@@ -2245,8 +2289,7 @@ export type Transcript = {
|
|
|
2245
2289
|
language_confidence: number | null;
|
|
2246
2290
|
/**
|
|
2247
2291
|
* The confidence threshold for the automatically detected language.
|
|
2248
|
-
* An error will be returned if the
|
|
2249
|
-
* Defaults to 0.
|
|
2292
|
+
* An error will be returned if the language confidence is below this threshold.
|
|
2250
2293
|
*/
|
|
2251
2294
|
language_confidence_threshold: number | null;
|
|
2252
2295
|
/**
|
|
@@ -2258,6 +2301,10 @@ export type Transcript = {
|
|
|
2258
2301
|
* The language model that was used for the transcript
|
|
2259
2302
|
*/
|
|
2260
2303
|
language_model: string;
|
|
2304
|
+
/**
|
|
2305
|
+
* Whether {@link https://www.assemblyai.com/docs/models/speech-recognition#multichannel-transcription | Multichannel transcription } was enabled in the transcription request, either true or false
|
|
2306
|
+
*/
|
|
2307
|
+
multichannel?: boolean | null;
|
|
2261
2308
|
/**
|
|
2262
2309
|
* Whether Automatic Punctuation is enabled, either true or false
|
|
2263
2310
|
*/
|
|
@@ -2413,7 +2460,6 @@ export type TranscriptCustomSpelling = {
|
|
|
2413
2460
|
* The language of your audio file. Possible values are found in {@link https://www.assemblyai.com/docs/concepts/supported-languages | Supported Languages }.
|
|
2414
2461
|
* The default value is 'en_us'.
|
|
2415
2462
|
*
|
|
2416
|
-
* @defaultValue "en_us
|
|
2417
2463
|
*/
|
|
2418
2464
|
export type TranscriptLanguageCode = "en" | "en_au" | "en_uk" | "en_us" | "es" | "fr" | "de" | "it" | "pt" | "nl" | "af" | "sq" | "am" | "ar" | "hy" | "as" | "az" | "ba" | "eu" | "be" | "bn" | "bs" | "br" | "bg" | "my" | "ca" | "zh" | "hr" | "cs" | "da" | "et" | "fo" | "fi" | "gl" | "ka" | "el" | "gu" | "ht" | "ha" | "haw" | "he" | "hi" | "hu" | "is" | "id" | "ja" | "jw" | "kn" | "kk" | "km" | "ko" | "lo" | "la" | "lv" | "ln" | "lt" | "lb" | "mk" | "mg" | "ms" | "ml" | "mt" | "mi" | "mr" | "mn" | "ne" | "no" | "nn" | "oc" | "pa" | "ps" | "fa" | "pl" | "ro" | "ru" | "sa" | "sr" | "sn" | "sd" | "si" | "sk" | "sl" | "so" | "su" | "sw" | "sv" | "tl" | "tg" | "ta" | "tt" | "te" | "th" | "bo" | "tr" | "tk" | "uk" | "ur" | "uz" | "vi" | "cy" | "yi" | "yo";
|
|
2419
2465
|
/**
|
|
@@ -2422,7 +2468,7 @@ export type TranscriptLanguageCode = "en" | "en_au" | "en_uk" | "en_us" | "es" |
|
|
|
2422
2468
|
* ```js
|
|
2423
2469
|
* {
|
|
2424
2470
|
* "page_details": {
|
|
2425
|
-
* "limit": 3
|
|
2471
|
+
* "limit": 3,
|
|
2426
2472
|
* "result_count": 3,
|
|
2427
2473
|
* "current_url": "https://api.assemblyai.com/v2/transcript?limit=3",
|
|
2428
2474
|
* "prev_url": "https://api.assemblyai.com/v2/transcript?limit=3&before_id=28a73d01-98db-41dd-9e98-2533ba0af117",
|
|
@@ -2444,8 +2490,8 @@ export type TranscriptLanguageCode = "en" | "en_au" | "en_uk" | "en_us" | "es" |
|
|
|
2444
2490
|
* "status": "error",
|
|
2445
2491
|
* "created": "2024-03-11T21:23:59.979420",
|
|
2446
2492
|
* "completed": null,
|
|
2447
|
-
* "audio_url": "https://storage.googleapis.com/client-docs-samples/nbc.
|
|
2448
|
-
* "error": "Download error, unable to download https://storage.googleapis.com/client-docs-samples/nbc.
|
|
2493
|
+
* "audio_url": "https://storage.googleapis.com/client-docs-samples/nbc.oopsie",
|
|
2494
|
+
* "error": "Download error, unable to download https://storage.googleapis.com/client-docs-samples/nbc.oopsie. Please make sure the file exists and is accessible from the internet."
|
|
2449
2495
|
* },
|
|
2450
2496
|
* {
|
|
2451
2497
|
* "id": "28a73d01-98db-41dd-9e98-2533ba0af117",
|
|
@@ -2453,7 +2499,7 @@ export type TranscriptLanguageCode = "en" | "en_au" | "en_uk" | "en_us" | "es" |
|
|
|
2453
2499
|
* "status": "completed",
|
|
2454
2500
|
* "created": "2024-03-11T21:12:57.372215",
|
|
2455
2501
|
* "completed": "2024-03-11T21:13:03.267020",
|
|
2456
|
-
* "audio_url": "https://
|
|
2502
|
+
* "audio_url": "https://assembly.ai/nbc.mp3",
|
|
2457
2503
|
* "error": null
|
|
2458
2504
|
* }
|
|
2459
2505
|
* ]
|
|
@@ -2461,7 +2507,13 @@ export type TranscriptLanguageCode = "en" | "en_au" | "en_uk" | "en_us" | "es" |
|
|
|
2461
2507
|
* ```
|
|
2462
2508
|
*/
|
|
2463
2509
|
export type TranscriptList = {
|
|
2510
|
+
/**
|
|
2511
|
+
* Details of the transcript page
|
|
2512
|
+
*/
|
|
2464
2513
|
page_details: PageDetails;
|
|
2514
|
+
/**
|
|
2515
|
+
* An array of transcripts
|
|
2516
|
+
*/
|
|
2465
2517
|
transcripts: TranscriptListItem[];
|
|
2466
2518
|
};
|
|
2467
2519
|
/**
|
|
@@ -2473,21 +2525,39 @@ export type TranscriptList = {
|
|
|
2473
2525
|
* "status": "completed",
|
|
2474
2526
|
* "created": "2023-11-02T21:49:25.586965",
|
|
2475
2527
|
* "completed": "2023-11-02T21:49:25.586965",
|
|
2476
|
-
* "audio_url": "https://
|
|
2528
|
+
* "audio_url": "https://assembly.ai/wildfires.mp3",
|
|
2477
2529
|
* "error": null
|
|
2478
2530
|
* }
|
|
2479
2531
|
* ```
|
|
2480
2532
|
*/
|
|
2481
2533
|
export type TranscriptListItem = {
|
|
2534
|
+
/**
|
|
2535
|
+
* The URL to the audio file
|
|
2536
|
+
*/
|
|
2482
2537
|
audio_url: string;
|
|
2538
|
+
/**
|
|
2539
|
+
* The date and time the transcript was completed
|
|
2540
|
+
*/
|
|
2483
2541
|
completed: Date | null;
|
|
2542
|
+
/**
|
|
2543
|
+
* The date and time the transcript was created
|
|
2544
|
+
*/
|
|
2484
2545
|
created: Date;
|
|
2485
2546
|
/**
|
|
2486
2547
|
* Error message of why the transcript failed
|
|
2487
2548
|
*/
|
|
2488
2549
|
error: string | null;
|
|
2550
|
+
/**
|
|
2551
|
+
* The unique identifier for the transcript
|
|
2552
|
+
*/
|
|
2489
2553
|
id: string;
|
|
2554
|
+
/**
|
|
2555
|
+
* The URL to retrieve the transcript
|
|
2556
|
+
*/
|
|
2490
2557
|
resource_url: string;
|
|
2558
|
+
/**
|
|
2559
|
+
* The status of the transcript
|
|
2560
|
+
*/
|
|
2491
2561
|
status: TranscriptStatus;
|
|
2492
2562
|
};
|
|
2493
2563
|
/**
|
|
@@ -2497,9 +2567,12 @@ export type TranscriptListItem = {
|
|
|
2497
2567
|
* {
|
|
2498
2568
|
* "speech_model": null,
|
|
2499
2569
|
* "language_code": "en_us",
|
|
2570
|
+
* "language_detection": true,
|
|
2571
|
+
* "language_confidence_threshold": 0.7,
|
|
2500
2572
|
* "punctuate": true,
|
|
2501
2573
|
* "format_text": true,
|
|
2502
|
-
* "
|
|
2574
|
+
* "multichannel": true,
|
|
2575
|
+
* "dual_channel": false,
|
|
2503
2576
|
* "webhook_url": "https://your-webhook-url.tld/path",
|
|
2504
2577
|
* "webhook_auth_header_name": "webhook-secret",
|
|
2505
2578
|
* "webhook_auth_header_value": "webhook-secret-value",
|
|
@@ -2525,7 +2598,6 @@ export type TranscriptListItem = {
|
|
|
2525
2598
|
* "speakers_expected": 2,
|
|
2526
2599
|
* "content_safety": true,
|
|
2527
2600
|
* "iab_categories": true,
|
|
2528
|
-
* "language_detection": false,
|
|
2529
2601
|
* "custom_spelling": [],
|
|
2530
2602
|
* "disfluencies": false,
|
|
2531
2603
|
* "sentiment_analysis": true,
|
|
@@ -2551,22 +2623,27 @@ export type TranscriptOptionalParams = {
|
|
|
2551
2623
|
audio_start_from?: number;
|
|
2552
2624
|
/**
|
|
2553
2625
|
* Enable {@link https://www.assemblyai.com/docs/models/auto-chapters | Auto Chapters }, can be true or false
|
|
2626
|
+
* @defaultValue false
|
|
2554
2627
|
*/
|
|
2555
2628
|
auto_chapters?: boolean;
|
|
2556
2629
|
/**
|
|
2557
2630
|
* Enable Key Phrases, either true or false
|
|
2631
|
+
* @defaultValue false
|
|
2558
2632
|
*/
|
|
2559
2633
|
auto_highlights?: boolean;
|
|
2560
2634
|
/**
|
|
2561
2635
|
* How much to boost specified words
|
|
2636
|
+
* @defaultValue default
|
|
2562
2637
|
*/
|
|
2563
2638
|
boost_param?: TranscriptBoostParam;
|
|
2564
2639
|
/**
|
|
2565
2640
|
* Enable {@link https://www.assemblyai.com/docs/models/content-moderation | Content Moderation }, can be true or false
|
|
2641
|
+
* @defaultValue false
|
|
2566
2642
|
*/
|
|
2567
2643
|
content_safety?: boolean;
|
|
2568
2644
|
/**
|
|
2569
2645
|
* The confidence threshold for the Content Moderation model. Values must be between 25 and 100.
|
|
2646
|
+
* @defaultValue 50
|
|
2570
2647
|
*/
|
|
2571
2648
|
content_safety_confidence?: number;
|
|
2572
2649
|
/**
|
|
@@ -2575,57 +2652,78 @@ export type TranscriptOptionalParams = {
|
|
|
2575
2652
|
custom_spelling?: TranscriptCustomSpelling[];
|
|
2576
2653
|
/**
|
|
2577
2654
|
* Enable custom topics, either true or false
|
|
2655
|
+
* @defaultValue false
|
|
2578
2656
|
*/
|
|
2579
2657
|
custom_topics?: boolean;
|
|
2580
2658
|
/**
|
|
2581
2659
|
* Transcribe Filler Words, like "umm", in your media file; can be true or false
|
|
2660
|
+
* @defaultValue false
|
|
2582
2661
|
*/
|
|
2583
2662
|
disfluencies?: boolean;
|
|
2584
2663
|
/**
|
|
2664
|
+
* @deprecated
|
|
2585
2665
|
* Enable {@link https://www.assemblyai.com/docs/models/speech-recognition#dual-channel-transcription | Dual Channel } transcription, can be true or false.
|
|
2666
|
+
* @defaultValue false
|
|
2586
2667
|
*/
|
|
2587
2668
|
dual_channel?: boolean;
|
|
2588
2669
|
/**
|
|
2589
2670
|
* Enable {@link https://www.assemblyai.com/docs/models/entity-detection | Entity Detection }, can be true or false
|
|
2671
|
+
* @defaultValue false
|
|
2590
2672
|
*/
|
|
2591
2673
|
entity_detection?: boolean;
|
|
2592
2674
|
/**
|
|
2593
2675
|
* Filter profanity from the transcribed text, can be true or false
|
|
2676
|
+
* @defaultValue false
|
|
2594
2677
|
*/
|
|
2595
2678
|
filter_profanity?: boolean;
|
|
2596
2679
|
/**
|
|
2597
2680
|
* Enable Text Formatting, can be true or false
|
|
2681
|
+
* @defaultValue true
|
|
2598
2682
|
*/
|
|
2599
2683
|
format_text?: boolean;
|
|
2600
2684
|
/**
|
|
2601
2685
|
* Enable {@link https://www.assemblyai.com/docs/models/topic-detection | Topic Detection }, can be true or false
|
|
2686
|
+
* @defaultValue false
|
|
2602
2687
|
*/
|
|
2603
2688
|
iab_categories?: boolean;
|
|
2604
2689
|
/**
|
|
2605
2690
|
* The language of your audio file. Possible values are found in {@link https://www.assemblyai.com/docs/concepts/supported-languages | Supported Languages }.
|
|
2606
2691
|
* The default value is 'en_us'.
|
|
2692
|
+
*
|
|
2693
|
+
* @defaultValue en_us
|
|
2607
2694
|
*/
|
|
2608
2695
|
language_code?: LiteralUnion<TranscriptLanguageCode, string> | null;
|
|
2609
2696
|
/**
|
|
2610
2697
|
* The confidence threshold for the automatically detected language.
|
|
2611
|
-
* An error will be returned if the
|
|
2698
|
+
* An error will be returned if the language confidence is below this threshold.
|
|
2612
2699
|
* Defaults to 0.
|
|
2700
|
+
*
|
|
2701
|
+
* @defaultValue 0
|
|
2613
2702
|
*/
|
|
2614
2703
|
language_confidence_threshold?: number;
|
|
2615
2704
|
/**
|
|
2616
2705
|
* Enable {@link https://www.assemblyai.com/docs/models/speech-recognition#automatic-language-detection | Automatic language detection }, either true or false.
|
|
2706
|
+
* @defaultValue false
|
|
2617
2707
|
*/
|
|
2618
2708
|
language_detection?: boolean;
|
|
2709
|
+
/**
|
|
2710
|
+
* Enable {@link https://www.assemblyai.com/docs/models/speech-recognition#multichannel-transcription | Multichannel } transcription, can be true or false.
|
|
2711
|
+
* @defaultValue false
|
|
2712
|
+
*/
|
|
2713
|
+
multichannel?: boolean;
|
|
2619
2714
|
/**
|
|
2620
2715
|
* Enable Automatic Punctuation, can be true or false
|
|
2716
|
+
* @defaultValue true
|
|
2621
2717
|
*/
|
|
2622
2718
|
punctuate?: boolean;
|
|
2623
2719
|
/**
|
|
2624
2720
|
* Redact PII from the transcribed text using the Redact PII model, can be true or false
|
|
2721
|
+
* @defaultValue false
|
|
2625
2722
|
*/
|
|
2626
2723
|
redact_pii?: boolean;
|
|
2627
2724
|
/**
|
|
2628
2725
|
* 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.
|
|
2726
|
+
* @defaultValue false
|
|
2629
2727
|
*/
|
|
2630
2728
|
redact_pii_audio?: boolean;
|
|
2631
2729
|
/**
|
|
@@ -2639,35 +2737,39 @@ export type TranscriptOptionalParams = {
|
|
|
2639
2737
|
redact_pii_policies?: PiiPolicy[];
|
|
2640
2738
|
/**
|
|
2641
2739
|
* 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.
|
|
2740
|
+
* @defaultValue "hash"
|
|
2642
2741
|
*/
|
|
2643
2742
|
redact_pii_sub?: SubstitutionPolicy | null;
|
|
2644
2743
|
/**
|
|
2645
2744
|
* Enable {@link https://www.assemblyai.com/docs/models/sentiment-analysis | Sentiment Analysis }, can be true or false
|
|
2745
|
+
* @defaultValue false
|
|
2646
2746
|
*/
|
|
2647
2747
|
sentiment_analysis?: boolean;
|
|
2648
2748
|
/**
|
|
2649
2749
|
* Enable {@link https://www.assemblyai.com/docs/models/speaker-diarization | Speaker diarization }, can be true or false
|
|
2750
|
+
* @defaultValue false
|
|
2650
2751
|
*/
|
|
2651
2752
|
speaker_labels?: boolean;
|
|
2652
2753
|
/**
|
|
2653
|
-
* 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.
|
|
2754
|
+
* 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.
|
|
2654
2755
|
* @defaultValue "null
|
|
2655
2756
|
*/
|
|
2656
2757
|
speakers_expected?: number | null;
|
|
2657
2758
|
/**
|
|
2658
2759
|
* The speech model to use for the transcription. When `null`, the "best" model is used.
|
|
2659
|
-
* @defaultValue
|
|
2760
|
+
* @defaultValue best
|
|
2660
2761
|
*/
|
|
2661
2762
|
speech_model?: SpeechModel | null;
|
|
2662
2763
|
/**
|
|
2663
2764
|
* Reject audio files that contain less than this fraction of speech.
|
|
2664
2765
|
* Valid values are in the range [0", 1] inclusive.
|
|
2665
2766
|
*
|
|
2666
|
-
* @defaultValue
|
|
2767
|
+
* @defaultValue 0
|
|
2667
2768
|
*/
|
|
2668
2769
|
speech_threshold?: number | null;
|
|
2669
2770
|
/**
|
|
2670
2771
|
* Enable {@link https://www.assemblyai.com/docs/models/summarization | Summarization }, can be true or false
|
|
2772
|
+
* @defaultValue false
|
|
2671
2773
|
*/
|
|
2672
2774
|
summarization?: boolean;
|
|
2673
2775
|
/**
|
|
@@ -2695,7 +2797,9 @@ export type TranscriptOptionalParams = {
|
|
|
2695
2797
|
*/
|
|
2696
2798
|
webhook_auth_header_value?: string | null;
|
|
2697
2799
|
/**
|
|
2698
|
-
* The URL to which we send webhook requests.
|
|
2800
|
+
* The URL to which we send webhook requests.
|
|
2801
|
+
* We sends two different types of webhook requests.
|
|
2802
|
+
* One request when a transcript is completed or failed, and one request when the redacted audio is ready if redact_pii_audio is enabled.
|
|
2699
2803
|
*/
|
|
2700
2804
|
webhook_url?: string;
|
|
2701
2805
|
/**
|
|
@@ -2745,14 +2849,25 @@ export type TranscriptOptionalParams = {
|
|
|
2745
2849
|
* ```
|
|
2746
2850
|
*/
|
|
2747
2851
|
export type TranscriptParagraph = {
|
|
2852
|
+
/**
|
|
2853
|
+
* The confidence score for the transcript of this paragraph
|
|
2854
|
+
*/
|
|
2748
2855
|
confidence: number;
|
|
2856
|
+
/**
|
|
2857
|
+
* The ending time, in milliseconds, of the paragraph
|
|
2858
|
+
*/
|
|
2749
2859
|
end: number;
|
|
2750
2860
|
/**
|
|
2751
|
-
* The
|
|
2861
|
+
* The starting time, in milliseconds, of the paragraph
|
|
2752
2862
|
*/
|
|
2753
|
-
speaker?: string | null;
|
|
2754
2863
|
start: number;
|
|
2864
|
+
/**
|
|
2865
|
+
* The transcript of the paragraph
|
|
2866
|
+
*/
|
|
2755
2867
|
text: string;
|
|
2868
|
+
/**
|
|
2869
|
+
* An array of words in the paragraph
|
|
2870
|
+
*/
|
|
2756
2871
|
words: TranscriptWord[];
|
|
2757
2872
|
};
|
|
2758
2873
|
/**
|
|
@@ -2762,10 +2877,13 @@ export type TranscriptParagraph = {
|
|
|
2762
2877
|
* {
|
|
2763
2878
|
* "speech_model": null,
|
|
2764
2879
|
* "language_code": "en_us",
|
|
2765
|
-
* "
|
|
2880
|
+
* "language_detection": true,
|
|
2881
|
+
* "language_confidence_threshold": 0.7,
|
|
2882
|
+
* "audio_url": "https://assembly.ai/wildfires.mp3",
|
|
2766
2883
|
* "punctuate": true,
|
|
2767
2884
|
* "format_text": true,
|
|
2768
|
-
* "
|
|
2885
|
+
* "multichannel": true,
|
|
2886
|
+
* "dual_channel": false,
|
|
2769
2887
|
* "webhook_url": "https://your-webhook-url/path",
|
|
2770
2888
|
* "webhook_auth_header_name": "webhook-secret",
|
|
2771
2889
|
* "webhook_auth_header_value": "webhook-secret-value",
|
|
@@ -2791,7 +2909,6 @@ export type TranscriptParagraph = {
|
|
|
2791
2909
|
* "speakers_expected": 2,
|
|
2792
2910
|
* "content_safety": true,
|
|
2793
2911
|
* "iab_categories": true,
|
|
2794
|
-
* "language_detection": false,
|
|
2795
2912
|
* "custom_spelling": [],
|
|
2796
2913
|
* "disfluencies": false,
|
|
2797
2914
|
* "sentiment_analysis": true,
|
|
@@ -2879,14 +2996,33 @@ export type TranscriptReadyStatus = "completed" | "error";
|
|
|
2879
2996
|
* ```
|
|
2880
2997
|
*/
|
|
2881
2998
|
export type TranscriptSentence = {
|
|
2999
|
+
/**
|
|
3000
|
+
* The channel of the sentence. The left and right channels are channels 1 and 2. Additional channels increment the channel number sequentially.
|
|
3001
|
+
*/
|
|
3002
|
+
channel?: string | null;
|
|
3003
|
+
/**
|
|
3004
|
+
* The confidence score for the transcript of this sentence
|
|
3005
|
+
*/
|
|
2882
3006
|
confidence: number;
|
|
3007
|
+
/**
|
|
3008
|
+
* The ending time, in milliseconds, for the sentence
|
|
3009
|
+
*/
|
|
2883
3010
|
end: number;
|
|
2884
3011
|
/**
|
|
2885
3012
|
* The speaker of the sentence if {@link https://www.assemblyai.com/docs/models/speaker-diarization | Speaker Diarization } is enabled, else null
|
|
2886
3013
|
*/
|
|
2887
|
-
speaker
|
|
3014
|
+
speaker: string | null;
|
|
3015
|
+
/**
|
|
3016
|
+
* The starting time, in milliseconds, for the sentence
|
|
3017
|
+
*/
|
|
2888
3018
|
start: number;
|
|
3019
|
+
/**
|
|
3020
|
+
* The transcript of the sentence
|
|
3021
|
+
*/
|
|
2889
3022
|
text: string;
|
|
3023
|
+
/**
|
|
3024
|
+
* An array of words in the sentence
|
|
3025
|
+
*/
|
|
2890
3026
|
words: TranscriptWord[];
|
|
2891
3027
|
};
|
|
2892
3028
|
/**
|
|
@@ -3013,6 +3149,10 @@ export type TranscriptStatus = "queued" | "processing" | "completed" | "error";
|
|
|
3013
3149
|
* ```
|
|
3014
3150
|
*/
|
|
3015
3151
|
export type TranscriptUtterance = {
|
|
3152
|
+
/**
|
|
3153
|
+
* The channel of this utterance. The left and right channels are channels 1 and 2. Additional channels increment the channel number sequentially.
|
|
3154
|
+
*/
|
|
3155
|
+
channel?: string | null;
|
|
3016
3156
|
/**
|
|
3017
3157
|
* The confidence score for the transcript of this utterance
|
|
3018
3158
|
*/
|
|
@@ -3050,18 +3190,35 @@ export type TranscriptWebhookNotification = TranscriptReadyNotification | Redact
|
|
|
3050
3190
|
* "start": 250,
|
|
3051
3191
|
* "end": 650,
|
|
3052
3192
|
* "confidence": 0.97465,
|
|
3193
|
+
* "channel": null,
|
|
3053
3194
|
* "speaker": null
|
|
3054
3195
|
* }
|
|
3055
3196
|
* ```
|
|
3056
3197
|
*/
|
|
3057
3198
|
export type TranscriptWord = {
|
|
3199
|
+
/**
|
|
3200
|
+
* The channel of the word. The left and right channels are channels 1 and 2. Additional channels increment the channel number sequentially.
|
|
3201
|
+
*/
|
|
3202
|
+
channel?: string | null;
|
|
3203
|
+
/**
|
|
3204
|
+
* The confidence score for the transcript of this word
|
|
3205
|
+
*/
|
|
3058
3206
|
confidence: number;
|
|
3207
|
+
/**
|
|
3208
|
+
* The ending time, in milliseconds, for the word
|
|
3209
|
+
*/
|
|
3059
3210
|
end: number;
|
|
3060
3211
|
/**
|
|
3061
|
-
* The speaker of the
|
|
3212
|
+
* The speaker of the word if {@link https://www.assemblyai.com/docs/models/speaker-diarization | Speaker Diarization } is enabled, else null
|
|
3213
|
+
*/
|
|
3214
|
+
speaker: string | null;
|
|
3215
|
+
/**
|
|
3216
|
+
* The starting time, in milliseconds, for the word
|
|
3062
3217
|
*/
|
|
3063
|
-
speaker?: string | null;
|
|
3064
3218
|
start: number;
|
|
3219
|
+
/**
|
|
3220
|
+
* The text of the word
|
|
3221
|
+
*/
|
|
3065
3222
|
text: string;
|
|
3066
3223
|
};
|
|
3067
3224
|
/**
|