Skip to content

Commit

Permalink
add: gemini-vertex-model-provider
Browse files Browse the repository at this point in the history
  • Loading branch information
iwilltry42 committed Dec 20, 2024
1 parent 4856ebb commit 6bf23e9
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ const translateUserFriendlyLabel = (label: string) => {
"OBOT_VOYAGE_MODEL_PROVIDER",
"OBOT_GROQ_MODEL_PROVIDER",
"OBOT_ANTHROPIC_BEDROCK_MODEL_PROVIDER",
"OBOT_GEMINI_VERTEX_MODEL_PROVIDER",
];

return fieldsToStrip
Expand Down
14 changes: 13 additions & 1 deletion ui/admin/app/components/model-providers/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export const CommonModelProviderIds = {
OPENAI: "openai-model-provider",
AZURE_OPENAI: "azure-openai-model-provider",
ANTHROPIC_BEDROCK: "anthropic-bedrock-model-provider",
GEMINI_VERTEX: "gemini-vertex-model-provider",
};

export const ModelProviderLinks = {
Expand All @@ -18,6 +19,8 @@ export const ModelProviderLinks = {
[CommonModelProviderIds.OPENAI]: "https://openai.com/",
[CommonModelProviderIds.ANTHROPIC_BEDROCK]:
"https://aws.amazon.com/bedrock/claude/",
[CommonModelProviderIds.GEMINI_VERTEX]:
"https://cloud.google.com/vertex-ai",
};

export const ModelProviderConfigurationLinks = {
Expand All @@ -44,7 +47,7 @@ export const ModelProviderRequiredTooltips: {
},
[CommonModelProviderIds.AZURE_OPENAI]: {
Endpoint:
"Endpoint for the Azure OpenAI service (e.g. https://<resource-name>.<region>.api.cognitive.microsoft.com/)",
"Endpoint for the Azure OpenAI service (eg. https://<resource-name>.<region>.api.cognitive.microsoft.com/)",
"Client Id":
"Unique identifier for the application when using Azure Active Directory. Can typically be found in App Registrations > [application].",
"Client Secret":
Expand All @@ -62,6 +65,11 @@ export const ModelProviderRequiredTooltips: {
"Session Token": "AWS Session Token",
Region: "AWS Region - make sure that the models you want to use are available in this region: https://docs.aws.amazon.com/bedrock/latest/userguide/models-regions.html",
},
[CommonModelProviderIds.GEMINI_VERTEX]: {
"Google Credentials JSON":
"Google Cloud Account Credentials - JSON File Contents: https://cloud.google.com/iam/docs/keys-create-delete#creating",
"Google Cloud Project": "Google Cloud Project ID",
},
};

export const ModelProviderSensitiveFields: Record<string, boolean | undefined> =
Expand Down Expand Up @@ -94,4 +102,8 @@ export const ModelProviderSensitiveFields: Record<string, boolean | undefined> =
OBOT_ANTHROPIC_BEDROCK_MODEL_PROVIDER_SECRET_ACCESS_KEY: true,
OBOT_ANTHROPIC_BEDROCK_MODEL_PROVIDER_SESSION_TOKEN: true,
OBOT_ANTHROPIC_BEDROCK_MODEL_PROVIDER_REGION: false,

// Gemini Vertex
OBOT_GEMINI_VERTEX_MODEL_PROVIDER_GOOGLE_CREDENTIALS_JSON: true,
OBOT_GEMINI_VERTEX_MODEL_PROVIDER_GOOGLE_CLOUD_PROJECT: false,
};
1 change: 1 addition & 0 deletions ui/admin/app/routes/_auth.model-providers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const sortModelProviders = (modelProviders: ModelProvider[]) => {
CommonModelProviderIds.OLLAMA,
CommonModelProviderIds.VOYAGE,
CommonModelProviderIds.GROQ,
CommonModelProviderIds.GEMINI_VERTEX,
];
const aIndex = preferredOrder.indexOf(a.id);
const bIndex = preferredOrder.indexOf(b.id);
Expand Down
1 change: 1 addition & 0 deletions ui/admin/public/assets/gemini_icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6bf23e9

Please sign in to comment.