| | |
| | | , Column('group_id', Integer, ForeignKey('group.id', ondelete='CASCADE')) |
| | | , Column('dialog_id', String(36), ForeignKey('dialogs.id', ondelete='CASCADE'))) |
| | | |
| | | group_agent_table = Table('group_agent', Base.metadata |
| | | group_agent_table = Table('group_canvas', Base.metadata |
| | | , Column('group_id', Integer, ForeignKey('group.id', ondelete='CASCADE')) |
| | | , Column('agent_id', String(36), ForeignKey('canvas.id', ondelete='CASCADE'))) |
| | | , Column('canvas_id', String(36), ForeignKey('canvas.id', ondelete='CASCADE'))) |
| | | |
| | | group_llm_table = Table('group_llm', Base.metadata |
| | | , Column('group_id', Integer, ForeignKey('group.id', ondelete='CASCADE')) |
| | |
| | | created_at = Column(DateTime, default=datetime.now()) |
| | | updated_at = Column(DateTime, default=datetime.now(), onupdate=datetime.now()) |
| | | creator = Column(Integer) |
| | | group_type = Column(Integer, default=1) |
| | | |
| | | |
| | | knowledges = relationship('KnowledgeModel', |
| | |
| | | |
| | | agents = relationship('CanvasModel', |
| | | secondary=group_agent_table, |
| | | backref=backref('groups', lazy='dynamic'), |
| | | lazy="dynamic") |
| | | backref=backref('groups', lazy='dynamic')) |
| | | |
| | | llms = relationship('CommonLlmModel', |
| | | secondary=group_llm_table, |
| | | backref=backref('groups', lazy='dynamic'), |
| | | lazy="dynamic") |
| | | backref=backref('groups', lazy='dynamic')) |
| | | |
| | | unified_agents = relationship('UnifiedAgentModel', |
| | | secondary=group_unified_agent_table, |
| | | backref=backref('roles', lazy='dynamic'), |
| | | lazy="dynamic") |
| | | backref=backref('groups', lazy='dynamic')) |
| | | def to_dict(self): |
| | | return { |
| | | 'groupId': self.id, |
| | |
| | | id: int |
| | | user_list: list |
| | | |
| | | |
| | | class GroupResource(BaseModel): |
| | | id: int |
| | | agents: list |
| | | dialogs: list |
| | | knowledges: list |
| | | |