mirror of
https://github.com/ItzCrazyKns/Perplexica.git
synced 2025-12-18 01:28:15 +00:00
Adds Google VertexAI as model provider
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { ChatOpenAI, OpenAIEmbeddings } from '@langchain/openai';
|
||||
import { ChatOllama } from '@langchain/community/chat_models/ollama';
|
||||
import { OllamaEmbeddings } from '@langchain/community/embeddings/ollama';
|
||||
import { hasGCPCredentials } from '../auth';
|
||||
import {
|
||||
getGroqApiKey,
|
||||
getOllamaApiEndpoint,
|
||||
@@ -111,6 +112,23 @@ export const getAvailableChatModelProviders = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
if (await hasGCPCredentials()) {
|
||||
try {
|
||||
models['vertexai'] = {
|
||||
'gemini-1.5-pro (preview-0409)': new VertexAI({
|
||||
temperature: 0.7,
|
||||
modelName: 'gemini-1.5-pro-preview-0409',
|
||||
}),
|
||||
'gemini-1.0-pro (Latest)': new VertexAI({
|
||||
temperature: 0.7,
|
||||
modelName: 'gemini-1.0-pro',
|
||||
}),
|
||||
};
|
||||
} catch (err) {
|
||||
logger.error(`Error loading VertexAI models: ${err}`);
|
||||
}
|
||||
}
|
||||
|
||||
models['custom_openai'] = {};
|
||||
|
||||
return models;
|
||||
|
||||
Reference in New Issue
Block a user