Merge pull request #4703 from ChatGPTNextWeb/feat/gemini-flash

feat: add gemini flash into vision model list
This commit is contained in:
fred-bf 2024-05-15 15:44:45 +08:00 committed by GitHub
commit 1e00c89988
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 5 deletions

View File

@ -290,17 +290,18 @@ export function getMessageImages(message: RequestMessage): string[] {
}
export function isVisionModel(model: string) {
// Note: This is a better way using the TypeScript feature instead of `&&` or `||` (ts v5.5.0-dev.20240314 I've been using)
const visionKeywords = [
"vision",
"claude-3",
"gemini-1.5-pro",
"gpt-4-turbo",
"gpt-4o",
"gemini-1.5-flash",
];
const isGpt4TurboPreview = model === "gpt-4-turbo-preview";
const isGpt4Turbo =
model.includes("gpt-4-turbo") && !model.includes("preview");
return (
visionKeywords.some((keyword) => model.includes(keyword)) &&
!isGpt4TurboPreview
visionKeywords.some((keyword) => model.includes(keyword)) || isGpt4Turbo
);
}