feat: Added vertex AI provider for orgs using gemini (#840)

Co-authored-by: Shourya Sharma <shourya.sharma@complyadvantage.com>
This commit is contained in:
Shourya Sharma
2024-11-14 16:34:58 +00:00
committed by GitHub
parent af33f3a602
commit 839a8ee25a
2 changed files with 72 additions and 2 deletions

View File

@@ -5,11 +5,10 @@ local Utils = require("avante.utils")
---@class avante.CoreConfig: avante.Config
local M = {}
---@class avante.Config
M.defaults = {
debug = false,
---@alias Provider "claude" | "openai" | "azure" | "gemini" | "cohere" | "copilot" | [string]
---@alias Provider "claude" | "openai" | "azure" | "gemini" | "vertex" | "cohere" | "copilot" | [string]
provider = "claude", -- Only recommend using Claude
auto_suggestions_provider = "claude",
---@alias Tokenizer "tiktoken" | "hf"
@@ -66,6 +65,15 @@ M.defaults = {
["local"] = false,
},
---@type AvanteSupportedProvider
vertex = {
endpoint = "https://LOCATION-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/publishers/google/models",
model = "gemini-1.5-flash-latest",
timeout = 30000, -- Timeout in milliseconds
temperature = 0,
max_tokens = 4096,
["local"] = false,
},
---@type AvanteSupportedProvider
cohere = {
endpoint = "https://api.cohere.com/v2",
model = "command-r-plus-08-2024",