Skip to content

Commit 3ba984d

Browse files
authored
Merge pull request #4306 from H0llyW00dzZ/simplify-cherry-pick
[Cherry Pick] Improve [Utils] Check Vision Model
2 parents f274683 + a4c54ca commit 3ba984d

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

app/utils.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -292,9 +292,11 @@ export function getMessageImages(message: RequestMessage): string[] {
292292
}
293293

294294
export function isVisionModel(model: string) {
295-
return (
296-
// model.startsWith("gpt-4-vision") ||
297-
// model.startsWith("gemini-pro-vision") ||
298-
model.includes("vision")
299-
);
295+
// Note: This is a better way using the TypeScript feature instead of `&&` or `||` (ts v5.5.0-dev.20240314 I've been using)
296+
const visionKeywords = [
297+
"vision",
298+
"claude-3",
299+
];
300+
301+
return visionKeywords.some(keyword => model.includes(keyword));
300302
}

0 commit comments

Comments
 (0)