Merge pull request #4306 from H0llyW00dzZ/simplify-cherry-pick
[Cherry Pick] Improve [Utils] Check Vision Model
This commit is contained in:
commit
3ba984d09e
12
app/utils.ts
12
app/utils.ts
|
@ -292,9 +292,11 @@ export function getMessageImages(message: RequestMessage): string[] {
|
|||
}
|
||||
|
||||
export function isVisionModel(model: string) {
|
||||
return (
|
||||
// model.startsWith("gpt-4-vision") ||
|
||||
// model.startsWith("gemini-pro-vision") ||
|
||||
model.includes("vision")
|
||||
);
|
||||
// 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",
|
||||
];
|
||||
|
||||
return visionKeywords.some(keyword => model.includes(keyword));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue