From 4e8cecd4ca733ba9356ba0e8df4b8da31eee286c Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期四, 17 十月 2024 15:51:55 +0800
Subject: [PATCH] fix

---
 app/service/ragflow.py |    2 +-
 app/api/chat.py        |    5 +++++
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/app/api/chat.py b/app/api/chat.py
index 7381aab..97babf6 100644
--- a/app/api/chat.py
+++ b/app/api/chat.py
@@ -56,6 +56,11 @@
                                 await websocket.send_json(result)
                                 await websocket.close()
                                 return
+                        else:
+                            chat_history.append({
+                                "content": message["message"],
+                                "role": "user"
+                            })
                     async for rag_response in ragflow_service.chat(token, chat_id, chat_history):
                         try:
                             print(f"Received from ragflow: {rag_response}")
diff --git a/app/service/ragflow.py b/app/service/ragflow.py
index d41a4da..4021866 100644
--- a/app/service/ragflow.py
+++ b/app/service/ragflow.py
@@ -59,7 +59,7 @@
 
         print(data)
         target_url = f"{self.base_url}/v1/conversation/completion"
-        async with httpx.AsyncClient(timeout=10.0) as client:
+        async with httpx.AsyncClient(timeout=300.0) as client:
             headers = {
                 'Content-Type': 'application/json',
                 'Authorization': token

--
Gitblit v1.8.0