zhaoqingang
2024-11-25 1ab90de913405b45050e0f732a03004087134fda
app/api/agent.py
@@ -64,6 +64,12 @@
        result = [item.to_dict() for item in records]
        return ResponseList(code=200, msg="", data=result)
    elif agent.agent_type == AgentType.DIFY:
        offset = (page - 1) * limit
        records = db.query(SessionModel).filter(SessionModel.agent_id == agent_id, SessionModel.tenant_id==current_user.id).order_by(SessionModel.create_date.desc()).offset(offset).limit(limit).all()
        result = [item.to_dict() for item in records]
        return ResponseList(code=200, msg="", data=result)
    else:
        return ResponseList(code=200, msg="Unsupported agent type")