mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-19 01:40:15 +01:00
🗣️ feat: Azure OpenAI speech (#2985)
* feat: Azure STT * feat: Azure TTS * refactor: use enums * fix: frontend tests * fix(config): wrong key provider
This commit is contained in:
parent
87bdbda10a
commit
a05e2c1dcc
4 changed files with 201 additions and 79 deletions
|
|
@ -6,7 +6,6 @@ import { fileConfigSchema } from './file-config';
|
|||
import { specsConfigSchema } from './models';
|
||||
import { FileSources } from './types/files';
|
||||
import { TModelsConfig } from './types';
|
||||
import { speech } from './api-endpoints';
|
||||
|
||||
export const defaultSocialLogins = ['google', 'facebook', 'openid', 'github', 'discord'];
|
||||
|
||||
|
|
@ -234,6 +233,15 @@ const ttsOpenaiSchema = z.object({
|
|||
voices: z.array(z.string()),
|
||||
});
|
||||
|
||||
const ttsAzureOpenAISchema = z.object({
|
||||
instanceName: z.string(),
|
||||
apiKey: z.string(),
|
||||
deploymentName: z.string(),
|
||||
apiVersion: z.string(),
|
||||
model: z.string(),
|
||||
voices: z.array(z.string()),
|
||||
});
|
||||
|
||||
const ttsElevenLabsSchema = z.object({
|
||||
url: z.string().optional(),
|
||||
websocketUrl: z.string().optional(),
|
||||
|
|
@ -260,18 +268,27 @@ const ttsLocalaiSchema = z.object({
|
|||
|
||||
const ttsSchema = z.object({
|
||||
openai: ttsOpenaiSchema.optional(),
|
||||
azureOpenAI: ttsAzureOpenAISchema.optional(),
|
||||
elevenLabs: ttsElevenLabsSchema.optional(),
|
||||
localai: ttsLocalaiSchema.optional(),
|
||||
});
|
||||
|
||||
const sttOpenaiSchema = z.object({
|
||||
url: z.string().optional(),
|
||||
apiKey: z.string(),
|
||||
model: z.string(),
|
||||
});
|
||||
|
||||
const sttAzureOpenAISchema = z.object({
|
||||
instanceName: z.string(),
|
||||
apiKey: z.string(),
|
||||
deploymentName: z.string(),
|
||||
apiVersion: z.string(),
|
||||
});
|
||||
|
||||
const sttSchema = z.object({
|
||||
openai: z
|
||||
.object({
|
||||
url: z.string().optional(),
|
||||
apiKey: z.string().optional(),
|
||||
model: z.string().optional(),
|
||||
})
|
||||
.optional(),
|
||||
openai: sttOpenaiSchema.optional(),
|
||||
azureOpenAI: sttAzureOpenAISchema.optional(),
|
||||
});
|
||||
|
||||
const speechTab = z
|
||||
|
|
@ -846,6 +863,36 @@ export enum SettingsTabValues {
|
|||
ACCOUNT = 'account',
|
||||
}
|
||||
|
||||
export enum STTProviders {
|
||||
/**
|
||||
* Provider for OpenAI STT
|
||||
*/
|
||||
OPENAI = 'openai',
|
||||
/**
|
||||
* Provider for Microsoft Azure STT
|
||||
*/
|
||||
AZURE_OPENAI = 'azureOpenAI',
|
||||
}
|
||||
|
||||
export enum TTSProviders {
|
||||
/**
|
||||
* Provider for OpenAI TTS
|
||||
*/
|
||||
OPENAI = 'openai',
|
||||
/**
|
||||
* Provider for Microsoft Azure OpenAI TTS
|
||||
*/
|
||||
AZURE_OPENAI = 'azureOpenAI',
|
||||
/**
|
||||
* Provider for ElevenLabs TTS
|
||||
*/
|
||||
ELEVENLABS = 'elevenlabs',
|
||||
/**
|
||||
* Provider for LocalAI TTS
|
||||
*/
|
||||
LOCALAI = 'localai',
|
||||
}
|
||||
|
||||
/** Enum for app-wide constants */
|
||||
export enum Constants {
|
||||
/** Key for the app's version. */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue