拉取 legion-hardware 的 ASR 转写并生成报告。 仅依据 asrText,禁止使用 aiJiaolianResultJson / aiSummaryContent 作为结论依据。
text
1. parse-user-intent.mjs → 解析时间 / 维度 / 交付形态
2. needClarification=true → 反问用户,结束(禁止执行 fetch)
3. 用户补充或 skipClarification / confirmed* → 再执行 fetch-asr-recordings.mjs
4. 按 reportPlan + themeRelated + outputFormat 生成报告
禁止只跑 fetch-asr-recordings.mjs 而不先意图解析(fetch 内置相同解析,若需反问会直接 ok:false 且不拉数)。
bash
# 步骤 1:意图(不拉数)
echo '{"userId":"u","orgId":"o","userMessage":"帮我总结录音"}' | \
node "{baseDir}/scripts/parse-user-intent.mjs"
# 步骤 2:确认后拉数(token 仅来自 Header / LEGION_AUTH_TOKEN)
export LEGION_AUTH_TOKEN="<JWT>"
echo '{"userId":"u","orgId":"o","userMessage":"总结最近 5 天录音","skipClarification":true}' | \
node "{baseDir}/scripts/fetch-asr-recordings.mjs"
项默认报告说明时间近 1 个月「未确认具体时间,已按默认最近 1 个月统计」维度十维拓客「因未提取到明确的分析维度信息,已使用默认十维拓客统计框架处理」
parse-user-intent / fetch 在以下情况 needClarification: true:
信号反问要点timeRange.confidence = ambiguous几天 / 几周 / 几个月timeRange.confidence = missing统计窗口;不答则默认 1 个月analysisFocus.confidence = ambiguous拓客 / 话术 / 教练 / 客户需求 / 或默认十维analysisFocus.confidence = missing分析方向;不答则默认十维
跳过反问:
skipClarification: true(网关在用户回复后设置)confirmedTime / confirmedDimension(见下)userMessage#网关将 首轮 + 追问回复 写入同一 body:
json
{
"userMessage": "帮我总结录音",
"followUpMessage": "最近 5 天,按拓客复盘",
"skipClarification": true
}
或拼接为单字段 userMessage。脚本会合并 userMessage + query + followUpMessage。
字段示例作用skipClarification``true不再反问,按解析结果或默认拉数confirmedTime``"default" 或 { "startTime":"...","endTime":"..." }锁定时间窗confirmedDimension``"default_ten" / "ten" / "AI 教练" / "股票趋势"锁定维度或专题
激活(其一): 对象词 + 动作词; 完整口令; intent=legion-loan-outreach-insight。
动作词: 总结、汇总、归纳、梳理、概括、小结、复盘、盘点、整合、整理、摘要、报告、结论(及英文同义,须配对象词)。
对象词:
类别中文英文录音 / 转写录音、转写、ASRrecording, transcript, ASR拓客拓客、走访、地推outreach, field sales话术 / 客户话术、客户拜访pitch, script, customer visit教练教练、AI 教练、教练反馈、教练点评coach, coaching, AI coach, coach feedback系统legion-hardwarelegion, hardware
不触发: 仅「总结一下」无对象词; 仅 调用 POST /api/recordings/ai-jiaolian 且无话术总结类动作词(走 AI 教练单次能力,不走本 skill)。
json
{
"userId": "...",
"orgId": "...",
"userMessage": "用户原话(必填)",
"followUpMessage": "可选,第二轮补充",
"skipClarification": false,
"confirmedTime": "default",
"confirmedDimension": "default_ten"
}
Header: Authorization: Bearer {JWT}( 禁止 body.token)
parse-time-range.mjs)#表述confidence行为最近 5 天 / 近 2 个月explicit按解析查询最近 / 近期(无数字)ambiguous先反问无时间missing先反问反问后仍无default近 1 个月
时区 Asia/Shanghai;上限:月 ≤12,天 ≤366。
条件输出无显式专题(走十维)十维拓客报告 + 默认维度说明(若适用)用户明确「十维 / 默认十维」十维(无需「未提取维度」说明)显式专题且 themeRelated=true仅 ## 用户关注:{主题}显式专题且 themeRelated=false仅: ## 分析结果 → 无相关内容(禁止十维、禁止编造)
themeRelated 由脚本用 主题核心词 匹配 asrText(已避免单独「KYC」「趋势」误命中)。
recordCount处理0十维骨架或专题内写明「样本为空」< 5标注「小样本,结论仅供参考」> 80(默认)见 stdout recordsHint,分析时优先近期并抽样
项说明默认 baseUrlhttp://192.168.109.50:8900( LEGION_HARDWARE_BASE_URL 可覆盖)接口GET 或 POST /api/recordings/asr-completed + startTime/ endTime部署须 新 jar(POST 支持 body 内时间);旧版 POST 仅 3 个月固定窗,自定义时间会失效
fetch 成功时 stdout 含: query、 analysisFocus、 themeRelated、 reportPlan、 outputFormat、 records[]。
outputFormat)#mode行为page(默认)按 templates/insight-report-page.md 生成 完整报告页(Markdown/HTML)text用户要求「只要文字/不要页面」custom用户要求导出/邮件等, 从其要求
每维:关键发现 / 典型摘录 / 量化指标 / 优化建议。
userId / orgId / Authorization → 不调 hardwareneedClarification 时禁止编造数据userId/ orgId 宜与 JWT 一致(建议网关校验)parse-user-intent; needClarification 时已反问且未 fetchthemeUnrelated 时仅输出「无相关内容」outputFormat