李富豪 hai 6 meses
pai
achega
2d1f8c15d7

+ 15 - 2
app/client/platforms/bigModel.ts

@@ -108,7 +108,7 @@ export class BigModelApi implements LLMApi {
       };
 
       controller.signal.onabort = finish;
-
+      let start = true;
       fetchEventSource(chatPath, {
         ...chatPayload,
         async onopen(res: any) {
@@ -145,11 +145,13 @@ export class BigModelApi implements LLMApi {
             return finish();
           }
         },
-        onmessage: (msg) => {
+        onmessage: async (msg) => {
           const info = JSON.parse(msg.data);
           if (info.event === 'finish') {
+            start = true;
             return finish();
           }
+
           // 获取当前的数据
           const currentData = info.data;
           const formatStart = '```think';
@@ -162,6 +164,17 @@ export class BigModelApi implements LLMApi {
           } else {
             remainText += currentData;
           }
+
+          const chatMode = useChatStore.getState().chatMode;
+          if (chatMode === 'LOCAL' && start) {// 切片
+            start = false;
+            const res: any = await api.get(`deepseek/api/slice/search/${info.id}`);
+            const sliceInfo = {
+              ...res.data,
+            }
+            delete sliceInfo.code;
+            console.log(sliceInfo, 'sliceInfo');
+          }
         },
         async onclose() {
           finish();

+ 12 - 12
app/components/DeekSeekHome.tsx

@@ -20,18 +20,18 @@ const DeekSeek: React.FC = () => {
     React.useEffect(() => {
         chatStore.clearSessions();
         setList([
-            // {
-            //     title: '智能问答',
-            //     onClick: () => {
-            //         navigate({ pathname: '/deepseekChat' })
-            //     }
-            // },
-            // {
-            //     title: '知识库问答',
-            //     onClick: () => {
-            //         navigate({ pathname: '/knowledgeChat' })
-            //     }
-            // },
+            {
+                title: '智能问答',
+                onClick: () => {
+                    navigate({ pathname: '/deepseekChat' })
+                }
+            },
+            {
+                title: '知识库问答',
+                onClick: () => {
+                    navigate({ pathname: '/knowledgeChat' })
+                }
+            },
             {
                 title: '数字系统答疑',
                 onClick: () => {

+ 7 - 6
app/components/DeepSeekChat.tsx

@@ -1369,7 +1369,7 @@ function _Chat() {
   return (
     <div className={styles.chat} key={session.id}>
       {
-        isMobileScreen &&
+        isMobileScreen && location.pathname !== '/' &&
         <div className="window-header" data-tauri-drag-region>
           <div style={{ display: 'flex', alignItems: 'center' }}
             className={`window-header-title ${styles["chat-body-title"]}`}>
@@ -1634,7 +1634,7 @@ function _Chat() {
                   display: 'flex',
                   justifyContent: 'center',
                   alignItems: 'center',
-                  marginRight: 20,
+                  marginRight: 10,
                   cursor: 'pointer',
                   background: isDeepThink ? '#dee9fc' : '#f3f4f6',
                   color: isDeepThink ? '#3875f6' : '#000000',
@@ -1650,8 +1650,8 @@ function _Chat() {
                 <img
                   src={isDeepThink ? sdsk_selected.src : sdsk.src}
                   style={{
+                    width: 18,
                     height: 18,
-
                   }}
                 />
                 <div style={{ marginLeft: 5 }}>
@@ -1675,7 +1675,8 @@ function _Chat() {
               <img
                 src={hlw.src}
                 style={{
-                  height: 18
+                  width: 18,
+                  height: 18,
                 }}
               />
               <div style={{ marginLeft: 5 }}>
@@ -1684,7 +1685,7 @@ function _Chat() {
             </div>
           </div>
           <div style={{ display: 'flex', alignItems: 'center' }}>
-            <div style={{ marginRight: 20 }}>
+            <div style={{ marginRight: 10 }}>
               <Upload
                 {...uploadConfig}
                 showUploadList={false}
@@ -1806,7 +1807,7 @@ function _Chat() {
           />
         )
       }
-    </div>
+    </div >
   );
 }
 

+ 2 - 2
app/components/chat.tsx

@@ -1003,8 +1003,8 @@ function _Chat() {
   const [loading, setLoading] = useState<boolean>(false);
 
   const fruits = [
-    { id: 'ONLINE', name: '智谱AI' },
     { id: 'LOCAL', name: 'deepseek' },
+    { id: 'ONLINE', name: '智谱AI' },
   ];
 
   const [selectedFruit, setSelectedFruit] = React.useState(chatStore.chatMode);
@@ -1716,7 +1716,7 @@ function _Chat() {
                 <IconButton
                   icon={<ExportIcon />}
                   bordered
-                  title={Locale.Chat.Actions.Export}
+                  title='分享该应用'
                 />
               </Popover>
             </div>

+ 0 - 4
app/styles/window.scss

@@ -13,10 +13,6 @@
   // 上方线条
   // border-bottom: 1px solid rgba(55, 155, 255, 0.5);
   border-bottom: 1px solid #dedede;
-
-  @media (max-width: 768px) {
-    display: none; // 解决DeepSeekHome Chat窗口在窄屏下出现window-header的问题
-  }
 }
 
 .window-header-title {

+ 1 - 1
next.config.mjs

@@ -92,7 +92,7 @@ if (mode !== "export") {
       },
       {
         source: "/bigmodel-api/:path*",
-        destination: "http://xia0miduo.gicp.net:8091/:path*",
+        destination: "http://xia0miduo.gicp.net:8401/:path*",
       },
       {
         source: "/deepseek-api/:path*",