assemblyai 3.0.1 → 3.1.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.
@@ -5,7 +5,7 @@ type Without<T, U> = {
5
5
  type XOR<T, U> = T | U extends object ? (Without<T, U> & U) | (Without<U, T> & T) : T | U;
6
6
  type OneOf<T extends any[]> = T extends [infer Only] ? Only : T extends [infer A, infer B, ...infer Rest] ? OneOf<[XOR<A, B>, ...Rest]> : never;
7
7
  /**
8
- * @description Will be either success, or unavailable in the rare case that the model failed.
8
+ * @description Either success, or unavailable in the rare case that the model failed
9
9
  * @enum {string}
10
10
  */
11
11
  export type AudioIntelligenceModelStatus = "success" | "unavailable";
@@ -23,13 +23,13 @@ export type AutoHighlightResult = {
23
23
  timestamps: Timestamp[];
24
24
  };
25
25
  /**
26
- * @description An array of results for the Key Phrases model, if it was enabled during the transcription request.
26
+ * @description An array of results for the Key Phrases model, if it is enabled.
27
27
  * See [Key phrases](https://www.assemblyai.com/docs/Models/key_phrases) for more information.
28
28
  */
29
29
  export type AutoHighlightsResult = {
30
30
  /** @description A temporally-sequential array of Key Phrases */
31
31
  results: AutoHighlightResult[];
32
- } | null;
32
+ };
33
33
  /** @description Chapter of the audio file */
