From 91b4ce2d9cad584342b11ad55fc498b72c8a254b Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Wed, 17 Apr 2024 13:31:38 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix=20image=20support=20autodete?= =?UTF-8?q?ction?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/llm/autodetect.ts | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/core/llm/autodetect.ts b/core/llm/autodetect.ts index 9a2cb2f1c..2ba433571 100644 --- a/core/llm/autodetect.ts +++ b/core/llm/autodetect.ts @@ -50,27 +50,21 @@ const PROVIDER_SUPPORTS_IMAGES: ModelProvider[] = [ "bedrock", ]; +const MODEL_SUPPORTS_IMAGES: string[] = [ + "llava", + "gpt-4-turbo", + "gpt-4-vision", + "claude-3", + "gemini-ultra", + "gemini-1.5-pro", +]; + function modelSupportsImages(provider: ModelProvider, model: string): boolean { if (!PROVIDER_SUPPORTS_IMAGES.includes(provider)) { return false; } - if (model.includes("llava")) { - return true; - } - - if (model.includes("claude-3")) { - return true; - } - - if (model.startsWith("gpt-4-turbo") || model.startsWith("gpt-4-vision")) { - return true; - } - - if ( - (model === "gemini-ultra" || model === "gemini-1.5-pro-latest") && - (provider === "gemini" || provider === "free-trial") - ) { + if (MODEL_SUPPORTS_IMAGES.includes(model)) { return true; }