refactor(chat): AI-native prompts, remove interview heuristics

- Drop interview_reply_length and utterance_substance; always run stage LLM
  and memory retrieval when enabled; trim Settings fields and .env.example.
- Replace guided/opening prompts with compact fact blocks plus unified
  behavior guidance; slim background_voice and persona to tone hints.
- InterviewAgent uses fixed chat_interview max_tokens/chars/segments.

Also includes stacked work: profile followup/extract path, evaluation rubric
and judge schema updates, transcript SPLIT handling in execution service,
user export markdown split tests, and golden case fixture.
This commit is contained in:
Kevin
2026-04-06 22:22:50 +08:00
parent ca8bcc8489
commit 2fded6fbd9
27 changed files with 426 additions and 1349 deletions

View File

@@ -88,13 +88,13 @@ def get_profile_extraction_prompt(
1. birth_year 填整数(四位数),如"65年出生"转为 1965
2. 如果用户在任一轮说过出生地/成长地/职业等,都要提取
3. 只提取明确提到的信息,不要猜测
4. 如果没有提取到任何信息,返回空对象 {{}}"""
4. 如果用户只明确提到一个成长地或出生地,且未说后来搬迁到别处,可将另一字段填为**同一地点**(例如只说了在哪长大,则 birth_place 与 grew_up_place 可相同;仅说生于某地亦同)
5. 如果没有提取到任何信息,返回空对象 {{}}"""
def get_profile_followup_prompt(
missing_fields: List[str],
filled_fields: Dict[str, str],
user_message: str,
nickname: str = "",
interview_stage_hint: str = "",
) -> str:
@@ -119,9 +119,7 @@ def get_profile_followup_prompt(
return f"""你是「岁月知己」。用户的基本信息已经收集完毕:
{filled_str}
用户刚才说:"{user_message}"
请对用户的回答做出温暖的回应,然后自然地过渡到人生故事的访谈。
用户本轮消息在对话末尾。请对用户的回答做出温暖的回应,然后自然地过渡到人生故事的访谈。
可以说类似「了解了!那我们现在开始聊聊你的人生故事吧」这样的话;{stage_hint}
**不要**默认只问童年,除非用户刚才聊的正是童年。
@@ -136,13 +134,17 @@ def get_profile_followup_prompt(
## 还需要了解
{missing_str}
用户刚才说:"{user_message}"
用户本轮原话在历史里(末尾 HumanMessage勿在脑中丢开。
请先对用户说的内容做出自然回应,然后**只**询问「还需要了解」中的信息(每次问 1-2 个)。
语气要像朋友聊天一样自然亲切
## 你怎么说
1. **先接住**:对用户说的内容做自然回应,像朋友在听
2. **话题优先**:若用户正在讲一段故事、回忆或情绪,**优先**顺着问一个与**当前话题**相关的具体小问题;不要为凑字段打断叙事。
3. **资料穿插**:仅当用户本轮主要在确认、闲聊或话题与缺失资料完全无关时,再在末尾**温和插入 01 个**「还需要了解」里的问题。
4. **轮换**:若上一轮你已就某一类资料追问过(见历史里助手发言),本轮**不要再问同一类**;改问其他缺失项,或本轮只承接、不提资料。
5. 每次最多 **12 个**资料相关问点;能用推断就不要重复确认已知地/年。
严格禁止:
- **严禁再次询问「已知信息」中已列出的内容**(例如已知出生年份就绝不要再问哪年出生)
- **严禁再次询问「已知信息」中已列出的内容**
- {chat_output_rules()}
回复格式:多条消息用 [SPLIT] 分隔。