李富豪 10 ماه پیش
والد
کامیت
6ddee1f1e5
3فایلهای تغییر یافته به همراه6 افزوده شده و 8 حذف شده
  1. 1 0
      app/client/platforms/bigmodel.ts
  2. 4 7
      app/components/chat.tsx
  3. 1 1
      app/components/sidebar.tsx

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

@@ -21,6 +21,7 @@ export class BigModelApi implements LLMApi {
 
   constructor() {
     this.baseURL = '/bigmodel-api';
+    // this.baseURL = 'http://xia0miduo.gicp.net:8091';// 流式调用
     this.apiPath = this.baseURL + '/bigmodel/api/model-api/sse-invoke';
   }
 

+ 4 - 7
app/components/chat.tsx

@@ -629,15 +629,12 @@ export function ChatActions(props: {
   useEffect(() => {
     setGuessList([]);
     const messages = session.messages.slice();
-    if (messages.length > 1) {
-      const backList = messages.reverse();
-      const item = backList.find(item => item.content && item.role === 'assistant')
-      if (!item) {
-        return
-      }
+    const backList = messages.reverse();
+    const item = backList.find(item => item.content && item.role === 'assistant')
+    if (item) {
       fetchGuessList(item)
     }
-  }, [session.messages]);
+  }, [session.messages.length]);
 
   return (
     <div className={styles["chat-input-actions"]}>

+ 1 - 1
app/components/sidebar.tsx

@@ -216,7 +216,7 @@ export function SideBarTail(props: {
 }
 
 export const SideBar = (props: { className?: string }) => {
-  useHotKey();
+  // useHotKey();
   const { onDragStart, shouldNarrow } = useDragSideBar();
   const [showPluginSelector, setShowPluginSelector] = useState(false);
   const navigate = useNavigate();