Merge pull request #97 from sijinhui/dev

Dev
This commit is contained in:
sijinhui 2024-05-15 23:24:43 +08:00 committed by GitHub
commit 836e2e40b8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 25 additions and 8 deletions

View File

@ -329,4 +329,5 @@
.cus-modal-container {
max-width: none !important;
width: 80vw !important;
}

View File

@ -513,7 +513,7 @@ export function ModalSelector<T extends CheckGroupValueType>(props: {
onClose?: () => void;
multiple?: boolean;
}) {
console.log("-----", props);
// console.log("-----", props);
const getCheckCardAvatar = (value: string): React.ReactNode => {
if (value.startsWith("gpt")) {
@ -525,8 +525,18 @@ export function ModalSelector<T extends CheckGroupValueType>(props: {
return <></>;
};
const clickMaskEvent = (event: React.MouseEvent) => {
const div = document.getElementById("modal-mask");
// console.log('-----', event.target)
if (event.target === div) {
props.onClose?.();
}
};
return (
<div
onClick={(event) => clickMaskEvent(event)}
id="modal-mask"
className={styles["modal-mask"] + " " + styles["modal-mask-container"]}
>
<Modal
@ -541,8 +551,13 @@ export function ModalSelector<T extends CheckGroupValueType>(props: {
defaultValue={props.defaultSelectedValue}
>
<Row
gutter={[16, 16]}
style={{ marginLeft: "-8px", marginRight: "-8px" }}
gutter={[16, 8]}
style={{
marginLeft: "-8px",
marginRight: "-8px",
display: "flex",
justifyContent: "center",
}}
>
{props.items.map((item, i) => {
const selected = props.defaultSelectedValue === item.value;
@ -557,6 +572,7 @@ export function ModalSelector<T extends CheckGroupValueType>(props: {
props.onClose?.();
}}
avatar={getCheckCardAvatar(item.value?.toString() ?? "")}
style={{ marginBottom: "8px", width: "250px" }}
/>
</Col>
);

View File

@ -161,6 +161,7 @@ const openaiModels = [
const googleModels = [
"gemini-1.0-pro",
"gemini-1.5-pro-latest",
"gemini-1.5-flash-latest",
"gemini-pro-vision",
];

View File

@ -296,13 +296,12 @@ export function isVisionModel(model: string) {
"vision",
"claude-3",
"gemini-1.5-pro",
"gpt-4-turbo",
"gpt-4o",
"gemini-1.5-flash",
];
const isGpt4TurboPreview = model === "gpt-4-turbo-preview";
const isGpt4Turbo =
model.includes("gpt-4-turbo") && !model.includes("preview");
return (
visionKeywords.some((keyword) => model.includes(keyword)) &&
!isGpt4TurboPreview
visionKeywords.some((keyword) => model.includes(keyword)) || isGpt4Turbo
);
}