from __future__ import annotations

from sqlalchemy import BigInteger, String, Text
from sqlalchemy.orm import Mapped, mapped_column

from fastapi_common.fastapi_common_web.models import BaseModel


class LeauditRagConversation(BaseModel):
    __tablename__ = "rag_conversation"

    Id: Mapped[int] = mapped_column("id", BigInteger, primary_key=True, autoincrement=True)
    conversationId: Mapped[str] = mapped_column("conversation_id", String(100), unique=True)
    userId: Mapped[int] = mapped_column("user_id", BigInteger)
    appId: Mapped[int | None] = mapped_column("app_id", BigInteger)
    name: Mapped[str] = mapped_column(String(500), default="新对话")
    introduction: Mapped[str] = mapped_column(Text, default="")
