| 123456789101112131415161718192021222324 |
- from datetime import datetime
- from sqlalchemy import DateTime, Integer, String, Text
- from sqlalchemy.dialects.sqlite import JSON
- from sqlalchemy.orm import Mapped, mapped_column
- from core_db import AuditMixin, Base, TenantMixin, VersionMixin
- from core_shared import JSONValue
- class AgentVersion(TenantMixin, AuditMixin, VersionMixin, Base):
- __tablename__ = "agent_version"
- agent_id: Mapped[str] = mapped_column(String(36), index=True)
- version_no: Mapped[int] = mapped_column(Integer)
- status: Mapped[str] = mapped_column(String(32), default="draft", index=True)
- role: Mapped[str] = mapped_column(String(64), default="assistant")
- goal: Mapped[str | None] = mapped_column(Text, nullable=True)
- system_prompt: Mapped[str] = mapped_column(Text)
- model_config_json: Mapped[dict[str, JSONValue]] = mapped_column(JSON, default=dict)
- memory_policy_json: Mapped[dict[str, JSONValue]] = mapped_column(JSON, default=dict)
- tool_refs_json: Mapped[list[dict[str, JSONValue]]] = mapped_column(JSON, default=list)
- skill_refs_json: Mapped[list[dict[str, JSONValue]]] = mapped_column(JSON, default=list)
- published_time: Mapped[datetime | None] = mapped_column(DateTime, nullable=True)
|