Gemini Pro 1.5, API support for 2M context and new experimental model (#2031)

This commit is contained in:
RahSwe 2024-08-02 19:24:31 +02:00 committed by GitHub
parent d4eecdef03
commit c55ef33fce
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 7 additions and 1 deletions

View File

@ -35,6 +35,7 @@ export default function GeminiLLMOptions({ settings }) {
"gemini-1.0-pro", "gemini-1.0-pro",
"gemini-1.5-pro-latest", "gemini-1.5-pro-latest",
"gemini-1.5-flash-latest", "gemini-1.5-flash-latest",
"gemini-1.5-pro-exp-0801",
].map((model) => { ].map((model) => {
return ( return (
<option key={model} value={model}> <option key={model} value={model}>

View File

@ -16,6 +16,7 @@ const PROVIDER_DEFAULT_MODELS = {
"gemini-1.0-pro", "gemini-1.0-pro",
"gemini-1.5-pro-latest", "gemini-1.5-pro-latest",
"gemini-1.5-flash-latest", "gemini-1.5-flash-latest",
"gemini-1.5-pro-exp-0801",
], ],
anthropic: [ anthropic: [
"claude-instant-1.2", "claude-instant-1.2",

View File

@ -96,7 +96,9 @@ class GeminiLLM {
case "gemini-1.5-flash-latest": case "gemini-1.5-flash-latest":
return 1_048_576; return 1_048_576;
case "gemini-1.5-pro-latest": case "gemini-1.5-pro-latest":
return 1_048_576; return 2_097_152;
case "gemini-1.5-pro-exp-0801":
return 2_097_152;
default: default:
return 30_720; // assume a gemini-pro model return 30_720; // assume a gemini-pro model
} }
@ -108,6 +110,7 @@ class GeminiLLM {
"gemini-1.0-pro", "gemini-1.0-pro",
"gemini-1.5-pro-latest", "gemini-1.5-pro-latest",
"gemini-1.5-flash-latest", "gemini-1.5-flash-latest",
"gemini-1.5-pro-exp-0801",
]; ];
return validModels.includes(modelName); return validModels.includes(modelName);
} }

View File

@ -585,6 +585,7 @@ function validGeminiModel(input = "") {
"gemini-1.0-pro", "gemini-1.0-pro",
"gemini-1.5-pro-latest", "gemini-1.5-pro-latest",
"gemini-1.5-flash-latest", "gemini-1.5-flash-latest",
"gemini-1.5-pro-exp-0801",
]; ];
return validModels.includes(input) return validModels.includes(input)
? null ? null