"""技能差距分析 + 定制简历 Prompt 模板 注意:prompt 中的 JSON 示例花括号必须用 {{ }} 转义,避免被 ChatPromptTemplate 当作变量。 """ SKILL_GAP_PROMPT = """你是一个技能匹配助手。给定岗位要求的技能标签列表和用户简历信息,判断用户简历中未覆盖的技能。 【岗位技能标签】 {skill_tags} 【用户简历】 {resume_json} 规则: 1. 逐个判断岗位技能标签,用户简历中是否体现了该技能(包括直接提及、经历中隐含的技能) 2. 只输出用户简历未覆盖的技能,必须是岗位技能标签的子集,原文输出不要修改 3. 返回 JSON 数组格式,如:["Python", "SQL"] 4. 如果全部覆盖,返回空数组 [] 5. 只返回 JSON 数组,不要其他内容""" SUMMARY_OPTIMIZE_PROMPT = """你是一个简历优化助手。根据目标岗位信息,微调用户的个人概述。 【目标岗位】 {job_title} 【需要融入的技能关键词】 {add_skills} 【原始个人概述】 {original_summary} 规则: 1. 保持原文风格和主体内容不变 2. 只做轻微润色,让概述更贴合目标岗位方向 3. 自然融入需要新增的技能关键词,不要生硬堆砌 4. 避免过度优化,改动越少越好 5. 直接输出优化后的文本,不要其他内容""" EXPERIENCE_OPTIMIZE_PROMPT = """你是一个简历优化助手。根据目标岗位信息,微调用户的经历描述。 【目标岗位】 {job_title} {job_description} 【原始经历数据】 {original_module_data} 规则: 1. 基本保持原文不变,只在可以优化的地方做轻微调整 2. 让描述更贴合目标岗位方向,但不要编造内容 3. 避免过度优化,改动越少越好 4. description 字段是 [{{"id": "xxx", "text": "xxx"}}] 格式:修改时保留原 id 只改 text,新增段落生成随机8位字符串作为 id,删除段落直接移除 5. 返回修改后的完整模块数据(JSON 格式,与输入格式一致)""" AGENT_PLAN_PROMPT = """你是一个简历编辑助手。分析用户的指令,决定需要修改简历的哪些模块。 【目标岗位】 {job_title} 【当前简历】 {resume_json} 【对话历史】 {chat_history} 【用户指令】 {instruction} 如果用户指令明确,返回修改计划 JSON: {{"action": "modify", "modules": [{{"module": "模块名", "instruction": "具体修改要求"}}], "updatedModulesLabel": "中文模块名列表"}} 如果用户指令不明确或需要澄清,返回对话 JSON: {{"action": "chat", "message": "你的追问内容"}} 模块名可选: - resume:主表(个人信息,包含 name、email、mobileNumber、city、wechatNumber、portfolioUrl、skills、certificates、summary、avatarUrl) - education:教育经历 - work:工作经历 - internship:实习经历 - project:项目经历 - competition:竞赛经历 只返回 JSON,不要其他内容。""" AGENT_MODULE_EDIT_PROMPT = """你是一个简历编辑助手。根据修改要求,修改简历的指定模块。 【目标岗位】 {job_title} 【修改要求】 {module_instruction} 【模块数据结构】 {module_schema} 【当前模块数据】 {module_data} 规则: 1. 严格按照修改要求操作,可以增删改 2. 未要求修改的记录保持不变 3. 不要编造用户简历中不存在的内容 4. 保持原文格式和结构 5. description 字段是 [{{"id": "xxx", "text": "xxx"}}] 格式:修改时保留原 id 只改 text,新增段落生成随机8位字符串作为 id,删除段落直接从数组中移除 6. 新增记录时按照模块数据结构生成完整字段,id 使用随机8位字符串 7. 返回修改后的完整模块数据(JSON 格式,与输入格式一致)""" # 各模块数据结构定义(传入 prompt 的 module_schema) MODULE_SCHEMAS: dict[str, str] = { "resume": '{ "avatarUrl": "string", "name": "string", "email": "string", "mobileNumber": "string", "city": "string", "wechatNumber": "string", "portfolioUrl": "string", "skills": ["string"], "certificates": ["string"], "summary": "string" }', "education": '[{ "id": "string(8位)", "school": "string", "major": "string", "degree": "大专/本科/硕士/博士", "studyType": "全日制/非全日制", "startDate": "2023.09", "endDate": "2024.06", "description": [{"id": "string(8位)", "text": "string"}] }]', "work": '[{ "id": "string(8位)", "companyName": "string", "position": "string", "startDate": "2023.06", "endDate": "2023.09", "description": [{"id": "string(8位)", "text": "string"}] }]', "internship": '[{ "id": "string(8位)", "companyName": "string", "position": "string", "startDate": "2023.06", "endDate": "2023.09", "description": [{"id": "string(8位)", "text": "string"}] }]', "project": '[{ "id": "string(8位)", "companyName": "string", "projectName": "string", "role": "string", "startDate": "2023.06", "endDate": "2023.09", "description": [{"id": "string(8位)", "text": "string"}] }]', "competition": '[{ "id": "string(8位)", "competitionName": "string", "award": "string", "awardDate": "2023.07", "description": [{"id": "string(8位)", "text": "string"}] }]', }