From 42ded25be43b7d72ca787d3197e197663a29f094 Mon Sep 17 00:00:00 2001 From: admin <2775444633@qq.com> Date: Tue, 24 Nov 2026 18:31:58 +0000 Subject: [PATCH] =?UTF-8?q?chore:=20sync=20docs/06-=E9=97=AE=E6=95=B0?= =?UTF-8?q?=E4=B8=8E=E5=8F=AF=E8=A7=86=E5=8C=96=E6=9E=B6=E6=9E=84=E8=AF=B4?= =?UTF-8?q?=E6=98=8E.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/06-问数与可视化架构说明.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/06-问数与可视化架构说明.md b/docs/06-问数与可视化架构说明.md index 861a888..2d07c54 100644 --- a/docs/06-问数与可视化架构说明.md +++ b/docs/06-问数与可视化架构说明.md @@ -20,7 +20,7 @@ DataHub (hive/mysql 数据集+字段) ←── 元数据 ────┤ ▼ Trino (:8090, catalog: hive / mysql / doris) ── 失败降级 ──► Doris(Hive Catalog) ──► MySQL 业务库 ▼ -回答 = 结论 + SQL + 结果表 + ```echarts 规格 → bridge 转 ```html ECharts artifact → Open WebUI 工件面板渲染 +回答 = 结论 + 结果表 + 数据摘要 + 单文件 HTML(内联 SVG)图表工件(正文不展开 SQL)→ Open WebUI 工件面板渲染 ``` 多轮:Open WebUI 会话 → bridge 以"首条用户消息哈希"为 session key 保存 Dify `conversation_id` 与本地 history; @@ -67,7 +67,8 @@ Trino catalog:`mysql`→192.168.50.176:3308/mini_erp;`hive`→thrift://192.1 - OpenAI 兼容接口;`stream=true` 时按 120 字分块 SSE。session key = sha1(首条 user 消息)[:16],保存 Dify conversation_id(多轮)与 history[-20:](降级多轮)。 - **主路** Dify chatflow blocking;**备路** fallback_pipeline:同一召回/元数据函数 → ollama qwen2.5:7b(上下文截断 recall 2200/meta 4500 字 + few-shot 示例)→ 宽容解析(JSON key 校验失败则从 prose/```sql 围栏提取 SQL)→ 执行链。 - **执行链降级**:Trino → Doris(`hive.` 替换为 `hive_warehouse.`)→ MySQL 业务库(去 `mysql.` 前缀)。任一成功即返回,engine 字段标明实际引擎。 -- **图表**:Dify 回答中的 ```echarts 块由 `echarts_to_html()` 转为 ```html artifact(div + `