mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-22 19:30:15 +01:00
refactor: replace getCustomConfig with getAppConfig in STTService, TTSService, and related files
This commit is contained in:
parent
b0256510b5
commit
c82c47ab6a
6 changed files with 37 additions and 40 deletions
|
|
@ -1,5 +1,5 @@
|
|||
const { getCustomConfig } = require('~/server/services/Config');
|
||||
const { logger } = require('~/config');
|
||||
const { logger } = require('@librechat/data-schemas');
|
||||
const { getAppConfig } = require('~/server/services/Config');
|
||||
|
||||
/**
|
||||
* This function retrieves the speechTab settings from the custom configuration
|
||||
|
|
@ -15,26 +15,26 @@ const { logger } = require('~/config');
|
|||
*/
|
||||
async function getCustomConfigSpeech(req, res) {
|
||||
try {
|
||||
const customConfig = await getCustomConfig();
|
||||
const appConfig = await getAppConfig();
|
||||
|
||||
if (!customConfig) {
|
||||
if (!appConfig) {
|
||||
return res.status(200).send({
|
||||
message: 'not_found',
|
||||
});
|
||||
}
|
||||
|
||||
const sttExternal = !!customConfig.speech?.stt;
|
||||
const ttsExternal = !!customConfig.speech?.tts;
|
||||
const sttExternal = !!appConfig.speech?.stt;
|
||||
const ttsExternal = !!appConfig.speech?.tts;
|
||||
let settings = {
|
||||
sttExternal,
|
||||
ttsExternal,
|
||||
};
|
||||
|
||||
if (!customConfig.speech?.speechTab) {
|
||||
if (!appConfig.speech?.speechTab) {
|
||||
return res.status(200).send(settings);
|
||||
}
|
||||
|
||||
const speechTab = customConfig.speech.speechTab;
|
||||
const speechTab = appConfig.speech.speechTab;
|
||||
|
||||
if (speechTab.advancedMode !== undefined) {
|
||||
settings.advancedMode = speechTab.advancedMode;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue