agent_config.py 901 B

123456789101112131415161718
  1. from core_db import AuditMixin, Base, EntityMixin
  2. from core_shared import JSONValue
  3. from sqlalchemy import String, Text
  4. from sqlalchemy import JSON
  5. from sqlalchemy.orm import Mapped, mapped_column
  6. class AgentConfig(EntityMixin, AuditMixin, Base):
  7. __tablename__ = "agent_config"
  8. agent_id: Mapped[str] = mapped_column(String(36), index=True)
  9. role: Mapped[str] = mapped_column(String(64), default="assistant")
  10. goal: Mapped[str | None] = mapped_column(Text, nullable=True)
  11. system_prompt: Mapped[str] = mapped_column(Text)
  12. model_config_json: Mapped[dict[str, JSONValue]] = mapped_column(JSON, default=dict)
  13. memory_policy_json: Mapped[dict[str, JSONValue]] = mapped_column(JSON, default=dict)
  14. tool_refs_json: Mapped[list[dict[str, JSONValue]]] = mapped_column(JSON, default=list)
  15. skill_refs_json: Mapped[list[dict[str, JSONValue]]] = mapped_column(JSON, default=list)