From 1d3e66d077376a36300dfb0892815fcf44f46ca4 Mon Sep 17 00:00:00 2001 From: Oleg Ivaniv Date: Tue, 17 Dec 2024 17:29:55 +0100 Subject: [PATCH 1/2] fix(google-genai): Update multimodal model check to include gemini-2 support --- libs/langchain-google-genai/src/chat_models.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/langchain-google-genai/src/chat_models.ts b/libs/langchain-google-genai/src/chat_models.ts index 93f5dfa9c26f..1fc4edbc84fc 100644 --- a/libs/langchain-google-genai/src/chat_models.ts +++ b/libs/langchain-google-genai/src/chat_models.ts @@ -580,7 +580,7 @@ export class ChatGoogleGenerativeAI private client: GenerativeModel; get _isMultimodalModel() { - return this.model.includes("vision") || this.model.startsWith("gemini-1.5"); + return this.model.includes("vision") || this.model.startsWith("gemini-1.5") || this.model.startsWith("gemini-2"); } constructor(fields?: GoogleGenerativeAIChatInput) { From 6a5cfa9c439221aa21e7a19f6f7caad3ed3386f4 Mon Sep 17 00:00:00 2001 From: jacoblee93 Date: Thu, 19 Dec 2024 14:11:44 -0800 Subject: [PATCH 2/2] Format --- libs/langchain-google-genai/src/chat_models.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libs/langchain-google-genai/src/chat_models.ts b/libs/langchain-google-genai/src/chat_models.ts index 1fc4edbc84fc..fd09579bff09 100644 --- a/libs/langchain-google-genai/src/chat_models.ts +++ b/libs/langchain-google-genai/src/chat_models.ts @@ -580,7 +580,11 @@ export class ChatGoogleGenerativeAI private client: GenerativeModel; get _isMultimodalModel() { - return this.model.includes("vision") || this.model.startsWith("gemini-1.5") || this.model.startsWith("gemini-2"); + return ( + this.model.includes("vision") || + this.model.startsWith("gemini-1.5") || + this.model.startsWith("gemini-2") + ); } constructor(fields?: GoogleGenerativeAIChatInput) {