generated from kgod/ai-review-template
feat: builder 简历生成 + 轻度优化 + 简历导入交付副本
自内部仓库剥离深度优化与 RAG 知识库后的交付版本: - Builder 对话式简历生成(FSM + 意图路由 LLM 兜底增强) - 条目级轻度优化:事实覆盖门禁 + STAR/bullet 修复链,功能/简介/成果与技术栈同级保护 - 简历导入:DOCX/PDF 解析、结构归一、手机号脱敏 - PostgreSQL 运行时 + Alembic 迁移链 Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
"""记录类模块表单卡构造(RecordFields 组件的后端契约)。"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
from .enrichment_modules import ModuleSpec
|
||||
from .fsm import anchor_field_specs, component
|
||||
|
||||
|
||||
def record_card(
|
||||
profile: dict[str, Any], spec: ModuleSpec, value: dict[str, Any] | None = None
|
||||
) -> dict[str, Any]:
|
||||
"""anchor_note 仅描述;record_fields 按经历类型渲染核心字段。"""
|
||||
draft = profile["enrichment"]["module_draft"]
|
||||
entry = draft.get("entry") if isinstance(draft.get("entry"), dict) else {}
|
||||
record_type = (
|
||||
draft.get("record_type")
|
||||
or entry.get("record_type")
|
||||
or spec.record_type
|
||||
or profile.get("anchor_type")
|
||||
)
|
||||
is_note = spec.kind == "anchor_note"
|
||||
return component(
|
||||
"RecordFields",
|
||||
module=spec.name,
|
||||
record_type=record_type,
|
||||
title=spec.prompt,
|
||||
fields=[] if is_note else anchor_field_specs(record_type),
|
||||
show_description=True,
|
||||
require_description=is_note,
|
||||
skippable=spec.skippable,
|
||||
value=value,
|
||||
)
|
||||
Reference in New Issue
Block a user