"""模型版本表""" from .base import Base from .types import JSONB from sqlalchemy.orm import Mapped, mapped_column from sqlalchemy import BigInteger, Integer, VARCHAR, DECIMAL, Boolean from typing import Optional class ModelVersion(Base): __tablename__ = "model_versions" id: Mapped[int] = mapped_column(Integer, primary_key=True, autoincrement=True) name: Mapped[str] = mapped_column(VARCHAR(255), nullable=False) provider: Mapped[str] = mapped_column(VARCHAR(100), nullable=False) version: Mapped[str] = mapped_column(VARCHAR(100), nullable=False) capability_boundaries: Mapped[dict] = mapped_column(JSONB, nullable=False) cost_per_1k_tokens: Mapped[Optional[float]] = mapped_column( DECIMAL(10, 6), nullable=True ) is_active: Mapped[bool] = mapped_column(Boolean, nullable=False, default=True)