This commit is contained in:
archer
2023-07-01 13:09:02 +08:00
parent 4c54e1821b
commit 9bdd5f522d
85 changed files with 4738 additions and 1236 deletions

View File

@@ -54,11 +54,8 @@ const PcSliderBar = ({
}>();
const { history, loadHistory } = useChatStore();
const { myModels, myCollectionModels, loadMyModels } = useUserStore();
const models = useMemo(
() => [...myModels, ...myCollectionModels],
[myCollectionModels, myModels]
);
const { myApps, myCollectionApps, loadMyModels } = useUserStore();
const models = useMemo(() => [...myApps, ...myCollectionApps], [myCollectionApps, myApps]);
// custom title edit
const { onOpenModal, EditModal: EditTitleModal } = useEditInfo({

View File

@@ -35,13 +35,10 @@ const PhoneSliderBar = ({
}) => {
const router = useRouter();
const [currentTab, setCurrentTab] = useState(TabEnum.app);
const { myModels, myCollectionModels, loadMyModels } = useUserStore();
const { myApps, myCollectionApps, loadMyModels } = useUserStore();
const { isOpen: isOpenWx, onOpen: onOpenWx, onClose: onCloseWx } = useDisclosure();
const models = useMemo(
() => [...myModels, ...myCollectionModels],
[myCollectionModels, myModels]
);
const models = useMemo(() => [...myApps, ...myCollectionApps], [myCollectionApps, myApps]);
useQuery(['loadModels'], () => loadMyModels(false));
const { history, loadHistory } = useChatStore();

View File

@@ -175,7 +175,7 @@ const Chat = () => {
const messages = adaptChatItem_openAI({ messages: prompts, reserveId: true });
// 流请求,获取数据
const { newChatId, quoteLen, errMsg } = await streamFetch({
const { newChatId, errMsg } = await streamFetch({
data: {
messages,
chatId,
@@ -203,6 +203,7 @@ const Chat = () => {
return;
}
// save chat
if (newChatId) {
setForbidLoadChatData(true);
router.replace(`/chat?modelId=${modelId}&chatId=${newChatId}`);
@@ -219,7 +220,7 @@ const Chat = () => {
return {
...item,
status: 'finish',
quoteLen,
quoteLen: 0,
systemPrompt: `${chatData.systemPrompt}${`${
chatData.limitPrompt ? `\n\n${chatData.limitPrompt}` : ''
}`}`