| | |
| | | RAGFLOW = 1 |
| | | BISHENG = 2 |
| | | BASIC = 3 |
| | | DIFY = 4 |
| | | |
| | | |
| | | class AgentModel(Base): |
| | |
| | | |
| | | |
| | | class CanvasModel(Base): |
| | | __tablename__ = 'user_canvas' |
| | | __mapper_args__ = { |
| | | # "order_by": 'SEQ' |
| | | } |
| | | id = Column(String(32), primary_key=True) |
| | | create_time = Column(BigInteger) |
| | | __tablename__ = 'canvas' |
| | | |
| | | id = Column(String(32), primary_key=True) # id |
| | | create_date = Column(DateTime, default=datetime.now) |
| | | update_time = Column(BigInteger) |
| | | update_date = Column(DateTime, default=datetime.now) |
| | | avatar = Column(Text) |
| | | user_id = Column(String(255)) |
| | | title = Column(String(255)) |
| | | description = Column(Text) |
| | | canvas_type = Column(String(32)) |
| | | avatar = Column(Text) # 图标 |
| | | user_id = Column(String(255)) # 用户id |
| | | title = Column(String(255)) # 标题 |
| | | description = Column(Text) # 说明 |
| | | canvas_type = Column(String(32)) # agent类型 |
| | | dsl = Column(Text) |
| | | agent_type = Column(String(2)) # agent平台 |
| | | |
| | | |
| | | |
| | |
| | | def to_json(self): |
| | | return { |
| | | 'id': self.id, |
| | | 'create_time': self.create_time, |
| | | 'create_date': self.create_date, |
| | | 'update_time': self.update_time, |
| | | 'update_date': self.update_date, |
| | | 'avatar': self.avatar, |
| | | 'user_id': self.user_id, |
| | |
| | | |
| | | @staticmethod |
| | | def is_type(record_id, t): |
| | | record = UnifiedAgent.get_by_id(record_id) |
| | | return record and record.type == t |
| | | record = UnifiedAgentModel.get_by_id(record_id) |
| | | return record and record.type == t |
| | | |
| | | |