diff --git a/api/models/model.py b/api/models/model.py index 45b48c623b..2536f1e214 100644 --- a/api/models/model.py +++ b/api/models/model.py @@ -74,24 +74,24 @@ class App(Base): __tablename__ = "apps" __table_args__ = (db.PrimaryKeyConstraint("id", name="app_pkey"), db.Index("app_tenant_id_idx", "tenant_id")) - id = mapped_column(StringUUID, server_default=db.text("uuid_generate_v4()")) - tenant_id: Mapped[str] = mapped_column(StringUUID, nullable=False) - name = mapped_column(db.String(255), nullable=False) - description = mapped_column(db.Text, nullable=False, server_default=db.text("''::character varying")) - mode: Mapped[str] = mapped_column(db.String(255), nullable=False) + id: Mapped[str] = mapped_column(StringUUID, server_default=db.text("uuid_generate_v4()")) + tenant_id: Mapped[str] = mapped_column(StringUUID) + name: Mapped[str] = mapped_column(db.String(255)) + description: Mapped[str] = mapped_column(db.Text, server_default=db.text("''::character varying")) + mode: Mapped[str] = mapped_column(db.String(255)) icon_type = mapped_column(db.String(255), nullable=True) # image, emoji - icon = mapped_column(db.String(255)) - icon_background = mapped_column(db.String(255)) + icon: Mapped[str] = mapped_column(db.String(255)) + icon_background: Mapped[str] = mapped_column(db.String(255)) app_model_config_id = mapped_column(StringUUID, nullable=True) workflow_id = mapped_column(StringUUID, nullable=True) - status = mapped_column(db.String(255), nullable=False, server_default=db.text("'normal'::character varying")) - enable_site = mapped_column(db.Boolean, nullable=False) - enable_api = mapped_column(db.Boolean, nullable=False) - api_rpm = mapped_column(db.Integer, nullable=False, server_default=db.text("0")) - api_rph = mapped_column(db.Integer, nullable=False, server_default=db.text("0")) - is_demo = mapped_column(db.Boolean, nullable=False, server_default=db.text("false")) - is_public = mapped_column(db.Boolean, nullable=False, server_default=db.text("false")) - is_universal = mapped_column(db.Boolean, nullable=False, server_default=db.text("false")) + status: Mapped[str] = mapped_column(db.String(255), server_default=db.text("'normal'::character varying")) + enable_site: Mapped[bool] = mapped_column(db.Boolean) + enable_api: Mapped[bool] = mapped_column(db.Boolean) + api_rpm: Mapped[int] = mapped_column(db.Integer, server_default=db.text("0")) + api_rph: Mapped[int] = mapped_column(db.Integer, server_default=db.text("0")) + is_demo: Mapped[bool] = mapped_column(db.Boolean, server_default=db.text("false")) + is_public: Mapped[int] = mapped_column(db.Boolean, server_default=db.text("false")) + is_universal: Mapped[int] = mapped_column(db.Boolean, server_default=db.text("false")) tracing = mapped_column(db.Text, nullable=True) max_active_requests: Mapped[Optional[int]] = mapped_column(nullable=True) created_by = mapped_column(StringUUID, nullable=True) @@ -1326,7 +1326,7 @@ class MessageAnnotation(Base): app_id: Mapped[str] = mapped_column(StringUUID) conversation_id: Mapped[Optional[str]] = mapped_column(StringUUID, db.ForeignKey("conversations.id")) message_id: Mapped[Optional[str]] = mapped_column(StringUUID) - question: Mapped[Optional[str]] + question: Mapped[str] content: Mapped[str] hit_count = mapped_column(db.Integer, nullable=False, server_default=db.text("0")) account_id = mapped_column(StringUUID, nullable=False)