mirror of
https://github.com/labring/FastGPT.git
synced 2025-08-06 15:36:21 +00:00
feat: v4
This commit is contained in:
@@ -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({
|
||||
|
@@ -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();
|
||||
|
@@ -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}` : ''
|
||||
}`}`
|
||||
|
Reference in New Issue
Block a user