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:
@@ -1,5 +1,5 @@
|
||||
"""
|
||||
访谈 Agent 可配置性格(Persona):仅影响语气与追问倾向,不替代事实边界与槽位约束。
|
||||
访谈 Agent 可配置性格(Persona):仅影响语气,不替代事实边界与槽位约束。
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
@@ -20,41 +20,21 @@ def normalize_interview_persona(raw: str | None) -> str:
|
||||
return "default"
|
||||
|
||||
|
||||
def get_interview_persona_block(persona: str) -> str:
|
||||
"""
|
||||
返回注入到访谈 prompt 的「访谈性格」段落(不含 default,由调用方跳过)。
|
||||
"""
|
||||
def get_interview_persona_tone_hint(persona: str) -> str:
|
||||
"""一句访谈性格提示,融入主 system prompt;default 返回空串。"""
|
||||
key = normalize_interview_persona(persona)
|
||||
if key == "default":
|
||||
return ""
|
||||
if key == "warm_listener":
|
||||
return "偏倾听与承接,语气柔和、少打断;不审问感,一次最多一个具体问题。"
|
||||
return "爱把人往一个具体细节里带;短句像微信,一次最多一个具体问题,不重复上文已清楚的事。"
|
||||
|
||||
blocks = {
|
||||
"warm_listener": (
|
||||
"## 访谈性格:温柔倾听\n"
|
||||
"在遵守「回忆录导向与闲聊」的前提下,优先把对话引向可写进回忆录的素材;明显闲聊时先陪聊。\n"
|
||||
"你更偏倾听与承接,语气柔和、少打断;"
|
||||
"但一旦用户说出**新的人名、新的关系、或新的情节线**(上文未展开),"
|
||||
"仍必须按本提示中的「追问触发」规则,在承接后带**一个**具体问题,不能用纯感慨代替。\n"
|
||||
"禁止审问感、禁止一次抛多个问题。"
|
||||
),
|
||||
"curious_guide": (
|
||||
"## 访谈性格:好奇引导\n"
|
||||
"在遵守「回忆录导向与闲聊」的前提下,追问尽量落在人生故事与未覆盖方向上;明显闲聊时先陪聊。\n"
|
||||
"你更愿意把人往**一个具体细节**里带:时间、场景、对方反应、你心里一闪而过的念头;"
|
||||
"每轮**最多一个**具体问题,短句、像微信。\n"
|
||||
"若本轮触发「追问触发」,优先追问用户刚抛出的新信息,不要为了凑问题去重复上文已清楚的事。"
|
||||
),
|
||||
}
|
||||
return blocks.get(key, "")
|
||||
|
||||
def get_interview_persona_block(persona: str) -> str:
|
||||
"""兼容旧名:返回空串,请改用 get_interview_persona_tone_hint。"""
|
||||
return ""
|
||||
|
||||
|
||||
def get_opening_persona_line(persona: str) -> str:
|
||||
"""开场白用的一行性格提示(短,避免喧宾夺主)。"""
|
||||
key = normalize_interview_persona(persona)
|
||||
if key == "default":
|
||||
return ""
|
||||
lines = {
|
||||
"warm_listener": "语气偏倾听、少打断;但仍须完成「问候 + 一个具体问题」。",
|
||||
"curious_guide": "语气偏好奇、爱往细节里带一个具体问题;不要一次问很多。",
|
||||
}
|
||||
return lines.get(key, "")
|
||||
"""兼容旧名:与访谈轮次共用一句性格提示。"""
|
||||
return get_interview_persona_tone_hint(persona)
|
||||
|
||||
Reference in New Issue
Block a user