Files
group_xinghuo_jinrong/docs/答辩/DEMO-SOP-问数.md
zhanghongyu_0626 647c07062e feat(trade): Enhance trade processing and context handling in customer service
- Introduced `pending_trade` handling in the chat API to manage trade requests more effectively.
- Updated the `submit_trade_api` to allow advisors to access customer trades based on assigned roles.
- Added new methods in `GatewayRepository` for managing core holdings during trade subscriptions and redemptions.
- Implemented context-aware trade dialogue management in the customer service layer to improve user experience during multi-turn interactions.
- Enhanced the tool service to support trade actions and suitability checks, ensuring accurate processing of user requests.

This update significantly improves the trade interaction flow, providing a more robust and user-friendly experience for customers engaging in trading activities.
2026-09-13 17:45:04 +08:00

2.9 KiB
Raw Permalink Blame History

答辩 Demo · 问数工作台 SOP

套餐 ① 答辩稳(2026-09-13 同步)· 基线 896 pytest(排除 sprint)· 27 Vitest · 问数/解读/analyze 拆分
全角色答辩动线: DEMO-SOP-答辩全流程.md

1. 环境(答辩前 30 分钟)

cd "d:\项目\JinRong"
docker compose up -d redis   # 或 .\scripts\dev\start-redis.ps1
# .env: REDIS_URL=redis://127.0.0.1:6380/0 · DEEPSEEK_API_KEY 已填

mysql -u root -p jinrong_agent < scripts/agent/seed-analyst-metric-dict.sql
mysql -u root -p jinrong_agent < scripts/agent/seed-analyst-query-templates.sql
# 或一键:.\scripts\dev\seed_analyst.ps1

python -m uvicorn app.main:app --reload --port 8000
cd web && npm run dev

无 DeepSeek Key: 问数仍可出 模板 SQL + 表;点「分析该数据」解读会降级或失败——答辩建议带 Key。

2. 推荐口述动线(3~5 分钟 · 分析员账号)

步骤 操作 答辩句
1 打开 问数工作台 「查数和解读拆开:先 NL2SQL 可审计,再按需看图说话」
2 问:客户总数是多少 指 蓝色「模板命中 · customer_total_count」 → D-06 模板跳过 LLM 写 SQL
3 再问同一题 指 绿色「结果缓存」 → 权限指纹 + SQL + 表世代
4 点 分析该数据 「上下文只有本轮问题和表格,不接 Chat 历史;数字走 D-10 护栏」
5 问:近30天申购金额(或含「近30天」「申购」「金额」) 模板 subscribe_amount_recent_days
6 问:近30天交易流水是多少 clarify → N-01 多义,不猜口径
7 可选 点 抽样溯源(N-03)· 失败场景 转人工(N-07)
8 可选 deny 理财师问非名下客户 → 权限与问数 同一 answer,解读按钮不调 LLM

3. 客户角色(平台服务 · 数据分析)

  • 登录 客户 Demo → 平台服务 · 数据分析
  • 问:我近30天有多少笔交易 → 模板 customer_self_trade_count_recent(需种子)
  • 按钮文案:解读我的数据 · 尾注含「AI 分析有风险」

4. 20 题 battery(答辩后自测,报告不入库)

python scripts/dev/run_query_battery.py
# 脚本内显式 interpret: false;本地生成 scripts/dev/battery_report.json(.gitignore)

验收:A1 Q17(created_at 列不误杀)· A5 流水 clarify · 模板题稳定命中。

5. 答辩口径(不上台)

  • 多轮追问、看板钻取等能力扩展不在答辩展开;评委若问深,可指向 docs/course/ 问数模块。
  • N-03 抽样、N-07 转人工已最小闭环(sample API + escalate + 问数页按钮)
  • /app/analytics/chat 重定向到问数页,避免双入口
  • 分析占位 agent_service 仍存在于 API,菜单已收