mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-16 16:30:15 +01:00
✨ feat: Add GOOGLE_LOC environment variable (#4395)
This commit is contained in:
parent
bf5b87e0b2
commit
ef118009f6
2 changed files with 5 additions and 1 deletions
|
|
@ -146,6 +146,8 @@ GOOGLE_KEY=user_provided
|
||||||
|
|
||||||
# GOOGLE_TITLE_MODEL=gemini-pro
|
# GOOGLE_TITLE_MODEL=gemini-pro
|
||||||
|
|
||||||
|
# GOOGLE_LOC=us-central1
|
||||||
|
|
||||||
# Google Safety Settings
|
# Google Safety Settings
|
||||||
# NOTE: These settings apply to both Vertex AI and Gemini API (AI Studio)
|
# NOTE: These settings apply to both Vertex AI and Gemini API (AI Studio)
|
||||||
#
|
#
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ const {
|
||||||
} = require('./prompts');
|
} = require('./prompts');
|
||||||
const BaseClient = require('./BaseClient');
|
const BaseClient = require('./BaseClient');
|
||||||
|
|
||||||
const loc = 'us-central1';
|
const loc = process.env.GOOGLE_LOC || 'us-central1';
|
||||||
const publisher = 'google';
|
const publisher = 'google';
|
||||||
const endpointPrefix = `https://${loc}-aiplatform.googleapis.com`;
|
const endpointPrefix = `https://${loc}-aiplatform.googleapis.com`;
|
||||||
// const apiEndpoint = loc + '-aiplatform.googleapis.com';
|
// const apiEndpoint = loc + '-aiplatform.googleapis.com';
|
||||||
|
|
@ -593,6 +593,8 @@ class GoogleClient extends BaseClient {
|
||||||
|
|
||||||
createLLM(clientOptions) {
|
createLLM(clientOptions) {
|
||||||
const model = clientOptions.modelName ?? clientOptions.model;
|
const model = clientOptions.modelName ?? clientOptions.model;
|
||||||
|
clientOptions.location = loc;
|
||||||
|
clientOptions.endpoint = `${loc}-aiplatform.googleapis.com`;
|
||||||
if (this.project_id && this.isTextModel) {
|
if (this.project_id && this.isTextModel) {
|
||||||
logger.debug('Creating Google VertexAI client');
|
logger.debug('Creating Google VertexAI client');
|
||||||
return new GoogleVertexAI(clientOptions);
|
return new GoogleVertexAI(clientOptions);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue