| 1234567891011121314151617 |
- from core_db import AuditMixin, Base, EntityMixin
- from sqlalchemy import Integer, String, Text
- from sqlalchemy import JSON
- from sqlalchemy.orm import Mapped, mapped_column
- class Message(EntityMixin, AuditMixin, Base):
- __tablename__ = "message"
- session_id: Mapped[str] = mapped_column(String(36), index=True)
- turn_id: Mapped[str | None] = mapped_column(String(36), nullable=True, index=True)
- role: Mapped[str] = mapped_column(String(32))
- content_type: Mapped[str] = mapped_column(String(32))
- content_text: Mapped[str | None] = mapped_column(Text, nullable=True)
- content_json: Mapped[dict | None] = mapped_column(JSON, nullable=True)
- token_count: Mapped[int | None] = mapped_column(Integer, nullable=True)
|