From 9d6b434e333d654cfe03f1bf3c3abc86b649cd5b Mon Sep 17 00:00:00 2001 From: oleg Date: Thu, 19 Dec 2024 23:28:03 +0100 Subject: [PATCH] fix(google-genai): Update multimodal model check to include gemini-2 support (#7389) Co-authored-by: jacoblee93 --- 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 93f5dfa9c26f..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"); + return ( + this.model.includes("vision") || + this.model.startsWith("gemini-1.5") || + this.model.startsWith("gemini-2") + ); } constructor(fields?: GoogleGenerativeAIChatInput) {