assemblyai 3.0.1 → 3.1.1

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,16 +1,16 @@
1
1
  /**
2
2
  * Interface for classes that can create resources.
3
3
  * @template T The type of the resource.
4
- * @template Parameters The type of the parameters required to create the resource.
4
+ * @template Params The type of the parameters required to create the resource.
5
5
  */
6
- interface Createable<T, Parameters, Options = Record<string, unknown>> {
6
+ interface Createable<T, Params, Options = Record<string, unknown>> {
7
7
  /**
8
8
  * Create a new resource.
9
9
  * @param params The parameters of the new resource.
10
10
  * @param options The options used for creating the new resource.
11
11
  * @return A promise that resolves to the newly created resource.
12
12
  */
13
- create(params: Parameters, options?: Options): Promise<T>;
13
+ create(params: Params, options?: Options): Promise<T>;
14
14
  }
15
15
 
16
16
  /**
@@ -3,5 +3,5 @@ type BaseServiceParams = {
3
3
  baseUrl?: string;
4
4
  };
5
5
 
6
- export type * from "./abstractions";
6
+ export * from "./abstractions";
7
7
  export type { BaseServiceParams };
@@ -1,5 +1,46 @@
1
- export type CreateTranscriptOptions = {
2
- poll?: boolean;
1
+ import { FileUploadParams } from "../files";
2
+ import { TranscriptParams } from "../openapi.generated";
3
+
4
+ export type PollingOptions = {
5
+ /**
6
+ * The amount of time to wait between polling requests.
7
+ * @default 3000 or every 3 seconds
8
+ */
3
9
  pollingInterval?: number;
10
+ /**
11
+ * The maximum amount of time to wait for the transcript to be ready.
12
+ * @default -1 which means wait forever
13
+ */
4
14
  pollingTimeout?: number;
5
15
  };
16
+
17
+ export type CreateTranscriptOptions = {
18
+ /**
19
+ * Whether to poll the transcript until it is ready.
20
+ * @default true
21
+ */
22
+ poll?: boolean;
23
+ } & PollingOptions;
24
+
25
+ /**
26
+ * The audio to transcribe. This can be a public URL, a local file path, a readable file stream, or a file buffer.
27
+ */
28
+ export type AudioToTranscribe = FileUploadParams;
29
+
30
+ /**
31
+ * The parameters to transcribe an audio file.
32
+ */
33
+ export type TranscribeParams = { audio: AudioToTranscribe } & Omit<
34
+ TranscriptParams,
35
+ "audio_url"
36
+ >;
37
+
38
+ /**
39
+ * The parameters to start the transcription of an audio file.
40
+ */
41
+ export type SubmitParams = TranscribeParams;
42
+
43
+ /**
44
+ * The options to transcribe an audio file, including polling options.
45
+ */
46
+ export type TranscribeOptions = PollingOptions;
File without changes