李富豪 7 kuukautta sitten
vanhempi
commit
45b29050a8
3 muutettua tiedostoa jossa 48 lisäystä ja 24 poistoa
  1. 1 0
      app/client/platforms/deepSeek.ts
  2. 6 0
      app/components/DeepSeekChat.tsx
  3. 41 24
      app/components/sidebar.tsx

+ 1 - 0
app/client/platforms/deepSeek.ts

@@ -184,6 +184,7 @@ export class DeepSeekApi implements LLMApi {
               date: item.date,
               role: item.role,
               content: item.content,
+              document: item.document,
             })),
           };
           if (session.appId) {

+ 6 - 0
app/components/DeepSeekChat.tsx

@@ -1370,6 +1370,12 @@ function _Chat() {
                         )}
                       </div>
                     </div>
+                    {/* {
+                      isUser && message.document && message.document.url &&
+                      <div>
+                        {message.document.url}
+                      </div>
+                    } */}
                     {/* {showTyping && (
                       <div className={styles["chat-message-status"]}>
                         正在输入…

+ 41 - 24
app/components/sidebar.tsx

@@ -221,14 +221,10 @@ export const SideBar = (props: { className?: string }) => {
       let url = '';
       if (getType() === 'bigModel') {
         const appId = globalStore.selectedAppId;
-        if (chatMode) {
-          if (chatMode === 'LOCAL') {
-            url = `/bigmodel/api/dialog/list/${appId}`;
-          } else {
-            url = `/takai/api/dialog/list/${appId}`;
-          }
-        } else {
+        if (chatMode === 'LOCAL') {
           url = `/bigmodel/api/dialog/list/${appId}`;
+        } else {
+          url = `/takai/api/dialog/list/${appId}`;
         }
       } else {
         const appId = '1881269958412521255';
@@ -276,12 +272,17 @@ export const SideBar = (props: { className?: string }) => {
                 label: (
                   <a onClick={async () => {
                     try {
-                      if (chatMode === 'LOCAL') {
+                      if (getType() === 'bigModel') {
+                        if (chatMode === 'LOCAL') {
+                          await api.delete(`/bigmodel/api/dialog/del/${child.key}`);
+                          await fetchChatList();
+                        } else {
+                          await api.delete(`/takai/api/dialog/del/${child.key}`);
+                          await fetchChatList(chatMode);
+                        }
+                      } else {
                         await api.delete(`/bigmodel/api/dialog/del/${child.key}`);
                         await fetchChatList();
-                      } else {
-                        await api.delete(`/takai/api/dialog/del/${child.key}`);
-                        await fetchChatList(chatMode);
                       }
                       chatStore.clearSessions();
                       useChatStore.setState({
@@ -377,10 +378,14 @@ export const SideBar = (props: { className?: string }) => {
               } else {
                 navigate({ pathname: '/newDeepseekChat' });
               }
-              if (chatStore.chatMode === 'LOCAL') {
-                await fetchChatList();
+              if (getType() === 'bigModel') {
+                if (chatStore.chatMode === 'LOCAL') {
+                  await fetchChatList();
+                } else {
+                  await fetchChatList(chatStore.chatMode);
+                }
               } else {
-                await fetchChatList(chatStore.chatMode);
+                await fetchChatList();
               }
             }}
           >
@@ -392,10 +397,14 @@ export const SideBar = (props: { className?: string }) => {
         style={{ border: 'none' }}
         onClick={async ({ key }) => {
           let url = ``;
-          if (chatStore.chatMode === 'LOCAL') {
-            url = `/bigmodel/api/dialog/detail/${key}`;
+          if (getType() === 'bigModel') {
+            if (chatStore.chatMode === 'LOCAL') {
+              url = `/bigmodel/api/dialog/detail/${key}`;
+            } else {
+              url = `/takai/api/dialog/detail/${key}`;
+            }
           } else {
-            url = `/takai/api/dialog/detail/${key}`;
+            url = `/bigmodel/api/dialog/detail/${key}`;
           }
           const res = await api.get(url);
           const list = res.data.map(((item: any) => {
@@ -438,18 +447,26 @@ export const SideBar = (props: { className?: string }) => {
           form.validateFields().then(async (values) => {
             setModalOpen(false);
             try {
-              if (chatStore.chatMode === 'LOCAL') {
+              if (getType() === 'bigModel') {
+                if (chatStore.chatMode === 'LOCAL') {
+                  await api.put(`/bigmodel/api/dialog/update`, {
+                    id: values.dialogId,
+                    dialogName: values.dialogName
+                  });
+                  await fetchChatList();
+                } else {
+                  await api.put(`/takai/api/dialog/update`, {
+                    id: values.dialogId,
+                    dialogName: values.dialogName
+                  });
+                  await fetchChatList(chatStore.chatMode);
+                }
+              } else {
                 await api.put(`/bigmodel/api/dialog/update`, {
                   id: values.dialogId,
                   dialogName: values.dialogName
                 });
                 await fetchChatList();
-              } else {
-                await api.put(`/takai/api/dialog/update`, {
-                  id: values.dialogId,
-                  dialogName: values.dialogName
-                });
-                await fetchChatList(chatStore.chatMode);
               }
               chatStore.updateCurrentSession((value) => {
                 value.topic = values.dialogName;