Merge pull request #4412 from RubuJam/main

Gemini will generate the request address based on the selected model name and supports Gemini 1.5 Pro (gemini-1.5-pro-latest).
This commit is contained in:
DeanYao
2024-04-15 11:44:53 +08:00
committed by GitHub
3 changed files with 24 additions and 8 deletions

View File

@@ -98,10 +98,8 @@ export const Azure = {
export const Google = {
ExampleEndpoint: "https://generativelanguage.googleapis.com/",
ChatPath: "v1beta/models/gemini-pro:generateContent",
VisionChatPath: "v1beta/models/gemini-pro-vision:generateContent",
// /api/openai/v1/chat/completions
ChatPath: (modelName: string) => `v1beta/models/${modelName}:generateContent`,
VisionChatPath: (modelName: string) => `v1beta/models/${modelName}:generateContent`,
};
export const DEFAULT_INPUT_TEMPLATE = `{{input}}`; // input / time / model / lang
@@ -136,6 +134,7 @@ export const KnowledgeCutOffDate: Record<string, string> = {
// After improvements,
// it's now easier to add "KnowledgeCutOffDate" instead of stupid hardcoding it, as was done previously.
"gemini-pro": "2023-12",
"gemini-pro-vision": "2023-12",
};
export const DEFAULT_MODELS = [
@@ -311,7 +310,16 @@ export const DEFAULT_MODELS = [
},
},
{
name: "gemini-pro",
name: "gemini-1.0-pro",
available: true,
provider: {
id: "google",
providerName: "Google",
providerType: "google",
},
},
{
name: "gemini-1.5-pro-latest",
available: true,
provider: {
id: "google",