Merge pull request #4 from SolarifyDev/access-ome-office-app
接入OME Office APP数据
This commit is contained in:
commit
521b0c2fbd
|
@ -13,7 +13,6 @@ import SendWhiteIcon from "../icons/send-white.svg";
|
||||||
import BrainIcon from "../icons/brain.svg";
|
import BrainIcon from "../icons/brain.svg";
|
||||||
import RenameIcon from "../icons/rename.svg";
|
import RenameIcon from "../icons/rename.svg";
|
||||||
import EditIcon from "../icons/rename.svg";
|
import EditIcon from "../icons/rename.svg";
|
||||||
import ExportIcon from "../icons/share.svg";
|
|
||||||
import ReturnIcon from "../icons/return.svg";
|
import ReturnIcon from "../icons/return.svg";
|
||||||
import CopyIcon from "../icons/copy.svg";
|
import CopyIcon from "../icons/copy.svg";
|
||||||
import SpeakIcon from "../icons/speak.svg";
|
import SpeakIcon from "../icons/speak.svg";
|
||||||
|
@ -1283,6 +1282,7 @@ function _Chat() {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const appstore = useAppConfig();
|
||||||
const accessStore = useAccessStore();
|
const accessStore = useAccessStore();
|
||||||
const [speechStatus, setSpeechStatus] = useState(false);
|
const [speechStatus, setSpeechStatus] = useState(false);
|
||||||
const [speechLoading, setSpeechLoading] = useState(false);
|
const [speechLoading, setSpeechLoading] = useState(false);
|
||||||
|
@ -1340,7 +1340,10 @@ function _Chat() {
|
||||||
) {
|
) {
|
||||||
const copiedHello = Object.assign({}, BOT_HELLO);
|
const copiedHello = Object.assign({}, BOT_HELLO);
|
||||||
if (!accessStore.isAuthorized()) {
|
if (!accessStore.isAuthorized()) {
|
||||||
copiedHello.content = Locale.Error.Unauthorized;
|
if (!isEmpty(appstore.omeToken)) {
|
||||||
|
} else {
|
||||||
|
copiedHello.content = Locale.Error.Unauthorized;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
context.push(copiedHello);
|
context.push(copiedHello);
|
||||||
}
|
}
|
||||||
|
@ -1569,6 +1572,7 @@ function _Chat() {
|
||||||
const imagesData: string[] = [];
|
const imagesData: string[] = [];
|
||||||
for (let i = 0; i < files.length; i++) {
|
for (let i = 0; i < files.length; i++) {
|
||||||
const file = event.target.files[i];
|
const file = event.target.files[i];
|
||||||
|
console.log("file", file);
|
||||||
uploadImageRemote(file)
|
uploadImageRemote(file)
|
||||||
.then((dataUrl) => {
|
.then((dataUrl) => {
|
||||||
imagesData.push(dataUrl);
|
imagesData.push(dataUrl);
|
||||||
|
@ -1735,7 +1739,7 @@ function _Chat() {
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<div className="window-action-button">
|
{/* <div className="window-action-button">
|
||||||
<IconButton
|
<IconButton
|
||||||
icon={<ExportIcon />}
|
icon={<ExportIcon />}
|
||||||
bordered
|
bordered
|
||||||
|
@ -1744,7 +1748,7 @@ function _Chat() {
|
||||||
setShowExport(true);
|
setShowExport(true);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div> */}
|
||||||
{showMaxIcon && (
|
{showMaxIcon && (
|
||||||
<div className="window-action-button">
|
<div className="window-action-button">
|
||||||
<IconButton
|
<IconButton
|
||||||
|
|
|
@ -262,15 +262,42 @@ export function Home() {
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
window.parent.postMessage("omemetis is ready", "*");
|
if (window.ReactNativeWebView) {
|
||||||
|
try {
|
||||||
|
const message = {
|
||||||
|
data: "omemetis is ready",
|
||||||
|
url: location.origin,
|
||||||
|
};
|
||||||
|
window.ReactNativeWebView.postMessage(JSON.stringify(message));
|
||||||
|
} catch {}
|
||||||
|
} else {
|
||||||
|
window.parent.postMessage("omemetis is ready", "*");
|
||||||
|
}
|
||||||
|
|
||||||
const handleMessage = (event: any) => {
|
const handleMessage = (event: any) => {
|
||||||
if (!event.origin.includes("omeoffice")) {
|
const data = event.data;
|
||||||
return; // 如果不是信任的源,忽略消息
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isEmpty(event?.data?.omeToken))
|
if (isEmpty(data) || (typeof data === "string" && data === "")) return;
|
||||||
appConfig.setOmeToken(event.data.omeToken);
|
|
||||||
|
if (window.ReactNativeWebView) {
|
||||||
|
try {
|
||||||
|
const params = JSON.parse(data);
|
||||||
|
|
||||||
|
if (!isEmpty(params?.ometoken) && params?.from === "OmeOfficeApp") {
|
||||||
|
appConfig.setOmeToken(params?.ometoken ?? "");
|
||||||
|
}
|
||||||
|
} catch {}
|
||||||
|
} else {
|
||||||
|
if (
|
||||||
|
!event.origin.includes("omeoffice") &&
|
||||||
|
!event.origin.includes("localhost")
|
||||||
|
) {
|
||||||
|
return; // 如果不是信任的源,忽略消息
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isEmpty(event?.data?.ometoken))
|
||||||
|
appConfig.setOmeToken(event.data.ometoken);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
window.addEventListener("message", handleMessage);
|
window.addEventListener("message", handleMessage);
|
||||||
|
|
|
@ -49,8 +49,7 @@ import Locale, {
|
||||||
changeLang,
|
changeLang,
|
||||||
getLang,
|
getLang,
|
||||||
} from "../locales";
|
} from "../locales";
|
||||||
import { copyToClipboard, clientUpdate, semverCompare } from "../utils";
|
import { copyToClipboard, semverCompare } from "../utils";
|
||||||
import Link from "next/link";
|
|
||||||
import {
|
import {
|
||||||
Anthropic,
|
Anthropic,
|
||||||
Azure,
|
Azure,
|
||||||
|
@ -67,7 +66,6 @@ import {
|
||||||
RELEASE_URL,
|
RELEASE_URL,
|
||||||
STORAGE_KEY,
|
STORAGE_KEY,
|
||||||
ServiceProvider,
|
ServiceProvider,
|
||||||
SlotID,
|
|
||||||
UPDATE_URL,
|
UPDATE_URL,
|
||||||
Stability,
|
Stability,
|
||||||
Iflytek,
|
Iflytek,
|
||||||
|
@ -1510,7 +1508,7 @@ export function Settings() {
|
||||||
</Popover>
|
</Popover>
|
||||||
</ListItem>
|
</ListItem>
|
||||||
|
|
||||||
<ListItem
|
{/* <ListItem
|
||||||
title={Locale.Settings.Update.Version(currentVersion ?? "unknown")}
|
title={Locale.Settings.Update.Version(currentVersion ?? "unknown")}
|
||||||
subTitle={
|
subTitle={
|
||||||
checkingUpdate
|
checkingUpdate
|
||||||
|
@ -1541,7 +1539,7 @@ export function Settings() {
|
||||||
onClick={() => checkUpdate(true)}
|
onClick={() => checkUpdate(true)}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</ListItem>
|
</ListItem> */}
|
||||||
|
|
||||||
<ListItem title={Locale.Settings.SendKey}>
|
<ListItem title={Locale.Settings.SendKey}>
|
||||||
<Select
|
<Select
|
||||||
|
@ -1774,7 +1772,7 @@ export function Settings() {
|
||||||
</ListItem>
|
</ListItem>
|
||||||
</List>
|
</List>
|
||||||
|
|
||||||
<List id={SlotID.CustomModel}>
|
{/* <List id={SlotID.CustomModel}>
|
||||||
{saasStartComponent}
|
{saasStartComponent}
|
||||||
{accessCodeComponent}
|
{accessCodeComponent}
|
||||||
|
|
||||||
|
@ -1871,7 +1869,7 @@ export function Settings() {
|
||||||
}
|
}
|
||||||
></input>
|
></input>
|
||||||
</ListItem>
|
</ListItem>
|
||||||
</List>
|
</List> */}
|
||||||
|
|
||||||
<List>
|
<List>
|
||||||
<ModelConfigList
|
<ModelConfigList
|
||||||
|
|
|
@ -3,14 +3,12 @@ import React, { Fragment, useEffect, useMemo, useRef, useState } from "react";
|
||||||
import styles from "./home.module.scss";
|
import styles from "./home.module.scss";
|
||||||
|
|
||||||
import { IconButton } from "./button";
|
import { IconButton } from "./button";
|
||||||
import SettingsIcon from "../icons/settings.svg";
|
|
||||||
import ChatGptIcon from "../icons/chatgpt.svg";
|
import ChatGptIcon from "../icons/chatgpt.svg";
|
||||||
import AddIcon from "../icons/add.svg";
|
import AddIcon from "../icons/add.svg";
|
||||||
import DeleteIcon from "../icons/delete.svg";
|
import DeleteIcon from "../icons/delete.svg";
|
||||||
import MaskIcon from "../icons/mask.svg";
|
import MaskIcon from "../icons/mask.svg";
|
||||||
import McpIcon from "../icons/mcp.svg";
|
import McpIcon from "../icons/mcp.svg";
|
||||||
import DragIcon from "../icons/drag.svg";
|
import DragIcon from "../icons/drag.svg";
|
||||||
import DiscoveryIcon from "../icons/discovery.svg";
|
|
||||||
|
|
||||||
import Locale from "../locales";
|
import Locale from "../locales";
|
||||||
|
|
||||||
|
@ -24,7 +22,7 @@ import {
|
||||||
Path,
|
Path,
|
||||||
} from "../constant";
|
} from "../constant";
|
||||||
|
|
||||||
import { Link, useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import { isIOS, useMobileScreen } from "../utils";
|
import { isIOS, useMobileScreen } from "../utils";
|
||||||
import dynamic from "next/dynamic";
|
import dynamic from "next/dynamic";
|
||||||
import { Selector, showConfirm } from "./ui-lib";
|
import { Selector, showConfirm } from "./ui-lib";
|
||||||
|
@ -278,13 +276,13 @@ export function SideBar(props: { className?: string }) {
|
||||||
shadow
|
shadow
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<IconButton
|
{/* <IconButton
|
||||||
icon={<DiscoveryIcon />}
|
icon={<DiscoveryIcon />}
|
||||||
text={shouldNarrow ? undefined : Locale.Discovery.Name}
|
text={shouldNarrow ? undefined : Locale.Discovery.Name}
|
||||||
className={styles["sidebar-bar-button"]}
|
className={styles["sidebar-bar-button"]}
|
||||||
onClick={() => setshowDiscoverySelector(true)}
|
onClick={() => setshowDiscoverySelector(true)}
|
||||||
shadow
|
shadow
|
||||||
/>
|
/> */}
|
||||||
</div>
|
</div>
|
||||||
{showDiscoverySelector && (
|
{showDiscoverySelector && (
|
||||||
<Selector
|
<Selector
|
||||||
|
@ -325,7 +323,7 @@ export function SideBar(props: { className?: string }) {
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className={styles["sidebar-action"]}>
|
{/* <div className={styles["sidebar-action"]}>
|
||||||
<Link to={Path.Settings}>
|
<Link to={Path.Settings}>
|
||||||
<IconButton
|
<IconButton
|
||||||
aria={Locale.Settings.Title}
|
aria={Locale.Settings.Title}
|
||||||
|
@ -333,7 +331,7 @@ export function SideBar(props: { className?: string }) {
|
||||||
shadow
|
shadow
|
||||||
/>
|
/>
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div> */}
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
secondaryAction={
|
secondaryAction={
|
||||||
|
|
|
@ -33,7 +33,7 @@ export const CN_MASKS: BuiltinMask[] = [
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
modelConfig: {
|
modelConfig: {
|
||||||
model: "gpt-3.5-turbo",
|
model: "gpt-4o-mini",
|
||||||
temperature: 1,
|
temperature: 1,
|
||||||
max_tokens: 2000,
|
max_tokens: 2000,
|
||||||
presence_penalty: 0,
|
presence_penalty: 0,
|
||||||
|
@ -59,7 +59,7 @@ export const CN_MASKS: BuiltinMask[] = [
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
modelConfig: {
|
modelConfig: {
|
||||||
model: "gpt-3.5-turbo",
|
model: "gpt-4o-mini",
|
||||||
temperature: 1,
|
temperature: 1,
|
||||||
max_tokens: 2000,
|
max_tokens: 2000,
|
||||||
presence_penalty: 0,
|
presence_penalty: 0,
|
||||||
|
@ -85,7 +85,7 @@ export const CN_MASKS: BuiltinMask[] = [
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
modelConfig: {
|
modelConfig: {
|
||||||
model: "gpt-3.5-turbo",
|
model: "gpt-4o-mini",
|
||||||
temperature: 1,
|
temperature: 1,
|
||||||
max_tokens: 2000,
|
max_tokens: 2000,
|
||||||
presence_penalty: 0,
|
presence_penalty: 0,
|
||||||
|
@ -111,7 +111,7 @@ export const CN_MASKS: BuiltinMask[] = [
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
modelConfig: {
|
modelConfig: {
|
||||||
model: "gpt-3.5-turbo",
|
model: "gpt-4o-mini",
|
||||||
temperature: 1,
|
temperature: 1,
|
||||||
max_tokens: 2000,
|
max_tokens: 2000,
|
||||||
presence_penalty: 0,
|
presence_penalty: 0,
|
||||||
|
@ -137,7 +137,7 @@ export const CN_MASKS: BuiltinMask[] = [
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
modelConfig: {
|
modelConfig: {
|
||||||
model: "gpt-3.5-turbo",
|
model: "gpt-4o-mini",
|
||||||
temperature: 1,
|
temperature: 1,
|
||||||
max_tokens: 2000,
|
max_tokens: 2000,
|
||||||
presence_penalty: 0,
|
presence_penalty: 0,
|
||||||
|
@ -163,7 +163,7 @@ export const CN_MASKS: BuiltinMask[] = [
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
modelConfig: {
|
modelConfig: {
|
||||||
model: "gpt-3.5-turbo",
|
model: "gpt-4o-mini",
|
||||||
temperature: 1,
|
temperature: 1,
|
||||||
max_tokens: 2000,
|
max_tokens: 2000,
|
||||||
presence_penalty: 0,
|
presence_penalty: 0,
|
||||||
|
@ -189,7 +189,7 @@ export const CN_MASKS: BuiltinMask[] = [
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
modelConfig: {
|
modelConfig: {
|
||||||
model: "gpt-3.5-turbo",
|
model: "gpt-4o-mini",
|
||||||
temperature: 1,
|
temperature: 1,
|
||||||
max_tokens: 2000,
|
max_tokens: 2000,
|
||||||
presence_penalty: 0,
|
presence_penalty: 0,
|
||||||
|
@ -215,7 +215,7 @@ export const CN_MASKS: BuiltinMask[] = [
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
modelConfig: {
|
modelConfig: {
|
||||||
model: "gpt-3.5-turbo",
|
model: "gpt-4o-mini",
|
||||||
temperature: 1,
|
temperature: 1,
|
||||||
max_tokens: 2000,
|
max_tokens: 2000,
|
||||||
presence_penalty: 0,
|
presence_penalty: 0,
|
||||||
|
@ -247,7 +247,7 @@ export const CN_MASKS: BuiltinMask[] = [
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
modelConfig: {
|
modelConfig: {
|
||||||
model: "gpt-3.5-turbo",
|
model: "gpt-4o-mini",
|
||||||
temperature: 0.5,
|
temperature: 0.5,
|
||||||
max_tokens: 2000,
|
max_tokens: 2000,
|
||||||
presence_penalty: 0,
|
presence_penalty: 0,
|
||||||
|
@ -273,7 +273,7 @@ export const CN_MASKS: BuiltinMask[] = [
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
modelConfig: {
|
modelConfig: {
|
||||||
model: "gpt-3.5-turbo",
|
model: "gpt-4o-mini",
|
||||||
temperature: 1,
|
temperature: 1,
|
||||||
max_tokens: 2000,
|
max_tokens: 2000,
|
||||||
presence_penalty: 0,
|
presence_penalty: 0,
|
||||||
|
@ -306,7 +306,7 @@ export const CN_MASKS: BuiltinMask[] = [
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
modelConfig: {
|
modelConfig: {
|
||||||
model: "gpt-3.5-turbo",
|
model: "gpt-4o-mini",
|
||||||
temperature: 1,
|
temperature: 1,
|
||||||
max_tokens: 2000,
|
max_tokens: 2000,
|
||||||
presence_penalty: 0,
|
presence_penalty: 0,
|
||||||
|
@ -339,7 +339,7 @@ export const CN_MASKS: BuiltinMask[] = [
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
modelConfig: {
|
modelConfig: {
|
||||||
model: "gpt-3.5-turbo",
|
model: "gpt-4o-mini",
|
||||||
temperature: 1,
|
temperature: 1,
|
||||||
max_tokens: 2000,
|
max_tokens: 2000,
|
||||||
presence_penalty: 0,
|
presence_penalty: 0,
|
||||||
|
@ -397,7 +397,7 @@ export const CN_MASKS: BuiltinMask[] = [
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
modelConfig: {
|
modelConfig: {
|
||||||
model: "gpt-3.5-turbo",
|
model: "gpt-4o-mini",
|
||||||
temperature: 1,
|
temperature: 1,
|
||||||
max_tokens: 2000,
|
max_tokens: 2000,
|
||||||
presence_penalty: 0,
|
presence_penalty: 0,
|
||||||
|
@ -429,7 +429,7 @@ export const CN_MASKS: BuiltinMask[] = [
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
modelConfig: {
|
modelConfig: {
|
||||||
model: "gpt-4",
|
model: "gpt-4o-mini",
|
||||||
temperature: 0.5,
|
temperature: 0.5,
|
||||||
max_tokens: 2000,
|
max_tokens: 2000,
|
||||||
presence_penalty: 0,
|
presence_penalty: 0,
|
||||||
|
|
|
@ -14,7 +14,7 @@ export const EN_MASKS: BuiltinMask[] = [
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
modelConfig: {
|
modelConfig: {
|
||||||
model: "gpt-4",
|
model: "gpt-4o-mini",
|
||||||
temperature: 0.3,
|
temperature: 0.3,
|
||||||
max_tokens: 2000,
|
max_tokens: 2000,
|
||||||
presence_penalty: 0,
|
presence_penalty: 0,
|
||||||
|
@ -60,7 +60,7 @@ export const EN_MASKS: BuiltinMask[] = [
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
modelConfig: {
|
modelConfig: {
|
||||||
model: "gpt-4",
|
model: "gpt-4o-mini",
|
||||||
temperature: 0.5,
|
temperature: 0.5,
|
||||||
max_tokens: 2000,
|
max_tokens: 2000,
|
||||||
presence_penalty: 0,
|
presence_penalty: 0,
|
||||||
|
@ -86,7 +86,7 @@ export const EN_MASKS: BuiltinMask[] = [
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
modelConfig: {
|
modelConfig: {
|
||||||
model: "gpt-3.5-turbo",
|
model: "gpt-4o-mini",
|
||||||
temperature: 0.5,
|
temperature: 0.5,
|
||||||
max_tokens: 2000,
|
max_tokens: 2000,
|
||||||
presence_penalty: 0,
|
presence_penalty: 0,
|
||||||
|
@ -118,7 +118,7 @@ export const EN_MASKS: BuiltinMask[] = [
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
modelConfig: {
|
modelConfig: {
|
||||||
model: "gpt-4",
|
model: "gpt-4o-mini",
|
||||||
temperature: 0.5,
|
temperature: 0.5,
|
||||||
max_tokens: 2000,
|
max_tokens: 2000,
|
||||||
presence_penalty: 0,
|
presence_penalty: 0,
|
||||||
|
|
|
@ -33,7 +33,7 @@ export const TW_MASKS: BuiltinMask[] = [
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
modelConfig: {
|
modelConfig: {
|
||||||
model: "gpt-3.5-turbo",
|
model: "gpt-4o-mini",
|
||||||
temperature: 1,
|
temperature: 1,
|
||||||
max_tokens: 2000,
|
max_tokens: 2000,
|
||||||
presence_penalty: 0,
|
presence_penalty: 0,
|
||||||
|
@ -59,7 +59,7 @@ export const TW_MASKS: BuiltinMask[] = [
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
modelConfig: {
|
modelConfig: {
|
||||||
model: "gpt-3.5-turbo",
|
model: "gpt-4o-mini",
|
||||||
temperature: 1,
|
temperature: 1,
|
||||||
max_tokens: 2000,
|
max_tokens: 2000,
|
||||||
presence_penalty: 0,
|
presence_penalty: 0,
|
||||||
|
@ -85,7 +85,7 @@ export const TW_MASKS: BuiltinMask[] = [
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
modelConfig: {
|
modelConfig: {
|
||||||
model: "gpt-3.5-turbo",
|
model: "gpt-4o-mini",
|
||||||
temperature: 1,
|
temperature: 1,
|
||||||
max_tokens: 2000,
|
max_tokens: 2000,
|
||||||
presence_penalty: 0,
|
presence_penalty: 0,
|
||||||
|
@ -111,7 +111,7 @@ export const TW_MASKS: BuiltinMask[] = [
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
modelConfig: {
|
modelConfig: {
|
||||||
model: "gpt-3.5-turbo",
|
model: "gpt-4o-mini",
|
||||||
temperature: 1,
|
temperature: 1,
|
||||||
max_tokens: 2000,
|
max_tokens: 2000,
|
||||||
presence_penalty: 0,
|
presence_penalty: 0,
|
||||||
|
@ -137,7 +137,7 @@ export const TW_MASKS: BuiltinMask[] = [
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
modelConfig: {
|
modelConfig: {
|
||||||
model: "gpt-3.5-turbo",
|
model: "gpt-4o-mini",
|
||||||
temperature: 1,
|
temperature: 1,
|
||||||
max_tokens: 2000,
|
max_tokens: 2000,
|
||||||
presence_penalty: 0,
|
presence_penalty: 0,
|
||||||
|
@ -163,7 +163,7 @@ export const TW_MASKS: BuiltinMask[] = [
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
modelConfig: {
|
modelConfig: {
|
||||||
model: "gpt-3.5-turbo",
|
model: "gpt-4o-mini",
|
||||||
temperature: 1,
|
temperature: 1,
|
||||||
max_tokens: 2000,
|
max_tokens: 2000,
|
||||||
presence_penalty: 0,
|
presence_penalty: 0,
|
||||||
|
@ -189,7 +189,7 @@ export const TW_MASKS: BuiltinMask[] = [
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
modelConfig: {
|
modelConfig: {
|
||||||
model: "gpt-3.5-turbo",
|
model: "gpt-4o-mini",
|
||||||
temperature: 1,
|
temperature: 1,
|
||||||
max_tokens: 2000,
|
max_tokens: 2000,
|
||||||
presence_penalty: 0,
|
presence_penalty: 0,
|
||||||
|
@ -215,7 +215,7 @@ export const TW_MASKS: BuiltinMask[] = [
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
modelConfig: {
|
modelConfig: {
|
||||||
model: "gpt-3.5-turbo",
|
model: "gpt-4o-mini",
|
||||||
temperature: 1,
|
temperature: 1,
|
||||||
max_tokens: 2000,
|
max_tokens: 2000,
|
||||||
presence_penalty: 0,
|
presence_penalty: 0,
|
||||||
|
@ -247,7 +247,7 @@ export const TW_MASKS: BuiltinMask[] = [
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
modelConfig: {
|
modelConfig: {
|
||||||
model: "gpt-3.5-turbo",
|
model: "gpt-4o-mini",
|
||||||
temperature: 0.5,
|
temperature: 0.5,
|
||||||
max_tokens: 2000,
|
max_tokens: 2000,
|
||||||
presence_penalty: 0,
|
presence_penalty: 0,
|
||||||
|
@ -273,7 +273,7 @@ export const TW_MASKS: BuiltinMask[] = [
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
modelConfig: {
|
modelConfig: {
|
||||||
model: "gpt-3.5-turbo",
|
model: "gpt-4o-mini",
|
||||||
temperature: 1,
|
temperature: 1,
|
||||||
max_tokens: 2000,
|
max_tokens: 2000,
|
||||||
presence_penalty: 0,
|
presence_penalty: 0,
|
||||||
|
@ -306,7 +306,7 @@ export const TW_MASKS: BuiltinMask[] = [
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
modelConfig: {
|
modelConfig: {
|
||||||
model: "gpt-3.5-turbo",
|
model: "gpt-4o-mini",
|
||||||
temperature: 1,
|
temperature: 1,
|
||||||
max_tokens: 2000,
|
max_tokens: 2000,
|
||||||
presence_penalty: 0,
|
presence_penalty: 0,
|
||||||
|
@ -339,7 +339,7 @@ export const TW_MASKS: BuiltinMask[] = [
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
modelConfig: {
|
modelConfig: {
|
||||||
model: "gpt-3.5-turbo",
|
model: "gpt-4o-mini",
|
||||||
temperature: 1,
|
temperature: 1,
|
||||||
max_tokens: 2000,
|
max_tokens: 2000,
|
||||||
presence_penalty: 0,
|
presence_penalty: 0,
|
||||||
|
@ -397,7 +397,7 @@ export const TW_MASKS: BuiltinMask[] = [
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
modelConfig: {
|
modelConfig: {
|
||||||
model: "gpt-3.5-turbo",
|
model: "gpt-4o-mini",
|
||||||
temperature: 1,
|
temperature: 1,
|
||||||
max_tokens: 2000,
|
max_tokens: 2000,
|
||||||
presence_penalty: 0,
|
presence_penalty: 0,
|
||||||
|
@ -429,7 +429,7 @@ export const TW_MASKS: BuiltinMask[] = [
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
modelConfig: {
|
modelConfig: {
|
||||||
model: "gpt-4",
|
model: "gpt-4o-mini",
|
||||||
temperature: 0.5,
|
temperature: 0.5,
|
||||||
max_tokens: 2000,
|
max_tokens: 2000,
|
||||||
presence_penalty: 0,
|
presence_penalty: 0,
|
||||||
|
|
|
@ -138,7 +138,7 @@ export function uploadImage(file: Blob): Promise<string> {
|
||||||
})
|
})
|
||||||
.then((res) => res.json())
|
.then((res) => res.json())
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
// console.log("res", res);
|
console.log("upload res", res);
|
||||||
if (res?.code == 0 && res?.data) {
|
if (res?.code == 0 && res?.data) {
|
||||||
return res?.data;
|
return res?.data;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue