generated from kgod/ai-review-template
自内部仓库剥离深度优化与 RAG 知识库后的交付版本: - Builder 对话式简历生成(FSM + 意图路由 LLM 兜底增强) - 条目级轻度优化:事实覆盖门禁 + STAR/bullet 修复链,功能/简介/成果与技术栈同级保护 - 简历导入:DOCX/PDF 解析、结构归一、手机号脱敏 - PostgreSQL 运行时 + Alembic 迁移链 Co-Authored-By: Claude <noreply@anthropic.com>
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)
|
|
|