Files
group_xinghuo_jinrong/docs/course/jinrong-module-customer/modules/07-wave3-queries.html
T
zhanghongyu_0626 4b8e11c9bd feat(threshold): Implement customer loss threshold configuration and notification system
- Added `ThresholdRepository` for managing customer loss threshold configurations and notifications.
- Introduced `threshold_service` to handle loss threshold alerts based on customer portfolio performance.
- Enhanced `customer_prompts` to include new intent for querying product net values.
- Updated `customer_service` to integrate new threshold alert functionality into existing workflows.
- Implemented `sanitize_postprocess` for improved compliance handling in customer interactions.
- Enhanced course documentation to reflect updates in advisor training modules and interactive elements.

This update significantly improves the customer experience by providing proactive loss threshold notifications and enhancing the overall service framework.
2026-09-10 10:57:40 +08:00

109 lines
6.2 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<section class="module" id="module-7">
<div class="module-inner">
<p class="eyebrow animate-in">模块 7 · Wave3 数据查询扩展</p>
<h1 class="module-title animate-in">净值、阈值、匹配说明<br>关键词怎么分流?</h1>
<p class="module-lead animate-in">
2026-09-10 批次在持仓/流水/风评/适当性之外,又接了<strong>净值查询(C-05)</strong>、<strong>亏损阈值(C-04)</strong>和<strong>「我能买什么」(C-11)</strong>。
指挥 AI 改意图时,先看<strong>关键词路由顺序</strong>——数据查询类必须优先于「帮我记住」类 save_note。
</p>
<div class="screen animate-in">
<h2>新增 intent 一览</h2>
<div class="pattern-cards">
<div class="pattern-card">
<h3>C-05 · nav_query</h3>
<p>「最新净值 / 单位净值 / 基金净值」→ Core 只读 <code>get_latest_nav</code>(快照)。<strong>「实时净值」</strong>仍走 <code>reject</code>(禁止实时盘口)。</p>
</div>
<div class="pattern-card">
<h3>C-04 · 阈值提醒</h3>
<p>用户说「亏 10% 提醒我」→ L1 槽 <code>threshold_pref_summary</code> + 写 <code>customer_threshold_config</code>;下次<strong>查持仓</strong>时组合加权盈亏达线 → 追加提醒 + <code>customer_notify_log</code>。</p>
</div>
<div class="pattern-card">
<h3>C-11 · 匹配说明</h3>
<p>「我能买什么 / 匹配产品 / 有哪些我能买」→ <code>suitability_check</code> + Core 可购列表。<strong>「推荐稳赚」</strong>仍 <code>reject</code>。</p>
</div>
<div class="pattern-card">
<h3>C-07 · 风评重测</h3>
<p>「重新测评 / 重做风评」扩进风评关键词 → 引导 App/网点;Agent 内<strong>不做</strong>问卷。</p>
</div>
</div>
</div>
<div class="screen animate-in">
<h2>关键词优先级(易踩坑)</h2>
<p>客户线各分支 System Prompt 模板(<code>customer_prompts.py</code>)里 <code>keyword_route</code> 顺序:</p>
<div class="step-cards">
<div class="step-card">
<span class="step-num">1</span>
<p>转人工 / reject(实时净值、推荐稳赚等)</p>
</div>
<div class="step-card">
<span class="step-num">2</span>
<p><strong>数据查询</strong>:流水 · 风评 · 适当性 · 持仓(含「最近的流水」)</p>
</div>
<div class="step-card">
<span class="step-num">3</span>
<p><code>save_note</code>(「帮我记住…」——但不含上面已命中的数据词)</p>
</div>
<div class="step-card">
<span class="step-num">4</span>
<p>匹配说明 · 净值查询</p>
</div>
</div>
<div class="callout callout-warning">
<strong>回归用例:</strong> 「帮我记住最近的流水」必须走 <code>transaction_query</code>,不能误进 save_note——见 <code>test_wave5_notes.py</code>。
</div>
</div>
<div class="screen animate-in">
<div class="translation-block">
<div class="translation-code">
<span class="translation-label">C-04 · 亏损阈值服务(threshold_service.py)</span>
<pre><code><span class="code-line"><span class="code-comment"># 画像抽槽 → sync_threshold_from_summary</span></span>
<span class="code-line"><span class="code-comment"># query_holdings 末尾 → build_threshold_alert</span></span>
<span class="code-line"><span class="code-keyword">if</span> loss_pct >= threshold:</span>
<span class="code-line"> append alert + insert_notify_log</span></code></pre>
</div>
<div class="translation-english">
<span class="translation-label">白话</span>
<div class="translation-lines">
<p class="tl">阈值不是 push 通知——只有客户<strong>再来问持仓</strong>时才 inline 提醒。</p>
<p class="tl">组合盈亏按持仓<strong>市值加权</strong>算,不是单只基金。</p>
<p class="tl">改阈值:口述新比例 → 画像摘要更新 → config upsert。</p>
</div>
</div>
</div>
</div>
<div class="screen animate-in">
<h2>1B 仍覆盖 nav_query</h2>
<p>违禁词扫描后的分治(<code>sanitize_postprocess.py</code>)把 <code>nav_query</code> 算进数据查询 intent——interpret 嘴瓢时仍回退 Core <code>fact_text</code>。</p>
<div class="quiz-container" id="quiz-customer-m7">
<div class="quiz-question-block"
data-correct="option-b"
data-explanation-right="对。C-05 走 Core 最新净值快照;「实时净值」是 reject 关键词,不是 nav_query。"
data-explanation-wrong="实时盘口/爬虫不在一期范围;见 C-05 选型文档。">
<h3 class="quiz-question">客户问「这只基金实时净值多少」,系统怎么走?</h3>
<div class="quiz-options">
<button class="quiz-option" data-value="option-a" onclick="selectOption(this)">
<div class="quiz-option-radio"></div><span>nav_query → Core get_latest_nav</span>
</button>
<button class="quiz-option" data-value="option-b" onclick="selectOption(this)">
<div class="quiz-option-radio"></div><span>reject · 实时净值禁止</span>
</button>
<button class="quiz-option" data-value="option-c" onclick="selectOption(this)">
<div class="quiz-option-radio"></div><span>RAG fin_product 查费率</span>
</button>
</div>
<div class="quiz-feedback"></div>
</div>
<button class="quiz-check-btn" onclick="checkQuiz('quiz-customer-m7')">检查答案</button>
<button class="quiz-reset-btn" onclick="resetQuiz('quiz-customer-m7')">重做</button>
</div>
<p class="module-footer-note">相关文件:客户线意图模板(<code>customer_prompts.py</code>)· Core 只读 Tool(<code>core_ro_tool.py</code>)· 阈值服务(<code>threshold_service.py</code>)· 测试 <code>test_threshold_service.py</code> · <code>test_wave2_prompts.py</code></p>
</div>
</div>
</section>