sunsheng 2 місяців тому
батько
коміт
37410bb7ad

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

@@ -23,7 +23,7 @@ export class DeepSeekApi implements LLMApi {
     // this.baseURL = 'http://192.168.3.209:18078';
     this.baseURL = '/deepseek-api';
     // this.apiPath = this.baseURL + '/vllm/ai/chat';//线上地址
-  this.apiPath = this.baseURL + '/vllm/chat'; // 测试地址 
+    this.apiPath = this.baseURL + '/vllm/chat'; // 测试地址 
   }
 
   async chat(options: ChatOptions) {

+ 2 - 0
app/components/chat.tsx

@@ -1980,6 +1980,7 @@ function _Chat() {
           setAutoScroll(false);
         }}
       >
+        {/* 这里是具体的聊天框 */}
         {
           messages.length > 1 ?
             <>
@@ -2156,6 +2157,7 @@ function _Chat() {
                           </div>
                         }
                         <div className={styles["chat-message-item"]}>
+                          {JSON.stringify(message)}
                           <Markdown
                             key={message.streaming ? "loading" : "done"}
                             content={getMessageTextContent(message)}

+ 7 - 1
app/components/markdown.tsx

@@ -215,6 +215,7 @@ function _MarkDownContent(props: { content: string }) {
       components={{
         pre: PreCode,
         code: ({ className, children }) => {
+          // console.log('className, children-----3',className, children)
           if (className && className.includes('language-think')) {
             return (
               <code style={{ whiteSpace: 'pre-wrap', background: '#f3f4f6', color: '#525252' }}>
@@ -225,14 +226,19 @@ function _MarkDownContent(props: { content: string }) {
             return children;
           }
         },
-        p: (pProps) => <p {...pProps} dir="auto" />,
+        p: (pProps) => {
+          // console.log('pProps-----2',pProps)
+         return <p {...pProps} dir="auto" />
+        },
         a: (aProps) => {
+          // console.log('aProps-----4',aProps)
           const href = aProps.href || "";
           const isInternal = /^\/#/i.test(href);
           const target = isInternal ? "_self" : aProps.target ?? "_blank";
           return <a {...aProps} target={target} />;
         },
         img: ({ src, alt }) => (
+          // console.log('src, alt-----5',src, alt),
           <div style={{ width: '100%', height: 'auto', cursor: 'pointer' }}>
             <Image
               width='80%'