mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-05-19 20:20:16 +09:00
Improve [Utils] Check Vision Model
- [+] refactor(utils.ts): improve isVisionModel function to use array.some instead of model.includes
This commit is contained in:
parent
cc0eae7153
commit
a4c54cae60
12
app/utils.ts
12
app/utils.ts
@ -292,9 +292,11 @@ export function getMessageImages(message: RequestMessage): string[] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function isVisionModel(model: string) {
|
export function isVisionModel(model: string) {
|
||||||
return (
|
// Note: This is a better way using the TypeScript feature instead of `&&` or `||` (ts v5.5.0-dev.20240314 I've been using)
|
||||||
// model.startsWith("gpt-4-vision") ||
|
const visionKeywords = [
|
||||||
// model.startsWith("gemini-pro-vision") ||
|
"vision",
|
||||||
model.includes("vision")
|
"claude-3",
|
||||||
);
|
];
|
||||||
|
|
||||||
|
return visionKeywords.some(keyword => model.includes(keyword));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user