from __future__ import annotations import uuid from sqlalchemy import JSON, ForeignKey, String from sqlalchemy.dialects.postgresql import JSONB, UUID from sqlalchemy.orm import Mapped, mapped_column from core.db.base import Base, TimestampMixin class SystemAgents(TimestampMixin, Base): __tablename__: str = "system_agents" agent_type: Mapped[str] = mapped_column( String(20), primary_key=True, ) llm_id: Mapped[uuid.UUID] = mapped_column( UUID(as_uuid=True), ForeignKey("llms.id", ondelete="RESTRICT"), nullable=False, ) status: Mapped[str] = mapped_column( String(20), nullable=False, ) config: Mapped[dict] = mapped_column( JSON().with_variant(JSONB, "postgresql"), nullable=False, server_default="{}", )