assemblyai 4.3.0 → 4.3.2

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.
@@ -1,86 +1,86 @@
1
1
  import { BaseService } from "../base";
2
- import { ParagraphsResponse, SentencesResponse, Transcript, TranscriptList, TranscriptParams, CreateTranscriptOptions, Createable, Deletable, Listable, Retrieveable, SubtitleFormat, RedactedAudioResponse, ListTranscriptParams, WordSearchResponse, BaseServiceParams, PollingOptions, TranscribeParams, TranscribeOptions, SubmitParams } from "../..";
2
+ import { ParagraphsResponse, SentencesResponse, Transcript, TranscriptList, TranscriptParams, CreateTranscriptOptions, SubtitleFormat, RedactedAudioResponse, ListTranscriptParams, WordSearchResponse, BaseServiceParams, PollingOptions, TranscribeParams, TranscribeOptions, SubmitParams } from "../..";
3
3
  import { FileService } from "../files";
4
- export declare class TranscriptService extends BaseService implements Createable<Transcript, TranscriptParams, CreateTranscriptOptions>, Retrieveable<Transcript>, Deletable<Transcript>, Listable<TranscriptList> {
4
+ export declare class TranscriptService extends BaseService {
5
5
  private files;
6
6
  constructor(params: BaseServiceParams, files: FileService);
7
7
  /**
8
8
  * Transcribe an audio file. This will create a transcript and wait until the transcript status is "completed" or "error".
9
- * @param params The parameters to transcribe an audio file.
10
- * @param options The options to transcribe an audio file.
9
+ * @param params - The parameters to transcribe an audio file.
10
+ * @param options - The options to transcribe an audio file.
11
11
  * @returns A promise that resolves to the transcript. The transcript status is "completed" or "error".
12
12
  */
13
13
  transcribe(params: TranscribeParams, options?: TranscribeOptions): Promise<Transcript>;
14
14
  /**
15
15
  * Submits a transcription job for an audio file. This will not wait until the transcript status is "completed" or "error".
16
- * @param params The parameters to start the transcription of an audio file.
16
+ * @param params - The parameters to start the transcription of an audio file.
17
17
  * @returns A promise that resolves to the queued transcript.
18
18
  */
19
19
  submit(params: SubmitParams): Promise<Transcript>;
20
20
  /**
21
21
  * Create a transcript.
22
- * @param params The parameters to create a transcript.
23
- * @param options The options used for creating the new transcript.
22
+ * @param params - The parameters to create a transcript.
23
+ * @param options - The options used for creating the new transcript.
24
24
  * @returns A promise that resolves to the transcript.
25
25
  * @deprecated Use `transcribe` instead to transcribe a audio file that includes polling, or `submit` to transcribe a audio file without polling.
26
26
  */
27
27
  create(params: TranscriptParams, options?: CreateTranscriptOptions): Promise<Transcript>;
28
28
  /**
29
29
  * Wait until the transcript ready, either the status is "completed" or "error".
30
- * @param transcriptId The ID of the transcript.
31
- * @param options The options to wait until the transcript is ready.
30
+ * @param transcriptId - The ID of the transcript.
31
+ * @param options - The options to wait until the transcript is ready.
32
32
  * @returns A promise that resolves to the transcript. The transcript status is "completed" or "error".
33
33
  */
34
34
  waitUntilReady(transcriptId: string, options?: PollingOptions): Promise<Transcript>;
35
35
  /**
36
36
  * Retrieve a transcript.
37
- * @param id The identifier of the transcript.
37
+ * @param id - The identifier of the transcript.
38
38
  * @returns A promise that resolves to the transcript.
39
39
  */
40
40
  get(id: string): Promise<Transcript>;
41
41
  /**
42
42
  * Retrieves a page of transcript listings.
43
- * @param parameters The parameters to filter the transcript list by, or the URL to retrieve the transcript list from.
43
+ * @param params - The parameters to filter the transcript list by, or the URL to retrieve the transcript list from.
44
44
  */
45
- list(parameters?: ListTranscriptParams | string): Promise<TranscriptList>;
45
+ list(params?: ListTranscriptParams | string): Promise<TranscriptList>;
46
46
  /**
47
47
  * Delete a transcript
48
- * @param id The identifier of the transcript.
48
+ * @param id - The identifier of the transcript.
49
49
  * @returns A promise that resolves to the transcript.
50
50
  */
51
51
  delete(id: string): Promise<Transcript>;
52
52
  /**
53
53
  * Search through the transcript for a specific set of keywords.
54
54
  * You can search for individual words, numbers, or phrases containing up to five words or numbers.
55
- * @param id The identifier of the transcript.
56
- * @param words Keywords to search for.
57
- * @return A promise that resolves to the sentences.
55
+ * @param id - The identifier of the transcript.
56
+ * @param words - Keywords to search for.
57
+ * @returns A promise that resolves to the sentences.
58
58
  */
59
59
  wordSearch(id: string, words: string[]): Promise<WordSearchResponse>;
60
60
  /**
61
61
  * Retrieve all sentences of a transcript.
62
- * @param id The identifier of the transcript.
63
- * @return A promise that resolves to the sentences.
62
+ * @param id - The identifier of the transcript.
63
+ * @returns A promise that resolves to the sentences.
64
64
  */
65
65
  sentences(id: string): Promise<SentencesResponse>;
66
66
  /**
67
67
  * Retrieve all paragraphs of a transcript.
68
- * @param id The identifier of the transcript.
69
- * @return A promise that resolves to the paragraphs.
68
+ * @param id - The identifier of the transcript.
69
+ * @returns A promise that resolves to the paragraphs.
70
70
  */
71
71
  paragraphs(id: string): Promise<ParagraphsResponse>;
72
72
  /**
73
73
  * Retrieve subtitles of a transcript.
74
- * @param id The identifier of the transcript.
75
- * @param format The format of the subtitles.
76
- * @param chars_per_caption The maximum number of characters per caption.
77
- * @return A promise that resolves to the subtitles text.
74
+ * @param id - The identifier of the transcript.
75
+ * @param format - The format of the subtitles.
76
+ * @param chars_per_caption - The maximum number of characters per caption.
77
+ * @returns A promise that resolves to the subtitles text.
78
78
  */
79
79
  subtitles(id: string, format?: SubtitleFormat, chars_per_caption?: number): Promise<string>;
80
80
  /**
81
81
  * Retrieve redactions of a transcript.
82
- * @param id The identifier of the transcript.
83
- * @return A promise that resolves to the subtitles text.
82
+ * @param id - The identifier of the transcript.
83
+ * @returns A promise that resolves to the subtitles text.
84
84
  */
85
85
  redactions(id: string): Promise<RedactedAudioResponse>;
86
86
  }
@@ -1,64 +1,80 @@
1
1
  /**
2
- * Format: binary
3
- * @description Binary audio data
2
+ * Binary audio data
4
3
  */
5
4
  export type AudioData = ArrayBufferLike;
6
5
  /**
7
- * @description The encoding of the audio data
8
- * @default pcm_s16le
9
- * @enum {string}
6
+ * The encoding of the audio data
7
+ * @defaultValue "pcm_s16"le
10
8
  */
11
9
  export type AudioEncoding = "pcm_s16le" | "pcm_mulaw";
12
- /** @description Configure the threshold for how long to wait before ending an utterance. Default is 700ms. */
10
+ /**
11
+ * Configure the threshold for how long to wait before ending an utterance. Default is 700ms.
12
+ */
13
13
  export type ConfigureEndUtteranceSilenceThreshold = {
14
- /** @description The duration threshold in milliseconds */
14
+ /**
15
+ * The duration threshold in milliseconds
16
+ */
15
17
  end_utterance_silence_threshold: number;
16
18
  };
17
19
  export type FinalTranscript = RealtimeBaseTranscript & {
18
20
  /**
19
- * @description Describes the type of message
20
- * @constant
21
+ * Describes the type of message
21
22
  */
22
23
  message_type: "FinalTranscript";
23
- /** @description Whether the text is punctuated and cased */
24
+ /**
25
+ * Whether the text is punctuated and cased
26
+ */
24
27
  punctuated: boolean;
25
- /** @description Whether the text is formatted, for example Dollar -> $ */
28
+ /**
29
+ * Whether the text is formatted, for example Dollar -&gt; $
30
+ */
26
31
  text_formatted: boolean;
27
32
  };
28
- /** @description Manually end an utterance */
33
+ /**
34
+ * Manually end an utterance
35
+ */
29
36
  export type ForceEndUtterance = {
30
- /** @description A boolean value to communicate that you wish to force the end of the utterance */
37
+ /**
38
+ * A boolean value to communicate that you wish to force the end of the utterance
39
+ */
31
40
  force_end_utterance: boolean;
32
41
  };
33
- /** @enum {string} */
34
42
  export type MessageType = "SessionBegins" | "PartialTranscript" | "FinalTranscript" | "SessionTerminated";
35
43
  export type PartialTranscript = RealtimeBaseTranscript & {
36
44
  /**
37
- * @description Describes the type of message
38
- * @constant
45
+ * Describes the type of message
39
46
  */
40
47
  message_type: "PartialTranscript";
41
48
  };
42
49
  export type RealtimeBaseMessage = {
43
- /** @description Describes the type of the message */
50
+ /**
51
+ * Describes the type of the message
52
+ */
44
53
  message_type: MessageType;
45
54
  };
46
55
  export type RealtimeBaseTranscript = {
47
- /** @description End time of audio sample relative to session start, in milliseconds */
56
+ /**
57
+ * End time of audio sample relative to session start, in milliseconds
58
+ */
48
59
  audio_end: number;
49
- /** @description Start time of audio sample relative to session start, in milliseconds */
60
+ /**
61
+ * Start time of audio sample relative to session start, in milliseconds
62
+ */
50
63
  audio_start: number;
51
64
  /**
52
- * Format: double
53
- * @description The confidence score of the entire transcription, between 0 and 1
65
+ * The confidence score of the entire transcription, between 0 and 1
54
66
  */
55
67
  confidence: number;
56
- /** @description The timestamp for the partial transcript */
68
+ /**
69
+ * The timestamp for the partial transcript
70
+ */
57
71
  created: Date;
58
- /** @description The partial transcript for your audio */
72
+ /**
73
+ * The partial transcript for your audio
74
+ */
59
75
  text: string;
60
76
  /**
61
- * @description An array of objects, with the information for each word in the transcription text.
77
+ * An array of objects, with the information for each word in the transcription text.
62
78
  * Includes the start and end time of the word in milliseconds, the confidence score of the word, and the text, which is the word itself.
63
79
  */
64
80
  words: Word[];
@@ -68,43 +84,48 @@ export type RealtimeError = {
68
84
  };
69
85
  export type RealtimeMessage = SessionBegins | PartialTranscript | FinalTranscript | SessionTerminated | RealtimeError;
70
86
  export type RealtimeTranscript = PartialTranscript | FinalTranscript;
71
- /** @enum {string} */
72
87
  export type RealtimeTranscriptType = "PartialTranscript" | "FinalTranscript";
73
88
  export type SessionBegins = RealtimeBaseMessage & {
74
- /** @description Timestamp when this session will expire */
89
+ /**
90
+ * Timestamp when this session will expire
91
+ */
75
92
  expires_at: Date;
76
93
  /**
77
- * @description Describes the type of the message
78
- * @constant
94
+ * Describes the type of the message
79
95
  */
80
96
  message_type: "SessionBegins";
81
97
  /**
82
- * Format: uuid
83
- * @description Unique identifier for the established session
98
+ * Unique identifier for the established session
84
99
  */
85
100
  session_id: string;
86
101
  };
87
102
  export type SessionTerminated = RealtimeBaseMessage & {
88
103
  /**
89
- * @description Describes the type of the message
90
- * @constant
104
+ * Describes the type of the message
91
105
  */
92
106
  message_type: "SessionTerminated";
93
107
  };
94
- export type TerminateSession = RealtimeBaseMessage & {
95
- /** @description Set to true to end your real-time session forever */
108
+ export type TerminateSession = {
109
+ /**
110
+ * Set to true to end your real-time session forever
111
+ */
96
112
  terminate_session: boolean;
97
113
  };
98
114
  export type Word = {
99
115
  /**
100
- * Format: double
101
- * @description Confidence score of the word
116
+ * Confidence score of the word
102
117
  */
103
118
  confidence: number;
104
- /** @description End time of the word in milliseconds */
119
+ /**
120
+ * End time of the word in milliseconds
121
+ */
105
122
  end: number;
106
- /** @description Start time of the word in milliseconds */
123
+ /**
124
+ * Start time of the word in milliseconds
125
+ */
107
126
  start: number;
108
- /** @description The word itself */
127
+ /**
128
+ * The word itself
129
+ */
109
130
  text: string;
110
131
  };