mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 08:50:15 +01:00
➿ fix: use appConfig correctly in getVoices
This commit is contained in:
parent
c0511b9a5f
commit
1764de53a5
1 changed files with 8 additions and 6 deletions
|
|
@ -14,16 +14,18 @@ const { getProvider } = require('./TTSService');
|
||||||
*/
|
*/
|
||||||
async function getVoices(req, res) {
|
async function getVoices(req, res) {
|
||||||
try {
|
try {
|
||||||
const appConfig = await getAppConfig({
|
const appConfig =
|
||||||
|
req.config ??
|
||||||
|
(await getAppConfig({
|
||||||
role: req.user?.role,
|
role: req.user?.role,
|
||||||
});
|
}));
|
||||||
|
|
||||||
if (!appConfig || !appConfig?.speech?.tts) {
|
const ttsSchema = appConfig?.speech?.tts;
|
||||||
|
if (!ttsSchema) {
|
||||||
throw new Error('Configuration or TTS schema is missing');
|
throw new Error('Configuration or TTS schema is missing');
|
||||||
}
|
}
|
||||||
|
|
||||||
const ttsSchema = appConfig?.speech?.tts;
|
const provider = await getProvider(appConfig);
|
||||||
const provider = await getProvider(ttsSchema);
|
|
||||||
let voices;
|
let voices;
|
||||||
|
|
||||||
switch (provider) {
|
switch (provider) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue