对话线程模型
| 3 | from db.base import Base |
| 4 | |
| 5 | class ThreadModel(Base): |
| 6 | """ |
| 7 | 对话线程模型 |
| 8 | """ |
| 9 | __tablename__ = "threads" |
| 10 | |
| 11 | id = Column(UUID(as_uuid=False), primary_key=True, comment="线程ID") |
| 12 | createdAt = Column(String(50), name="createdAt", comment="创建时间") |
| 13 | name = Column(String(255), comment="线程名称") |
| 14 | userId = Column(UUID(as_uuid=False), ForeignKey("users.id", ondelete="CASCADE"), name="userId", comment="用户ID") |
| 15 | userIdentifier = Column(String(255), name="userIdentifier", comment="用户标识符") |
| 16 | tags = Column(JSONB, comment="标签") |
| 17 | metadata_ = Column(JSONB, name="metadata", comment="元数据") |
| 18 | |
| 19 | def __repr__(self): |
| 20 | return f"<Thread(id='{self.id}', name='{self.name}', userId='{self.userId}', createdAt='{self.createdAt}')>" |
nothing calls this directly
no outgoing calls
no test coverage detected