generated from kgod/ai-review-template
40 lines
1.2 KiB
Python
40 lines
1.2 KiB
Python
"""Structured contracts for experience optimization model output."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from typing import Literal
|
|
|
|
from pydantic import Field
|
|
|
|
from .llm_services import StrictSchema
|
|
|
|
|
|
class StarOutput(StrictSchema):
|
|
situation: str | None
|
|
task: str | None
|
|
action: str | None
|
|
result: str | None
|
|
|
|
|
|
class ClaimOutput(StrictSchema):
|
|
text: str
|
|
evidence_ids: list[str] = Field(max_length=12)
|
|
claim_type: Literal[
|
|
"action", "result", "metric", "technology", "role",
|
|
"organization", "award", "time",
|
|
]
|
|
|
|
|
|
class ExperienceOptimizationOutput(StrictSchema):
|
|
optimized_description: str = Field(min_length=1, max_length=1200)
|
|
bullets: list[str] = Field(min_length=1, max_length=5)
|
|
star: StarOutput
|
|
changes: list[str] = Field(max_length=5)
|
|
missing_facts: list[str] = Field(max_length=8)
|
|
claims: list[ClaimOutput] = Field(max_length=12)
|
|
covered_fact_ids: list[str] = Field(default_factory=list, max_length=24)
|
|
omitted_fact_ids: list[str] = Field(default_factory=list, max_length=24)
|
|
|
|
unconfirmed_suggestions: list[str] = Field(default_factory=list, max_length=6)
|
|
optional_enhancements: list[str] = Field(default_factory=list, max_length=6)
|
|
|