Watch
1
0
Fork
You've already forked Seyyed_arc
0
forked from hesabix/arc
Seyyed_arc/hesabixAPI/adapters/db/models/ai_eval_case.py

29 lines
1.3 KiB
Python

from __future__ import annotations
from datetime import datetime
from sqlalchemy import Boolean, DateTime, ForeignKey, Integer, String, Text
from sqlalchemy.orm import Mapped, mapped_column
from adapters.db.session import Base
class AIEvalCase(Base):
__tablename__ = "ai_eval_cases"
id: Mapped[int] = mapped_column(primary_key=True, autoincrement=True)
name: Mapped[str] = mapped_column(String(255), nullable=False)
description: Mapped[str | None] = mapped_column(Text, nullable=True)
role: Mapped[str] = mapped_column(String(50), nullable=False, default="user")
business_id: Mapped[int | None] = mapped_column(
Integer, ForeignKey("businesses.id", ondelete="SET NULL"), nullable=True
)
user_message: Mapped[str] = mapped_column(Text, nullable=False)
expected_substrings: Mapped[str | None] = mapped_column(Text, nullable=True)
forbidden_substrings: Mapped[str | None] = mapped_column(Text, nullable=True)
use_tools: Mapped[bool] = mapped_column(Boolean, nullable=False, default=False)
is_active: Mapped[bool] = mapped_column(Boolean, nullable=False, default=True)
created_at: Mapped[datetime] = mapped_column(DateTime, default=datetime.utcnow, nullable=False)
updated_at: Mapped[datetime] = mapped_column(
DateTime, default=datetime.utcnow, onupdate=datetime.utcnow, nullable=False
)