mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-18 01:10:14 +01:00
🛡️ feat: Google Reverse Proxy support, CIVIC_INTEGRITY harm category (#5037)
* 🛡️ feat: Google Reverse Proxy support, `CIVIC_INTEGRITY` harm category * 🔧 chore: Update @langchain/google-vertexai to version 0.1.4 in package.json and package-lock.json * fix: revert breaking Vertex AI changes --------- Co-authored-by: KiGamji <maloyh44@gmail.com>
This commit is contained in:
parent
22a87b6162
commit
3ceb227507
5 changed files with 98 additions and 53 deletions
|
|
@ -1,9 +1,15 @@
|
|||
const { EModelEndpoint, AuthKeys } = require('librechat-data-provider');
|
||||
const { getUserKey, checkUserKeyExpiry } = require('~/server/services/UserService');
|
||||
const { GoogleClient } = require('~/app');
|
||||
const { isEnabled } = require('~/server/utils');
|
||||
|
||||
const initializeClient = async ({ req, res, endpointOption }) => {
|
||||
const { GOOGLE_KEY, GOOGLE_REVERSE_PROXY, PROXY } = process.env;
|
||||
const {
|
||||
GOOGLE_KEY,
|
||||
GOOGLE_REVERSE_PROXY,
|
||||
GOOGLE_AUTH_HEADER,
|
||||
PROXY,
|
||||
} = process.env;
|
||||
const isUserProvided = GOOGLE_KEY === 'user_provided';
|
||||
const { key: expiresAt } = req.body;
|
||||
|
||||
|
|
@ -46,6 +52,7 @@ const initializeClient = async ({ req, res, endpointOption }) => {
|
|||
req,
|
||||
res,
|
||||
reverseProxyUrl: GOOGLE_REVERSE_PROXY ?? null,
|
||||
authHeader: isEnabled(GOOGLE_AUTH_HEADER) ?? null,
|
||||
proxy: PROXY ?? null,
|
||||
...clientOptions,
|
||||
...endpointOption,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue