add exp model to v1Beta ()

This commit is contained in:
Timothy Carambat 2024-08-09 14:19:49 -07:00 committed by GitHub
parent 01e85b0ffc
commit f06ef6180d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -17,12 +17,14 @@ class GeminiLLM {
this.gemini = genAI.getGenerativeModel(
{ model: this.model },
{
// Gemini-1.5-pro and Gemini-1.5-flash are only available on the v1beta API.
apiVersion:
this.model === "gemini-1.5-pro-latest" ||
this.model === "gemini-1.5-flash-latest"
? "v1beta"
: "v1",
// Gemini-1.5-pro-* and Gemini-1.5-flash are only available on the v1beta API.
apiVersion: [
"gemini-1.5-pro-latest",
"gemini-1.5-flash-latest",
"gemini-1.5-pro-exp-0801",
].includes(this.model)
? "v1beta"
: "v1",
}
);
this.limits = {