Full-stack Amazon AI Transcreation Platform with: - FastAPI backend (async, PostgreSQL, Redis, Celery) with 11 DB tables - JWT auth (SSO-ready abstract provider pattern) - 6-agent pipeline orchestrator with deterministic modules - Next.js 14 frontend with Amazon branding (Ember fonts, orange/dark theme) - Job wizard, monitoring HUD, output review, admin screens - 154 TM/reference files imported, 12 locales configured - Docker Compose for all services Agents 2-5 (TM retrieval, ranker, transcreator, compliance) are stubs pending Phase 3 LLM integration. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
53 lines
2.3 KiB
Python
53 lines
2.3 KiB
Python
import enum
|
|
import uuid
|
|
|
|
from sqlalchemy import Enum, ForeignKey, Integer, JSON, String, Text
|
|
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
|
|
|
from app.models.base import Base, TimestampMixin, generate_uuid
|
|
|
|
|
|
class ConfidenceTier(str, enum.Enum):
|
|
high = "high"
|
|
moderate = "moderate"
|
|
low = "low"
|
|
|
|
|
|
class OutputRow(Base, TimestampMixin):
|
|
__tablename__ = "output_rows"
|
|
|
|
id: Mapped[uuid.UUID] = mapped_column(
|
|
primary_key=True, default=generate_uuid
|
|
)
|
|
instance_id: Mapped[uuid.UUID] = mapped_column(
|
|
ForeignKey("locale_instances.id", ondelete="CASCADE"), nullable=False
|
|
)
|
|
line_id: Mapped[uuid.UUID] = mapped_column(
|
|
ForeignKey("source_lines.id", ondelete="CASCADE"), nullable=False
|
|
)
|
|
row_order: Mapped[int] = mapped_column(Integer, nullable=False)
|
|
confidence_tier: Mapped[ConfidenceTier] = mapped_column(
|
|
Enum(ConfidenceTier, name="confidence_tier", create_constraint=True),
|
|
nullable=False,
|
|
)
|
|
option_1: Mapped[str] = mapped_column(Text, nullable=False)
|
|
backtranslation_1: Mapped[str] = mapped_column(Text, nullable=False)
|
|
rationale_1: Mapped[str] = mapped_column(Text, nullable=False)
|
|
option_2: Mapped[str | None] = mapped_column(Text, nullable=True)
|
|
backtranslation_2: Mapped[str | None] = mapped_column(Text, nullable=True)
|
|
rationale_2: Mapped[str | None] = mapped_column(Text, nullable=True)
|
|
option_3: Mapped[str | None] = mapped_column(Text, nullable=True)
|
|
backtranslation_3: Mapped[str | None] = mapped_column(Text, nullable=True)
|
|
rationale_3: Mapped[str | None] = mapped_column(Text, nullable=True)
|
|
tm_entries_cited: Mapped[dict | None] = mapped_column(JSON, nullable=True)
|
|
winning_seg_key: Mapped[str | None] = mapped_column(String(255), nullable=True)
|
|
character_count_option_1: Mapped[int | None] = mapped_column(Integer, nullable=True)
|
|
character_count_option_2: Mapped[int | None] = mapped_column(Integer, nullable=True)
|
|
character_count_option_3: Mapped[int | None] = mapped_column(Integer, nullable=True)
|
|
|
|
# Relationships
|
|
instance = relationship("LocaleInstance", back_populates="output_rows")
|
|
line = relationship("SourceLine", back_populates="output_rows")
|
|
feedback = relationship(
|
|
"Feedback", back_populates="output", lazy="selectin", cascade="all, delete-orphan"
|
|
)
|