feat(smart-mind-map-tool): initial release v1.0.0 with adaptive Rich UI

This commit is contained in:
fujie
2026-03-04 23:14:06 +08:00
parent eda495e55f
commit 56a6ddd422
36 changed files with 3550 additions and 187 deletions

View File

@@ -0,0 +1,62 @@
# Smart Mind Map Tool - Knowledge Visualization & Structuring
Smart Mind Map Tool is the tool version of the popular Smart Mind Map action plugin for Open WebUI. It allows the model to proactively generate interactive mind maps during conversations by intelligently analyzing context and structuring knowledge into visual hierarchies.
> **Note**: Prefer using the manual trigger button instead? Check out the [Smart Mind Map Action Version](https://openwebui.com/posts/turn_any_text_into_beautiful_mind_maps_3094c59a) here.
**Author:** [Fu-Jie](https://github.com/Fu-Jie) | **Version:** 1.0.0 | **Project:** [OpenWebUI Extensions](https://github.com/Fu-Jie/openwebui-extensions) | **License:** MIT
---
## Why is there a Tool version?
1. **Powered by OpenWebUI 0.8.0 Rich UI**: Previous versions of OpenWebUI did not support embedding custom HTML/iframes directly into the chat stream. Starting with 0.8.0, the platform introduced full Rich UI rendering support for **both Actions and Tools**, unleashing interactive frontend possibilities.
2. **AI Autonomous Invocation (vs. Action)**: While an **Action** is passive and requires a manual button click from the user, the **Tool** version gives the model **autonomy**. The AI can analyze the conversational context and decide on its own exactly when generating a mind map would be most helpful, offering a true "smart assistant" experience.
It is perfect for:
- Summarizing complex discussions.
- Planning projects or outlining articles.
- Explaining hierarchical concepts.
## ✨ Key Features
-**Proactive Generation**: The AI triggers the tool automatically when it senses a need for structured visualization.
-**Full Context Awareness**: Supports aggregation of the entire conversation history to generate comprehensive knowledge maps.
-**Native Multi-language UI (i18n)**: Automatically detects and adapts to your browser/system language (en-US, zh-CN, ja-JP, etc.).
-**Premium UI/UX**: Matches the Action version with a compact toolbar, glassmorphism aesthetics, and professional borders.
-**Interactive Controls**: Zoom (In/Out/Reset), Level-based expansion (Default to Level 3), and Fullscreen mode.
-**High-Quality Export**: Export your mind maps as print-ready PNG images.
## 🛠️ Installation & Setup
1. **Install**: Upload `smart_mind_map_tool.py` to your OpenWebUI Admin Settings -> Plugins -> Tools.
2. **Enable Native Tool Calling**: Navigate to `Admin Settings -> Models` or your workspace settings, and ensure that **Native Tool Calling** is enabled for your selected model. This is required for the AI to reliably and actively invoke the tool automatically.
3. **Assign**: Toggle the tool "ON" for your desired models in the workspace or model settings.
4. **Configure**:
- `MESSAGE_COUNT`: Set to `12` (default) to use the 12 most recent messages, or `0` for the entire conversation history.
- `MODEL_ID`: Specify a preferred model for analysis (defaults to the current chat model).
## ⚙️ Configuration (Valves)
| Parameter | Default | Description |
| :--- | :--- | :--- |
| `MODEL_ID` | (Empty) | The model used for text analysis. If empty, uses the current chat model. |
| `MESSAGE_COUNT` | `12` | Number of messages to aggregate. `0` = All messages. |
| `MIN_TEXT_LENGTH` | `100` | Minimum character count required to trigger a mind map. |
## ❓ FAQ & Troubleshooting
- **Language mismatch?**: The tool uses a 4-level detection (Frontend Script > Browser Header > User Profile > Default). Ensure your browser language is set correctly.
- **Too tiny or too large?**: We've optimized the height to `500px` for inline chat display with a responsive "Fit to Screen" logic.
- **Exporting**: Click the "⛶" for fullscreen if you want a wider view before exporting to PNG.
---
## ⭐ Support
If this tool helps you visualize ideas better, please give us a star on [GitHub](https://github.com/Fu-Jie/openwebui-extensions).
## ⚖️ License
MIT License. Developed with ❤️ by Fu-Jie.

View File

@@ -0,0 +1,62 @@
# 思维导图工具 - 知识可视化与结构化利器
思维导图工具Smart Mind Map Tool是广受好评的“思维导图”插件的工具Tool版本。它赋予了模型主动生成交互式思维导图的能力通过智能分析上下文将碎片化知识转化为层级分明的视觉架构。
> **说明**:如果您更倾向于手动点击按钮触发生成,可以获取 [思维导图 Action动作版本](https://openwebui.com/posts/turn_any_text_into_beautiful_mind_maps_3094c59a)。
**作者:** [Fu-Jie](https://github.com/Fu-Jie) | **版本:** 1.0.0 | **项目:** [OpenWebUI Extensions](https://github.com/Fu-Jie/openwebui-extensions) | **许可证:** MIT
---
## 🚀 为什么会有工具Tool版本
1. **得益于 OpenWebUI 0.8.0 的 Rich UI 特性**:在以前的版本中,是不支持直接将自定义的 HTML/iframe 嵌入到对话流中的。而从 0.8.0 开始平台不仅支持了这种顺滑的前端组件直出Rich UI而且同时对 **Action****Tool** 开放了该能力。
2. **AI 自主调用(区别于 Action****Action** 是被动的,需要用户在输入框或消息旁手动点击触发;而 **Tool** 赋予了模型**自主权**。AI 可以根据对话上下文,自行判断在什么时候为您生成导图最有帮助,实现真正的“智能助理”体验。
它非常适合以下场景:
- 总结复杂的对话内容。
- 规划项目、整理文章大纲。
- 解释具有层级结构的抽象概念。
## ✨ 核心特性
-**主动触发生成**AI 在感知到需要视觉化展示时会自动调用工具生成导图。
-**全量上下文感知**支持聚合整个会话历史MESSAGE_COUNT 为 0生成最完整的知识地图。
-**原生多语言 UI (i18n)**:自动检测并适配浏览器/系统语言(简体中文、繁体中文、英文、日文、韩文等)。
-**统一的高级视觉**:完全复刻 Action 版本的极简工具栏、玻璃拟态审美以及专业边框阴影。
-**深度交互控制**:支持缩放(放大/缩小/重置)、层级调节(默认为 3 级展开)以及全屏模式。
-**高品质导出**:支持将导图导出为超高清 PNG 图片。
## 🛠️ 安装与设置
1. **安装**:在 OpenWebUI 管理员设置 -> 插件 -> 工具中上传 `smart_mind_map_tool.py`
2. **启用原生理机制**:在“管理员设置 -> 模型”或配置里,确保目标模型**启用了原生工具调用Native Tool Calling**。只有开启这个能力AI 才能自主并稳定地触发 Tool 功能。
3. **分配工具**:在工作区或聊天界面处为目标模型选中并挂载本工具。
4. **配置**
- `MESSAGE_COUNT`:设置为 `12`(默认)以使用最近的 12 条对话记录,或设置为 `0` 聚合全部历史。
- `MODEL_ID`:指定分析导图时偏好的模型(留空则默认使用当前模型)。
## ⚙️ 配置参数 (Valves)
| 参数 | 默认值 | 描述 |
| :--- | :--- | :--- |
| `MODEL_ID` | (留空) | 用于文本分析的模型 ID。留空则随当前聊天模型。 |
| `MESSAGE_COUNT` | `12` | 聚合消息的数量。`0` 表示全量消息,`12` 表示截取最近的 12 条。 |
| `MIN_TEXT_LENGTH` | `100` | 触发导图分析所需的最小字符长度。 |
## ❓ 常见问题
- **语言显示不正确?**:工具采用 4 级探测机制(前端脚本 > 浏览器头 > 用户资料 > 默认)。请检查浏览器语言设置。
- **生成的导图太小或太大?**:我们针对对话流内联显示优化了 `500px` 的固定高度,并配有自适应缩放逻辑。
- **导出图片**:建议先点击“⛶”进入全屏,获得最佳构图后再点击导出。
---
## ⭐ 支持
如果这个工具帮您理清了思路,欢迎在 [GitHub](https://github.com/Fu-Jie/openwebui-extensions) 给我们一个 Star。
## ⚖️ 许可证
MIT License. Designed with ❤️ by Fu-Jie.

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,23 @@
# Smart Mind Map Tool v1.0.0 Release Notes
## Overview
The Smart Mind Map Tool represents a strategic evolution of our popular Action plugin, fully optimized for the tool-calling era. Powered by OpenWebUI 0.8.0's Rich UI enhancements, it transforms knowledge visualization from a manual task into an autonomous AI capability, intelligently deciding when a visual breakdown will most benefit your workflow.
## New Features
- **AI Proactive Invocation**: The AI can now autonomously trigger mind map generation based on the project's logic and user intent without manual clicks.
- **Native Rich UI Embedding**: Direct chat-stream HTML/iframe rendering with smooth interaction and responsive scaling.
- **Smart Context Injection**: Completely refactored to use native `__messages__`. Simplifies calling parameters while ensuring deep understanding of the conversation history.
- **Fluid Responsive Layout**: Implemented golden-ratio `aspect-ratio: 16 / 9` with flexible height bounds for a consistent experience across Desktop and Mobile.
- **Deep i18n Support**: 4-level automated language detection cascade (JS > Header > Profile > Default). Natively supports 13 languages: **English, Simplified Chinese, Traditional Chinese (HK/TW), Japanese, Korean, French, German, Spanish, Italian, Russian, Vietnamese, and Indonesian**.
## Bug Fixes
- **Iframe Background Bleed Fix**: Resolved the "white border" issue in dark mode by forcing bone-level transparency on the HTML/Body frame.
- **Drawing Area Refinement**: Replaced fixed 500px height with flexible clamping for better readability on varied screen sizes.
## Migration & Setup
- **Native Tool Calling**: For reliable autonomous triggering, MUST enable **"Native Tool Calling"** in either individual **Chat Settings** (Controls icon at top-right corner) or OpenWebUI Admin -> Model settings.
- **MESSAGE_COUNT**: Defaulting to `12` messages for optimal performance. Set to `0` for full conservation summaries.

View File

@@ -0,0 +1,23 @@
# Smart Mind Map Tool v1.0.0 版本发布说明
## 概览
智能思维导图工具Smart Mind Map Tool作为广受好评的 Action 版本插件的深度进化,正式开启 v1.0.0 工具化时代。本次发布利用 OpenWebUI 0.8.0 的 Rich UI 技术,将“导图生成”从用户点按的“被动技能”转化为 AI 自主判断的“主动智能”,为您提供无缝的知识可视化体验。
## 新功能
- **AI 自主/主动调用**AI 现在可以根据对话的复杂度和上下文,自动决定何时生成导图,无需用户手动触发。
- **原生 Rich UI 嵌入**:得益于 OpenWebUI 最新架构,导图现在能够以 HTML/iframe 形式直接嵌入对话流中,支持实时缩放和交互。
- **全自动上下文注入**:弃用了旧的手动文本输入参数,改为原生支持 `__messages__`。工具会自动从当前对话提取最近 12 条(默认)或全量消息进行结构化分析。
- **完美响应式布局**:基于 16:9 黄金比例设计,并辅以 `aspect-ratio` 适配,解决移动端与桌面端的排版冲突问题。
- **原生多语言支持**:支持 4 级自动化语言探测JS 脚本 > 浏览器头 > 用户资料 > 默认回退)。内置适配了 13 种主流语言,包括:**简体中文、繁体中文(港/台)、英语、俄语、日语、韩语、法语、德语、西班牙语、意大利语、越南语、印度尼西亚语**。所有 UI 界面、按钮、状态提示及 AI 生成逻辑均经过本地化优化。
## 问题修复
- **背景融合黑洞修复**:解决了在暗黑模式下 iframe 边缘可能出现的白色背景露边问题,通过强制声明 HTML/Body 透明背景实现 UI 无缝融合。
- **画布高度优化**:移除了固定 500px 高度,采用 `aspect-ratio` 和弹性高度限制,防止在小屏幕下内容被截断。
## 迁移与配置说明
- **Native Tool Calling**: 为了获得最佳体验,请务必在 **右上角对话设置**(参数图标)或 OpenWebUI 管理员设置的模型选项中开启 **“启用原生工具调用 (Native Tool Calling)”**。
- **MESSAGE_COUNT**: 默认值为 `12`。如需分析整段超长会话,请在 Valves 中将其设为 `0`