zhaoqingang
2024-11-13 3f6b4007979dc56d266e3202f28a741d93300b31
app/models/group_model.py
@@ -19,7 +19,7 @@
group_agent_table = Table('group_agent', Base.metadata
                           , Column('group_id', Integer, ForeignKey('group.id', ondelete='CASCADE'))
                           , Column('agent_id', String(36), ForeignKey('user_canvas.id', ondelete='CASCADE')))
                           , Column('agent_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'))
@@ -38,6 +38,7 @@
    status = Column(String(10), nullable=False, default="1")
    created_at = Column(DateTime, default=datetime.now())
    updated_at = Column(DateTime, default=datetime.now(), onupdate=datetime.now())
    creator = Column(Integer)
    knowledges = relationship('KnowledgeModel',
@@ -79,8 +80,8 @@
    def __repr__(self):
        return '<Role name:%r description:%r iconCls:%r seq:%r>\n' \
            % (self.NAME, self.DESCRIPTION, self.ICONCLS, self.SEQ)
        return '<Role name:%r description:%r>\n' \
            % (self.group_name, self.group_description)
    def to_json(self):
        json = {
@@ -129,3 +130,10 @@
    id: int
    user_list: list
class GroupResource(BaseModel):
    id: int
    agents: list
    dialogs: list
    knowledges: list