generated from kgod/ai-review-template
45 lines
1.3 KiB
Python
45 lines
1.3 KiB
Python
"""Contracts shared by the light and deep experience optimization flows."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from typing import Any, Literal
|
|
|
|
from pydantic import BaseModel, ConfigDict, Field
|
|
|
|
|
|
class OptimizationStartRequest(BaseModel):
|
|
model_config = ConfigDict(extra="forbid")
|
|
|
|
entry_id: str = Field(min_length=1, max_length=64)
|
|
instruction: str | None = Field(default=None, max_length=200)
|
|
source: str | None = Field(default=None, max_length=32)
|
|
|
|
|
|
class OptimizationAnswerRequest(BaseModel):
|
|
model_config = ConfigDict(extra="forbid")
|
|
|
|
answer: str = Field(min_length=1, max_length=1000)
|
|
|
|
|
|
class TargetPositionRequest(BaseModel):
|
|
model_config = ConfigDict(extra="forbid")
|
|
|
|
target_position: str = Field(min_length=1, max_length=32)
|
|
|
|
|
|
class OptimizationRunView(BaseModel):
|
|
id: str
|
|
mode: Literal["light", "deep"]
|
|
status: str
|
|
entry_id: str
|
|
question_count: int = 0
|
|
question: dict[str, Any] | None = None
|
|
proposal: dict[str, Any] | None = None
|
|
covered_dimensions: list[str] = Field(default_factory=list)
|
|
remaining_high_priority_gaps: list[str] = Field(default_factory=list)
|
|
decision_source: str | None = None
|
|
error_code: str | None = None
|
|
action: Any | None = None
|
|
gap_report: list[dict[str, Any]] | None = None
|
|
tier: str | None = None
|