From 2267c8634a8f319a4d9c71d787f988cc3cf67d95 Mon Sep 17 00:00:00 2001 From: Wenjie Zhang Date: Wed, 3 Sep 2025 16:06:56 +0800 Subject: [PATCH] =?UTF-8?q?refactor(graph):=20=E9=87=8D=E6=9E=84=E7=9F=A5?= =?UTF-8?q?=E8=AF=86=E5=9B=BE=E8=B0=B1=E7=BB=84=E4=BB=B6=E4=B8=BAGraphCanv?= =?UTF-8?q?as=E5=B9=B6=E6=9B=BF=E6=8D=A2GraphContainer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将原有的GraphContainer组件重构为更灵活的GraphCanvas组件,支持插槽布局和更多配置选项 更新KnowledgeGraphResult和GraphView视图使用新组件 删除旧的GraphContainer组件并更新相关文档 --- docs/changelog/update.md | 6 +- web/src/components/GraphCanvas.vue | 380 ++++++++++++++++ web/src/components/GraphContainer.vue | 286 ------------ .../KnowledgeGraphResult.vue | 4 +- web/src/views/GraphView.vue | 407 +++--------------- 5 files changed, 439 insertions(+), 644 deletions(-) create mode 100644 web/src/components/GraphCanvas.vue delete mode 100644 web/src/components/GraphContainer.vue diff --git a/docs/changelog/update.md b/docs/changelog/update.md index 8275628f..e2c213ed 100644 --- a/docs/changelog/update.md +++ b/docs/changelog/update.md @@ -6,8 +6,8 @@ - [ ] 使用更好的知识图谱检索方法 - [ ] 使用其他的聊天记录管理方法,解决两个问题,一个是上下文长度过长,一个是上下文的类型变得更加丰富,比如多模态等等。(现在是基于 LangGraph 的 Memory 实现的,v0.2.3 版本实现),暂定使用 [mem0](github.com/mem0ai/mem0) 来实现。但是目前了解下来,还不是我想要的那种方案。可能会基于这个实现一个 ThreadConvManager 这个类。 - [ ] 添加对于上传文件的支持:这里的复杂的地方就在于如何和历史记录结合在一起(v0.2.3 版本实现,放在记忆管理后面) -- [ ] 将现在的GraphContainer相关的代码分离到一个单独的组件中,然后 actions 和 footer 都是作为 slot top/bottom 提供的 -- [ ] 移除现有的 GraphContainer 然后应用到 AgentView 中。 +- [x] 将现在的 graphview.vue 文件中 GraphContainer相关的代码分离到一个单独的组件中,然后 actions 和 footer 都是作为 slot top/bottom 提供的 +- [x] 然后应用到 web/src/components/ToolCallingResult/KnowledgeGraphResult.vue 中,替换现有的 GraphContainer。 - [ ] 知识图谱的上传和可视化,支持属性,标签的展示 🐛**BUGs** @@ -28,5 +28,5 @@ - [ ] 添加 SQL 读取工具 - [ ] 添加绘图工具(这里的绘图是指绘制固定格式的图和表等,暂时没想好如何支持自定义绘图) - [ ] 添加测试脚本,覆盖最常见的功能 -- [ ] 添加用户日志与用户反馈模块,可以在 AgentView 中查看信息 - [ ] 优化对文档信息的检索展示(检索结果页、详情页) +- [ ] 集成 LangFuse (观望)添加用户日志与用户反馈模块,可以在 AgentView 中查看信息 diff --git a/web/src/components/GraphCanvas.vue b/web/src/components/GraphCanvas.vue new file mode 100644 index 00000000..5d8a49e8 --- /dev/null +++ b/web/src/components/GraphCanvas.vue @@ -0,0 +1,380 @@ + + + + + \ No newline at end of file diff --git a/web/src/components/GraphContainer.vue b/web/src/components/GraphContainer.vue deleted file mode 100644 index 521d477f..00000000 --- a/web/src/components/GraphContainer.vue +++ /dev/null @@ -1,286 +0,0 @@ - - - - - \ No newline at end of file diff --git a/web/src/components/ToolCallingResult/KnowledgeGraphResult.vue b/web/src/components/ToolCallingResult/KnowledgeGraphResult.vue index 486b4c9f..396c1939 100644 --- a/web/src/components/ToolCallingResult/KnowledgeGraphResult.vue +++ b/web/src/components/ToolCallingResult/KnowledgeGraphResult.vue @@ -9,7 +9,7 @@
- +
@@ -55,7 +55,7 @@