- 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.
120 lines
7.0 KiB
HTML
120 lines
7.0 KiB
HTML
<section class="module" id="module-2">
|
||
<div class="module-inner">
|
||
<p class="eyebrow animate-in">模块 2 · 认识主要角色</p>
|
||
<h1 class="module-title animate-in">四个 Agent,<br>各干各的活</h1>
|
||
<p class="module-lead animate-in">
|
||
它们<strong>不互相打电话</strong>(不调彼此的 LLM)。要共享信息,走数据库里的画像层、预警表、平台 API。
|
||
像一栋楼里的四个窗口,共用同一套档案室。
|
||
</p>
|
||
|
||
<div class="screen animate-in">
|
||
<h2>四个窗口分别是谁</h2>
|
||
<div class="pattern-cards">
|
||
<div class="pattern-card">
|
||
<h3>客户财富 Agent</h3>
|
||
<p>服务登录客户本人:查持仓/流水、产品规则 RAG、合规话术。代码:登录客户 14 节点编排(<code>customer_service.py</code>)登录客户 14 节点编排</p>
|
||
</div>
|
||
<div class="pattern-card">
|
||
<h3>代理人助手</h3>
|
||
<p>服务理财师:聊名下客户、公开知识库。代码:顾问通用 tool→llm→guard 编排(<code>agent_service.py</code>)顾问通用 tool→llm→guard 编排 + advisor 分支</p>
|
||
</div>
|
||
<div class="pattern-card">
|
||
<h3>数据分析 Agent</h3>
|
||
<p>NL→SQL 问数、看板 metrics、口径资产。独立路由 <code>/api/analyst/*</code></p>
|
||
</div>
|
||
<div class="pattern-card">
|
||
<h3>风控监测 Agent</h3>
|
||
<p>预警台账、适当性、AML、模拟交易触发规则。代码:<code>app/service/risk/*</code></p>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="screen animate-in">
|
||
<h2>群聊:一次请求里谁跟谁说话</h2>
|
||
<p>理财师问「客户 CUST-9527 持仓如何」——简化对话:</p>
|
||
|
||
<div class="chat-window" id="chat-module2">
|
||
<div class="chat-messages">
|
||
<div class="chat-message" data-msg="0" data-sender="browser" style="display:none">
|
||
<div class="chat-avatar" style="background:#2A7B9B">前</div>
|
||
<div class="chat-bubble">
|
||
<span class="chat-sender" style="color:#2A7B9B">浏览器</span>
|
||
<p>POST /api/chat/stream · X-Agent-Type: advisor</p>
|
||
</div>
|
||
</div>
|
||
<div class="chat-message" data-msg="1" data-sender="chat" style="display:none">
|
||
<div class="chat-avatar" style="background:#5A9DB8">API</div>
|
||
<div class="chat-bubble">
|
||
<span class="chat-sender" style="color:#5A9DB8">四 Agent 对话 HTTP 入口(chat.py)</span>
|
||
<p>验 JWT + 矩阵准入 → 建/续 session</p>
|
||
</div>
|
||
</div>
|
||
<div class="chat-message" data-msg="2" data-sender="tool" style="display:none">
|
||
<div class="chat-avatar" style="background:#1F6280">Tool</div>
|
||
<div class="chat-bubble">
|
||
<span class="chat-sender" style="color:#1F6280">对话 Tool 编排(tool_service.py)</span>
|
||
<p>关键词命中「持仓」→ query_holdings → 查 core_ro</p>
|
||
</div>
|
||
</div>
|
||
<div class="chat-message" data-msg="3" data-sender="llm" style="display:none">
|
||
<div class="chat-avatar" style="background:#D4A843">AI</div>
|
||
<div class="chat-bubble">
|
||
<span class="chat-sender" style="color:#D4A843">DeepSeek</span>
|
||
<p>把 Tool 结果组织成自然语言,SSE 推回前端</p>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="chat-typing" id="chat-module2-typing" style="display:none">
|
||
<div class="chat-avatar" id="chat-module2-typing-avatar">…</div>
|
||
<div class="chat-typing-dots"><span class="typing-dot"></span><span class="typing-dot"></span><span class="typing-dot"></span></div>
|
||
</div>
|
||
<div class="chat-controls">
|
||
<button class="btn chat-next-btn">下一条</button>
|
||
<button class="btn chat-all-btn">全部播放</button>
|
||
<button class="btn chat-reset-btn">重播</button>
|
||
<span class="chat-progress"></span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="screen animate-in">
|
||
<h2>代码地图(改功能前先找门)</h2>
|
||
<div class="file-tree animate-in">
|
||
<div class="tree-item tree-folder">app/</div>
|
||
<div class="tree-item tree-indent">FastAPI 应用入口(main.py)FastAPI 应用入口 — 挂载所有路由</div>
|
||
<div class="tree-item tree-indent">四 Agent 对话 HTTP 入口(chat.py)四 Agent 对话 HTTP 入口 — app/api/chat.py</div>
|
||
<div class="tree-item tree-indent">问数 REST 路由(analyst.py)问数 REST 路由 — app/api/analyst.py</div>
|
||
<div class="tree-item tree-indent">风控 REST(risk.py)风控 REST — app/api/risk.py · 模拟交易 HTTP 入口(simulate.py)模拟交易 HTTP 入口 — app/api/simulate.py</div>
|
||
<div class="tree-item tree-indent">登录客户 14 节点编排(customer_service.py)登录客户 14 节点编排 — app/service/customer_service.py</div>
|
||
<div class="tree-item tree-indent">顾问通用 tool→llm→guard 编排(agent_service.py)顾问通用 tool→llm→guard 编排 — app/service/agent_service.py</div>
|
||
<div class="tree-item tree-folder">web/</div>
|
||
<div class="tree-item tree-indent">src/pages/* — 四角色页面</div>
|
||
<div class="tree-item tree-indent">src/api/*.ts — 调后端(注意鉴权头差异)</div>
|
||
</div>
|
||
|
||
<div class="quiz-container" id="quiz-module2">
|
||
<div class="quiz-question-block"
|
||
data-correct="option-c"
|
||
data-explanation-right="客户线已独立:同步 POST /api/chat 和 SSE stream 都走 登录客户 14 节点编排(customer_service.py),不是 顾问通用 tool→llm→guard 编排(agent_service.py)那条通用图。"
|
||
data-explanation-wrong="customer 在 四 Agent 对话 HTTP 入口(chat.py)里有专门 if 分支,不会和 advisor 共用同一张 LangGraph。">
|
||
<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>顾问通用 tool→llm→guard 编排(agent_service.py)通用图</span>
|
||
</button>
|
||
<button class="quiz-option" data-value="option-b" onclick="selectOption(this)">
|
||
<div class="quiz-option-radio"></div><span>analyst_agent 问数</span>
|
||
</button>
|
||
<button class="quiz-option" data-value="option-c" onclick="selectOption(this)">
|
||
<div class="quiz-option-radio"></div><span>登录客户 14 节点编排(customer_service.py)LangGraph</span>
|
||
</button>
|
||
</div>
|
||
<div class="quiz-feedback"></div>
|
||
</div>
|
||
<button class="quiz-check-btn" onclick="checkQuiz('quiz-module2')">检查答案</button>
|
||
<button class="quiz-reset-btn" onclick="resetQuiz('quiz-module2')">重做</button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</section>
|