李富豪 9 miesięcy temu
rodzic
commit
a011d5fe8a

+ 3 - 1
app/client/platforms/bigModel.ts

@@ -152,11 +152,13 @@ export class BigModelApi implements LLMApi {
         async onclose() {
           finish();
           const session = useChatStore.getState().sessions[0];
+          const item = session.messages.find(item => item.role === 'user');
+          const dialogName = item ? item.content : '新的聊天';
           const data = {
             id: session.id,
             appId: session.appId,
             userId: undefined,
-            dialogName: session.topic,
+            dialogName: dialogName,
             messages: session.messages.map(item => ({
               id: item.id,
               date: item.date,

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

@@ -154,11 +154,13 @@ export class DeepSeekApi implements LLMApi {
         async onclose() {
           finish();
           const session = useChatStore.getState().sessions[0];
+          const item = session.messages.find(item => item.role === 'user');
+          const dialogName = item ? item.content : '新的聊天';
           const data = {
             id: session.id,
             appId: session.appId,
             userId: undefined,
-            dialogName: session.topic,
+            dialogName: dialogName,
             messages: session.messages.map(item => ({
               id: item.id,
               date: item.date,

+ 6 - 3
app/components/chat.tsx

@@ -969,6 +969,7 @@ function _Chat() {
   type AppList = {
     label: string,
     value: string,
+    desc: string,
   }[];
 
   const [appList, setAppList] = useState<AppList>([]);
@@ -987,6 +988,7 @@ function _Chat() {
         return {
           label: item.name,
           value: item.appId,
+          desc: item.desc,
         }
       })
       setAppList(list);
@@ -1859,11 +1861,12 @@ function _Chat() {
                 <h1 style={{ textAlign: 'center' }}>
                   {getAppName()}
                 </h1>
-                <p style={{ textAlign: 'center' }}>创建人: admin</p>
-                <p style={{ textAlign: 'center' }}>
+                {/* <p style={{ textAlign: 'center' }}>
                   您好,欢迎使用建科·小智使用知识库创建的{getAppName()}
+                </p> */}
+                <p style={{ textAlign: 'center' }}>
+                  {appValue ? appList.find(item => item.value)?.desc : ''}
                 </p>
-                <p style={{ textAlign: 'center' }}>如果需要问本企业相关的其他问题请点击左上角,选中切换的知识库问答应用使用</p>
                 <p>我猜您可能想问:</p>
                 {
                   questionList.map((item, index) => {