feat: tts

This commit is contained in:
DDMeaqua
2024-09-18 11:24:25 +08:00
parent 212605a7e3
commit 3ae8ec1af6
19 changed files with 2 additions and 490 deletions

View File

@@ -64,16 +64,6 @@ export interface SpeechOptions {
onController?: (controller: AbortController) => void;
}
export interface TranscriptionOptions {
model?: "whisper-1";
file: Blob;
language?: string;
prompt?: string;
response_format?: "json" | "text" | "srt" | "verbose_json" | "vtt";
temperature?: number;
onController?: (controller: AbortController) => void;
}
export interface ChatOptions {
messages: RequestMessage[];
config: LLMConfig;
@@ -109,7 +99,6 @@ export interface LLMModelProvider {
export abstract class LLMApi {
abstract chat(options: ChatOptions): Promise<void>;
abstract speech(options: SpeechOptions): Promise<ArrayBuffer>;
abstract transcription(options: TranscriptionOptions): Promise<string>;
abstract usage(): Promise<LLMUsage>;
abstract models(): Promise<LLMModel[]>;
}