assemblyai 1.0.1 → 2.0.1-beta
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/LICENSE +21 -0
- package/README.md +192 -83
- package/dist/index.d.ts +4 -0
- package/dist/index.esm.js +473 -0
- package/dist/index.js +482 -0
- package/dist/services/base.d.ts +13 -0
- package/dist/services/files/index.d.ts +9 -0
- package/dist/services/index.d.ts +29 -0
- package/dist/services/lemur/index.d.ts +8 -0
- package/dist/services/realtime/factory.d.ts +10 -0
- package/dist/services/realtime/index.d.ts +2 -0
- package/dist/services/realtime/service.d.ts +22 -0
- package/dist/services/transcripts/index.d.ts +59 -0
- package/dist/types/asyncapi.generated.d.ts +87 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/openapi.generated.d.ts +685 -0
- package/dist/types/realtime/index.d.ts +36 -0
- package/dist/types/services/abstractions.d.ts +52 -0
- package/dist/types/services/index.d.ts +6 -0
- package/dist/types/transcripts/index.d.ts +5 -0
- package/dist/utils/axios.d.ts +3 -0
- package/dist/utils/errors/index.d.ts +1 -0
- package/dist/utils/errors/realtime.d.ts +23 -0
- package/package.json +58 -21
- package/src/index.ts +5 -0
- package/src/services/base.ts +14 -0
- package/src/services/files/index.ts +22 -0
- package/src/services/index.ts +49 -0
- package/src/services/lemur/index.ts +49 -0
- package/src/services/realtime/factory.ts +32 -0
- package/src/services/realtime/index.ts +2 -0
- package/src/services/realtime/service.ts +184 -0
- package/src/services/transcripts/index.ts +178 -0
- package/src/types/asyncapi.generated.ts +124 -0
- package/src/types/index.ts +5 -0
- package/src/types/openapi.generated.ts +834 -0
- package/src/types/realtime/index.ts +68 -0
- package/src/types/services/abstractions.ts +56 -0
- package/src/types/services/index.ts +7 -0
- package/src/types/transcripts/index.ts +5 -0
- package/src/utils/.gitkeep +0 -0
- package/src/utils/axios.ts +19 -0
- package/src/utils/errors/index.ts +5 -0
- package/src/utils/errors/realtime.ts +45 -0
- package/.eslintrc.json +0 -3
- package/index.js +0 -15
- package/src/Client.js +0 -28
- package/src/api/Http/Request.js +0 -108
- package/src/api/Http/Response.js +0 -23
- package/src/api/Model.js +0 -17
- package/src/api/Transcript.js +0 -16
- package/src/api/Upload.js +0 -41
- package/src/api/util.js +0 -48
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
export type AudioData = {
|
|
2
|
+
/** @description Raw audio data, base64 encoded. This can be the raw data recorded directly from a microphone or read from an audio file. */
|
|
3
|
+
audio_data: string;
|
|
4
|
+
};
|
|
5
|
+
export type FinalTranscript = RealtimeBaseTranscript & {
|
|
6
|
+
/**
|
|
7
|
+
* @description Describes the type of message.
|
|
8
|
+
* @constant
|
|
9
|
+
*/
|
|
10
|
+
message_type: "FinalTranscript";
|
|
11
|
+
/** @description Whether the text has been punctuated and cased. */
|
|
12
|
+
punctuated: boolean;
|
|
13
|
+
/** @description Whether the text has been formatted (e.g. Dollar -> $) */
|
|
14
|
+
text_formatted: boolean;
|
|
15
|
+
};
|
|
16
|
+
/** @enum {string} */
|
|
17
|
+
export type MessageType = "SessionBegins" | "PartialTranscript" | "FinalTranscript" | "SessionTerminated";
|
|
18
|
+
export type PartialTranscript = RealtimeBaseTranscript & {
|
|
19
|
+
/**
|
|
20
|
+
* @description Describes the type of message.
|
|
21
|
+
* @constant
|
|
22
|
+
*/
|
|
23
|
+
message_type: "PartialTranscript";
|
|
24
|
+
};
|
|
25
|
+
export type RealtimeBaseMessage = {
|
|
26
|
+
/** @description Describes the type of the message. */
|
|
27
|
+
message_type: MessageType;
|
|
28
|
+
};
|
|
29
|
+
export type RealtimeBaseTranscript = {
|
|
30
|
+
/** @description End time of audio sample relative to session start, in milliseconds. */
|
|
31
|
+
audio_end: number;
|
|
32
|
+
/** @description Start time of audio sample relative to session start, in milliseconds. */
|
|
33
|
+
audio_start: number;
|
|
34
|
+
/**
|
|
35
|
+
* Format: double
|
|
36
|
+
* @description The confidence score of the entire transcription, between 0 and 1.
|
|
37
|
+
*/
|
|
38
|
+
confidence: number;
|
|
39
|
+
/** @description The timestamp for the partial transcript. */
|
|
40
|
+
created: Date;
|
|
41
|
+
/** @description The partial transcript for your audio. */
|
|
42
|
+
text: string;
|
|
43
|
+
/** @description An array of objects, with the information for each word in the transcription text. Includes the start/end time (in milliseconds) of the word, the confidence score of the word, and the text (i.e. the word itself). */
|
|
44
|
+
words: Word[];
|
|
45
|
+
};
|
|
46
|
+
export type RealtimeError = {
|
|
47
|
+
error: string;
|
|
48
|
+
};
|
|
49
|
+
export type RealtimeMessage = SessionBegins | PartialTranscript | FinalTranscript | SessionTerminated | RealtimeError;
|
|
50
|
+
export type RealtimeTranscript = PartialTranscript | FinalTranscript;
|
|
51
|
+
/** @enum {string} */
|
|
52
|
+
export type RealtimeTranscriptType = "PartialTranscript" | "FinalTranscript";
|
|
53
|
+
export type SessionBegins = RealtimeBaseMessage & {
|
|
54
|
+
/** @description Timestamp when this session will expire. */
|
|
55
|
+
expires_at: Date;
|
|
56
|
+
/**
|
|
57
|
+
* @description Describes the type of the message.
|
|
58
|
+
* @constant
|
|
59
|
+
*/
|
|
60
|
+
message_type: "SessionBegins";
|
|
61
|
+
/** @description Unique identifier for the established session. */
|
|
62
|
+
session_id: string;
|
|
63
|
+
};
|
|
64
|
+
export type SessionTerminated = RealtimeBaseMessage & {
|
|
65
|
+
/**
|
|
66
|
+
* @description Describes the type of the message.
|
|
67
|
+
* @constant
|
|
68
|
+
*/
|
|
69
|
+
message_type: "SessionTerminated";
|
|
70
|
+
};
|
|
71
|
+
export type TerminateSession = RealtimeBaseMessage & {
|
|
72
|
+
/** @description A boolean value to communicate that you wish to end your real-time session forever. */
|
|
73
|
+
terminate_session: boolean;
|
|
74
|
+
};
|
|
75
|
+
export type Word = {
|
|
76
|
+
/**
|
|
77
|
+
* Format: double
|
|
78
|
+
* @description Confidence score of the word
|
|
79
|
+
*/
|
|
80
|
+
confidence: number;
|
|
81
|
+
/** @description End time of the word in milliseconds */
|
|
82
|
+
end: number;
|
|
83
|
+
/** @description Start time of the word in milliseconds */
|
|
84
|
+
start: number;
|
|
85
|
+
/** @description The word itself */
|
|
86
|
+
text: string;
|
|
87
|
+
};
|