34
34
  export type Chapter = {
35
35
  /** @description The starting time, in milliseconds, for the chapter */
@@ -58,7 +58,7 @@ export type ContentSafetyLabel = {
58
58
  severity: number;
59
59
  };
60
60
  export type ContentSafetyLabelResult = {
61
- /** @description An array of objects, one per sensitive topic that was detected in the section */
61
+ /** @description An array of safety labels, one per sensitive topic that was detected in the section */
62
62
  labels: ContentSafetyLabel[];
63
63
  /** @description The sentence index at which the section ends */
64
64
  sentences_idx_end: number;
@@ -69,50 +69,54 @@ export type ContentSafetyLabelResult = {
69
69
  /** @description Timestamp information for the section */
70
70
  timestamp: Timestamp;
71
71
  };
72
+ /**
73
+ * @description An array of results for the Content Moderation model, if it is enabled.
74
+ * See [Content moderation](https://www.assemblyai.com/docs/Models/content_moderation) for more information.
75
+ */
72
76
  export type ContentSafetyLabelsResult = {
73
77
  results: ContentSafetyLabelResult[];
74
78
  /** @description A summary of the Content Moderation severity results for the entire audio file */
75
79
  severity_score_summary: {
76
80
  [key: string]: SeverityScoreSummary;
77
81
  };
78
- /** @description Will be either success, or unavailable in the rare case that the Content Moderation model failed. */
82
+ /** @description The status of the Content Moderation model. Either success, or unavailable in the rare case that the model failed. */
79
83
  status: AudioIntelligenceModelStatus;
80
84
  /** @description A summary of the Content Moderation confidence results for the entire audio file */
81
85
  summary: {
82
86
  [key: string]: number;
83
87
  };
84
- } | null;
88
+ };
85
89
  export type CreateRealtimeTemporaryTokenParameters = {
86
- /** @description The amount of time until the token expires in seconds. */
90
+ /** @description The amount of time until the token expires in seconds */
87
91
  expires_in: number;
88
92
  };
89
93
  /** @description The parameters for creating a transcript */
90
94
  export type CreateTranscriptOptionalParameters = {
91
95
  /** @description The point in time, in milliseconds, to stop transcribing in your media file */
92
96
  audio_end_at?: number;
93
- /** @description The point in time, in milliseconds, to begin transcription from in your media file */
97
+ /** @description The point in time, in milliseconds, to begin transcribing in your media file */
94
98
  audio_start_from?: number;
95
99
  /** @description Enable [Auto Chapters](https://www.assemblyai.com/docs/Models/auto_chapters), can be true or false */
96
100
  auto_chapters?: boolean;
97
- /** @description Whether Key Phrases was enabled in the transcription request, either true or false */
101
+ /** @description Whether Key Phrases is enabled, either true or false */
98
102
  auto_highlights?: boolean;
99
- /** @description The word boost parameter value, if provided in the transcription request. */
103
+ /** @description The word boost parameter value */
100
104
  boost_param?: TranscriptBoostParam;
101
105
  /** @description Enable [Content Moderation](https://www.assemblyai.com/docs/Models/content_moderation), can be true or false */
102
106
  content_safety?: boolean;
103
107
  /** @description Customize how words are spelled and formatted using to and from values */
104
108
  custom_spelling?: TranscriptCustomSpelling[];
105
- /** @description Whether custom topics was enabled in the transcription request, either true or false */
109
+ /** @description Whether custom topics is enabled, either true or false */
106
110
  custom_topics?: boolean;
107
- /** @description Transcribe Filler Words, like "umm", in your media file; can be true or false. */
111
+ /** @description Transcribe Filler Words, like "umm", in your media file; can be true or false */
108
112
  disfluencies?: boolean;
109
- /** @description Enable [Dual Channel](https://assemblyai.com/docs/Models/speech_recognition#dual-channel-transcription) transcription, can be true or false. */
113
+ /** @description Enable [Dual Channel](https://assemblyai.com/docs/Models/speech_recognition#dual-channel-transcription) transcription, can be true or false */
110
114
  dual_channel?: boolean;
111
115
  /** @description Enable [Entity Detection](https://www.assemblyai.com/docs/Models/entity_detection), can be true or false */
112
116
  entity_detection?: boolean;
113
- /** @description Filter profanity from the transcribed text, can be true or false. */
117
+ /** @description Filter profanity from the transcribed text, can be true or false */
114
118
  filter_profanity?: boolean;
115
- /** @description Enable Text Formatting, can be true or false. */
119
+ /** @description Enable Text Formatting, can be true or false */
116
120
  format_text?: boolean;
117
121
  /** @description Enable [Topic Detection](https://www.assemblyai.com/docs/Models/iab_classification), can be true or false */
118
122
  iab_categories?: boolean;
@@ -120,10 +124,10 @@ export type CreateTranscriptOptionalParameters = {
120
124
  * @description The language of your audio file. Possible values are found in [Supported Languages](https://www.assemblyai.com/docs/Concepts/supported_languages).
121
125
  * The default value is 'en_us'.
122
126
  */
123
- language_code?: TranscriptLanguageCode;
124
- /** @description Whether [Automatic language detection](https://www.assemblyai.com/docs/Models/speech_recognition#automatic-language-detection) was enabled in the transcription request, either true or false. */
127
+ language_code?: TranscriptLanguageCode | null;
128
+ /** @description Whether [Automatic language detection](https://www.assemblyai.com/docs/Models/speech_recognition#automatic-language-detection) is enabled, either true or false */
125
129
  language_detection?: boolean;
126
- /** @description Enable Automatic Punctuation, can be true or false. */
130
+ /** @description Enable Automatic Punctuation, can be true or false */
127
131
  punctuate?: boolean;
128
132
  /** @description Redact PII from the transcribed text using the Redact PII model, can be true or false */
129
133
  redact_pii?: boolean;
@@ -137,13 +141,13 @@ export type CreateTranscriptOptionalParameters = {
137
141
  /** @description The list of PII Redaction policies to enable. See [PII redaction](https://www.assemblyai.com/docs/Models/pii_redaction) for more details. */
138
142
  redact_pii_policies?: PiiPolicy[];
139
143
  /** @description The replacement logic for detected PII, can be "entity_type" or "hash". See [PII redaction](https://www.assemblyai.com/docs/Models/pii_redaction) for more details. */
140
- redact_pii_sub?: SubstitutionPolicy;
144
+ redact_pii_sub?: SubstitutionPolicy | null;
141
145
  /** @description Enable [Sentiment Analysis](https://www.assemblyai.com/docs/Models/sentiment_analysis), can be true or false */
142
146
  sentiment_analysis?: boolean;
143
147
  /** @description Enable [Speaker diarization](https://www.assemblyai.com/docs/Models/speaker_diarization), can be true or false */
144
148
  speaker_labels?: boolean;
145
149
  /**
146
- * @description Tells the speaker label model how many speakers it should attempt to identify, up to 10. See [Speaker diarization](https://www.assemblyai.com/docs/Models/speaker_diarization) for more details.
150
+ * @description Tell the speaker label model how many speakers it should attempt to identify, up to 10. See [Speaker diarization](https://www.assemblyai.com/docs/Models/speaker_diarization) for more details.
147
151
  * @default null
148
152
  */
149
153
  speakers_expected?: number | null;
@@ -167,21 +171,21 @@ export type CreateTranscriptOptionalParameters = {
167
171
  * @default bullets
168
172
  */
169
173
  summary_type?: SummaryType;
170
- /** @description The list of custom topics provided if custom topics was enabled in the transcription request */
174
+ /** @description The list of custom topics provided, if custom topics is enabled */
171
175
  topics?: string[];
172
176
  /**
173
- * @description The header name which should be sent back with webhook calls, if provided in the transcription request.
177
+ * @description The header name which should be sent back with webhook calls
174
178
  * @default null
175
179
  */
176
180
  webhook_auth_header_name?: string | null;
177
181
  /**
178
- * @description Defaults to null. Optionally allows a user to specify a header name and value to send back with a webhook call for added security.
182
+ * @description Specify a header name and value to send back with a webhook call for added security
179
183
  * @default null
180
184
  */
181
185
  webhook_auth_header_value?: string | null;
182
- /** @description The URL to which we send webhooks upon trancription completion, if provided in the transcription request. */
186
+ /** @description The URL to which AssemblyAI send webhooks upon trancription completion */
183
187
  webhook_url?: string;
184
- /** @description The list of custom vocabulary to boost transcription probability for, if provided in the transcription request. */
188
+ /** @description The list of custom vocabulary to boost transcription probability for */
185
189
  word_boost?: string[];
186
190
  };
187
191
  /** @description The parameters for creating a transcript */
@@ -213,7 +217,7 @@ export type Error = {
213
217
  };
214
218
  export type LemurActionItemsParameters = LemurBaseParameters;
215
219
  export type LemurActionItemsResponse = LemurBaseResponse & {
216
- /** @description The response generated by LeMUR. */
220
+ /** @description The response generated by LeMUR */
217
221
  response: string;
218
222
  };
219
223
  export type LemurBaseParameters = {
@@ -225,7 +229,12 @@ export type LemurBaseParameters = {
225
229
  }
226
230
  ]>;
227
231
  final_model?: LemurModel;
228
- /** @description Max output size in tokens. Up to 4000 allowed. */
232
+ /**
233
+ * @description Custom formatted transcript data. Maximum size is the context limit of the selected model, which defaults to 100000.
234
+ * Use either transcript_ids or input_text as input into LeMUR.
235
+ */
236
+ input_text?: string;
237
+ /** @description Max output size in tokens, up to 4000 */
229
238
  max_output_size?: number;
230
239
  /**
231
240
  * Format: float
@@ -234,8 +243,11 @@ export type LemurBaseParameters = {
234
243
  * Can be any value between 0.0 and 1.0 inclusive.
235
244
  */
236
245
  temperature?: number;
237
- /** @description A list of completed transcripts with text. Up to 100 files max, or 100 hours max. Whichever is lower. */
238
- transcript_ids: string[];
246
+ /**
247
+ * @description A list of completed transcripts with text. Up to a maximum of 100 files or 100 hours, whichever is lower.
248
+ * Use either transcript_ids or input_text as input into LeMUR.
249
+ */
250
+ transcript_ids?: string[];
239
251
  };
240
252
  export type LemurBaseResponse = {
241
253
  /** @description The ID of the LeMUR request */
@@ -252,7 +264,7 @@ export type LemurQuestion = {
252
264
  answer_format?: string;
253
265
  /** @description What discrete options to return. Useful for precise responses. Can't be used with answer_format. Example: ["Yes", "No"] */
254
266
  answer_options?: string[];
255
- /** @description Any context about the transcripts you wish to provide. This can be a string, or free-form JSON. */
267
+ /** @description Any context about the transcripts you wish to provide. This can be a string or any object. */
256
268
  context?: OneOf<[
257
269
  string,
258
270
  {
@@ -262,19 +274,19 @@ export type LemurQuestion = {
262
274
  /** @description The question you wish to ask. For more complex questions use default model. */
263
275
  question: string;
264
276
  };
265
- /** @description An answer generated by LeMUR and its question. */
277
+ /** @description An answer generated by LeMUR and its question */
266
278
  export type LemurQuestionAnswer = {
267
- /** @description The answer generated by LeMUR. */
279
+ /** @description The answer generated by LeMUR */
268
280
  answer: string;
269
- /** @description The question for LeMUR to answer. */
281
+ /** @description The question for LeMUR to answer */
270
282
  question: string;
271
283
  };
272
284
  export type LemurQuestionAnswerParameters = LemurBaseParameters & {
273
- /** @description A list of questions to ask. */
285
+ /** @description A list of questions to ask */
274
286
  questions: LemurQuestion[];
275
287
  };
276
288
  export type LemurQuestionAnswerResponse = LemurBaseResponse & {
277
- /** @description The answers generated by LeMUR and their questions. */
289
+ /** @description The answers generated by LeMUR and their questions */
278
290
  response: LemurQuestionAnswer[];
279
291
  };
280
292
  export type LemurSummaryParameters = LemurBaseParameters & {
@@ -282,7 +294,7 @@ export type LemurSummaryParameters = LemurBaseParameters & {
282
294
  answer_format?: string;
283
295
  };
284
296
  export type LemurSummaryResponse = LemurBaseResponse & {
285
- /** @description The response generated by LeMUR. */
297
+ /** @description The response generated by LeMUR */
286
298
  response: string;
287
299
  };
288
300
  export type LemurTaskParameters = LemurBaseParameters & {
@@ -290,7 +302,7 @@ export type LemurTaskParameters = LemurBaseParameters & {
290
302
  prompt: string;
291
303
  };
292
304
  export type LemurTaskResponse = LemurBaseResponse & {
293
- /** @description The response generated by LeMUR. */
305
+ /** @description The response generated by LeMUR */
294
306
  response: string;
295
307
  };
296
308
  export type PageDetails = {
@@ -310,11 +322,11 @@ export type ParagraphsResponse = {
310
322
  /** @enum {string} */
311
323
  export type PiiPolicy = "medical_process" | "medical_condition" | "blood_type" | "drug" | "injury" | "number_sequence" | "email_address" | "date_of_birth" | "phone_number" | "us_social_security_number" | "credit_card_number" | "credit_card_expiration" | "credit_card_cvv" | "date" | "nationality" | "event" | "language" | "location" | "money_amount" | "person_name" | "person_age" | "organization" | "political_affiliation" | "occupation" | "religion" | "drivers_license" | "banking_information";
312
324
  export type PurgeLemurRequestDataResponse = {
313
- /** @description Whether the request data was deleted. */
325
+ /** @description Whether the request data was deleted */
314
326
  deleted: boolean;
315
- /** @description The ID of the LeMUR request */
316
- request_id: string;
317
327
  /** @description The ID of the deletion request of the LeMUR request */
328
+ request_id: string;
329
+ /** @description The ID of the LeMUR request to purge the data for */
318
330
  request_id_to_purge: string;
319
331
  };
320
332
  export type RealtimeTemporaryTokenResponse = {
@@ -341,7 +353,7 @@ export type SentencesResponse = {
341
353
  };
342
354
  /** @enum {unknown} */
343
355
  export type Sentiment = "POSITIVE" | "NEUTRAL" | "NEGATIVE";
344
- /** @description The result of the sentiment analysis model. */
356
+ /** @description The result of the sentiment analysis model */
345
357
  export type SentimentAnalysisResult = {
346
358
  /**
347
359
  * Format: double
@@ -369,7 +381,7 @@ export type SeverityScoreSummary = {
369
381
  };
370
382
  /**
371
383
  * @description The replacement logic for detected PII, can be "entity_type" or "hash". See [PII redaction](https://www.assemblyai.com/docs/Models/pii_redaction) for more details.
372
- * @enum {string|null}
384
+ * @enum {string}
373
385
  */
374
386
  export type SubstitutionPolicy = "entity_type" | "hash";
375
387
  /**
@@ -389,14 +401,28 @@ export type SummaryModel = "informative" | "conversational" | "catchy";
389
401
  * @enum {string}
390
402
  */
391
403
  export type SummaryType = "bullets" | "bullets_verbose" | "gist" | "headline" | "paragraph";
392
- /** @description Timestamp containing a start and end property in milliseconds. */
404
+ /** @description Timestamp containing a start and end property in milliseconds */
393
405
  export type Timestamp = {
394
406
  /** @description The end time in milliseconds */
395
407
  end: number;
396
408
  /** @description The start time in milliseconds */
397
409
  start: number;
398
410
  };
399
- /** @description The result of the topic detection model. */
411
+ /**
412
+ * @description The result of the Topic Detection model, if it is enabled.
413
+ * See [Topic Detection](https://www.assemblyai.com/docs/Models/iab_classification) for more information.
414
+ */
415
+ export type TopicDetectionModelResult = {
416
+ /** @description An array of results for the Topic Detection model */
417
+ results: TopicDetectionResult[];
418
+ /** @description The status of the Topic Detection model. Either success, or unavailable in the rare case that the model failed. */
419
+ status: AudioIntelligenceModelStatus;
420
+ /** @description The overall relevance of topic to the entire audio file */
421
+ summary: {
422
+ [key: string]: number;
423
+ };
424
+ };
425
+ /** @description The result of the topic detection model */
400
426
  export type TopicDetectionResult = {
401
427
  labels?: {
402
428
  /** @description The IAB taxonomical label for the label of the detected topic, where > denotes supertopic/subtopic relationship */
@@ -415,7 +441,7 @@ export type TopicDetectionResult = {
415
441
  export type Transcript = {
416
442
  /**
417
443
  * @deprecated
418
- * @description The acoustic model that was used for the transcription
444
+ * @description The acoustic model that was used for the transcript
419
445
  */
420
446
  acoustic_model: string;
421
447
  /**
@@ -423,22 +449,22 @@ export type Transcript = {
423
449
  * @description The duration of this transcript object's media file, in seconds
424
450
  */
425
451
  audio_duration?: number | null;
426
- /** @description The point in time, in milliseconds, in the file at which the transcription was terminated, if provided in the transcription request */
452
+ /** @description The point in time, in milliseconds, in the file at which the transcription was terminated */
427
453
  audio_end_at?: number | null;
428
- /** @description The point in time, in milliseconds, in the file at which the transcription was started, if provided in the transcription request */
454
+ /** @description The point in time, in milliseconds, in the file at which the transcription was started */
429
455
  audio_start_from?: number | null;
430
456
  /** @description The URL of the media that was transcribed */
431
457
  audio_url: string;
432
- /** @description Enable [Auto Chapters](https://www.assemblyai.com/docs/Models/auto_chapters), can be true or false */
458
+ /** @description Whether [Auto Chapters](https://www.assemblyai.com/docs/Models/auto_chapters) is enabled, can be true or false */
433
459
  auto_chapters?: boolean | null;
434
- /** @description Whether Key Phrases was enabled in the transcription request, either true or false */
460
+ /** @description Whether Key Phrases is enabled, either true or false */
435
461
  auto_highlights: boolean;
436
462
  /**
437
- * @description An array of results for the Key Phrases model, if it was enabled during the transcription request.
463
+ * @description An array of results for the Key Phrases model, if it is enabled.
438
464
  * See [Key phrases](https://www.assemblyai.com/docs/Models/key_phrases) for more information.
439
465
  */
440
- auto_highlights_result?: AutoHighlightsResult;
441
- /** @description The word boost parameter value, if provided in the transcription request */
466
+ auto_highlights_result?: AutoHighlightsResult | null;
467
+ /** @description The word boost parameter value */
442
468
  boost_param?: string | null;
443
469
  /** @description An array of temporally sequential chapters for the audio file */
444
470
  chapters?: Chapter[] | null;
@@ -447,51 +473,42 @@ export type Transcript = {
447
473
  * @description The confidence score for the transcript, between 0.0 (low confidence) and 1.0 (high confidence)
448
474
  */
449
475
  confidence?: number | null;
450
- /** @description Enable [Content Moderation](https://www.assemblyai.com/docs/Models/content_moderation), can be true or false */
476
+ /** @description Whether [Content Moderation](https://www.assemblyai.com/docs/Models/content_moderation) is enabled, can be true or false */
451
477
  content_safety?: boolean | null;
452
478
  /**
453
- * @description An array of results for the Content Moderation model, if it was enabled during the transcription request.
479
+ * @description An array of results for the Content Moderation model, if it is enabled.
454
480
  * See [Content moderation](https://www.assemblyai.com/docs/Models/content_moderation) for more information.
455
481
  */
456
- content_safety_labels?: ContentSafetyLabelsResult;
482
+ content_safety_labels?: ContentSafetyLabelsResult | null;
457
483
  /** @description Customize how words are spelled and formatted using to and from values */
458
484
  custom_spelling?: TranscriptCustomSpelling[] | null;
459
- /** @description Whether custom topics was enabled in the transcription request, either true or false */
485
+ /** @description Whether custom topics is enabled, either true or false */
460
486
  custom_topics?: boolean | null;
461
487
  /** @description Transcribe Filler Words, like "umm", in your media file; can be true or false */
462
488
  disfluencies?: boolean | null;
463
- /** @description Whether [Dual channel transcription](https://www.assemblyai.com/docs/Models/speech_recognition#dual-channel-transcription) was enabled in the transcription request, either true or false */
489
+ /** @description Whether [Dual channel transcription](https://www.assemblyai.com/docs/Models/speech_recognition#dual-channel-transcription) is enabled, either true or false */
464
490
  dual_channel?: boolean | null;
465
491
  /**
466
- * @description An array of results for the Entity Detection model, if it was enabled during the transcription request.
492
+ * @description An array of results for the Entity Detection model, if it is enabled.
467
493
  * See [Entity detection](https://www.assemblyai.com/docs/Models/entity_detection) for more information.
468
494
  */
469
495
  entities?: Entity[] | null;
470
- /** @description Enable [Entity Detection](https://www.assemblyai.com/docs/Models/entity_detection), can be true or false */
496
+ /** @description Whether [Entity Detection](https://www.assemblyai.com/docs/Models/entity_detection) is enabled, can be true or false */
471
497
  entity_detection?: boolean | null;
472
498
  /** @description Error message of why the transcript failed */
473
499
  error?: string;
474
- /** @description Whether [Profanity Filtering](https://www.assemblyai.com/docs/Models/speech_recognition#profanity-filtering) was enabled in the transcription request, either true or false */
500
+ /** @description Whether [Profanity Filtering](https://www.assemblyai.com/docs/Models/speech_recognition#profanity-filtering) is enabled, either true or false */
475
501
  filter_profanity?: boolean | null;
476
- /** @description Whether Text Formatting was enabled in the transcription request, either true or false */
502
+ /** @description Whether Text Formatting is enabled, either true or false */
477
503
  format_text?: boolean | null;
478
- /** @description Enable [Topic Detection](https://www.assemblyai.com/docs/Models/iab_classification), can be true or false */
504
+ /** @description Whether [Topic Detection](https://www.assemblyai.com/docs/Models/iab_classification) is enabled, can be true or false */
479
505
  iab_categories?: boolean | null;
480
506
  /**
481
- * @description The result of the Topic Detection model, if it was enabled during the transcription request.
507
+ * @description The result of the Topic Detection model, if it is enabled.
482
508
  * See [Topic Detection](https://www.assemblyai.com/docs/Models/iab_classification) for more information.
483
509
  */
484
- iab_categories_result?: {
485
- /** @description An array of results for the Topic Detection model. */
486
- results: TopicDetectionResult[];
487
- /** @description Will be either success, or unavailable in the rare case that the Content Moderation model failed. */
488
- status: AudioIntelligenceModelStatus;
489
- /** @description The overall relevance of topic to the entire audio file */
490
- summary: {
491
- [key: string]: number;
492
- };
493
- } | null;
494
- /** @description The unique identifier of your transcription */
510
+ iab_categories_result?: TopicDetectionModelResult | null;
511
+ /** @description The unique identifier of your transcript */
495
512
  id: string;
496
513
  /**
497
514
  * @description The language of your audio file.
@@ -499,24 +516,24 @@ export type Transcript = {
499
516
  * The default value is 'en_us'.
500
517
  */
501
518
  language_code?: TranscriptLanguageCode;
502
- /** @description Whether [Automatic language detection](https://www.assemblyai.com/docs/Models/speech_recognition#automatic-language-detection) was enabled in the transcription request, either true or false */
519
+ /** @description Whether [Automatic language detection](https://www.assemblyai.com/docs/Models/speech_recognition#automatic-language-detection) is enabled, either true or false */
503
520
  language_detection?: boolean | null;
504
521
  /**
505
522
  * @deprecated
506
- * @description The language model that was used for the transcription
523
+ * @description The language model that was used for the transcript
507
524
  */
508
525
  language_model: string;
509
- /** @description Whether Automatic Punctuation was enabled in the transcription request, either true or false. */
526
+ /** @description Whether Automatic Punctuation is enabled, either true or false */
510
527
  punctuate?: boolean | null;
511
- /** @description Whether [PII Redaction](https://www.assemblyai.com/docs/Models/pii_redaction) was enabled in the transcription request, either true or false */
528
+ /** @description Whether [PII Redaction](https://www.assemblyai.com/docs/Models/pii_redaction) is enabled, either true or false */
512
529
  redact_pii: boolean;
513
530
  /**
514
- * @description Whether a redacted version of the audio file was generated (enabled or disabled in the transcription request),
531
+ * @description Whether a redacted version of the audio file was generated,
515
532
  * either true or false. See [PII redaction](https://www.assemblyai.com/docs/Models/pii_redaction) for more information.
516
533
  */
517
534
  redact_pii_audio?: boolean | null;
518
535
  /**
519
- * @description The audio quality of the PII-redacted audio file, if enabled in the transcription request.
536
+ * @description The audio quality of the PII-redacted audio file, if redact_pii_audio is enabled.
520
537
  * See [PII redaction](https://www.assemblyai.com/docs/Models/pii_redaction) for more information.
521
538
  */
522
539
  redact_pii_audio_quality?: string | null;
@@ -527,16 +544,16 @@ export type Transcript = {
527
544
  redact_pii_policies?: PiiPolicy[] | null;
528
545
  /** @description The replacement logic for detected PII, can be "entity_type" or "hash". See [PII redaction](https://www.assemblyai.com/docs/Models/pii_redaction) for more details. */
529
546
  redact_pii_sub?: SubstitutionPolicy;
530
- /** @description Enable [Sentiment Analysis](https://www.assemblyai.com/docs/Models/sentiment_analysis), can be true or false */
547
+ /** @description Whether [Sentiment Analysis](https://www.assemblyai.com/docs/Models/sentiment_analysis) is enabled, can be true or false */
531
548
  sentiment_analysis?: boolean | null;
532
549
  /**
533
- * @description An array of results for the Sentiment Analysis model, if it was enabled during the transcription request.
550
+ * @description An array of results for the Sentiment Analysis model, if it is enabled.
534
551
  * See [Sentiment analysis](https://www.assemblyai.com/docs/Models/sentiment_analysis) for more information.
535
552
  */
536
553
  sentiment_analysis_results?: SentimentAnalysisResult[] | null;
537
- /** @description Enable [Speaker diarization](https://www.assemblyai.com/docs/Models/speaker_diarization), can be true or false */
554
+ /** @description Whether [Speaker diarization](https://www.assemblyai.com/docs/Models/speaker_diarization) is enabled, can be true or false */
538
555
  speaker_labels?: boolean | null;
539
- /** @description Defaults to null. Tells the speaker label model how many speakers it should attempt to identify, up to 10. See [Speaker diarization](https://www.assemblyai.com/docs/Models/speaker_diarization) for more details. */
556
+ /** @description Tell the speaker label model how many speakers it should attempt to identify, up to 10. See [Speaker diarization](https://www.assemblyai.com/docs/Models/speaker_diarization) for more details. */
540
557
  speakers_expected?: number | null;
541
558
  /**
542
559
  * Format: float
@@ -546,42 +563,42 @@ export type Transcript = {
546
563
  speech_threshold?: number | null;
547
564
  /**
548
565
  * @deprecated
549
- * @description Whether speed boost was enabled in the transcription request
566
+ * @description Whether speed boost is enabled
550
567
  */
551
568
  speed_boost?: boolean | null;
552
- /** @description The status of your transcription. Possible values are queued, processing, completed, or error. */
569
+ /** @description The status of your transcript. Possible values are queued, processing, completed, or error. */
553
570
  status: TranscriptStatus;
554
- /** @description Whether [Summarization](https://www.assemblyai.com/docs/Models/summarization) was enabled in the transcription request, either true or false */
571
+ /** @description Whether [Summarization](https://www.assemblyai.com/docs/Models/summarization) is enabled, either true or false */
555
572
  summarization: boolean;
556
- /** @description The generated summary of the media file, if [Summarization](https://www.assemblyai.com/docs/Models/summarization) was enabled in the transcription request */
573
+ /** @description The generated summary of the media file, if [Summarization](https://www.assemblyai.com/docs/Models/summarization) is enabled */
557
574
  summary?: string | null;
558
575
  /**
559
576
  * @description The Summarization model used to generate the summary,
560
- * if [Summarization](https://www.assemblyai.com/docs/Models/summarization) was enabled in the transcription request
577
+ * if [Summarization](https://www.assemblyai.com/docs/Models/summarization) is enabled
561
578
  */
562
579
  summary_model?: string | null;
563
- /** @description The type of summary generated, if [Summarization](https://www.assemblyai.com/docs/Models/summarization) was enabled in the transcription request */
580
+ /** @description The type of summary generated, if [Summarization](https://www.assemblyai.com/docs/Models/summarization) is enabled */
564
581
  summary_type?: string | null;
565
582
  /** @description The textual transcript of your media file */
566
583
  text?: string | null;
567
584
  /** @description True while a request is throttled and false when a request is no longer throttled */
568
585
  throttled?: boolean | null;
569
- /** @description The list of custom topics provided if custom topics was enabled in the transcription request */
586
+ /** @description The list of custom topics provided if custom topics is enabled */
570
587
  topics?: string[];
571
588
  /**
572
589
  * @description When dual_channel or speaker_labels is enabled, a list of turn-by-turn utterance objects.
573
590
  * See [Speaker diarization](https://www.assemblyai.com/docs/Models/speaker_diarization) for more information.
574
591
  */
575
592
  utterances?: TranscriptUtterance[] | null;
576
- /** @description Whether webhook authentication details were provided in the transcription request */
593
+ /** @description Whether webhook authentication details were provided */
577
594
  webhook_auth: boolean;
578
- /** @description The header name which should be sent back with webhook calls, if provided in the transcription request */
595
+ /** @description The header name which should be sent back with webhook calls */
579
596
  webhook_auth_header_name?: string | null;
580
- /** @description The status code we received from your server when delivering your webhook, if a webhook URL was provided in the transcription request */
597
+ /** @description The status code we received from your server when delivering your webhook, if a webhook URL was provided */
581
598
  webhook_status_code?: number | null;
582
- /** @description The URL to which we send webhooks upon trancription completion, if provided in the transcription request */
599
+ /** @description The URL to which we send webhooks upon trancription completion */
583
600
  webhook_url?: string | null;
584
- /** @description The list of custom vocabulary to boost transcription probability for, if provided in the transcription request */
601
+ /** @description The list of custom vocabulary to boost transcription probability for */
585
602
  word_boost?: string[];
586
603
  /**
587
604
  * @description An array of temporally-sequential word objects, one for each word in the transcript.
@@ -590,7 +607,7 @@ export type Transcript = {
590
607
  words?: TranscriptWord[] | null;
591
608
  };
592
609
  /**
593
- * @description The word boost parameter value, if provided in the transcription request.
610
+ * @description The word boost parameter value
594
611
  * @enum {string}
595
612
  */
596
613
  export type TranscriptBoostParam = "low" | "default" | "high";
@@ -606,7 +623,7 @@ export type TranscriptCustomSpelling = {
606
623
  * The default value is 'en_us'.
607
624
  *
608
625
  * @default en_us
609
- * @enum {string|null}
626
+ * @enum {string}
610
627
  */
611
628
  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";
612
629
  export type TranscriptList = {
@@ -659,7 +676,7 @@ export type TranscriptSentence = {
659
676
  words: TranscriptWord[];
660
677
  };
661
678
  /**
662
- * @description The status of your transcription. Possible values are queued, processing, completed, or error.
679
+ * @description The status of your transcript. Possible values are queued, processing, completed, or error.
663
680
  * @enum {string}
664
681
  */
665
682
  export type TranscriptStatus = "queued" | "processing" | "completed" | "error";
@@ -2,5 +2,5 @@ type BaseServiceParams = {
2
2
  apiKey: string;
3
3
  baseUrl?: string;
4
4
  };
5
- export type * from "./abstractions";
5
+ export * from "./abstractions";
6
6
  export type { BaseServiceParams };
@@ -1,5 +1,19 @@
1
- export type CreateTranscriptOptions = {
2
- poll?: boolean;
1
+ export type PollingOptions = {
2
+ /**
3
+ * The amount of time to wait between polling requests.
4
+ * @default 3000 or every 3 seconds
5
+ */
3
6
  pollingInterval?: number;
7
+ /**
8
+ * The maximum amount of time to wait for the transcript to be ready.
9
+ * @default -1 which means wait forever
10
+ */
4
11
  pollingTimeout?: number;
5
12
  };
13
+ export type CreateTranscriptOptions = {
14
+ /**
15
+ * Whether to poll the transcript until it is ready.
16
+ * @default true
17
+ */
18
+ poll?: boolean;
19
+ } & PollingOptions;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "assemblyai",
3
- "version": "3.0.1",
3
+ "version": "3.1.0",
4
4
  "description": "The AssemblyAI Node.js 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
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",
package/src/index.ts CHANGED
@@ -1,2 +1,2 @@
1
- export type * from "./types";
1
+ export * from "./types";
2
2
  export * from "./services";