This commit is contained in:
GH Action - Upstream Sync 2024-03-20 00:25:18 +00:00
commit 92ead9ff61
2 changed files with 9 additions and 5 deletions

View File

@ -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;

View File

@ -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));
} }