From ce9fb375be9a551b4cdc5cb78a759fbcea1eac22 Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期四, 21 十一月 2024 20:13:04 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.5.5:10010/r/rag-gateway
---
app/api/agent.py | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/app/api/agent.py b/app/api/agent.py
index af36024..fe6e6c0 100644
--- a/app/api/agent.py
+++ b/app/api/agent.py
@@ -60,7 +60,7 @@
elif agent.agent_type == AgentType.BASIC:
offset = (page - 1) * limit
- records = db.query(SessionModel).filter(SessionModel.agent_id == agent_id).offset(offset).limit(limit).all()
+ records = db.query(SessionModel).filter(SessionModel.agent_id == agent_id, SessionModel.tenant_id==current_user.id).offset(offset).limit(limit).all()
result = [item.to_dict() for item in records]
return ResponseList(code=200, msg="", data=result)
@@ -140,8 +140,8 @@
except Exception as e:
raise HTTPException(status_code=500, detail=str(e))
elif agent.agent_type == AgentType.BASIC:
- session = db.query(SessionModel).filter(SessionModel.agent_id == agent_id, SessionModel.tenant_id==current_user.id).first()
- return JSONResponse(status_code=200, content={"code": 200, "data": session.log_to_json()})
+ session = db.query(SessionModel).filter(SessionModel.id == conversation_id).first()
+ return JSONResponse(status_code=200, content={"code": 200, "data": session.log_to_json() if session else {}})
else:
return JSONResponse(status_code=200, content={"code": 200, "log": "Unsupported agent type"})
--
Gitblit v1.8.0