assemblyai 4.3.3 → 4.4.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 +34 -0
- package/README.md +12 -7
- package/dist/assemblyai.umd.js +24 -2
- package/dist/assemblyai.umd.min.js +1 -1
- package/dist/bun.mjs +22 -0
- package/dist/deno.mjs +22 -0
- package/dist/index.cjs +24 -2
- package/dist/index.mjs +24 -2
- package/dist/node.cjs +22 -0
- package/dist/node.mjs +22 -0
- package/dist/services/realtime/service.d.ts +4 -1
- package/dist/types/asyncapi.generated.d.ts +36 -3
- package/dist/types/openapi.generated.d.ts +121 -31
- package/dist/types/realtime/index.d.ts +27 -2
- package/package.json +8 -4
- package/src/services/realtime/service.ts +26 -0
- package/src/services/transcripts/index.ts +13 -0
- package/src/types/asyncapi.generated.ts +37 -1
- package/src/types/openapi.generated.ts +121 -31
- package/src/types/realtime/index.ts +27 -0
|
@@ -271,6 +271,10 @@ export type AutoHighlightsResult = {
|
|
|
271
271
|
* A temporally-sequential array of Key Phrases
|
|
272
272
|
*/
|
|
273
273
|
results: AutoHighlightResult[];
|
|
274
|
+
/**
|
|
275
|
+
* The status of the Key Phrases model. Either success, or unavailable in the rare case that the model failed.
|
|
276
|
+
*/
|
|
277
|
+
status: AudioIntelligenceModelStatus;
|
|
274
278
|
};
|
|
275
279
|
|
|
276
280
|
/**
|
|
@@ -585,7 +589,8 @@ export type LemurActionItemsResponse = LemurBaseResponse & {
|
|
|
585
589
|
* ```js
|
|
586
590
|
* {
|
|
587
591
|
* "transcript_ids": [
|
|
588
|
-
* "
|
|
592
|
+
* "85f9b381-e90c-46ed-beca-7d76245d375e",
|
|
593
|
+
* "7c3acd18-df4d-4432-88f5-1e89f8827eea"
|
|
589
594
|
* ],
|
|
590
595
|
* "context": "This is an interview about wildfires.",
|
|
591
596
|
* "final_model": "default",
|
|
@@ -831,12 +836,12 @@ export type LemurSummaryResponse = LemurBaseResponse & {
|
|
|
831
836
|
* }
|
|
832
837
|
* ```
|
|
833
838
|
*/
|
|
834
|
-
export type LemurTaskParams =
|
|
839
|
+
export type LemurTaskParams = {
|
|
835
840
|
/**
|
|
836
841
|
* Your text to prompt the model to produce a desired output, including any context you want to pass into the model.
|
|
837
842
|
*/
|
|
838
843
|
prompt: string;
|
|
839
|
-
};
|
|
844
|
+
} & LemurBaseParams;
|
|
840
845
|
|
|
841
846
|
/**
|
|
842
847
|
* @example
|
|
@@ -847,12 +852,12 @@ export type LemurTaskParams = LemurBaseParams & {
|
|
|
847
852
|
* }
|
|
848
853
|
* ```
|
|
849
854
|
*/
|
|
850
|
-
export type LemurTaskResponse =
|
|
855
|
+
export type LemurTaskResponse = {
|
|
851
856
|
/**
|
|
852
857
|
* The response generated by LeMUR.
|
|
853
858
|
*/
|
|
854
859
|
response: string;
|
|
855
|
-
};
|
|
860
|
+
} & LemurBaseResponse;
|
|
856
861
|
|
|
857
862
|
/**
|
|
858
863
|
* @example
|
|
@@ -896,6 +901,8 @@ export type ListTranscriptParams = {
|
|
|
896
901
|
};
|
|
897
902
|
|
|
898
903
|
/**
|
|
904
|
+
* Details of the transcript page.
|
|
905
|
+
* Details of the transcript page. Transcripts are sorted from newest to oldest. The previous URL always points to a page with older transcripts.
|
|
899
906
|
* @example
|
|
900
907
|
* ```js
|
|
901
908
|
* {
|
|
@@ -908,10 +915,27 @@ export type ListTranscriptParams = {
|
|
|
908
915
|
* ```
|
|
909
916
|
*/
|
|
910
917
|
export type PageDetails = {
|
|
918
|
+
/**
|
|
919
|
+
* The URL used to retrieve the current page of transcripts
|
|
920
|
+
*/
|
|
911
921
|
current_url: string;
|
|
922
|
+
/**
|
|
923
|
+
* The number of results this page is limited to
|
|
924
|
+
*/
|
|
912
925
|
limit: number;
|
|
913
|
-
|
|
914
|
-
|
|
926
|
+
/**
|
|
927
|
+
* The URL to the next page of transcripts
|
|
928
|
+
* The URL to the next page of transcripts. The next URL always points to a page with newer transcripts.
|
|
929
|
+
*/
|
|
930
|
+
next_url: string | null;
|
|
931
|
+
/**
|
|
932
|
+
* The URL to the previous page of transcripts
|
|
933
|
+
* The URL to the next page of transcripts. The previous URL always points to a page with older transcripts.
|
|
934
|
+
*/
|
|
935
|
+
prev_url: string | null;
|
|
936
|
+
/**
|
|
937
|
+
* The actual number of results in the page
|
|
938
|
+
*/
|
|
915
939
|
result_count: number;
|
|
916
940
|
};
|
|
917
941
|
|
|
@@ -1063,7 +1087,7 @@ export type PurgeLemurRequestDataResponse = {
|
|
|
1063
1087
|
*/
|
|
1064
1088
|
export type RealtimeTemporaryTokenResponse = {
|
|
1065
1089
|
/**
|
|
1066
|
-
* The temporary authentication token for
|
|
1090
|
+
* The temporary authentication token for Streaming Speech-to-Text
|
|
1067
1091
|
*/
|
|
1068
1092
|
token: string;
|
|
1069
1093
|
};
|
|
@@ -1269,12 +1293,12 @@ export type SeverityScoreSummary = {
|
|
|
1269
1293
|
/**
|
|
1270
1294
|
* The speech model to use for the transcription.
|
|
1271
1295
|
*/
|
|
1272
|
-
export type SpeechModel = "nano" | "conformer-2";
|
|
1296
|
+
export type SpeechModel = "best" | "nano" | "conformer-2";
|
|
1273
1297
|
|
|
1274
1298
|
/**
|
|
1275
|
-
* The replacement logic for detected PII, can be "
|
|
1299
|
+
* 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
1300
|
*/
|
|
1277
|
-
export type SubstitutionPolicy = "
|
|
1301
|
+
export type SubstitutionPolicy = "entity_name" | "hash";
|
|
1278
1302
|
|
|
1279
1303
|
/**
|
|
1280
1304
|
* Format of the subtitles
|
|
@@ -1734,7 +1758,7 @@ export type TopicDetectionResult = {
|
|
|
1734
1758
|
* "punctuate": true,
|
|
1735
1759
|
* "format_text": true,
|
|
1736
1760
|
* "dual_channel": false,
|
|
1737
|
-
* "webhook_url": "https://your-webhook-url/path",
|
|
1761
|
+
* "webhook_url": "https://your-webhook-url.tld/path",
|
|
1738
1762
|
* "webhook_status_code": 200,
|
|
1739
1763
|
* "webhook_auth": true,
|
|
1740
1764
|
* "webhook_auth_header_name": "webhook-secret",
|
|
@@ -2485,32 +2509,45 @@ export type TranscriptLanguageCode =
|
|
|
2485
2509
|
| "vi";
|
|
2486
2510
|
|
|
2487
2511
|
/**
|
|
2512
|
+
* A list of transcripts
|
|
2513
|
+
* A list of transcripts. Transcripts are sorted from newest to oldest. The previous URL always points to a page with older transcripts.
|
|
2488
2514
|
* @example
|
|
2489
2515
|
* ```js
|
|
2490
2516
|
* {
|
|
2491
2517
|
* "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=
|
|
2518
|
+
* "limit": 3",
|
|
2519
|
+
* "result_count": 3,
|
|
2520
|
+
* "current_url": "https://api.assemblyai.com/v2/transcript?limit=3",
|
|
2521
|
+
* "prev_url": "https://api.assemblyai.com/v2/transcript?limit=3&before_id=28a73d01-98db-41dd-9e98-2533ba0af117",
|
|
2522
|
+
* "next_url": "https://api.assemblyai.com/v2/transcript?limit=3&after_id=b33f4691-85b7-4f31-be12-a87cef1c1229"
|
|
2497
2523
|
* },
|
|
2498
2524
|
* "transcripts": [
|
|
2499
2525
|
* {
|
|
2500
|
-
* "id": "
|
|
2501
|
-
* "resource_url": "https://api.assemblyai.com/v2/transcript/
|
|
2526
|
+
* "id": "b33f4691-85b7-4f31-be12-a87cef1c1229",
|
|
2527
|
+
* "resource_url": "https://api.assemblyai.com/v2/transcript/b33f4691-85b7-4f31-be12-a87cef1c1229",
|
|
2502
2528
|
* "status": "completed",
|
|
2503
|
-
* "created": "
|
|
2504
|
-
* "completed": "
|
|
2505
|
-
* "audio_url": "
|
|
2529
|
+
* "created": "2024-03-11T21:29:59.936851",
|
|
2530
|
+
* "completed": "2024-03-11T21:30:07.314223",
|
|
2531
|
+
* "audio_url": "http://deleted_by_user",
|
|
2532
|
+
* "error": null
|
|
2533
|
+
* },
|
|
2534
|
+
* {
|
|
2535
|
+
* "id": "ce522f10-d204-42e8-a838-6b95098145cc",
|
|
2536
|
+
* "resource_url": "https://api.assemblyai.com/v2/transcript/ce522f10-d204-42e8-a838-6b95098145cc",
|
|
2537
|
+
* "status": "error",
|
|
2538
|
+
* "created": "2024-03-11T21:23:59.979420",
|
|
2539
|
+
* "completed": null,
|
|
2540
|
+
* "audio_url": "https://storage.googleapis.com/client-docs-samples/nbc.mp3",
|
|
2541
|
+
* "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."
|
|
2506
2542
|
* },
|
|
2507
2543
|
* {
|
|
2508
|
-
* "id": "
|
|
2509
|
-
* "resource_url": "https://api.assemblyai.com/v2/transcript/
|
|
2544
|
+
* "id": "28a73d01-98db-41dd-9e98-2533ba0af117",
|
|
2545
|
+
* "resource_url": "https://api.assemblyai.com/v2/transcript/28a73d01-98db-41dd-9e98-2533ba0af117",
|
|
2510
2546
|
* "status": "completed",
|
|
2511
|
-
* "created": "
|
|
2512
|
-
* "completed": "
|
|
2513
|
-
* "audio_url": "
|
|
2547
|
+
* "created": "2024-03-11T21:12:57.372215",
|
|
2548
|
+
* "completed": "2024-03-11T21:13:03.267020",
|
|
2549
|
+
* "audio_url": "https://storage.googleapis.com/aai-docs-samples/nbc.mp3",
|
|
2550
|
+
* "error": null
|
|
2514
2551
|
* }
|
|
2515
2552
|
* ]
|
|
2516
2553
|
* }
|
|
@@ -2530,7 +2567,8 @@ export type TranscriptList = {
|
|
|
2530
2567
|
* "status": "completed",
|
|
2531
2568
|
* "created": "2023-11-02T21:49:25.586965",
|
|
2532
2569
|
* "completed": "2023-11-02T21:49:25.586965",
|
|
2533
|
-
* "audio_url": "https://github.com/AssemblyAI-Examples/audio-examples/raw/main/20230607_me_canadian_wildfires.mp3"
|
|
2570
|
+
* "audio_url": "https://github.com/AssemblyAI-Examples/audio-examples/raw/main/20230607_me_canadian_wildfires.mp3",
|
|
2571
|
+
* "error": null
|
|
2534
2572
|
* }
|
|
2535
2573
|
* ```
|
|
2536
2574
|
*/
|
|
@@ -2538,6 +2576,10 @@ export type TranscriptListItem = {
|
|
|
2538
2576
|
audio_url: string;
|
|
2539
2577
|
completed: Date | null;
|
|
2540
2578
|
created: Date;
|
|
2579
|
+
/**
|
|
2580
|
+
* Error message of why the transcript failed
|
|
2581
|
+
*/
|
|
2582
|
+
error: string | null;
|
|
2541
2583
|
id: string;
|
|
2542
2584
|
resource_url: string;
|
|
2543
2585
|
status: TranscriptStatus;
|
|
@@ -2553,7 +2595,7 @@ export type TranscriptListItem = {
|
|
|
2553
2595
|
* "punctuate": true,
|
|
2554
2596
|
* "format_text": true,
|
|
2555
2597
|
* "dual_channel": true,
|
|
2556
|
-
* "webhook_url": "https://your-webhook-url/path",
|
|
2598
|
+
* "webhook_url": "https://your-webhook-url.tld/path",
|
|
2557
2599
|
* "webhook_auth_header_name": "webhook-secret",
|
|
2558
2600
|
* "webhook_auth_header_value": "webhook-secret-value",
|
|
2559
2601
|
* "auto_highlights": true,
|
|
@@ -2806,13 +2848,61 @@ export type TranscriptParagraph = {
|
|
|
2806
2848
|
|
|
2807
2849
|
/**
|
|
2808
2850
|
* The parameters for creating a transcript
|
|
2851
|
+
* @example
|
|
2852
|
+
* ```js
|
|
2853
|
+
* {
|
|
2854
|
+
* "speech_model": null,
|
|
2855
|
+
* "language_code": "en_us",
|
|
2856
|
+
* "audio_url": "https://github.com/AssemblyAI-Examples/audio-examples/raw/main/20230607_me_canadian_wildfires.mp3",
|
|
2857
|
+
* "punctuate": true,
|
|
2858
|
+
* "format_text": true,
|
|
2859
|
+
* "dual_channel": true,
|
|
2860
|
+
* "webhook_url": "https://your-webhook-url/path",
|
|
2861
|
+
* "webhook_auth_header_name": "webhook-secret",
|
|
2862
|
+
* "webhook_auth_header_value": "webhook-secret-value",
|
|
2863
|
+
* "auto_highlights": true,
|
|
2864
|
+
* "audio_start_from": 10,
|
|
2865
|
+
* "audio_end_at": 280,
|
|
2866
|
+
* "word_boost": [
|
|
2867
|
+
* "aws",
|
|
2868
|
+
* "azure",
|
|
2869
|
+
* "google cloud"
|
|
2870
|
+
* ],
|
|
2871
|
+
* "boost_param": "high",
|
|
2872
|
+
* "filter_profanity": true,
|
|
2873
|
+
* "redact_pii": true,
|
|
2874
|
+
* "redact_pii_audio": true,
|
|
2875
|
+
* "redact_pii_audio_quality": "mp3",
|
|
2876
|
+
* "redact_pii_policies": [
|
|
2877
|
+
* "us_social_security_number",
|
|
2878
|
+
* "credit_card_number"
|
|
2879
|
+
* ],
|
|
2880
|
+
* "redact_pii_sub": "hash",
|
|
2881
|
+
* "speaker_labels": true,
|
|
2882
|
+
* "speakers_expected": 2,
|
|
2883
|
+
* "content_safety": true,
|
|
2884
|
+
* "iab_categories": true,
|
|
2885
|
+
* "language_detection": false,
|
|
2886
|
+
* "custom_spelling": [],
|
|
2887
|
+
* "disfluencies": false,
|
|
2888
|
+
* "sentiment_analysis": true,
|
|
2889
|
+
* "auto_chapters": true,
|
|
2890
|
+
* "entity_detection": true,
|
|
2891
|
+
* "speech_threshold": 0.5,
|
|
2892
|
+
* "summarization": true,
|
|
2893
|
+
* "summary_model": "informative",
|
|
2894
|
+
* "summary_type": "bullets",
|
|
2895
|
+
* "custom_topics": true,
|
|
2896
|
+
* "topics": []
|
|
2897
|
+
* }
|
|
2898
|
+
* ```
|
|
2809
2899
|
*/
|
|
2810
|
-
export type TranscriptParams =
|
|
2900
|
+
export type TranscriptParams = {
|
|
2811
2901
|
/**
|
|
2812
2902
|
* The URL of the audio or video file to transcribe.
|
|
2813
2903
|
*/
|
|
2814
2904
|
audio_url: string;
|
|
2815
|
-
};
|
|
2905
|
+
} & TranscriptOptionalParams;
|
|
2816
2906
|
|
|
2817
2907
|
/**
|
|
2818
2908
|
* The notification when the transcript status is completed or error.
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
PartialTranscript,
|
|
5
5
|
RealtimeTranscript,
|
|
6
6
|
RealtimeTranscriptType,
|
|
7
|
+
SessionInformation,
|
|
7
8
|
} from "../asyncapi.generated";
|
|
8
9
|
|
|
9
10
|
type CreateRealtimeTranscriberParams = {
|
|
@@ -27,6 +28,18 @@ type CreateRealtimeTranscriberParams = {
|
|
|
27
28
|
* The duration of the end utterance silence threshold in milliseconds
|
|
28
29
|
*/
|
|
29
30
|
endUtteranceSilenceThreshold?: number;
|
|
31
|
+
/**
|
|
32
|
+
* Disable partial transcripts.
|
|
33
|
+
* Set to `true` to not receive partial transcripts. Defaults to `false`.
|
|
34
|
+
* @defaultValue false
|
|
35
|
+
*/
|
|
36
|
+
disablePartialTranscripts?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Enable extra session information.
|
|
39
|
+
* Set to `true` to receive the `session_information` message before the session ends. Defaults to `false`.
|
|
40
|
+
* @defaultValue false
|
|
41
|
+
*/
|
|
42
|
+
enableExtraSessionInformation?: boolean;
|
|
30
43
|
} & (
|
|
31
44
|
| {
|
|
32
45
|
/**
|
|
@@ -69,6 +82,18 @@ type RealtimeTranscriberParams = {
|
|
|
69
82
|
* The duration of the end utterance silence threshold in milliseconds
|
|
70
83
|
*/
|
|
71
84
|
endUtteranceSilenceThreshold?: number;
|
|
85
|
+
/**
|
|
86
|
+
* Disable partial transcripts.
|
|
87
|
+
* Set to `true` to not receive partial transcripts. Defaults to `false`.
|
|
88
|
+
* @defaultValue false
|
|
89
|
+
*/
|
|
90
|
+
disablePartialTranscripts?: boolean;
|
|
91
|
+
/**
|
|
92
|
+
* Enable extra session information.
|
|
93
|
+
* Set to `true` to receive the `session_information` message before the session ends. Defaults to `false`.
|
|
94
|
+
* @defaultValue false
|
|
95
|
+
*/
|
|
96
|
+
enableExtraSessionInformation?: boolean;
|
|
72
97
|
} & (
|
|
73
98
|
| {
|
|
74
99
|
/**
|
|
@@ -96,6 +121,7 @@ type RealtimeEvents =
|
|
|
96
121
|
| "transcript"
|
|
97
122
|
| "transcript.partial"
|
|
98
123
|
| "transcript.final"
|
|
124
|
+
| "session_information"
|
|
99
125
|
| "error";
|
|
100
126
|
|
|
101
127
|
type SessionBeginsEventData = {
|
|
@@ -109,6 +135,7 @@ type RealtimeListeners = {
|
|
|
109
135
|
transcript?: (transcript: RealtimeTranscript) => void;
|
|
110
136
|
"transcript.partial"?: (transcript: PartialTranscript) => void;
|
|
111
137
|
"transcript.final"?: (transcript: FinalTranscript) => void;
|
|
138
|
+
session_information?: (info: SessionInformation) => void;
|
|
112
139
|
error?: (error: Error) => void;
|
|
113
140
|
};
|
|
114
141
|
|