Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
refactor: migrate MessageAnnotation to TypeBase (#34807)
sxxtony98e74c8fde63
diff --git a/api/models/model.py b/api/models/model.pyindex 365564d7845..47b096d0bf6 100644--- a/api/models/model.py+++ b/api/models/model.py@@ -1078,7 +1078,7 @@ class Conversation(Base):messages = db.relationship("Message", backref="conversation", lazy="select", passive_deletes="all")message_annotations = db.relationship(- "MessageAnnotation", backref="conversation", lazy="select", passive_deletes="all"+ lambda: MessageAnnotation, backref="conversation", lazy="select", passive_deletes="all")is_deleted: Mapped[bool] = mapped_column(sa.Boolean, nullable=False, server_default=sa.text("false"))@@ -1837,7 +1837,7 @@ class MessageFile(TypeBase):)-class MessageAnnotation(Base):+class MessageAnnotation(TypeBase):__tablename__ = "message_annotations"__table_args__ = (sa.PrimaryKeyConstraint("id", name="message_annotation_pkey"),@@ -1846,17 +1846,25 @@ class MessageAnnotation(Base):sa.Index("message_annotation_message_idx", "message_id"),)- id: Mapped[str] = mapped_column(StringUUID, default=lambda: str(uuid4()))+ id: Mapped[str] = mapped_column(+ StringUUID, insert_default=lambda: str(uuid4()), default_factory=lambda: str(uuid4()), init=False+ )app_id: Mapped[str] = mapped_column(StringUUID)- conversation_id: Mapped[str | None] = mapped_column(StringUUID, sa.ForeignKey("conversations.id"))- message_id: Mapped[str | None] = mapped_column(StringUUID)question: Mapped[str] = mapped_column(LongText, nullable=False)content: Mapped[str] = mapped_column(LongText, nullable=False)- hit_count: Mapped[int] = mapped_column(sa.Integer, nullable=False, server_default=sa.text("0"))account_id: Mapped[str] = mapped_column(StringUUID, nullable=False)- created_at: Mapped[datetime] = mapped_column(sa.DateTime, nullable=False, server_default=func.current_timestamp())+ conversation_id: Mapped[str | None] = mapped_column(StringUUID, sa.ForeignKey("conversations.id"), default=None)+ message_id: Mapped[str | None] = mapped_column(StringUUID, default=None)+ hit_count: Mapped[int] = mapped_column(sa.Integer, nullable=False, server_default=sa.text("0"), default=0)+ created_at: Mapped[datetime] = mapped_column(+ sa.DateTime, nullable=False, server_default=func.current_timestamp(), init=False+ )updated_at: Mapped[datetime] = mapped_column(- sa.DateTime, nullable=False, server_default=func.current_timestamp(), onupdate=func.current_timestamp()+ sa.DateTime,+ nullable=False,+ server_default=func.current_timestamp(),+ onupdate=func.current_timestamp(),+ init=False,)@property