mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-09-22 06:00:56 +02: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) {
|
||||
try {
|
||||
const appConfig = await getAppConfig({
|
||||
role: req.user?.role,
|
||||
});
|
||||
const appConfig =
|
||||
req.config ??
|
||||
(await getAppConfig({
|
||||
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');
|
||||
}
|
||||
|
||||
const ttsSchema = appConfig?.speech?.tts;
|
||||
const provider = await getProvider(ttsSchema);
|
||||
const provider = await getProvider(appConfig);
|
||||
let voices;
|
||||
|
||||
switch (provider) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue