From 6612550c064a68dbc8772c182228d7428b562fd7 Mon Sep 17 00:00:00 2001 From: Fred Date: Wed, 15 May 2024 15:29:38 +0800 Subject: [PATCH 1/4] feat: support gemini flash --- app/constant.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/app/constant.ts b/app/constant.ts index a3d9c206f..5047ad1d1 100644 --- a/app/constant.ts +++ b/app/constant.ts @@ -151,6 +151,7 @@ const openaiModels = [ const googleModels = [ "gemini-1.0-pro", "gemini-1.5-pro-latest", + "gemini-1.5-flash-latest", "gemini-pro-vision", ]; From 4789a7f6a93cb7c271755a201d04523de246bbec Mon Sep 17 00:00:00 2001 From: Fred Date: Wed, 15 May 2024 15:42:06 +0800 Subject: [PATCH 2/4] feat: add gemini flash into vision model list --- app/utils.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/utils.ts b/app/utils.ts index 07d0dcb13..0007e2b61 100644 --- a/app/utils.ts +++ b/app/utils.ts @@ -290,16 +290,19 @@ export function getMessageImages(message: RequestMessage): string[] { } export function isVisionModel(model: string) { - // 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", "gemini-1.5-pro", + "gemini-1.5-flash", ]; - const isGpt4Turbo = model.includes("gpt-4-turbo") && !model.includes("preview"); + const isGpt4Turbo = + model.includes("gpt-4-turbo") && !model.includes("preview"); - return visionKeywords.some((keyword) => model.includes(keyword)) || isGpt4Turbo; + return ( + visionKeywords.some((keyword) => model.includes(keyword)) || isGpt4Turbo + ); } From 15ddb5fe8c294ed5211435b83dcc8c20063cffca Mon Sep 17 00:00:00 2001 From: sijinhui Date: Wed, 15 May 2024 17:21:01 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?=E9=80=89=E6=8B=A9ui?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/components/ui-lib.module.scss | 1 + app/components/ui-lib.tsx | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/app/components/ui-lib.module.scss b/app/components/ui-lib.module.scss index 69c686420..8e5a39723 100644 --- a/app/components/ui-lib.module.scss +++ b/app/components/ui-lib.module.scss @@ -329,4 +329,5 @@ .cus-modal-container { max-width: none !important; + width: 80vw !important; } diff --git a/app/components/ui-lib.tsx b/app/components/ui-lib.tsx index 9ed711e29..02c4fe513 100644 --- a/app/components/ui-lib.tsx +++ b/app/components/ui-lib.tsx @@ -114,6 +114,7 @@ interface ModalProps { defaultMax?: boolean; footer?: React.ReactNode; onClose?: () => void; + maskClosable?: boolean; is_cus?: boolean; } export function Modal(props: ModalProps) { @@ -534,6 +535,7 @@ export function ModalSelector(props: { onClose={() => props.onClose?.()} footer={null} is_cus={true} + maskClosable={true} > (props: { defaultValue={props.defaultSelectedValue} > {props.items.map((item, i) => { const selected = props.defaultSelectedValue === item.value; @@ -557,6 +564,7 @@ export function ModalSelector(props: { props.onClose?.(); }} avatar={getCheckCardAvatar(item.value?.toString() ?? "")} + style={{ marginBottom: "8px", width: "250px" }} /> ); From 424199a6979ac1b264ed9d54f52660f74bb60801 Mon Sep 17 00:00:00 2001 From: sijinhui Date: Wed, 15 May 2024 17:31:57 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?=E9=80=89=E6=8B=A9ui?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/components/ui-lib.tsx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/app/components/ui-lib.tsx b/app/components/ui-lib.tsx index 02c4fe513..a65f669e3 100644 --- a/app/components/ui-lib.tsx +++ b/app/components/ui-lib.tsx @@ -114,7 +114,6 @@ interface ModalProps { defaultMax?: boolean; footer?: React.ReactNode; onClose?: () => void; - maskClosable?: boolean; is_cus?: boolean; } export function Modal(props: ModalProps) { @@ -514,7 +513,7 @@ export function ModalSelector(props: { onClose?: () => void; multiple?: boolean; }) { - console.log("-----", props); + // console.log("-----", props); const getCheckCardAvatar = (value: string): React.ReactNode => { if (value.startsWith("gpt")) { @@ -526,8 +525,18 @@ export function ModalSelector(props: { return <>; }; + const clickMaskEvent = (event: React.MouseEvent) => { + const div = document.getElementById("modal-mask"); + // console.log('-----', event.target) + if (event.target === div) { + props.onClose?.(); + } + }; + return (
clickMaskEvent(event)} + id="modal-mask" className={styles["modal-mask"] + " " + styles["modal-mask-container"]} > (props: { onClose={() => props.onClose?.()} footer={null} is_cus={true} - maskClosable={true} >