1. 建立问题库大纲,对应每个人生阶段槽位
2. 鼓励使用更生活化的交流语言共情与总结
3. 降低评审模型可能发生截断的概率
4. 成稿质量维度强化情感表达和上下文连贯性
This commit is contained in:
yangshilin
2026-04-09 15:32:35 +08:00
parent 064ad2161d
commit e1341c6d18
49 changed files with 938 additions and 271 deletions

View File

@@ -19,7 +19,10 @@ _TRAIT_HINTS: tuple[tuple[str, tuple[str, ...]], ...] = (
("规划目标感", ("计划", "规划", "目标", "打算", "一步步", "安排", "准备")),
("求真较真", ("弄明白", "搞清楚", "想通", "为什么", "较真", "求证")),
("行动力", ("决定", "创业", "开始做", "尝试", "报名", "跑去", "去做")),
("家庭责任感", ("家里", "父母", "妈妈", "爸爸", "妻子", "丈夫", "孩子", "照顾", "支持")),
(
"家庭责任感",
("家里", "父母", "妈妈", "爸爸", "妻子", "丈夫", "孩子", "照顾", "支持"),
),
("即时反馈驱动", ("反馈", "看到结果", "成就感", "立刻", "马上见效")),
("自由天性", ("自由", "无拘无束", "满世界跑", "疯玩", "", "不管")),
("动手创造", ("自己动手", "", "", "", "", "", "", "生火", "")),
@@ -59,6 +62,7 @@ def extract_scene_cues(user_message: str) -> list[str]:
cues.append(description)
return cues[:3]
_SLOT_REPEAT_PATTERNS: dict[str, tuple[str, ...]] = {
"place": ("哪里长大", "家乡", "老家", "在哪长大", "什么地方长大"),
"people": ("谁对你影响", "家里都有谁", "小时候和谁", "身边有什么人"),
@@ -222,7 +226,9 @@ def build_runtime_interview_state(
persona_additions.append(
PersonaThread(
trait=trait,
evidence=_trim_sentence(marker if marker in msg else haystack, limit=70),
evidence=_trim_sentence(
marker if marker in msg else haystack, limit=70
),
source="heuristic",
stage=active_stage,
)
@@ -239,7 +245,9 @@ def build_runtime_interview_state(
)
def extract_recent_questions(messages: Iterable[BaseMessage], *, limit: int = 4) -> list[str]:
def extract_recent_questions(
messages: Iterable[BaseMessage], *, limit: int = 4
) -> list[str]:
questions: list[str] = []
for msg in messages:
if not isinstance(msg, AIMessage):
@@ -324,4 +332,3 @@ def stage_slot_hint_lines(stage: str) -> list[str]:
keys = STAGE_SLOT_KEYS.get(stage, ())
stage_zh = STAGE_DISPLAY_ZH.get(stage, stage)
return [f"{stage_zh}:{key}" for key in keys]