"""default 路径下根据用户职业自由文本注入轻量提示(与 cadre/military 专属块正交)。""" from __future__ import annotations from app.agents.chat.background_voice import normalize_background_voice def get_occupation_chat_hint(occupation: str | None, background_voice: str) -> str: """一句职业事实(仅 default 路径);cadre/military 语气由 background_voice 覆盖。""" if normalize_background_voice(background_voice) != "default": return "" occ = (occupation or "").strip() if not occ: return "" return f"从事过「{occ}」相关工作,聊天可自然贴近其经历,不要刻意。" def get_occupation_narrative_hint(occupation: str | None, background_voice: str) -> str: """default 路径的叙事职业上下文。""" if normalize_background_voice(background_voice) != "default": return "" occ = (occupation or "").strip() if not occ: return "" return ( f"## 用户职业背景(仅供文体微调,须遵守事实边界)\n" f"用户从事过「{occ}」相关工作。叙事时可适度使用该领域常见的书面用语," f"让正文贴近讲述者的身份感。\n" f"**禁止**因职业背景而补充口述未出现的岗位职责、行业流程、单位层级或专业术语细节;" f"只有当用户口述里已出现相关表达时,才可顺势书面化。" )