Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web
This commit is contained in:
commit
92ead9ff61
|
@ -219,6 +219,8 @@ function useSubmitHandler() {
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const shouldSubmit = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {
|
const shouldSubmit = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {
|
||||||
|
// Fix Chinese input method "Enter" on Safari
|
||||||
|
if (e.keyCode == 229) return false;
|
||||||
if (e.key !== "Enter") return false;
|
if (e.key !== "Enter") return false;
|
||||||
if (e.key === "Enter" && (e.nativeEvent.isComposing || isComposing.current))
|
if (e.key === "Enter" && (e.nativeEvent.isComposing || isComposing.current))
|
||||||
return false;
|
return false;
|
||||||
|
|
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