From f5f6ab74044362e44262c39b1b6e2a88a36e0f91 Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期四, 17 十月 2024 11:11:10 +0800 Subject: [PATCH] ragflow发送消息前查找消息历史并放到消息里 --- app/models/agent_model.py | 20 ++++++++++++++++---- 1 files changed, 16 insertions(+), 4 deletions(-) diff --git a/app/models/agent_model.py b/app/models/agent_model.py index 1b2bdb2..f247db9 100644 --- a/app/models/agent_model.py +++ b/app/models/agent_model.py @@ -1,15 +1,27 @@ from enum import IntEnum -from sqlalchemy import Column, String, Enum as SQLAlchemyEnum +from sqlalchemy import Column, String, Enum as SQLAlchemyEnum, Integer from app.models.base_model import Base class AgentType(IntEnum): RAGFLOW = 1 BISHENG = 2 + BASIC = 3 class AgentModel(Base): __tablename__ = "agent" - id = Column(String(255), primary_key=True, index=True) - name = Column(String(255), index=True) - agent_type = Column(SQLAlchemyEnum(AgentType), nullable=False) # 1 ragflow 2 bisheng + id = Column(String(255), primary_key=True) + name = Column(String(255)) + sort = Column(Integer, default=0, nullable=False) + agent_type = Column(SQLAlchemyEnum(AgentType), nullable=False) + type = Column(String(255), nullable=False) + + # to_dict 鏂规硶 + def to_dict(self): + return { + 'id': self.id, + 'name': self.name, + 'agent_type': self.agent_type, + 'type': self.type + } -- Gitblit v1.8.0