From 1405d432efda5c5c1621d909ceaa37d8df469358 Mon Sep 17 00:00:00 2001 From: TheoryOfNekomata Date: Sun, 23 Apr 2023 09:01:27 +0800 Subject: [PATCH] Add elevenlabs platform Define common types for elevenlabs. --- README.md | 3 +++ src/platforms/elevenlabs/common.ts | 9 +++++++++ src/platforms/elevenlabs/events.ts | 0 src/platforms/elevenlabs/index.ts | 10 ++++++++++ src/platforms/openai/common.ts | 2 +- 5 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 src/platforms/elevenlabs/common.ts create mode 100644 src/platforms/elevenlabs/events.ts create mode 100644 src/platforms/elevenlabs/index.ts diff --git a/README.md b/README.md index 545a4ff..5a7ebb7 100644 --- a/README.md +++ b/README.md @@ -20,3 +20,6 @@ Many-in-one AI client. - [ ] files - [ ] fine-tunes - [ ] moderations +* ElevenLabs + - [ ] TTS (stream) + - [ ] get voices diff --git a/src/platforms/elevenlabs/common.ts b/src/platforms/elevenlabs/common.ts new file mode 100644 index 0000000..83546a3 --- /dev/null +++ b/src/platforms/elevenlabs/common.ts @@ -0,0 +1,9 @@ +export const enum ApiVersion { + V1 = 'v1', +} + +export interface Configuration { + apiKey: string; + apiVersion: ApiVersion; + baseUrl?: string; +} diff --git a/src/platforms/elevenlabs/events.ts b/src/platforms/elevenlabs/events.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/platforms/elevenlabs/index.ts b/src/platforms/elevenlabs/index.ts new file mode 100644 index 0000000..2b97806 --- /dev/null +++ b/src/platforms/elevenlabs/index.ts @@ -0,0 +1,10 @@ +import { Configuration } from './common'; + +export * from './common'; + +export const PLATFORM_ID = 'elevenlabs' as const; + +export interface PlatformConfig { + platform: typeof PLATFORM_ID; + platformConfiguration: Configuration; +} diff --git a/src/platforms/openai/common.ts b/src/platforms/openai/common.ts index 5bcc7cc..3ea9e3f 100644 --- a/src/platforms/openai/common.ts +++ b/src/platforms/openai/common.ts @@ -38,7 +38,7 @@ export class PlatformError extends Error { } } -export enum ApiVersion { +export const enum ApiVersion { V1 = 'v1', }