mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-10-10 20:16:37 +08:00
Merge branch 'ChatGPTNextWeb:main' into main
This commit is contained in:
commit
35b5f844bc
@ -25,7 +25,7 @@ One-Click to get a well-designed cross-platform ChatGPT web UI, with GPT3, GPT4
|
|||||||
[MacOS-image]: https://img.shields.io/badge/-MacOS-black?logo=apple
|
[MacOS-image]: https://img.shields.io/badge/-MacOS-black?logo=apple
|
||||||
[Linux-image]: https://img.shields.io/badge/-Linux-333?logo=ubuntu
|
[Linux-image]: https://img.shields.io/badge/-Linux-333?logo=ubuntu
|
||||||
|
|
||||||
[](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2FYidadaa%2FChatGPT-Next-Web&env=OPENAI_API_KEY&env=CODE&env=GOOGLE_API_KEY&project-name=chatgpt-next-web&repository-name=ChatGPT-Next-Web)
|
[](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2FChatGPTNextWeb%2FChatGPT-Next-Web&env=OPENAI_API_KEY&env=CODE&project-name=nextchat&repository-name=NextChat)
|
||||||
|
|
||||||
[](https://zeabur.com/templates/ZBUEFA)
|
[](https://zeabur.com/templates/ZBUEFA)
|
||||||
|
|
||||||
|
@ -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
Block a user