🔊 fix: Missing Proxy config in TTS and STT Services (#10852)

* Fix TTS STT proxy

* Add STT proxy env var

* Add TTS proxy env var

* chore: import order

* chore: import order

---------

Co-authored-by: Danny Avila <danacordially@gmail.com>
This commit is contained in:
alfo-dev 2025-12-10 02:23:03 +01:00 committed by GitHub
parent a07cc11cd6
commit b4892d81d3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 1 deletions

View file

@ -4,6 +4,7 @@ const FormData = require('form-data');
const { Readable } = require('stream');
const { logger } = require('@librechat/data-schemas');
const { genAzureEndpoint } = require('@librechat/api');
const { HttpsProxyAgent } = require('https-proxy-agent');
const { extractEnvVariable, STTProviders } = require('librechat-data-provider');
const { getAppConfig } = require('~/server/services/Config');
@ -266,8 +267,14 @@ class STTService {
language,
);
const options = { headers };
if (process.env.PROXY) {
options.httpsAgent = new HttpsProxyAgent(process.env.PROXY);
}
try {
const response = await axios.post(url, data, { headers });
const response = await axios.post(url, data, options);
if (response.status !== 200) {
throw new Error('Invalid response from the STT API');