dy-dashboard/vault/知识库/工作指南/训练记录/2026-08-14-AI分析问答式智能分析上线.md
2026-10-28 11:14:17 +08:00

16 lines
1006 B
Markdown
Raw Permalink 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.

### 1. AI分析菜单:新增问答式智能分析(DeepSeek NL2SQL)
**旭东 → OpenClaw:**
> [Fri 2026-08-14 15:34 GMT+8] AI分析这里,我是想做成那种问答式的方式,你有什么好的建议吗?
> [15:38] 我想要使用方案B,有大模型API,我可以发你一个DeepSeek的key
> [15:40] sk-869bcfd6ac4e4ddb8a953ee05cd38e0b
**OpenClaw 响应:**
已实现方案B(DeepSeek NL2SQL)问答式AI分析:
- AI分析菜单从占位页升级为问答对话框,支持自然语言提问(含6个示例问题快捷按钮)
- 后端 /api/ai/ask:问题 → DeepSeek 生成 SQL → 只读查询执行 → 返回表格+中文说明
- 安全兜底:仅允许单条 SELECT,拦截 INSERT/UPDATE/DELETE/多语句/危险函数,结果上限200行
- API Key 保存在 ai_config.py(已加入 .gitignore,不进入 Git/知识库)
- 已实测通过:"当前库存最多的10个SKU""最近7天出库量TOP10"均正确返回
- 服务重启验证 HTTP 200,Git 提交 b061b1a