Some checks failed
continuous-integration/drone/push Build is failing
更新内容: - 后端 AI 服务优化(能力分析、知识点解析等) - 前端考试和陪练界面更新 - 修复多个 prompt 和 JSON 解析问题 - 更新 Coze 语音客户端
221 lines
7.3 KiB
Python
221 lines
7.3 KiB
Python
"""
|
||
智能工牌能力分析与课程推荐提示词模板
|
||
|
||
功能:分析员工与顾客的对话记录,评估能力维度得分,并推荐适合的课程
|
||
"""
|
||
|
||
# ==================== 元数据 ====================
|
||
|
||
PROMPT_META = {
|
||
"name": "ability_analysis",
|
||
"display_name": "智能工牌能力分析",
|
||
"description": "分析员工与顾客对话,评估多维度能力得分,推荐个性化课程",
|
||
"module": "kaopeilian",
|
||
"variables": ["dialogue_history", "user_info", "courses"],
|
||
"version": "1.0.0",
|
||
"author": "kaopeilian-team",
|
||
}
|
||
|
||
|
||
# ==================== 系统提示词 ====================
|
||
|
||
SYSTEM_PROMPT = """你是话术分析专家,用户是一家轻医美连锁品牌的员工,用户提交的是用户自己与顾客的对话记录,你做分析与评分。并严格按照以下格式输出。并根据课程列表,为该用户提供选课建议。
|
||
|
||
输出标准:
|
||
{
|
||
"analysis": {
|
||
"total_score": 82,
|
||
"ability_dimensions": [
|
||
{
|
||
"name": "专业知识",
|
||
"score": 88,
|
||
"feedback": "产品知识扎实,能准确回答客户问题。建议:继续深化对新产品的了解。"
|
||
},
|
||
{
|
||
"name": "沟通技巧",
|
||
"score": 92,
|
||
"feedback": "语言表达清晰流畅,善于倾听客户需求。建议:可以多使用开放式问题引导。"
|
||
},
|
||
{
|
||
"name": "操作技能",
|
||
"score": 85,
|
||
"feedback": "基本操作熟练,流程规范。建议:提升复杂场景的应对速度。"
|
||
},
|
||
{
|
||
"name": "客户服务",
|
||
"score": 90,
|
||
"feedback": "服务态度优秀,客户体验良好。建议:进一步提升个性化服务能力。"
|
||
},
|
||
{
|
||
"name": "安全意识",
|
||
"score": 79,
|
||
"feedback": "基本安全规范掌握,但在细节提醒上还可加强。"
|
||
},
|
||
{
|
||
"name": "应变能力",
|
||
"score": 76,
|
||
"feedback": "面对突发情况反应较快,但处理方式可以更灵活多样。"
|
||
}
|
||
],
|
||
"course_recommendations": [
|
||
{
|
||
"course_id": 5,
|
||
"course_name": "应变能力提升训练营",
|
||
"recommendation_reason": "该课程专注于提升应变能力,包含大量实战案例分析和模拟演练,针对您当前的薄弱环节(应变能力76分)设计。通过学习可提升15分左右。",
|
||
"priority": "high",
|
||
"match_score": 95
|
||
},
|
||
{
|
||
"course_id": 3,
|
||
"course_name": "安全规范与操作标准",
|
||
"recommendation_reason": "系统讲解安全规范和操作标准,通过案例教学帮助建立安全意识。当前您的安全意识得分为79分,通过本课程学习预计可提升12分。",
|
||
"priority": "high",
|
||
"match_score": 88
|
||
},
|
||
{
|
||
"course_id": 7,
|
||
"course_name": "高级销售技巧",
|
||
"recommendation_reason": "进阶课程,帮助您将已有的沟通优势(92分)转化为更高级的销售技能,进一步巩固客户服务能力(90分)。",
|
||
"priority": "medium",
|
||
"match_score": 82
|
||
}
|
||
]
|
||
}
|
||
}
|
||
|
||
## 输出要求(严格执行)
|
||
1. 直接输出纯净的 JSON,不要包含 Markdown 标记(如 ```json)
|
||
2. 不要包含任何解释性文字
|
||
3. 能力维度必须包含:专业知识、沟通技巧、操作技能、客户服务、安全意识、应变能力
|
||
4. 课程推荐必须来自提供的课程列表,使用真实的 course_id
|
||
5. 推荐课程数量:1-5个,优先推荐能补齐短板的课程
|
||
6. priority 取值:high(得分<80的薄弱项)、medium(得分80-85)、low(锦上添花)
|
||
|
||
## 评分标准
|
||
- 90-100:优秀
|
||
- 80-89:良好
|
||
- 70-79:一般
|
||
- 60-69:需改进
|
||
- <60:亟需提升"""
|
||
|
||
|
||
# ==================== 用户提示词模板 ====================
|
||
|
||
USER_PROMPT = """对话记录:{dialogue_history}
|
||
|
||
---
|
||
|
||
用户的信息和岗位:{user_info}
|
||
|
||
---
|
||
|
||
所有可选课程:{courses}"""
|
||
|
||
|
||
# ==================== JSON Schema ====================
|
||
|
||
ABILITY_ANALYSIS_SCHEMA = {
|
||
"type": "object",
|
||
"required": ["analysis"],
|
||
"properties": {
|
||
"analysis": {
|
||
"type": "object",
|
||
"required": ["total_score", "ability_dimensions", "course_recommendations"],
|
||
"properties": {
|
||
"total_score": {
|
||
"type": "number",
|
||
"description": "总体评分(0-100)",
|
||
"minimum": 0,
|
||
"maximum": 100
|
||
},
|
||
"ability_dimensions": {
|
||
"type": "array",
|
||
"description": "能力维度评分列表",
|
||
"items": {
|
||
"type": "object",
|
||
"required": ["name", "score", "feedback"],
|
||
"properties": {
|
||
"name": {
|
||
"type": "string",
|
||
"description": "能力维度名称"
|
||
},
|
||
"score": {
|
||
"type": "number",
|
||
"description": "该维度得分(0-100)",
|
||
"minimum": 0,
|
||
"maximum": 100
|
||
},
|
||
"feedback": {
|
||
"type": "string",
|
||
"description": "该维度的反馈和建议"
|
||
}
|
||
}
|
||
},
|
||
"minItems": 1
|
||
},
|
||
"course_recommendations": {
|
||
"type": "array",
|
||
"description": "课程推荐列表",
|
||
"items": {
|
||
"type": "object",
|
||
"required": ["course_id", "course_name", "recommendation_reason", "priority", "match_score"],
|
||
"properties": {
|
||
"course_id": {
|
||
"type": "integer",
|
||
"description": "课程ID"
|
||
},
|
||
"course_name": {
|
||
"type": "string",
|
||
"description": "课程名称"
|
||
},
|
||
"recommendation_reason": {
|
||
"type": "string",
|
||
"description": "推荐理由"
|
||
},
|
||
"priority": {
|
||
"type": "string",
|
||
"description": "推荐优先级",
|
||
"enum": ["high", "medium", "low"]
|
||
},
|
||
"match_score": {
|
||
"type": "number",
|
||
"description": "匹配度得分(0-100)",
|
||
"minimum": 0,
|
||
"maximum": 100
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
|
||
# ==================== 能力维度常量 ====================
|
||
|
||
ABILITY_DIMENSIONS = [
|
||
"专业知识",
|
||
"沟通技巧",
|
||
"操作技能",
|
||
"客户服务",
|
||
"安全意识",
|
||
"应变能力",
|
||
]
|
||
|
||
PRIORITY_LEVELS = ["high", "medium", "low"]
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|