Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Mar 20, 2024
2 parents 52cddbd + 3ba984d commit 49b71a9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 2 additions & 0 deletions app/components/chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ function useSubmitHandler() {
}, []);

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" && (e.nativeEvent.isComposing || isComposing.current))
return false;
Expand Down
12 changes: 7 additions & 5 deletions app/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

0 comments on commit 49b71a9

Please sign in to comment.