From cfb8a353c72f96494cd46a78bd917f6ed8aaef1d Mon Sep 17 00:00:00 2001
From: zhaoqingang <zhaoqg0118@163.com>
Date: 星期三, 20 十一月 2024 17:01:07 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.5.5:10010/r/rag-gateway

---
 app/api/chat.py |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/app/api/chat.py b/app/api/chat.py
index a42c819..5e6f1da 100644
--- a/app/api/chat.py
+++ b/app/api/chat.py
@@ -14,6 +14,7 @@
 from app.service.basic import BasicService
 from app.service.ragflow import RagflowService
 from app.service.service_token import get_bisheng_token, get_ragflow_token
+from app.service.session import SessionService
 
 router = APIRouter()
 
@@ -203,6 +204,12 @@
                 # 鎺ユ敹鍓嶇娑堟伅
                 message = await websocket.receive_json()
                 question = message.get("message")
+                SessionService(db).create_session(
+                    session_id=chat_id,
+                    name=question,
+                    agent_id=agent_id,
+                    agent_type=AgentType.BASIC
+                )
                 if not question:
                     await websocket.send_json({"message": "Invalid request", "type": "error"})
                     continue
@@ -220,7 +227,7 @@
                             data = json.loads(text)
                             output = data.get("output", "")
                             excel_name = data.get("excel_name", "")
-                            image_name = data.get("excel_name", "")
+                            image_name = data.get("image_name", "")
                             excel_url = None
                             image_url = None
                             if excel_name:

--
Gitblit v1.8.0