zhaoqingang
2025-03-28 226202d6eee6480f3386c6295be26fad42940cc8
app/models/session_model.py
@@ -20,10 +20,11 @@
    agent_id = Column(String(255))
    agent_type = Column(SQLAlchemyEnum(AgentType), nullable=False)  # 目前只存basic的,ragflow和bisheng的调接口获取
    create_date = Column(DateTime, default=current_time)  # 创建时间,默认值为当前时区时间
    update_date = Column(DateTime, default=current_time, onupdate=current_time)  # 更新时间,默认值为当前时区时间,更新时自动更新
    update_date = Column(DateTime, default=current_time, onupdate=current_time, index=True)  # 更新时间,默认值为当前时区时间,更新时自动更新
    tenant_id = Column(Integer)  # 创建人
    message = Column(TEXT)  # 说明
    conversation_id = Column(String(64))
    workflow = Column(Integer, default=0)
    # to_dict 方法
    def to_dict(self):
@@ -32,6 +33,7 @@
            'name': self.name,
            'agent_type': self.agent_type,
            'agent_id': self.agent_id,
            'workflow': self.workflow if self.workflow else 0,
            'create_date': self.create_date.strftime("%Y-%m-%d %H:%M:%S"),
            'update_date': self.update_date.strftime("%Y-%m-%d %H:%M:%S"),
        }