assemblyai 4.3.3 → 4.3.4
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 +18 -0
- package/README.md +12 -8
- package/dist/types/asyncapi.generated.d.ts +1 -1
- package/dist/types/openapi.generated.d.ts +117 -31
- package/package.json +1 -1
- package/src/types/asyncapi.generated.ts +1 -1
- package/src/types/openapi.generated.ts +117 -31
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [4.3.4] - 2024-04-02
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- `SpeechModel.Best` enum
|
|
8
|
+
- `TranscriptListItem.error` property
|
|
9
|
+
|
|
10
|
+
### Updated
|
|
11
|
+
|
|
12
|
+
- Make `PageDetails.prev_url` nullable
|
|
13
|
+
- Rename Realtime to Streaming inside code documentation
|
|
14
|
+
- More inline code documentation
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
|
|
18
|
+
- Rename `SubstitutionPolicy` literal "entity_type" to "entity_name"
|
|
19
|
+
- Fix the pagination example in "List transcripts" sample on README
|
|
20
|
+
|
|
3
21
|
## [4.3.3] - 2024-03-18
|
|
4
22
|
|
|
5
23
|
### Added
|
package/README.md
CHANGED
|
@@ -19,7 +19,6 @@ It is written primarily for Node.js in TypeScript with all types exported, but a
|
|
|
19
19
|
## Documentation
|
|
20
20
|
|
|
21
21
|
Visit the [AssemblyAI documentation](https://www.assemblyai.com/docs) for step-by-step instructions and a lot more details about our AI models and API.
|
|
22
|
-
Explore the [SDK API reference](https://assemblyai.github.io/assemblyai-node-sdk/) for more details on the SDK types, functions, and classes.
|
|
23
22
|
|
|
24
23
|
## Quickstart
|
|
25
24
|
|
|
@@ -185,13 +184,18 @@ const page = await client.transcripts.list();
|
|
|
185
184
|
You can also paginate over all pages.
|
|
186
185
|
|
|
187
186
|
```typescript
|
|
188
|
-
let
|
|
187
|
+
let previousPageUrl: string | null = null;
|
|
189
188
|
do {
|
|
190
|
-
const page = await client.transcripts.list(
|
|
191
|
-
|
|
192
|
-
} while (
|
|
189
|
+
const page = await client.transcripts.list(previousPageUrl);
|
|
190
|
+
previousPageUrl = page.page_details.prev_url;
|
|
191
|
+
} while (previousPageUrl !== null);
|
|
193
192
|
```
|
|
194
193
|
|
|
194
|
+
> [!NOTE]
|
|
195
|
+
> To paginate over all pages, you need to use the `page.page_details.prev_url`
|
|
196
|
+
> because the transcripts are returned in descending order by creation date and time.
|
|
197
|
+
> The first page is are the most recent transcript, and each "previous" page are older transcripts.
|
|
198
|
+
|
|
195
199
|
</details>
|
|
196
200
|
|
|
197
201
|
<details>
|
|
@@ -241,9 +245,9 @@ You can configure the following events.
|
|
|
241
245
|
```typescript
|
|
242
246
|
rt.on("open", ({ sessionId, expiresAt }) => console.log('Session ID:', sessionId, 'Expires at:', expiresAt));
|
|
243
247
|
rt.on("close", (code: number, reason: string) => console.log('Closed', code, reason));
|
|
244
|
-
rt.on("transcript", (transcript:
|
|
245
|
-
rt.on("transcript.partial", (transcript:
|
|
246
|
-
rt.on("transcript.final", (transcript:
|
|
248
|
+
rt.on("transcript", (transcript: TranscriptMessage) => console.log('Transcript:', transcript));
|
|
249
|
+
rt.on("transcript.partial", (transcript: PartialTranscriptMessage) => console.log('Partial transcript:', transcript));
|
|
250
|
+
rt.on("transcript.final", (transcript: FinalTranscriptMessage) => console.log('Final transcript:', transcript));
|
|
247
251
|
rt.on("error", (error: Error) => console.error('Error', error));
|
|
248
252
|
```
|
|
249
253
|
|
|
@@ -107,7 +107,7 @@ export type SessionTerminated = RealtimeBaseMessage & {
|
|
|
107
107
|
};
|
|
108
108
|
export type TerminateSession = {
|
|
109
109
|
/**
|
|
110
|
-
* Set to true to end your
|
|
110
|
+
* Set to true to end your streaming session forever
|
|
111
111
|
*/
|
|
112
112
|
terminate_session: boolean;
|
|
113
113
|
};
|
|
@@ -532,7 +532,8 @@ export type LemurActionItemsResponse = LemurBaseResponse & {
|
|
|
532
532
|
* ```js
|
|
533
533
|
* {
|
|
534
534
|
* "transcript_ids": [
|
|
535
|
-
* "
|
|
535
|
+
* "85f9b381-e90c-46ed-beca-7d76245d375e",
|
|
536
|
+
* "7c3acd18-df4d-4432-88f5-1e89f8827eea"
|
|
536
537
|
* ],
|
|
537
538
|
* "context": "This is an interview about wildfires.",
|
|
538
539
|
* "final_model": "default",
|
|
@@ -761,12 +762,12 @@ export type LemurSummaryResponse = LemurBaseResponse & {
|
|
|
761
762
|
* }
|
|
762
763
|
* ```
|
|
763
764
|
*/
|
|
764
|
-
export type LemurTaskParams =
|
|
765
|
+
export type LemurTaskParams = {
|
|
765
766
|
/**
|
|
766
767
|
* Your text to prompt the model to produce a desired output, including any context you want to pass into the model.
|
|
767
768
|
*/
|
|
768
769
|
prompt: string;
|
|
769
|
-
};
|
|
770
|
+
} & LemurBaseParams;
|
|
770
771
|
/**
|
|
771
772
|
* @example
|
|
772
773
|
* ```js
|
|
@@ -776,12 +777,12 @@ export type LemurTaskParams = LemurBaseParams & {
|
|
|
776
777
|
* }
|
|
777
778
|
* ```
|
|
778
779
|
*/
|
|
779
|
-
export type LemurTaskResponse =
|
|
780
|
+
export type LemurTaskResponse = {
|
|
780
781
|
/**
|
|
781
782
|
* The response generated by LeMUR.
|
|
782
783
|
*/
|
|
783
784
|
response: string;
|
|
784
|
-
};
|
|
785
|
+
} & LemurBaseResponse;
|
|
785
786
|
/**
|
|
786
787
|
* @example
|
|
787
788
|
* ```js
|
|
@@ -823,6 +824,8 @@ export type ListTranscriptParams = {
|
|
|
823
824
|
throttled_only?: boolean;
|
|
824
825
|
};
|
|
825
826
|
/**
|
|
827
|
+
* Details of the transcript page.
|
|
828
|
+
* Details of the transcript page. Transcripts are sorted from newest to oldest. The previous URL always points to a page with older transcripts.
|
|
826
829
|
* @example
|
|
827
830
|
* ```js
|
|
828
831
|
* {
|
|
@@ -835,10 +838,27 @@ export type ListTranscriptParams = {
|
|
|
835
838
|
* ```
|
|
836
839
|
*/
|
|
837
840
|
export type PageDetails = {
|
|
841
|
+
/**
|
|
842
|
+
* The URL used to retrieve the current page of transcripts
|
|
843
|
+
*/
|
|
838
844
|
current_url: string;
|
|
845
|
+
/**
|
|
846
|
+
* The number of results this page is limited to
|
|
847
|
+
*/
|
|
839
848
|
limit: number;
|
|
840
|
-
|
|
841
|
-
|
|
849
|
+
/**
|
|
850
|
+
* The URL to the next page of transcripts
|
|
851
|
+
* The URL to the next page of transcripts. The next URL always points to a page with newer transcripts.
|
|
852
|
+
*/
|
|
853
|
+
next_url: string | null;
|
|
854
|
+
/**
|
|
855
|
+
* The URL to the previous page of transcripts
|
|
856
|
+
* The URL to the next page of transcripts. The previous URL always points to a page with older transcripts.
|
|
857
|
+
*/
|
|
858
|
+
prev_url: string | null;
|
|
859
|
+
/**
|
|
860
|
+
* The actual number of results in the page
|
|
861
|
+
*/
|
|
842
862
|
result_count: number;
|
|
843
863
|
};
|
|
844
864
|
/**
|
|
@@ -959,7 +979,7 @@ export type PurgeLemurRequestDataResponse = {
|
|
|
959
979
|
*/
|
|
960
980
|
export type RealtimeTemporaryTokenResponse = {
|
|
961
981
|
/**
|
|
962
|
-
* The temporary authentication token for
|
|
982
|
+
* The temporary authentication token for Streaming Speech-to-Text
|
|
963
983
|
*/
|
|
964
984
|
token: string;
|
|
965
985
|
};
|
|
@@ -1157,11 +1177,11 @@ export type SeverityScoreSummary = {
|
|
|
1157
1177
|
/**
|
|
1158
1178
|
* The speech model to use for the transcription.
|
|
1159
1179
|
*/
|
|
1160
|
-
export type SpeechModel = "nano" | "conformer-2";
|
|
1180
|
+
export type SpeechModel = "best" | "nano" | "conformer-2";
|
|
1161
1181
|
/**
|
|
1162
|
-
* The replacement logic for detected PII, can be "
|
|
1182
|
+
* The replacement logic for detected PII, can be "entity_name" or "hash". See {@link https://www.assemblyai.com/docs/models/pii-redaction | PII redaction } for more details.
|
|
1163
1183
|
*/
|
|
1164
|
-
export type SubstitutionPolicy = "
|
|
1184
|
+
export type SubstitutionPolicy = "entity_name" | "hash";
|
|
1165
1185
|
/**
|
|
1166
1186
|
* Format of the subtitles
|
|
1167
1187
|
*/
|
|
@@ -1609,7 +1629,7 @@ export type TopicDetectionResult = {
|
|
|
1609
1629
|
* "punctuate": true,
|
|
1610
1630
|
* "format_text": true,
|
|
1611
1631
|
* "dual_channel": false,
|
|
1612
|
-
* "webhook_url": "https://your-webhook-url/path",
|
|
1632
|
+
* "webhook_url": "https://your-webhook-url.tld/path",
|
|
1613
1633
|
* "webhook_status_code": 200,
|
|
1614
1634
|
* "webhook_auth": true,
|
|
1615
1635
|
* "webhook_auth_header_name": "webhook-secret",
|
|
@@ -2336,32 +2356,45 @@ export type TranscriptCustomSpelling = {
|
|
|
2336
2356
|
*/
|
|
2337
2357
|
export type TranscriptLanguageCode = "en" | "en_au" | "en_uk" | "en_us" | "es" | "fr" | "de" | "it" | "pt" | "nl" | "hi" | "ja" | "zh" | "fi" | "ko" | "pl" | "ru" | "tr" | "uk" | "vi";
|
|
2338
2358
|
/**
|
|
2359
|
+
* A list of transcripts
|
|
2360
|
+
* A list of transcripts. Transcripts are sorted from newest to oldest. The previous URL always points to a page with older transcripts.
|
|
2339
2361
|
* @example
|
|
2340
2362
|
* ```js
|
|
2341
2363
|
* {
|
|
2342
2364
|
* "page_details": {
|
|
2343
|
-
* "limit":
|
|
2344
|
-
* "result_count":
|
|
2345
|
-
* "current_url": "https://api.assemblyai.com/v2/transcript?limit=
|
|
2346
|
-
* "prev_url": "https://api.assemblyai.com/v2/transcript?limit=
|
|
2347
|
-
* "next_url": "https://api.assemblyai.com/v2/transcript?limit=
|
|
2365
|
+
* "limit": 3",
|
|
2366
|
+
* "result_count": 3,
|
|
2367
|
+
* "current_url": "https://api.assemblyai.com/v2/transcript?limit=3",
|
|
2368
|
+
* "prev_url": "https://api.assemblyai.com/v2/transcript?limit=3&before_id=28a73d01-98db-41dd-9e98-2533ba0af117",
|
|
2369
|
+
* "next_url": "https://api.assemblyai.com/v2/transcript?limit=3&after_id=b33f4691-85b7-4f31-be12-a87cef1c1229"
|
|
2348
2370
|
* },
|
|
2349
2371
|
* "transcripts": [
|
|
2350
2372
|
* {
|
|
2351
|
-
* "id": "
|
|
2352
|
-
* "resource_url": "https://api.assemblyai.com/v2/transcript/
|
|
2373
|
+
* "id": "b33f4691-85b7-4f31-be12-a87cef1c1229",
|
|
2374
|
+
* "resource_url": "https://api.assemblyai.com/v2/transcript/b33f4691-85b7-4f31-be12-a87cef1c1229",
|
|
2353
2375
|
* "status": "completed",
|
|
2354
|
-
* "created": "
|
|
2355
|
-
* "completed": "
|
|
2356
|
-
* "audio_url": "
|
|
2376
|
+
* "created": "2024-03-11T21:29:59.936851",
|
|
2377
|
+
* "completed": "2024-03-11T21:30:07.314223",
|
|
2378
|
+
* "audio_url": "http://deleted_by_user",
|
|
2379
|
+
* "error": null
|
|
2357
2380
|
* },
|
|
2358
2381
|
* {
|
|
2359
|
-
* "id": "
|
|
2360
|
-
* "resource_url": "https://api.assemblyai.com/v2/transcript/
|
|
2382
|
+
* "id": "ce522f10-d204-42e8-a838-6b95098145cc",
|
|
2383
|
+
* "resource_url": "https://api.assemblyai.com/v2/transcript/ce522f10-d204-42e8-a838-6b95098145cc",
|
|
2384
|
+
* "status": "error",
|
|
2385
|
+
* "created": "2024-03-11T21:23:59.979420",
|
|
2386
|
+
* "completed": null,
|
|
2387
|
+
* "audio_url": "https://storage.googleapis.com/client-docs-samples/nbc.mp3",
|
|
2388
|
+
* "error": "Download error, unable to download https://storage.googleapis.com/client-docs-samples/nbc.mp3. Please make sure the file exists and is accessible from the internet."
|
|
2389
|
+
* },
|
|
2390
|
+
* {
|
|
2391
|
+
* "id": "28a73d01-98db-41dd-9e98-2533ba0af117",
|
|
2392
|
+
* "resource_url": "https://api.assemblyai.com/v2/transcript/28a73d01-98db-41dd-9e98-2533ba0af117",
|
|
2361
2393
|
* "status": "completed",
|
|
2362
|
-
* "created": "
|
|
2363
|
-
* "completed": "
|
|
2364
|
-
* "audio_url": "
|
|
2394
|
+
* "created": "2024-03-11T21:12:57.372215",
|
|
2395
|
+
* "completed": "2024-03-11T21:13:03.267020",
|
|
2396
|
+
* "audio_url": "https://storage.googleapis.com/aai-docs-samples/nbc.mp3",
|
|
2397
|
+
* "error": null
|
|
2365
2398
|
* }
|
|
2366
2399
|
* ]
|
|
2367
2400
|
* }
|
|
@@ -2380,7 +2413,8 @@ export type TranscriptList = {
|
|
|
2380
2413
|
* "status": "completed",
|
|
2381
2414
|
* "created": "2023-11-02T21:49:25.586965",
|
|
2382
2415
|
* "completed": "2023-11-02T21:49:25.586965",
|
|
2383
|
-
* "audio_url": "https://github.com/AssemblyAI-Examples/audio-examples/raw/main/20230607_me_canadian_wildfires.mp3"
|
|
2416
|
+
* "audio_url": "https://github.com/AssemblyAI-Examples/audio-examples/raw/main/20230607_me_canadian_wildfires.mp3",
|
|
2417
|
+
* "error": null
|
|
2384
2418
|
* }
|
|
2385
2419
|
* ```
|
|
2386
2420
|
*/
|
|
@@ -2388,6 +2422,10 @@ export type TranscriptListItem = {
|
|
|
2388
2422
|
audio_url: string;
|
|
2389
2423
|
completed: Date | null;
|
|
2390
2424
|
created: Date;
|
|
2425
|
+
/**
|
|
2426
|
+
* Error message of why the transcript failed
|
|
2427
|
+
*/
|
|
2428
|
+
error: string | null;
|
|
2391
2429
|
id: string;
|
|
2392
2430
|
resource_url: string;
|
|
2393
2431
|
status: TranscriptStatus;
|
|
@@ -2402,7 +2440,7 @@ export type TranscriptListItem = {
|
|
|
2402
2440
|
* "punctuate": true,
|
|
2403
2441
|
* "format_text": true,
|
|
2404
2442
|
* "dual_channel": true,
|
|
2405
|
-
* "webhook_url": "https://your-webhook-url/path",
|
|
2443
|
+
* "webhook_url": "https://your-webhook-url.tld/path",
|
|
2406
2444
|
* "webhook_auth_header_name": "webhook-secret",
|
|
2407
2445
|
* "webhook_auth_header_value": "webhook-secret-value",
|
|
2408
2446
|
* "auto_highlights": true,
|
|
@@ -2653,13 +2691,61 @@ export type TranscriptParagraph = {
|
|
|
2653
2691
|
};
|
|
2654
2692
|
/**
|
|
2655
2693
|
* The parameters for creating a transcript
|
|
2694
|
+
* @example
|
|
2695
|
+
* ```js
|
|
2696
|
+
* {
|
|
2697
|
+
* "speech_model": null,
|
|
2698
|
+
* "language_code": "en_us",
|
|
2699
|
+
* "audio_url": "https://github.com/AssemblyAI-Examples/audio-examples/raw/main/20230607_me_canadian_wildfires.mp3",
|
|
2700
|
+
* "punctuate": true,
|
|
2701
|
+
* "format_text": true,
|
|
2702
|
+
* "dual_channel": true,
|
|
2703
|
+
* "webhook_url": "https://your-webhook-url/path",
|
|
2704
|
+
* "webhook_auth_header_name": "webhook-secret",
|
|
2705
|
+
* "webhook_auth_header_value": "webhook-secret-value",
|
|
2706
|
+
* "auto_highlights": true,
|
|
2707
|
+
* "audio_start_from": 10,
|
|
2708
|
+
* "audio_end_at": 280,
|
|
2709
|
+
* "word_boost": [
|
|
2710
|
+
* "aws",
|
|
2711
|
+
* "azure",
|
|
2712
|
+
* "google cloud"
|
|
2713
|
+
* ],
|
|
2714
|
+
* "boost_param": "high",
|
|
2715
|
+
* "filter_profanity": true,
|
|
2716
|
+
* "redact_pii": true,
|
|
2717
|
+
* "redact_pii_audio": true,
|
|
2718
|
+
* "redact_pii_audio_quality": "mp3",
|
|
2719
|
+
* "redact_pii_policies": [
|
|
2720
|
+
* "us_social_security_number",
|
|
2721
|
+
* "credit_card_number"
|
|
2722
|
+
* ],
|
|
2723
|
+
* "redact_pii_sub": "hash",
|
|
2724
|
+
* "speaker_labels": true,
|
|
2725
|
+
* "speakers_expected": 2,
|
|
2726
|
+
* "content_safety": true,
|
|
2727
|
+
* "iab_categories": true,
|
|
2728
|
+
* "language_detection": false,
|
|
2729
|
+
* "custom_spelling": [],
|
|
2730
|
+
* "disfluencies": false,
|
|
2731
|
+
* "sentiment_analysis": true,
|
|
2732
|
+
* "auto_chapters": true,
|
|
2733
|
+
* "entity_detection": true,
|
|
2734
|
+
* "speech_threshold": 0.5,
|
|
2735
|
+
* "summarization": true,
|
|
2736
|
+
* "summary_model": "informative",
|
|
2737
|
+
* "summary_type": "bullets",
|
|
2738
|
+
* "custom_topics": true,
|
|
2739
|
+
* "topics": []
|
|
2740
|
+
* }
|
|
2741
|
+
* ```
|
|
2656
2742
|
*/
|
|
2657
|
-
export type TranscriptParams =
|
|
2743
|
+
export type TranscriptParams = {
|
|
2658
2744
|
/**
|
|
2659
2745
|
* The URL of the audio or video file to transcribe.
|
|
2660
2746
|
*/
|
|
2661
2747
|
audio_url: string;
|
|
2662
|
-
};
|
|
2748
|
+
} & TranscriptOptionalParams;
|
|
2663
2749
|
/**
|
|
2664
2750
|
* The notification when the transcript status is completed or error.
|
|
2665
2751
|
* @example
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "assemblyai",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.4",
|
|
4
4
|
"description": "The AssemblyAI JavaScript SDK provides an easy-to-use interface for interacting with the AssemblyAI API, which supports async and real-time transcription, as well as the latest LeMUR models.",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=18"
|
|
@@ -149,7 +149,7 @@ export type SessionTerminated = RealtimeBaseMessage & {
|
|
|
149
149
|
|
|
150
150
|
export type TerminateSession = {
|
|
151
151
|
/**
|
|
152
|
-
* Set to true to end your
|
|
152
|
+
* Set to true to end your streaming session forever
|
|
153
153
|
*/
|
|
154
154
|
terminate_session: boolean;
|
|
155
155
|
};
|
|
@@ -585,7 +585,8 @@ export type LemurActionItemsResponse = LemurBaseResponse & {
|
|
|
585
585
|
* ```js
|
|
586
586
|
* {
|
|
587
587
|
* "transcript_ids": [
|
|
588
|
-
* "
|
|
588
|
+
* "85f9b381-e90c-46ed-beca-7d76245d375e",
|
|
589
|
+
* "7c3acd18-df4d-4432-88f5-1e89f8827eea"
|
|
589
590
|
* ],
|
|
590
591
|
* "context": "This is an interview about wildfires.",
|
|
591
592
|
* "final_model": "default",
|
|
@@ -831,12 +832,12 @@ export type LemurSummaryResponse = LemurBaseResponse & {
|
|
|
831
832
|
* }
|
|
832
833
|
* ```
|
|
833
834
|
*/
|
|
834
|
-
export type LemurTaskParams =
|
|
835
|
+
export type LemurTaskParams = {
|
|
835
836
|
/**
|
|
836
837
|
* Your text to prompt the model to produce a desired output, including any context you want to pass into the model.
|
|
837
838
|
*/
|
|
838
839
|
prompt: string;
|
|
839
|
-
};
|
|
840
|
+
} & LemurBaseParams;
|
|
840
841
|
|
|
841
842
|
/**
|
|
842
843
|
* @example
|
|
@@ -847,12 +848,12 @@ export type LemurTaskParams = LemurBaseParams & {
|
|
|
847
848
|
* }
|
|
848
849
|
* ```
|
|
849
850
|
*/
|
|
850
|
-
export type LemurTaskResponse =
|
|
851
|
+
export type LemurTaskResponse = {
|
|
851
852
|
/**
|
|
852
853
|
* The response generated by LeMUR.
|
|
853
854
|
*/
|
|
854
855
|
response: string;
|
|
855
|
-
};
|
|
856
|
+
} & LemurBaseResponse;
|
|
856
857
|
|
|
857
858
|
/**
|
|
858
859
|
* @example
|
|
@@ -896,6 +897,8 @@ export type ListTranscriptParams = {
|
|
|
896
897
|
};
|
|
897
898
|
|
|
898
899
|
/**
|
|
900
|
+
* Details of the transcript page.
|
|
901
|
+
* Details of the transcript page. Transcripts are sorted from newest to oldest. The previous URL always points to a page with older transcripts.
|
|
899
902
|
* @example
|
|
900
903
|
* ```js
|
|
901
904
|
* {
|
|
@@ -908,10 +911,27 @@ export type ListTranscriptParams = {
|
|
|
908
911
|
* ```
|
|
909
912
|
*/
|
|
910
913
|
export type PageDetails = {
|
|
914
|
+
/**
|
|
915
|
+
* The URL used to retrieve the current page of transcripts
|
|
916
|
+
*/
|
|
911
917
|
current_url: string;
|
|
918
|
+
/**
|
|
919
|
+
* The number of results this page is limited to
|
|
920
|
+
*/
|
|
912
921
|
limit: number;
|
|
913
|
-
|
|
914
|
-
|
|
922
|
+
/**
|
|
923
|
+
* The URL to the next page of transcripts
|
|
924
|
+
* The URL to the next page of transcripts. The next URL always points to a page with newer transcripts.
|
|
925
|
+
*/
|
|
926
|
+
next_url: string | null;
|
|
927
|
+
/**
|
|
928
|
+
* The URL to the previous page of transcripts
|
|
929
|
+
* The URL to the next page of transcripts. The previous URL always points to a page with older transcripts.
|
|
930
|
+
*/
|
|
931
|
+
prev_url: string | null;
|
|
932
|
+
/**
|
|
933
|
+
* The actual number of results in the page
|
|
934
|
+
*/
|
|
915
935
|
result_count: number;
|
|
916
936
|
};
|
|
917
937
|
|
|
@@ -1063,7 +1083,7 @@ export type PurgeLemurRequestDataResponse = {
|
|
|
1063
1083
|
*/
|
|
1064
1084
|
export type RealtimeTemporaryTokenResponse = {
|
|
1065
1085
|
/**
|
|
1066
|
-
* The temporary authentication token for
|
|
1086
|
+
* The temporary authentication token for Streaming Speech-to-Text
|
|
1067
1087
|
*/
|
|
1068
1088
|
token: string;
|
|
1069
1089
|
};
|
|
@@ -1269,12 +1289,12 @@ export type SeverityScoreSummary = {
|
|
|
1269
1289
|
/**
|
|
1270
1290
|
* The speech model to use for the transcription.
|
|
1271
1291
|
*/
|
|
1272
|
-
export type SpeechModel = "nano" | "conformer-2";
|
|
1292
|
+
export type SpeechModel = "best" | "nano" | "conformer-2";
|
|
1273
1293
|
|
|
1274
1294
|
/**
|
|
1275
|
-
* The replacement logic for detected PII, can be "
|
|
1295
|
+
* The replacement logic for detected PII, can be "entity_name" or "hash". See {@link https://www.assemblyai.com/docs/models/pii-redaction | PII redaction } for more details.
|
|
1276
1296
|
*/
|
|
1277
|
-
export type SubstitutionPolicy = "
|
|
1297
|
+
export type SubstitutionPolicy = "entity_name" | "hash";
|
|
1278
1298
|
|
|
1279
1299
|
/**
|
|
1280
1300
|
* Format of the subtitles
|
|
@@ -1734,7 +1754,7 @@ export type TopicDetectionResult = {
|
|
|
1734
1754
|
* "punctuate": true,
|
|
1735
1755
|
* "format_text": true,
|
|
1736
1756
|
* "dual_channel": false,
|
|
1737
|
-
* "webhook_url": "https://your-webhook-url/path",
|
|
1757
|
+
* "webhook_url": "https://your-webhook-url.tld/path",
|
|
1738
1758
|
* "webhook_status_code": 200,
|
|
1739
1759
|
* "webhook_auth": true,
|
|
1740
1760
|
* "webhook_auth_header_name": "webhook-secret",
|
|
@@ -2485,32 +2505,45 @@ export type TranscriptLanguageCode =
|
|
|
2485
2505
|
| "vi";
|
|
2486
2506
|
|
|
2487
2507
|
/**
|
|
2508
|
+
* A list of transcripts
|
|
2509
|
+
* A list of transcripts. Transcripts are sorted from newest to oldest. The previous URL always points to a page with older transcripts.
|
|
2488
2510
|
* @example
|
|
2489
2511
|
* ```js
|
|
2490
2512
|
* {
|
|
2491
2513
|
* "page_details": {
|
|
2492
|
-
* "limit":
|
|
2493
|
-
* "result_count":
|
|
2494
|
-
* "current_url": "https://api.assemblyai.com/v2/transcript?limit=
|
|
2495
|
-
* "prev_url": "https://api.assemblyai.com/v2/transcript?limit=
|
|
2496
|
-
* "next_url": "https://api.assemblyai.com/v2/transcript?limit=
|
|
2514
|
+
* "limit": 3",
|
|
2515
|
+
* "result_count": 3,
|
|
2516
|
+
* "current_url": "https://api.assemblyai.com/v2/transcript?limit=3",
|
|
2517
|
+
* "prev_url": "https://api.assemblyai.com/v2/transcript?limit=3&before_id=28a73d01-98db-41dd-9e98-2533ba0af117",
|
|
2518
|
+
* "next_url": "https://api.assemblyai.com/v2/transcript?limit=3&after_id=b33f4691-85b7-4f31-be12-a87cef1c1229"
|
|
2497
2519
|
* },
|
|
2498
2520
|
* "transcripts": [
|
|
2499
2521
|
* {
|
|
2500
|
-
* "id": "
|
|
2501
|
-
* "resource_url": "https://api.assemblyai.com/v2/transcript/
|
|
2522
|
+
* "id": "b33f4691-85b7-4f31-be12-a87cef1c1229",
|
|
2523
|
+
* "resource_url": "https://api.assemblyai.com/v2/transcript/b33f4691-85b7-4f31-be12-a87cef1c1229",
|
|
2502
2524
|
* "status": "completed",
|
|
2503
|
-
* "created": "
|
|
2504
|
-
* "completed": "
|
|
2505
|
-
* "audio_url": "
|
|
2525
|
+
* "created": "2024-03-11T21:29:59.936851",
|
|
2526
|
+
* "completed": "2024-03-11T21:30:07.314223",
|
|
2527
|
+
* "audio_url": "http://deleted_by_user",
|
|
2528
|
+
* "error": null
|
|
2506
2529
|
* },
|
|
2507
2530
|
* {
|
|
2508
|
-
* "id": "
|
|
2509
|
-
* "resource_url": "https://api.assemblyai.com/v2/transcript/
|
|
2531
|
+
* "id": "ce522f10-d204-42e8-a838-6b95098145cc",
|
|
2532
|
+
* "resource_url": "https://api.assemblyai.com/v2/transcript/ce522f10-d204-42e8-a838-6b95098145cc",
|
|
2533
|
+
* "status": "error",
|
|
2534
|
+
* "created": "2024-03-11T21:23:59.979420",
|
|
2535
|
+
* "completed": null,
|
|
2536
|
+
* "audio_url": "https://storage.googleapis.com/client-docs-samples/nbc.mp3",
|
|
2537
|
+
* "error": "Download error, unable to download https://storage.googleapis.com/client-docs-samples/nbc.mp3. Please make sure the file exists and is accessible from the internet."
|
|
2538
|
+
* },
|
|
2539
|
+
* {
|
|
2540
|
+
* "id": "28a73d01-98db-41dd-9e98-2533ba0af117",
|
|
2541
|
+
* "resource_url": "https://api.assemblyai.com/v2/transcript/28a73d01-98db-41dd-9e98-2533ba0af117",
|
|
2510
2542
|
* "status": "completed",
|
|
2511
|
-
* "created": "
|
|
2512
|
-
* "completed": "
|
|
2513
|
-
* "audio_url": "
|
|
2543
|
+
* "created": "2024-03-11T21:12:57.372215",
|
|
2544
|
+
* "completed": "2024-03-11T21:13:03.267020",
|
|
2545
|
+
* "audio_url": "https://storage.googleapis.com/aai-docs-samples/nbc.mp3",
|
|
2546
|
+
* "error": null
|
|
2514
2547
|
* }
|
|
2515
2548
|
* ]
|
|
2516
2549
|
* }
|
|
@@ -2530,7 +2563,8 @@ export type TranscriptList = {
|
|
|
2530
2563
|
* "status": "completed",
|
|
2531
2564
|
* "created": "2023-11-02T21:49:25.586965",
|
|
2532
2565
|
* "completed": "2023-11-02T21:49:25.586965",
|
|
2533
|
-
* "audio_url": "https://github.com/AssemblyAI-Examples/audio-examples/raw/main/20230607_me_canadian_wildfires.mp3"
|
|
2566
|
+
* "audio_url": "https://github.com/AssemblyAI-Examples/audio-examples/raw/main/20230607_me_canadian_wildfires.mp3",
|
|
2567
|
+
* "error": null
|
|
2534
2568
|
* }
|
|
2535
2569
|
* ```
|
|
2536
2570
|
*/
|
|
@@ -2538,6 +2572,10 @@ export type TranscriptListItem = {
|
|
|
2538
2572
|
audio_url: string;
|
|
2539
2573
|
completed: Date | null;
|
|
2540
2574
|
created: Date;
|
|
2575
|
+
/**
|
|
2576
|
+
* Error message of why the transcript failed
|
|
2577
|
+
*/
|
|
2578
|
+
error: string | null;
|
|
2541
2579
|
id: string;
|
|
2542
2580
|
resource_url: string;
|
|
2543
2581
|
status: TranscriptStatus;
|
|
@@ -2553,7 +2591,7 @@ export type TranscriptListItem = {
|
|
|
2553
2591
|
* "punctuate": true,
|
|
2554
2592
|
* "format_text": true,
|
|
2555
2593
|
* "dual_channel": true,
|
|
2556
|
-
* "webhook_url": "https://your-webhook-url/path",
|
|
2594
|
+
* "webhook_url": "https://your-webhook-url.tld/path",
|
|
2557
2595
|
* "webhook_auth_header_name": "webhook-secret",
|
|
2558
2596
|
* "webhook_auth_header_value": "webhook-secret-value",
|
|
2559
2597
|
* "auto_highlights": true,
|
|
@@ -2806,13 +2844,61 @@ export type TranscriptParagraph = {
|
|
|
2806
2844
|
|
|
2807
2845
|
/**
|
|
2808
2846
|
* The parameters for creating a transcript
|
|
2847
|
+
* @example
|
|
2848
|
+
* ```js
|
|
2849
|
+
* {
|
|
2850
|
+
* "speech_model": null,
|
|
2851
|
+
* "language_code": "en_us",
|
|
2852
|
+
* "audio_url": "https://github.com/AssemblyAI-Examples/audio-examples/raw/main/20230607_me_canadian_wildfires.mp3",
|
|
2853
|
+
* "punctuate": true,
|
|
2854
|
+
* "format_text": true,
|
|
2855
|
+
* "dual_channel": true,
|
|
2856
|
+
* "webhook_url": "https://your-webhook-url/path",
|
|
2857
|
+
* "webhook_auth_header_name": "webhook-secret",
|
|
2858
|
+
* "webhook_auth_header_value": "webhook-secret-value",
|
|
2859
|
+
* "auto_highlights": true,
|
|
2860
|
+
* "audio_start_from": 10,
|
|
2861
|
+
* "audio_end_at": 280,
|
|
2862
|
+
* "word_boost": [
|
|
2863
|
+
* "aws",
|
|
2864
|
+
* "azure",
|
|
2865
|
+
* "google cloud"
|
|
2866
|
+
* ],
|
|
2867
|
+
* "boost_param": "high",
|
|
2868
|
+
* "filter_profanity": true,
|
|
2869
|
+
* "redact_pii": true,
|
|
2870
|
+
* "redact_pii_audio": true,
|
|
2871
|
+
* "redact_pii_audio_quality": "mp3",
|
|
2872
|
+
* "redact_pii_policies": [
|
|
2873
|
+
* "us_social_security_number",
|
|
2874
|
+
* "credit_card_number"
|
|
2875
|
+
* ],
|
|
2876
|
+
* "redact_pii_sub": "hash",
|
|
2877
|
+
* "speaker_labels": true,
|
|
2878
|
+
* "speakers_expected": 2,
|
|
2879
|
+
* "content_safety": true,
|
|
2880
|
+
* "iab_categories": true,
|
|
2881
|
+
* "language_detection": false,
|
|
2882
|
+
* "custom_spelling": [],
|
|
2883
|
+
* "disfluencies": false,
|
|
2884
|
+
* "sentiment_analysis": true,
|
|
2885
|
+
* "auto_chapters": true,
|
|
2886
|
+
* "entity_detection": true,
|
|
2887
|
+
* "speech_threshold": 0.5,
|
|
2888
|
+
* "summarization": true,
|
|
2889
|
+
* "summary_model": "informative",
|
|
2890
|
+
* "summary_type": "bullets",
|
|
2891
|
+
* "custom_topics": true,
|
|
2892
|
+
* "topics": []
|
|
2893
|
+
* }
|
|
2894
|
+
* ```
|
|
2809
2895
|
*/
|
|
2810
|
-
export type TranscriptParams =
|
|
2896
|
+
export type TranscriptParams = {
|
|
2811
2897
|
/**
|
|
2812
2898
|
* The URL of the audio or video file to transcribe.
|
|
2813
2899
|
*/
|
|
2814
2900
|
audio_url: string;
|
|
2815
|
-
};
|
|
2901
|
+
} & TranscriptOptionalParams;
|
|
2816
2902
|
|
|
2817
2903
|
/**
|
|
2818
2904
|
* The notification when the transcript status is completed or error.
|