docs: standardize plugin READMEs and documentation rules
This commit is contained in:
@@ -230,7 +230,3 @@ except Exception as e:
|
||||
|
||||
Fu-Jie
|
||||
GitHub: [Fu-Jie/awesome-openwebui](https://github.com/Fu-Jie/awesome-openwebui)
|
||||
|
||||
## License
|
||||
|
||||
MIT License
|
||||
|
||||
@@ -229,7 +229,3 @@ except Exception as e:
|
||||
|
||||
Fu-Jie
|
||||
GitHub: [Fu-Jie/awesome-openwebui](https://github.com/Fu-Jie/awesome-openwebui)
|
||||
|
||||
## 许可证
|
||||
|
||||
MIT License
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# 🌊 Deep Dive
|
||||
|
||||
**Author:** [Fu-Jie](https://github.com/Fu-Jie/awesome-openwebui) | **Version:** 1.0.0 | **Project:** [Awesome OpenWebUI](https://github.com/Fu-Jie/awesome-openwebui)
|
||||
**Author:** [Fu-Jie](https://github.com/Fu-Jie/awesome-openwebui) | **Version:** 1.0.0 | **Project:** [Awesome OpenWebUI](https://github.com/Fu-Jie/awesome-openwebui) | **License:** MIT
|
||||
|
||||
A comprehensive thinking lens that dives deep into any content - from context to logic, insights, and action paths.
|
||||
|
||||
@@ -81,3 +81,10 @@ The plugin generates a structured thinking timeline:
|
||||
|
||||
- `deep_dive.py` - English version
|
||||
- `deep_dive_cn.py` - Chinese version (精读)
|
||||
|
||||
## Troubleshooting ❓
|
||||
|
||||
- **Plugin not working?**: Check if the filter/action is enabled in the model settings.
|
||||
- **Debug Logs**: Enable `SHOW_STATUS` in Valves to see progress updates.
|
||||
- **Error Messages**: If you see an error, please copy the full error message and report it.
|
||||
- **Submit an Issue**: If you encounter any problems, please submit an issue on GitHub: [Awesome OpenWebUI Issues](https://github.com/Fu-Jie/awesome-openwebui/issues)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# 📖 精读
|
||||
|
||||
**作者:** [Fu-Jie](https://github.com/Fu-Jie/awesome-openwebui) | **版本:** 1.0.0 | **项目:** [Awesome OpenWebUI](https://github.com/Fu-Jie/awesome-openwebui)
|
||||
**作者:** [Fu-Jie](https://github.com/Fu-Jie/awesome-openwebui) | **版本:** 1.0.0 | **项目:** [Awesome OpenWebUI](https://github.com/Fu-Jie/awesome-openwebui) | **许可证:** MIT
|
||||
|
||||
全方位的思维透镜 —— 从背景全景到逻辑脉络,从深度洞察到行动路径。
|
||||
|
||||
@@ -81,3 +81,10 @@
|
||||
|
||||
- `deep_dive.py` - 英文版 (Deep Dive)
|
||||
- `deep_dive_cn.py` - 中文版 (精读)
|
||||
|
||||
## 故障排除 (Troubleshooting) ❓
|
||||
|
||||
- **插件不工作?**: 请检查是否在模型设置中启用了该过滤器/动作。
|
||||
- **调试日志**: 在 Valves 中启用 `SHOW_STATUS` 以查看进度更新。
|
||||
- **错误信息**: 如果看到错误,请复制完整的错误信息并报告。
|
||||
- **提交 Issue**: 如果遇到任何问题,请在 GitHub 上提交 Issue:[Awesome OpenWebUI Issues](https://github.com/Fu-Jie/awesome-openwebui/issues)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# 📝 Export to Word (Enhanced)
|
||||
|
||||
**Author:** [Fu-Jie](https://github.com/Fu-Jie/awesome-openwebui) | **Version:** 0.4.3 | **Project:** [Awesome OpenWebUI](https://github.com/Fu-Jie/awesome-openwebui)
|
||||
**Author:** [Fu-Jie](https://github.com/Fu-Jie/awesome-openwebui) | **Version:** 0.4.3 | **Project:** [Awesome OpenWebUI](https://github.com/Fu-Jie/awesome-openwebui) | **License:** MIT
|
||||
|
||||
Export conversation to Word (.docx) with **syntax highlighting**, **native math equations**, **Mermaid diagrams**, **citations**, and **enhanced table formatting**.
|
||||
|
||||
@@ -86,3 +86,10 @@ Export conversation to Word (.docx) with **syntax highlighting**, **native math
|
||||
- **Font & Style Configuration**: Customizable fonts and table colors.
|
||||
- **Mermaid Enhancements**: Hybrid SVG+PNG rendering, background color config.
|
||||
- **Performance**: Real-time progress updates for large exports.
|
||||
|
||||
## Troubleshooting ❓
|
||||
|
||||
- **Plugin not working?**: Check if the filter/action is enabled in the model settings.
|
||||
- **Debug Logs**: Check the browser console (F12) for detailed logs if available.
|
||||
- **Error Messages**: If you see an error, please copy the full error message and report it.
|
||||
- **Submit an Issue**: If you encounter any problems, please submit an issue on GitHub: [Awesome OpenWebUI Issues](https://github.com/Fu-Jie/awesome-openwebui/issues)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# 📝 导出为 Word (增强版)
|
||||
|
||||
**Author:** [Fu-Jie](https://github.com/Fu-Jie/awesome-openwebui) | **Version:** 0.4.3 | **Project:** [Awesome OpenWebUI](https://github.com/Fu-Jie/awesome-openwebui)
|
||||
**Author:** [Fu-Jie](https://github.com/Fu-Jie/awesome-openwebui) | **Version:** 0.4.3 | **Project:** [Awesome OpenWebUI](https://github.com/Fu-Jie/awesome-openwebui) | **许可证:** MIT
|
||||
|
||||
将对话导出为 Word (.docx),支持**代码语法高亮**、**原生数学公式**、**Mermaid 图表**、**引用参考**和**增强表格格式**。
|
||||
|
||||
@@ -86,3 +86,10 @@
|
||||
- **字体与样式配置**: 支持自定义中英文字体、代码字体以及表格颜色。
|
||||
- **Mermaid 增强**: 混合 SVG+PNG 渲染,支持背景色配置。
|
||||
- **性能优化**: 导出大型文档时提供实时进度反馈。
|
||||
|
||||
## 故障排除 (Troubleshooting) ❓
|
||||
|
||||
- **插件不工作?**: 请检查是否在模型设置中启用了该过滤器/动作。
|
||||
- **调试日志**: 请查看浏览器控制台 (F12) 获取详细日志(如果可用)。
|
||||
- **错误信息**: 如果看到错误,请复制完整的错误信息并报告。
|
||||
- **提交 Issue**: 如果遇到任何问题,请在 GitHub 上提交 Issue:[Awesome OpenWebUI Issues](https://github.com/Fu-Jie/awesome-openwebui/issues)
|
||||
|
||||
@@ -2,9 +2,18 @@
|
||||
|
||||
Generate polished learning flashcards from any text—title, summary, key points, tags, and category—ready for review and sharing.
|
||||
|
||||
**Author:** [Fu-Jie](https://github.com/Fu-Jie/awesome-openwebui) | **Version:** 0.2.4 | **Project:** [Awesome OpenWebUI](https://github.com/Fu-Jie/awesome-openwebui) | **License:** MIT
|
||||
|
||||
## Preview 📸
|
||||
|
||||

|
||||
|
||||
## Highlights
|
||||
## What's New
|
||||
|
||||
### v0.2.4
|
||||
- **Clean Output**: Removed debug messages from output.
|
||||
|
||||
## Key Features 🔑
|
||||
|
||||
- **One-click generation**: Drop in text, get a structured card.
|
||||
- **Concise extraction**: 3–5 key points and 2–4 tags automatically surfaced.
|
||||
@@ -12,7 +21,14 @@ Generate polished learning flashcards from any text—title, summary, key points
|
||||
- **Progressive merge**: Multiple runs append cards into the same HTML container; enable clearing to reset.
|
||||
- **Status updates**: Live notifications for generating/done/error.
|
||||
|
||||
## Parameters
|
||||
## How to Use 🛠️
|
||||
|
||||
1. **Install**: Add the plugin to your OpenWebUI instance.
|
||||
2. **Configure**: Adjust settings in the Valves menu (optional).
|
||||
3. **Trigger**: Send text to the chat.
|
||||
4. **Result**: Watch status updates; the card HTML is embedded into the latest message.
|
||||
|
||||
## Configuration (Valves) ⚙️
|
||||
|
||||
| Param | Description | Default |
|
||||
| ------------------- | ------------------------------------------------------------ | ------- |
|
||||
@@ -23,34 +39,9 @@ Generate polished learning flashcards from any text—title, summary, key points
|
||||
| CLEAR_PREVIOUS_HTML | Whether to clear previous card HTML (otherwise append/merge) | false |
|
||||
| MESSAGE_COUNT | Use the latest N messages to build the card | 1 |
|
||||
|
||||
## How to Use
|
||||
## Troubleshooting ❓
|
||||
|
||||
1. Install and enable “Flash Card”.
|
||||
2. Send the text to the chat (multi-turn supported; governed by MESSAGE_COUNT).
|
||||
3. Watch status updates; the card HTML is embedded into the latest message.
|
||||
4. To regenerate from scratch, toggle CLEAR_PREVIOUS_HTML or resend text.
|
||||
|
||||
## Output Format
|
||||
|
||||
- JSON fields: `title`, `summary`, `key_points` (3–5), `tags` (2–4), `category`.
|
||||
- UI: gradient-styled card with tags, key-point list; supports stacking multiple cards.
|
||||
|
||||
## Tips
|
||||
|
||||
- Very short text triggers a prompt to add more; consider summarizing first.
|
||||
- Long text is accepted; for deep analysis, pre-condense with other tools before card creation.
|
||||
|
||||
## Author
|
||||
|
||||
Fu-Jie
|
||||
GitHub: [Fu-Jie/awesome-openwebui](https://github.com/Fu-Jie/awesome-openwebui)
|
||||
|
||||
## License
|
||||
|
||||
MIT License
|
||||
|
||||
## Changelog
|
||||
|
||||
### v0.2.4
|
||||
|
||||
- Removed debug messages from output
|
||||
- **Plugin not working?**: Check if the filter/action is enabled in the model settings.
|
||||
- **Debug Logs**: Enable `SHOW_STATUS` in Valves to see progress updates.
|
||||
- **Error Messages**: If you see an error, please copy the full error message and report it.
|
||||
- **Submit an Issue**: If you encounter any problems, please submit an issue on GitHub: [Awesome OpenWebUI Issues](https://github.com/Fu-Jie/awesome-openwebui/issues)
|
||||
|
||||
@@ -2,9 +2,18 @@
|
||||
|
||||
快速将文本提炼为精美的学习记忆卡片,自动抽取标题、摘要、关键要点、标签和分类,适合复习与分享。
|
||||
|
||||
**作者:** [Fu-Jie](https://github.com/Fu-Jie/awesome-openwebui) | **版本:** 0.2.4 | **项目:** [Awesome OpenWebUI](https://github.com/Fu-Jie/awesome-openwebui) | **许可证:** MIT
|
||||
|
||||
## 预览 📸
|
||||
|
||||

|
||||
|
||||
## 功能亮点
|
||||
## 更新日志
|
||||
|
||||
### v0.2.4
|
||||
- **输出优化**: 移除输出中的调试信息。
|
||||
|
||||
## 核心特性 🔑
|
||||
|
||||
- **一键生成**:输入任意文本,直接产出结构化卡片。
|
||||
- **要点聚合**:自动提取 3-5 个记忆要点与 2-4 个标签。
|
||||
@@ -12,7 +21,14 @@
|
||||
- **渐进合并**:多次调用会将新卡片合并到同一 HTML 容器中;如需重置可启用清空选项。
|
||||
- **状态提示**:实时推送“生成中/完成/错误”等状态与通知。
|
||||
|
||||
## 参数说明
|
||||
## 使用方法 🛠️
|
||||
|
||||
1. **安装**: 在插件市场安装并启用“闪记卡”。
|
||||
2. **配置**: 根据需要调整 Valves 设置(可选)。
|
||||
3. **触发**: 将待整理的文本发送到聊天框。
|
||||
4. **结果**: 等待状态提示,卡片将以 HTML 形式嵌入到最新消息中。
|
||||
|
||||
## 配置参数 (Valves) ⚙️
|
||||
|
||||
| 参数 | 说明 | 默认值 |
|
||||
| ------------------- | ------------------------------------- | ------ |
|
||||
@@ -23,34 +39,9 @@
|
||||
| CLEAR_PREVIOUS_HTML | 是否清空旧的卡片 HTML(否则合并追加) | false |
|
||||
| MESSAGE_COUNT | 取最近 N 条消息生成卡片 | 1 |
|
||||
|
||||
## 使用步骤
|
||||
## 故障排除 (Troubleshooting) ❓
|
||||
|
||||
1. 在插件市场安装并启用“闪记卡”。
|
||||
2. 将待整理的文本发送到聊天框(可多轮对话,受 MESSAGE_COUNT 控制)。
|
||||
3. 等待状态提示,卡片将以 HTML 形式嵌入到最新消息中。
|
||||
4. 若需重新生成,开启 CLEAR_PREVIOUS_HTML 或直接重发文本。
|
||||
|
||||
## 输出格式
|
||||
|
||||
- JSON 字段:`title`、`summary`、`key_points`(3-5 条)、`tags`(2-4 条)、`category`。
|
||||
- 前端呈现:单卡片带渐变主题、标签胶囊、要点列表,可连续追加多张卡片。
|
||||
|
||||
## 使用建议
|
||||
|
||||
- 文本过短会提醒补充,可先汇总再生成卡片。
|
||||
- 长文本无需截断,直接生成;如需深度分析可先用其他工具精炼后再制作卡片。
|
||||
|
||||
## 作者
|
||||
|
||||
Fu-Jie
|
||||
GitHub: [Fu-Jie/awesome-openwebui](https://github.com/Fu-Jie/awesome-openwebui)
|
||||
|
||||
## 许可证
|
||||
|
||||
MIT License
|
||||
|
||||
## 更新日志
|
||||
|
||||
### v0.2.4
|
||||
|
||||
- 移除输出中的调试信息
|
||||
- **插件不工作?**: 请检查是否在模型设置中启用了该过滤器/动作。
|
||||
- **调试日志**: 在 Valves 中启用 `SHOW_STATUS` 以查看进度更新。
|
||||
- **错误信息**: 如果看到错误,请复制完整的错误信息并报告。
|
||||
- **提交 Issue**: 如果遇到任何问题,请在 GitHub 上提交 Issue:[Awesome OpenWebUI Issues](https://github.com/Fu-Jie/awesome-openwebui/issues)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# 📊 Smart Infographic (AntV)
|
||||
|
||||
**Author:** [Fu-Jie](https://github.com/Fu-Jie/awesome-openwebui) | **Version:** 1.4.9 | **Project:** [Awesome OpenWebUI](https://github.com/Fu-Jie/awesome-openwebui)
|
||||
**Author:** [Fu-Jie](https://github.com/Fu-Jie/awesome-openwebui) | **Version:** 1.4.9 | **Project:** [Awesome OpenWebUI](https://github.com/Fu-Jie/awesome-openwebui) | **License:** MIT
|
||||
|
||||
An Open WebUI plugin powered by the AntV Infographic engine. It transforms long text into professional, beautiful infographics with a single click.
|
||||
|
||||
@@ -56,6 +56,14 @@ You can adjust the following parameters in the plugin settings to optimize the g
|
||||
| **Hierarchy** | `hierarchy-tree-tech-style-capsule-item`, `hierarchy-structure` | Org Charts, Structures |
|
||||
| **Charts** | `chart-column-simple`, `chart-bar-plain-text`, `chart-line-plain-text`, `chart-wordcloud` | Trends, Distributions, Metrics |
|
||||
|
||||
## Troubleshooting ❓
|
||||
|
||||
- **Plugin not working?**: Check if the filter/action is enabled in the model settings.
|
||||
- **Debug Logs**: Enable `SHOW_STATUS` in Valves to see progress updates.
|
||||
- **Error Messages**: If you see an error, please copy the full error message and report it.
|
||||
- **Submit an Issue**: If you encounter any problems, please submit an issue on GitHub: [Awesome OpenWebUI Issues](https://github.com/Fu-Jie/awesome-openwebui/issues)
|
||||
|
||||
|
||||
## 📝 Syntax Example (For Advanced Users)
|
||||
|
||||
You can also input this syntax directly for AI to render:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# 📊 智能信息图 (AntV Infographic)
|
||||
|
||||
**Author:** [Fu-Jie](https://github.com/Fu-Jie/awesome-openwebui) | **Version:** 1.4.9 | **Project:** [Awesome OpenWebUI](https://github.com/Fu-Jie/awesome-openwebui)
|
||||
**作者:** [Fu-Jie](https://github.com/Fu-Jie/awesome-openwebui) | **版本:** 1.4.9 | **项目:** [Awesome OpenWebUI](https://github.com/Fu-Jie/awesome-openwebui) | **许可证:** MIT
|
||||
|
||||
基于 AntV Infographic 引擎的 Open WebUI 插件,能够将长文本内容一键转换为专业、美观的信息图表。
|
||||
|
||||
@@ -56,6 +56,14 @@
|
||||
| **层级与结构** | `hierarchy-tree-tech-style-capsule-item`, `hierarchy-structure` | 组织架构、层级关系 |
|
||||
| **图表与数据** | `chart-column-simple`, `chart-bar-plain-text`, `chart-line-plain-text`, `chart-wordcloud` | 数据趋势、比例分布、数值对比 |
|
||||
|
||||
## 故障排除 (Troubleshooting) ❓
|
||||
|
||||
- **插件不工作?**: 请检查是否在模型设置中启用了该过滤器/动作。
|
||||
- **调试日志**: 在 Valves 中启用 `SHOW_STATUS` 以查看进度更新。
|
||||
- **错误信息**: 如果看到错误,请复制完整的错误信息并报告。
|
||||
- **提交 Issue**: 如果遇到任何问题,请在 GitHub 上提交 Issue:[Awesome OpenWebUI Issues](https://github.com/Fu-Jie/awesome-openwebui/issues)
|
||||
|
||||
|
||||
## 📝 语法示例 (高级用户)
|
||||
|
||||
你也可以直接输入以下语法让 AI 渲染:
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
# 📊 Smart Infographic (AntV)
|
||||
|
||||
An Open WebUI plugin powered by the AntV Infographic engine. It transforms long text into professional, beautiful infographics with a single click.
|
||||
|
||||
## ✨ Key Features
|
||||
|
||||
- 🚀 **AI-Powered Transformation**: Automatically analyzes text logic, extracts key points, and generates structured charts.
|
||||
- 🎨 **Professional Templates**: Includes various AntV official templates: Lists, Trees, Mindmaps, Comparison Tables, Flowcharts, and Statistical Charts.
|
||||
- 🔍 **Auto-Icon Matching**: Built-in logic to search and match the most relevant Material Design Icons based on content.
|
||||
- 📥 **Multi-Format Export**: Download your infographics as **SVG**, **PNG**, or a **Standalone HTML** file.
|
||||
- 🌈 **Highly Customizable**: Supports Dark/Light modes, auto-adapts theme colors, with bold titles and refined card layouts.
|
||||
- 📱 **Responsive Design**: Generated charts look great on both desktop and mobile devices.
|
||||
|
||||
## 🛠️ Supported Template Types
|
||||
|
||||
| Category | Template Name | Use Case |
|
||||
| :--- | :--- | :--- |
|
||||
| **Lists & Hierarchy** | `list-grid`, `tree-vertical`, `mindmap` | Features, Org Charts, Brainstorming |
|
||||
| **Sequence & Relation** | `sequence-roadmap`, `relation-circle` | Roadmaps, Circular Flows, Steps |
|
||||
| **Comparison & Analysis** | `compare-binary`, `compare-swot`, `quadrant-quarter` | Pros/Cons, SWOT, Quadrants |
|
||||
| **Charts & Data** | `chart-bar`, `chart-line`, `chart-pie` | Trends, Distributions, Metrics |
|
||||
|
||||
## 🚀 How to Use
|
||||
|
||||
1. **Install**: Search for "Smart Infographic" in the Open WebUI Community and install.
|
||||
2. **Trigger**: Enter your text in the chat, then click the **Action Button** (📊 icon) next to the input box.
|
||||
3. **AI Processing**: The AI analyzes the text and generates the infographic syntax.
|
||||
4. **Preview & Download**: Preview the result and use the download buttons below to save your infographic.
|
||||
|
||||
## ⚙️ Configuration (Valves)
|
||||
|
||||
You can adjust the following parameters in the plugin settings to optimize the generation:
|
||||
|
||||
| Parameter | Default | Description |
|
||||
| :--- | :--- | :--- |
|
||||
| **Show Status (SHOW_STATUS)** | `True` | Whether to show real-time AI analysis and generation status in the chat. |
|
||||
| **Model ID (MODEL_ID)** | `Empty` | Specify the LLM model for text analysis. If empty, the current chat model is used. |
|
||||
| **Min Text Length (MIN_TEXT_LENGTH)** | `100` | Minimum characters required to trigger analysis, preventing accidental triggers on short text. |
|
||||
| **Clear Previous (CLEAR_PREVIOUS_HTML)** | `False` | Whether to clear previous charts. If `False`, new charts will be appended below. |
|
||||
| **Message Count (MESSAGE_COUNT)** | `1` | Number of recent messages to use for analysis. Increase this for more context. |
|
||||
|
||||
## 📝 Syntax Example (For Advanced Users)
|
||||
|
||||
You can also input this syntax directly for AI to render:
|
||||
|
||||
```infographic
|
||||
infographic list-grid
|
||||
data
|
||||
title 🚀 Plugin Benefits
|
||||
desc Why use the Smart Infographic plugin
|
||||
items
|
||||
- label Fast Generation
|
||||
desc Convert text to charts in seconds
|
||||
- label Beautiful Design
|
||||
desc Uses AntV professional design standards
|
||||
```
|
||||
|
||||
## 👨💻 Author
|
||||
|
||||
**jeff**
|
||||
- GitHub: [Fu-Jie/awesome-openwebui](https://github.com/Fu-Jie/awesome-openwebui)
|
||||
|
||||
## 📄 License
|
||||
|
||||
MIT License
|
||||
@@ -1,14 +1,10 @@
|
||||
# Smart Mind Map - Mind Mapping Generation Plugin
|
||||
|
||||
**Author:** [Fu-Jie](https://github.com/Fu-Jie/awesome-openwebui) | **Version:** 0.9.1 | **License:** MIT
|
||||
|
||||
> **Important**: To ensure the maintainability and usability of all plugins, each plugin should be accompanied by clear and comprehensive documentation to ensure its functionality, configuration, and usage are well explained.
|
||||
|
||||
Smart Mind Map is a powerful OpenWebUI action plugin that intelligently analyzes long-form text content and automatically generates interactive mind maps, helping users structure and visualize knowledge.
|
||||
|
||||
---
|
||||
**Author:** [Fu-Jie](https://github.com/Fu-Jie/awesome-openwebui) | **Version:** 0.9.1 | **Project:** [Awesome OpenWebUI](https://github.com/Fu-Jie/awesome-openwebui) | **License:** MIT
|
||||
|
||||
## 🔥 What's New in v0.9.1
|
||||
## What's New in v0.9.1
|
||||
|
||||
**New Feature: Image Output Mode**
|
||||
|
||||
@@ -18,362 +14,51 @@ Smart Mind Map is a powerful OpenWebUI action plugin that intelligently analyzes
|
||||
- **Efficient Storage**: Image mode uploads SVG to `/api/v1/files`, avoiding huge base64 strings in chat history.
|
||||
- **Smart Features**: Auto-responsive width and automatic theme detection (light/dark) for generated images.
|
||||
|
||||
| Feature | HTML Mode (Default) | Image Mode |
|
||||
| :--- | :--- | :--- |
|
||||
| **Output Format** | Interactive HTML Block | Static Markdown Image |
|
||||
| **Interactivity** | Zoom, Pan, Expand/Collapse | None (Static Image) |
|
||||
| **Chat History** | Contains HTML Code | Clean (Image URL only) |
|
||||
| **Storage** | Browser Rendering | `/api/v1/files` Upload |
|
||||
## Key Features 🔑
|
||||
|
||||
---
|
||||
- ✅ **Intelligent Text Analysis**: Automatically identifies core themes, key concepts, and hierarchical structures.
|
||||
- ✅ **Interactive Visualization**: Generates beautiful interactive mind maps based on Markmap.js.
|
||||
- ✅ **High-Resolution PNG Export**: Export mind maps as high-quality PNG images (9x scale).
|
||||
- ✅ **Complete Control Panel**: Zoom controls, expand level selection, and fullscreen mode.
|
||||
- ✅ **Theme Switching**: Manual theme toggle button with automatic theme detection.
|
||||
- ✅ **Image Output Mode**: Generate static SVG images embedded directly in Markdown for cleaner history.
|
||||
|
||||
## Core Features
|
||||
## How to Use 🛠️
|
||||
|
||||
- ✅ **Intelligent Text Analysis**: Automatically identifies core themes, key concepts, and hierarchical structures
|
||||
- ✅ **Interactive Visualization**: Generates beautiful interactive mind maps based on Markmap.js
|
||||
- ✅ **High-Resolution PNG Export**: Export mind maps as high-quality PNG images (9x scale, ~1-2MB file size)
|
||||
- ✅ **Complete Control Panel**: Zoom controls (+/-/reset), expand level selection (All/2/3 levels), and fullscreen mode
|
||||
- ✅ **Theme Switching**: Manual theme toggle button (light/dark) with automatic theme detection
|
||||
- ✅ **Dark Mode Support**: Full dark mode support with automatic detection and manual override
|
||||
- ✅ **Multi-language Support**: Automatically adjusts output based on user language
|
||||
- ✅ **Real-time Rendering**: Renders mind maps directly in the chat interface without navigation
|
||||
- ✅ **Export Capabilities**: Supports PNG, SVG code, and Markdown source export
|
||||
- ✅ **Customizable Configuration**: Configurable LLM model, minimum text length, and other parameters
|
||||
- ✅ **Image Output Mode**: Generate static SVG images embedded directly in Markdown (**No HTML code output**, cleaner chat history)
|
||||
1. **Install**: Upload the `smart_mind_map.py` file in OpenWebUI Admin Settings -> Plugins -> Actions.
|
||||
2. **Configure**: Ensure you have an LLM model configured (e.g., `gemini-2.5-flash`).
|
||||
3. **Trigger**: Enable the "Smart Mind Map" action in chat settings and send text (at least 100 characters).
|
||||
4. **Result**: The mind map will be rendered directly in the chat interface.
|
||||
|
||||
---
|
||||
|
||||
## How It Works
|
||||
|
||||
1. **Text Extraction**: Extracts text content from user messages (automatically filters HTML code blocks)
|
||||
2. **Intelligent Analysis**: Analyzes text structure using the configured LLM model
|
||||
3. **Markdown Generation**: Converts analysis results to Markmap-compatible Markdown format
|
||||
4. **Visual Rendering**: Renders the mind map using Markmap.js in an HTML template with optimized font hierarchy (H1: 22px bold, H2: 18px bold)
|
||||
5. **Interactive Display**: Presents the mind map to users in an interactive format with complete control panel
|
||||
6. **Theme Detection**: Automatically detects and applies the current OpenWebUI theme (light/dark mode)
|
||||
7. **Export Options**: Provides PNG (high-resolution), SVG, and Markdown export functionality
|
||||
|
||||
---
|
||||
|
||||
## Installation and Configuration
|
||||
|
||||
### 1. Plugin Installation
|
||||
|
||||
1. Download the `smart_mind_map_cn.py` file to your local computer
|
||||
2. In OpenWebUI Admin Settings, find the "Plugins" section
|
||||
3. Select "Actions" type
|
||||
4. Upload the downloaded file
|
||||
5. Refresh the page, and the plugin will be available
|
||||
|
||||
### 2. Model Configuration
|
||||
|
||||
The plugin requires access to an LLM model for text analysis. Please ensure:
|
||||
|
||||
- Your OpenWebUI instance has at least one available LLM model configured
|
||||
- Recommended to use fast, economical models (e.g., `gemini-2.5-flash`) for the best experience
|
||||
- Configure the `LLM_MODEL_ID` parameter in the plugin settings
|
||||
|
||||
### 3. Plugin Activation
|
||||
|
||||
Select the "Smart Mind Map" action plugin in chat settings to enable it.
|
||||
|
||||
### 4. Theme Color Consistency (Optional)
|
||||
|
||||
To keep the mind map visually consistent with the OpenWebUI theme colors, enable same-origin access for artifacts in OpenWebUI:
|
||||
|
||||
- **Configuration Location**: In OpenWebUI User Settings: **Interface** → **Artifacts** → **iframe Sandbox Allow Same Origin**
|
||||
- **Enable Option**: Check the "Allow same-origin access for artifacts" / "iframe sandbox allow-same-origin" option
|
||||
- **Sandbox Attributes**: Ensure the iframe's sandbox attribute includes both `allow-same-origin` and `allow-scripts`
|
||||
|
||||
Once enabled, the mind map will automatically detect and apply the current OpenWebUI theme (light/dark) without any manual configuration.
|
||||
|
||||
---
|
||||
|
||||
## Configuration Parameters
|
||||
|
||||
You can adjust the following parameters in the plugin's settings (Valves):
|
||||
## Configuration (Valves) ⚙️
|
||||
|
||||
| Parameter | Default | Description |
|
||||
| :--- | :--- | :--- |
|
||||
| `show_status` | `true` | Whether to display operation status updates in the chat interface (e.g., "Analyzing..."). |
|
||||
| `LLM_MODEL_ID` | `gemini-2.5-flash` | LLM model ID for text analysis. Recommended to use fast and economical models. |
|
||||
| `MIN_TEXT_LENGTH` | `100` | Minimum text length (in characters) required for mind map analysis. Text that's too short cannot generate valid mind maps. |
|
||||
| `CLEAR_PREVIOUS_HTML` | `false` | Whether to clear previous plugin-generated HTML content when generating a new mind map. |
|
||||
| `MESSAGE_COUNT` | `1` | Number of recent messages to use for mind map generation (1-5). |
|
||||
| `OUTPUT_MODE` | `html` | Output mode: `html` for interactive HTML (default), or `image` to embed as static Markdown image. |
|
||||
| `show_status` | `true` | Whether to display operation status updates. |
|
||||
| `LLM_MODEL_ID` | `gemini-2.5-flash` | LLM model ID for text analysis. |
|
||||
| `MIN_TEXT_LENGTH` | `100` | Minimum text length required for analysis. |
|
||||
| `CLEAR_PREVIOUS_HTML` | `false` | Whether to clear previous plugin-generated HTML content. |
|
||||
| `MESSAGE_COUNT` | `1` | Number of recent messages to use for generation (1-5). |
|
||||
| `OUTPUT_MODE` | `html` | Output mode: `html` (interactive) or `image` (static). |
|
||||
|
||||
---
|
||||
## Troubleshooting ❓
|
||||
|
||||
## Usage
|
||||
|
||||
### Basic Usage
|
||||
|
||||
1. Enable the "Smart Mind Map" action in chat settings
|
||||
2. Input or paste long-form text content (at least 100 characters) in the conversation
|
||||
3. After sending the message, the plugin will automatically analyze and generate a mind map
|
||||
4. The mind map will be rendered directly in the chat interface
|
||||
|
||||
### Usage Example
|
||||
|
||||
**Input Text:**
|
||||
|
||||
```
|
||||
Artificial Intelligence (AI) is a branch of computer science dedicated to creating systems capable of performing tasks that typically require human intelligence.
|
||||
Main application areas include:
|
||||
1. Machine Learning - Enables computers to learn from data
|
||||
2. Natural Language Processing - Understanding and generating human language
|
||||
3. Computer Vision - Recognizing and processing images
|
||||
4. Robotics - Creating intelligent systems that can interact with the physical world
|
||||
```
|
||||
|
||||
**Generated Result:**
|
||||
The plugin will generate an interactive mind map centered on "Artificial Intelligence", including major application areas and their sub-concepts.
|
||||
|
||||
### Export Features
|
||||
|
||||
Generated mind maps support three export methods:
|
||||
|
||||
1. **Download PNG**: Click the "📥 Download PNG" button to export the mind map as a high-resolution PNG image (9x scale, ~1-2MB file size)
|
||||
2. **Copy SVG Code**: Click the "Copy SVG Code" button to copy the mind map in SVG format to the clipboard
|
||||
3. **Copy Markdown**: Click the "Copy Markdown" button to copy the raw Markdown format to the clipboard
|
||||
|
||||
### Control Panel
|
||||
|
||||
The interactive mind map includes a comprehensive control panel:
|
||||
|
||||
- **Zoom Controls**: `+` (zoom in), `-` (zoom out), `↻` (reset view)
|
||||
- **Expand Level**: Switch between "All", "2 Levels", "3 Levels" to control node expansion depth
|
||||
- **Fullscreen**: Enter fullscreen mode for better viewing experience
|
||||
- **Theme Toggle**: Manually switch between light and dark themes
|
||||
- **Plugin not working?**: Check if the action is enabled in the chat settings.
|
||||
- **Text too short**: Ensure input text contains at least 100 characters.
|
||||
- **Rendering failed**: Check browser console for errors related to Markmap.js or D3.js.
|
||||
- **Submit an Issue**: If you encounter any problems, please submit an issue on GitHub: [Awesome OpenWebUI Issues](https://github.com/Fu-Jie/awesome-openwebui/issues)
|
||||
|
||||
---
|
||||
|
||||
## Technical Architecture
|
||||
|
||||
### Frontend Rendering
|
||||
|
||||
- **Markmap.js**: Open-source mind mapping rendering engine
|
||||
- **D3.js**: Data visualization foundation library
|
||||
- **Responsive Design**: Adapts to different screen sizes
|
||||
- **Font Hierarchy**: Optimized typography with H1 (22px bold) and H2 (18px bold) for better readability
|
||||
|
||||
### PNG Export Technology
|
||||
|
||||
- **SVG to Canvas Conversion**: Converts mind map SVG to canvas for PNG export
|
||||
- **ForeignObject Handling**: Properly processes HTML content within SVG elements
|
||||
- **High Resolution**: 9x scale factor for print-quality output (~1-2MB file size)
|
||||
- **Theme Preservation**: Maintains current theme (light/dark) in exported PNG
|
||||
|
||||
### Theme Detection Mechanism
|
||||
|
||||
Automatically detects and applies themes with a 4-level priority:
|
||||
|
||||
1. **Explicit Toggle**: User manually clicks theme toggle button (highest priority)
|
||||
2. **Meta Tag**: Reads `<meta name="theme-color">` from parent document
|
||||
3. **Class/Data-Theme**: Checks `class` or `data-theme` attributes on parent HTML/body
|
||||
4. **System Preference**: Falls back to `prefers-color-scheme` media query
|
||||
|
||||
### Backend Processing
|
||||
|
||||
- **LLM Integration**: Calls configured models via `generate_chat_completion`
|
||||
- **Text Preprocessing**: Automatically filters HTML code blocks, extracts plain text content
|
||||
- **Format Conversion**: Converts LLM output to Markmap-compatible Markdown format
|
||||
|
||||
### Security Enhancements
|
||||
|
||||
- **XSS Protection**: Automatically escapes `</script>` tags to prevent script injection
|
||||
- **Input Validation**: Checks text length to avoid invalid requests
|
||||
- **Non-Bubbling Events**: Button clicks use `stopPropagation()` to prevent navigation interception
|
||||
|
||||
---
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Issue: Plugin Won't Start
|
||||
|
||||
**Solution:**
|
||||
|
||||
- Check OpenWebUI logs for error messages
|
||||
- Confirm the plugin is correctly uploaded and enabled
|
||||
- Verify OpenWebUI version supports action plugins
|
||||
|
||||
### Issue: Text Content Too Short
|
||||
|
||||
**Symptom:** Prompt shows "Text content is too short for effective analysis"
|
||||
|
||||
**Solution:**
|
||||
|
||||
- Ensure input text contains at least 100 characters (default configuration)
|
||||
- Lower the `MIN_TEXT_LENGTH` parameter value in plugin settings
|
||||
- Provide more detailed, structured text content
|
||||
|
||||
### Issue: Mind Map Not Generated
|
||||
|
||||
**Solution:**
|
||||
|
||||
- Check if `LLM_MODEL_ID` is configured correctly
|
||||
- Confirm the configured model is available in OpenWebUI
|
||||
- Review backend logs for LLM call failures
|
||||
- Verify user has sufficient permissions to access the configured model
|
||||
|
||||
### Issue: Mind Map Display Error
|
||||
|
||||
**Symptom:** Shows "⚠️ Mind map rendering failed"
|
||||
|
||||
**Solution:**
|
||||
|
||||
- Check browser console for error messages
|
||||
- Confirm Markmap.js and D3.js libraries are loading correctly
|
||||
- Verify generated Markdown format conforms to Markmap specifications
|
||||
- Try refreshing the page to re-render
|
||||
|
||||
### Issue: PNG Export Not Working
|
||||
|
||||
**Symptom:** PNG download button doesn't work or produces blank/corrupted images
|
||||
|
||||
**Solution:**
|
||||
|
||||
- Ensure browser supports HTML5 Canvas API (all modern browsers do)
|
||||
- Check browser console for errors related to `toDataURL()` or canvas rendering
|
||||
- Verify the mind map is fully rendered before clicking export
|
||||
- Try refreshing the page and re-generating the mind map
|
||||
- Use Chrome or Firefox for best PNG export compatibility
|
||||
|
||||
### Issue: Theme Not Auto-Detected
|
||||
|
||||
**Symptom:** Mind map doesn't match OpenWebUI theme colors
|
||||
|
||||
**Solution:**
|
||||
|
||||
- Enable "iframe Sandbox Allow Same Origin" in OpenWebUI Settings → Interface → Artifacts
|
||||
- Verify the iframe's sandbox attribute includes both `allow-same-origin` and `allow-scripts`
|
||||
- Ensure parent document has `<meta name="theme-color">` tag or theme class/attribute
|
||||
- Use the manual theme toggle button to override automatic detection
|
||||
- Check browser console for cross-origin errors
|
||||
|
||||
### Issue: Export Function Not Working
|
||||
|
||||
**Solution:**
|
||||
|
||||
- Confirm browser supports Clipboard API
|
||||
- Check if browser is blocking clipboard access permissions
|
||||
- Use modern browsers (Chrome, Firefox, Edge, etc.)
|
||||
|
||||
---
|
||||
- **Markmap.js**: Open-source mind mapping rendering engine.
|
||||
- **PNG Export**: 9x scale factor for print-quality output (~1-2MB file size).
|
||||
- **Theme Detection**: 4-level priority detection (Manual > Meta > Class > System).
|
||||
- **Security**: XSS protection and input validation.
|
||||
|
||||
## Best Practices
|
||||
|
||||
1. **Text Preparation**
|
||||
- Provide text content with clear structure and distinct hierarchies
|
||||
- Use paragraphs, lists, and other formatting to help LLM understand text structure
|
||||
- Avoid excessively lengthy or unstructured text
|
||||
|
||||
2. **Model Selection**
|
||||
- For daily use, recommend fast models like `gemini-2.5-flash`
|
||||
- For complex text analysis, use more powerful models (e.g., GPT-4)
|
||||
- Balance speed and analysis quality based on needs
|
||||
|
||||
3. **Performance Optimization**
|
||||
- Set `MIN_TEXT_LENGTH` appropriately to avoid processing text that's too short
|
||||
- For particularly long texts, consider summarizing before generating mind maps
|
||||
- Disable `show_status` in production environments to reduce interface updates
|
||||
|
||||
4. **Export Quality**
|
||||
- **PNG Export**: Best for presentations, documents, and sharing (9x resolution suitable for printing)
|
||||
- **SVG Export**: Best for further editing in vector graphics tools (infinite scalability)
|
||||
- **Markdown Export**: Best for version control, collaboration, and regeneration
|
||||
|
||||
5. **Theme Consistency**
|
||||
- Enable same-origin access for automatic theme detection
|
||||
- Use manual theme toggle if automatic detection fails
|
||||
- Export PNG after switching to desired theme for consistent visuals
|
||||
|
||||
---
|
||||
|
||||
## Requirements
|
||||
|
||||
This plugin uses only OpenWebUI's built-in dependencies. **No additional packages need to be installed.**
|
||||
|
||||
---
|
||||
|
||||
## Changelog
|
||||
|
||||
### v0.9.1
|
||||
|
||||
**New Feature: Image Output Mode**
|
||||
|
||||
- Added `OUTPUT_MODE` configuration parameter with two options:
|
||||
- `html` (default): Interactive HTML mind map with full control panel
|
||||
- `image`: Static SVG image embedded directly in Markdown (uploaded to `/api/v1/files`)
|
||||
- Image mode features:
|
||||
- Auto-responsive width (adapts to chat container)
|
||||
- Automatic theme detection (light/dark)
|
||||
- Persistent storage via Chat API (survives page refresh)
|
||||
- Efficient file storage (no huge base64 strings in chat history)
|
||||
|
||||
**Improvements:**
|
||||
|
||||
- Implemented robust Chat API update mechanism with retry logic
|
||||
- Fixed message persistence using both `messages[]` and `history.messages`
|
||||
- Added Event API for immediate frontend updates
|
||||
- Removed unnecessary `SVG_WIDTH` and `SVG_HEIGHT` parameters (now auto-calculated)
|
||||
|
||||
**Technical Details:**
|
||||
|
||||
- Image mode uses `__event_call__` to execute JavaScript in the browser
|
||||
- SVG is rendered offline, converted to Blob, and uploaded to OpenWebUI Files API
|
||||
- Updates chat message with `/api/v1/files/{id}/content` URL via OpenWebUI Backend-Controlled API flow
|
||||
|
||||
### v0.8.2
|
||||
|
||||
- Removed debug messages from output
|
||||
|
||||
### v0.8.0 (Previous Version)
|
||||
|
||||
**Major Features:**
|
||||
|
||||
- Added high-resolution PNG export (9x scale, ~1-2MB file size)
|
||||
- Implemented complete control panel with zoom controls (+/-/reset)
|
||||
- Added expand level selection (All/2/3 levels)
|
||||
- Integrated fullscreen mode with auto-fit
|
||||
- Added manual theme toggle button (light/dark)
|
||||
- Implemented automatic theme detection with 4-level priority
|
||||
|
||||
**Improvements:**
|
||||
|
||||
- Optimized font hierarchy (H1: 22px bold, H2: 18px bold)
|
||||
- Enhanced dark mode with full theme support
|
||||
- Improved PNG export technology (SVG to Canvas with foreignObject handling)
|
||||
- Added theme preservation in exported PNG images
|
||||
- Enhanced security with non-bubbling button events
|
||||
|
||||
**Bug Fixes:**
|
||||
|
||||
- Fixed theme detection in cross-origin iframes
|
||||
- Resolved PNG export issues with HTML content in SVG
|
||||
- Improved compatibility with OpenWebUI theme system
|
||||
|
||||
### v0.7.2
|
||||
|
||||
- Optimized text extraction logic, automatically filters HTML code blocks
|
||||
- Improved error handling and user feedback
|
||||
- Enhanced export functionality compatibility
|
||||
- Optimized UI styling and interactive experience
|
||||
|
||||
---
|
||||
|
||||
## License
|
||||
|
||||
This plugin is released under the MIT License.
|
||||
|
||||
## Contributing
|
||||
|
||||
Welcome to submit issue reports and improvement suggestions! Please visit the project repository: [awesome-openwebui](https://github.com/Fu-Jie/awesome-openwebui)
|
||||
|
||||
---
|
||||
|
||||
## Related Resources
|
||||
|
||||
- [Markmap Official Website](https://markmap.js.org/)
|
||||
- [OpenWebUI Documentation](https://docs.openwebui.com/)
|
||||
- [D3.js Official Website](https://d3js.org/)
|
||||
1. **Text Preparation**: Provide text with clear structure and distinct hierarchies.
|
||||
2. **Model Selection**: Use fast models like `gemini-2.5-flash` for daily use.
|
||||
3. **Export Quality**: Use PNG for presentations and SVG for further editing.
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
# 思维导图 - 思维导图生成插件
|
||||
|
||||
**作者:** [Fu-Jie](https://github.com/Fu-Jie/awesome-openwebui) | **版本:** 0.9.1 | **许可证:** MIT
|
||||
|
||||
> **重要提示**:为了确保所有插件的可维护性和易用性,每个插件都应附带清晰、完整的文档,以确保其功能、配置和使用方法得到充分说明。
|
||||
|
||||
思维导图是一个强大的 OpenWebUI 动作插件,能够智能分析长篇文本内容,自动生成交互式思维导图,帮助用户结构化和可视化知识。
|
||||
|
||||
---
|
||||
**作者:** [Fu-Jie](https://github.com/Fu-Jie/awesome-openwebui) | **版本:** 0.9.1 | **项目:** [Awesome OpenWebUI](https://github.com/Fu-Jie/awesome-openwebui) | **许可证:** MIT
|
||||
|
||||
## 🔥 v0.9.1 更新亮点
|
||||
## v0.9.1 更新亮点
|
||||
|
||||
**新功能:图片输出模式**
|
||||
|
||||
@@ -18,362 +14,51 @@
|
||||
- **高效存储**:图片模式将 SVG 上传至 `/api/v1/files`,避免聊天记录中出现超长 Base64 字符串。
|
||||
- **智能特性**:生成的图片支持自动响应式宽度和自动主题检测(亮色/暗色)。
|
||||
|
||||
| 特性 | HTML 模式 (默认) | 图片模式 |
|
||||
| :--- | :--- | :--- |
|
||||
| **输出格式** | 交互式 HTML 代码块 | 静态 Markdown 图片 |
|
||||
| **交互性** | 缩放、拖拽、展开/折叠 | 无 (静态图片) |
|
||||
| **聊天记录** | 包含 HTML 代码 | 简洁 (仅图片链接) |
|
||||
| **存储方式** | 浏览器实时渲染 | `/api/v1/files` 上传 |
|
||||
## 核心特性 🔑
|
||||
|
||||
---
|
||||
- ✅ **智能文本分析**:自动识别文本的核心主题、关键概念和层次结构。
|
||||
- ✅ **交互式可视化**:基于 Markmap.js 生成美观的交互式思维导图。
|
||||
- ✅ **高分辨率 PNG 导出**:导出高质量的 PNG 图片(9 倍分辨率)。
|
||||
- ✅ **完整控制面板**:缩放控制、展开层级选择、全屏模式。
|
||||
- ✅ **主题切换**:手动主题切换按钮与自动主题检测。
|
||||
- ✅ **图片输出模式**:生成静态 SVG 图片直接嵌入 Markdown,聊天记录更简洁。
|
||||
|
||||
## 核心特性
|
||||
## 使用方法 🛠️
|
||||
|
||||
- ✅ **智能文本分析**:自动识别文本的核心主题、关键概念和层次结构
|
||||
- ✅ **交互式可视化**:基于 Markmap.js 生成美观的交互式思维导图
|
||||
- ✅ **高分辨率 PNG 导出**:导出高质量的 PNG 图片(9 倍分辨率,约 1-2MB 文件大小)
|
||||
- ✅ **完整控制面板**:缩放控制(+/-/重置)、展开层级选择(全部/2级/3级)、全屏模式
|
||||
- ✅ **主题切换**:手动主题切换按钮(亮色/暗色)与自动主题检测
|
||||
- ✅ **深色模式支持**:完整的深色模式支持,自动检测与手动覆盖
|
||||
- ✅ **多语言支持**:根据用户语言自动调整输出
|
||||
- ✅ **实时渲染**:在聊天界面中直接渲染思维导图,无需跳转
|
||||
- ✅ **导出功能**:支持 PNG、SVG 代码和 Markdown 源码导出
|
||||
- ✅ **自定义配置**:可配置 LLM 模型、最小文本长度等参数
|
||||
- ✅ **图片输出模式**:生成静态 SVG 图片直接嵌入 Markdown(**不输出 HTML 代码**,聊天记录更简洁)
|
||||
1. **安装**: 在 OpenWebUI 管理员设置 -> 插件 -> 动作中上传 `smart_mind_map_cn.py`。
|
||||
2. **配置**: 确保配置了 LLM 模型(如 `gemini-2.5-flash`)。
|
||||
3. **触发**: 在聊天设置中启用“思维导图”动作,并发送文本(至少 100 字符)。
|
||||
4. **结果**: 思维导图将在聊天界面中直接渲染显示。
|
||||
|
||||
---
|
||||
|
||||
## 工作原理
|
||||
|
||||
1. **文本提取**:从用户消息中提取文本内容(自动过滤 HTML 代码块)
|
||||
2. **智能分析**:使用配置的 LLM 模型分析文本结构
|
||||
3. **Markdown 生成**:将分析结果转换为 Markmap 兼容的 Markdown 格式
|
||||
4. **可视化渲染**:在 HTML 模板中使用 Markmap.js 渲染思维导图,并优化字体层级(H1:22px 粗体,H2:18px 粗体)
|
||||
5. **交互展示**:以可交互的形式展示给用户,并提供完整的控制面板
|
||||
6. **主题检测**:自动检测并应用当前 OpenWebUI 的主题(亮色/暗色模式)
|
||||
7. **导出选项**:提供 PNG(高分辨率)、SVG 和 Markdown 导出功能
|
||||
|
||||
---
|
||||
|
||||
## 安装与配置
|
||||
|
||||
### 1. 插件安装
|
||||
|
||||
1. 下载 `smart_mind_map_cn.py` 文件到本地
|
||||
2. 在 OpenWebUI 管理员设置中找到"插件"(Plugins)部分
|
||||
3. 选择"动作"(Actions)类型
|
||||
4. 上传下载的文件
|
||||
5. 刷新页面,插件即可使用
|
||||
|
||||
### 2. 模型配置
|
||||
|
||||
插件需要访问 LLM 模型来分析文本。请确保:
|
||||
|
||||
- 您的 OpenWebUI 实例中配置了至少一个可用的 LLM 模型
|
||||
- 推荐使用快速、经济的模型(如 `gemini-2.5-flash`)来获得最佳体验
|
||||
- 在插件设置中配置 `LLM_MODEL_ID` 参数
|
||||
|
||||
### 3. 插件启用
|
||||
|
||||
在聊天设置中选择"思维导图"动作插件即可启用。
|
||||
|
||||
### 4. 主题颜色风格一致性(可选)
|
||||
|
||||
为了使思维导图与 OpenWebUI 主题颜色风格保持一致,需要在 OpenWebUI 中启用 artifact 的同源访问:
|
||||
|
||||
- **配置位置**:在 OpenWebUI 用户设置中找到"界面"→"产物"部分(Settings → Interface → Products/Artifacts)
|
||||
- **启用选项**:勾选 "iframe 沙盒允许同源访问"(Allow same-origin access for artifacts / iframe sandbox allow-same-origin)
|
||||
- **沙箱属性**:确保 iframe 的 sandbox 属性包含 `allow-same-origin` 和 `allow-scripts`
|
||||
|
||||
启用后,思维导图会自动检测并应用 OpenWebUI 的当前主题(亮色/暗色),无需手动配置。
|
||||
|
||||
---
|
||||
|
||||
## 配置参数
|
||||
|
||||
您可以在插件的设置(Valves)中调整以下参数:
|
||||
## 配置参数 (Valves) ⚙️
|
||||
|
||||
| 参数 | 默认值 | 描述 |
|
||||
| :--- | :--- | :--- |
|
||||
| `show_status` | `true` | 是否在聊天界面显示操作状态更新(如"正在分析...")。 |
|
||||
| `LLM_MODEL_ID` | `gemini-2.5-flash` | 用于文本分析的 LLM 模型 ID。推荐使用快速且经济的模型。 |
|
||||
| `MIN_TEXT_LENGTH` | `100` | 进行思维导图分析所需的最小文本长度(字符数)。文本过短将无法生成有效的导图。 |
|
||||
| `CLEAR_PREVIOUS_HTML` | `false` | 在生成新的思维导图时,是否清除之前由插件生成的 HTML 内容。 |
|
||||
| `show_status` | `true` | 是否在聊天界面显示操作状态更新。 |
|
||||
| `LLM_MODEL_ID` | `gemini-2.5-flash` | 用于文本分析的 LLM 模型 ID。 |
|
||||
| `MIN_TEXT_LENGTH` | `100` | 进行思维导图分析所需的最小文本长度。 |
|
||||
| `CLEAR_PREVIOUS_HTML` | `false` | 在生成新的思维导图时,是否清除之前的 HTML 内容。 |
|
||||
| `MESSAGE_COUNT` | `1` | 用于生成思维导图的最近消息数量(1-5)。 |
|
||||
| `OUTPUT_MODE` | `html` | 输出模式:`html` 为交互式 HTML(默认),`image` 为嵌入静态 Markdown 图片。 |
|
||||
| `OUTPUT_MODE` | `html` | 输出模式:`html`(交互式)或 `image`(静态图片)。 |
|
||||
|
||||
---
|
||||
## 故障排除 (Troubleshooting) ❓
|
||||
|
||||
## 使用方法
|
||||
|
||||
### 基本使用
|
||||
|
||||
1. 在聊天设置中启用"思维导图"动作
|
||||
2. 在对话中输入或粘贴长篇文本内容(至少 100 字符)
|
||||
3. 发送消息后,插件会自动分析并生成思维导图
|
||||
4. 思维导图将在聊天界面中直接渲染显示
|
||||
|
||||
### 使用示例
|
||||
|
||||
**输入文本:**
|
||||
|
||||
```
|
||||
人工智能(AI)是计算机科学的一个分支,致力于创建能够执行通常需要人类智能的任务的系统。
|
||||
主要应用领域包括:
|
||||
1. 机器学习 - 使计算机能够从数据中学习
|
||||
2. 自然语言处理 - 理解和生成人类语言
|
||||
3. 计算机视觉 - 识别和处理图像
|
||||
4. 机器人技术 - 创建能够与物理世界交互的智能系统
|
||||
```
|
||||
|
||||
**生成结果:**
|
||||
插件会生成一个以"人工智能"为中心主题的交互式思维导图,包含主要应用领域及其子概念。
|
||||
|
||||
### 导出功能
|
||||
|
||||
生成的思维导图支持三种导出方式:
|
||||
|
||||
1. **下载 PNG**:点击“📥 下载 PNG”按钮,可将思维导图导出为高分辨率 PNG 图片(9 倍分辨率,约 1-2MB 文件大小)
|
||||
2. **复制 SVG 代码**:点击“复制 SVG 代码”按钮,可将思维导图的 SVG 格式复制到剪贴板
|
||||
3. **复制 Markdown**:点击“复制 Markdown”按钮,可将原始 Markdown 格式复制到剪贴板
|
||||
|
||||
### 控制面板
|
||||
|
||||
交互式思维导图包含完整的控制面板:
|
||||
|
||||
- **缩放控制**:`+`(放大)、`-`(缩小)、`↻`(重置视图)
|
||||
- **展开层级**:在“全部”、“2 级”、“3 级”之间切换,控制节点展开深度
|
||||
- **全屏模式**:进入全屏模式,获得更好的查看体验
|
||||
- **主题切换**:手动在亮色和暗色主题之间切换
|
||||
- **插件无法启动**:检查 OpenWebUI 日志,确认插件已正确上传并启用。
|
||||
- **文本内容过短**:确保输入的文本至少包含 100 个字符。
|
||||
- **渲染失败**:检查浏览器控制台,确认 Markmap.js 和 D3.js 库是否正确加载。
|
||||
- **提交 Issue**: 如果遇到任何问题,请在 GitHub 上提交 Issue:[Awesome OpenWebUI Issues](https://github.com/Fu-Jie/awesome-openwebui/issues)
|
||||
|
||||
---
|
||||
|
||||
## 技术架构
|
||||
|
||||
### 前端渲染
|
||||
|
||||
- **Markmap.js**:开源的思维导图渲染引擎
|
||||
- **D3.js**:数据可视化基础库
|
||||
- **响应式设计**:适配不同屏幕尺寸
|
||||
- **字体层级**:优化的字体排版,H1(22px 粗体)和 H2(18px 粗体),提供更好的可读性
|
||||
|
||||
### PNG 导出技术
|
||||
|
||||
- **SVG 转 Canvas**:将思维导图 SVG 转换为 Canvas 以导出 PNG
|
||||
- **ForeignObject 处理**:正确处理 SVG 元素中的 HTML 内容
|
||||
- **高分辨率**:9 倍缩放因子,输出打印级质量(约 1-2MB 文件大小)
|
||||
- **主题保持**:在导出的 PNG 中保持当前主题(亮色/暗色)
|
||||
|
||||
### 主题检测机制
|
||||
|
||||
自动检测并应用主题,具有 4 级优先级:
|
||||
|
||||
1. **显式切换**:用户手动点击主题切换按钮(最高优先级)
|
||||
2. **Meta 标签**:从父文档读取 `<meta name="theme-color">`
|
||||
3. **Class/Data-Theme**:检查父文档 HTML/body 的 `class` 或 `data-theme` 属性
|
||||
4. **系统偏好**:回退到 `prefers-color-scheme` 媒体查询
|
||||
|
||||
### 后端处理
|
||||
|
||||
- **LLM 集成**:通过 `generate_chat_completion` 调用配置的模型
|
||||
- **文本预处理**:自动过滤 HTML 代码块,提取纯文本内容
|
||||
- **格式转换**:将 LLM 输出转换为 Markmap 兼容的 Markdown 格式
|
||||
|
||||
### 安全性增强
|
||||
|
||||
- **XSS 防护**:自动转义 `</script>` 标签,防止脚本注入
|
||||
- **输入验证**:检查文本长度,避免无效请求
|
||||
- **非冒泡事件**:按钮点击使用 `stopPropagation()` 防止导航拦截
|
||||
|
||||
---
|
||||
|
||||
## 故障排除
|
||||
|
||||
### 问题:插件无法启动
|
||||
|
||||
**解决方案:**
|
||||
|
||||
- 检查 OpenWebUI 日志,查看是否有错误信息
|
||||
- 确认插件已正确上传并启用
|
||||
- 验证 OpenWebUI 版本是否支持动作插件
|
||||
|
||||
### 问题:文本内容过短
|
||||
|
||||
**现象:** 提示"文本内容过短,无法进行有效分析"
|
||||
|
||||
**解决方案:**
|
||||
|
||||
- 确保输入的文本至少包含 100 个字符(默认配置)
|
||||
- 可以在插件设置中降低 `MIN_TEXT_LENGTH` 参数值
|
||||
- 提供更详细、结构化的文本内容
|
||||
|
||||
### 问题:思维导图未生成
|
||||
|
||||
**解决方案:**
|
||||
|
||||
- 检查 `LLM_MODEL_ID` 是否配置正确
|
||||
- 确认配置的模型在 OpenWebUI 中可用
|
||||
- 查看后端日志,检查是否有 LLM 调用失败的错误
|
||||
- 验证用户是否有足够的权限访问配置的模型
|
||||
|
||||
### 问题:思维导图显示错误
|
||||
|
||||
**现象:** 显示"⚠️ 思维导图渲染失败"
|
||||
|
||||
**解决方案:**
|
||||
|
||||
- 检查浏览器控制台的错误信息
|
||||
- 确认 Markmap.js 和 D3.js 库是否正确加载
|
||||
- 验证生成的 Markdown 格式是否符合 Markmap 规范
|
||||
- 尝试刷新页面重新渲染
|
||||
|
||||
### 问题:PNG 导出不工作
|
||||
|
||||
**现象:**PNG 下载按钮不工作或生成空白/损坏的图片
|
||||
|
||||
**解决方案:**
|
||||
|
||||
- 确保浏览器支持 HTML5 Canvas API(所有现代浏览器都支持)
|
||||
- 检查浏览器控制台是否有与 `toDataURL()` 或 Canvas 渲染相关的错误
|
||||
- 确保思维导图在点击导出前已完全渲染
|
||||
- 尝试刷新页面并重新生成思维导图
|
||||
- 使用 Chrome 或 Firefox,获得最佳 PNG 导出兼容性
|
||||
|
||||
### 问题:主题未自动检测
|
||||
|
||||
**现象:**思维导图不匹配 OpenWebUI 主题颜色
|
||||
|
||||
**解决方案:**
|
||||
|
||||
- 在 OpenWebUI 设置 → 界面 → 产物中,启用“iframe 沙盒允许同源访问”
|
||||
- 验证 iframe 的 sandbox 属性包含 `allow-same-origin` 和 `allow-scripts`
|
||||
- 确保父文档有 `<meta name="theme-color">` 标签或主题 class/属性
|
||||
- 使用手动主题切换按钮覆盖自动检测
|
||||
- 检查浏览器控制台是否有跨域错误
|
||||
|
||||
### 问题:导出功能不工作
|
||||
|
||||
**解决方案:**
|
||||
|
||||
- 确认浏览器支持剪贴板 API
|
||||
- 检查浏览器是否阻止了剪贴板访问权限
|
||||
- 使用现代浏览器(Chrome、Firefox、Edge 等)
|
||||
|
||||
---
|
||||
- **Markmap.js**:开源的思维导图渲染引擎。
|
||||
- **PNG 导出技术**:9 倍缩放因子,输出打印级质量。
|
||||
- **主题检测机制**:4 级优先级检测(手动 > Meta > Class > 系统)。
|
||||
- **安全性增强**:XSS 防护与输入验证。
|
||||
|
||||
## 最佳实践
|
||||
|
||||
1. **文本准备**
|
||||
- 提供结构清晰、层次分明的文本内容
|
||||
- 使用段落、列表等格式帮助 LLM 理解文本结构
|
||||
- 避免过于冗长或无结构的文本
|
||||
|
||||
2. **模型选择**
|
||||
- 对于日常使用,推荐 `gemini-2.5-flash` 等快速模型
|
||||
- 对于复杂文本分析,可以使用更强大的模型(如 GPT-4)
|
||||
- 根据需求平衡速度和分析质量
|
||||
|
||||
3. **性能优化**
|
||||
- 合理设置 `MIN_TEXT_LENGTH`,避免处理过短的文本
|
||||
- 对于特别长的文本,考虑先进行摘要再生成思维导图
|
||||
- 在生产环境中关闭 `show_status` 以减少界面更新
|
||||
|
||||
4. **导出质量**
|
||||
- **PNG 导出**:最适合演示、文档和分享(9 倍分辨率适合打印)
|
||||
- **SVG 导出**:最适合在矢量图形工具中进一步编辑(无限缩放)
|
||||
- **Markdown 导出**:最适合版本控制、协作和重新生成
|
||||
|
||||
5. **主题一致性**
|
||||
- 启用同源访问以实现自动主题检测
|
||||
- 如果自动检测失败,使用手动主题切换
|
||||
- 在切换到所需主题后导出 PNG,以保持视觉一致性
|
||||
|
||||
---
|
||||
|
||||
## 依赖要求
|
||||
|
||||
本插件仅使用 OpenWebUI 的内置依赖,**无需安装额外的软件包。**
|
||||
|
||||
---
|
||||
|
||||
## 更新日志
|
||||
|
||||
### v0.9.1
|
||||
|
||||
**新功能:图片输出模式**
|
||||
|
||||
- 新增 `OUTPUT_MODE` 配置参数,支持两种模式:
|
||||
- `html`(默认):交互式 HTML 思维导图,带完整控制面板
|
||||
- `image`:静态 SVG 图片直接嵌入 Markdown(上传至 `/api/v1/files`)
|
||||
- 图片模式特性:
|
||||
- 自动响应式宽度(适应聊天容器)
|
||||
- 自动主题检测(亮色/暗色)
|
||||
- 通过 Chat API 持久化存储(刷新页面后保留)
|
||||
- 高效文件存储(聊天记录中无超长 Base64 字符串)
|
||||
|
||||
**改进项:**
|
||||
|
||||
- 实现健壮的 Chat API 更新机制,带重试逻辑
|
||||
- 修复消息持久化,同时更新 `messages[]` 和 `history.messages`
|
||||
- 添加 Event API 实现即时前端更新
|
||||
- 移除不必要的 `SVG_WIDTH` 和 `SVG_HEIGHT` 参数(现已自动计算)
|
||||
|
||||
**技术细节:**
|
||||
|
||||
- 图片模式使用 `__event_call__` 在浏览器中执行 JavaScript
|
||||
- SVG 离屏渲染,转换为 Blob,并上传至 OpenWebUI Files API
|
||||
- 通过 OpenWebUI Backend-Controlled API 流程更新聊天消息为 `/api/v1/files/{id}/content` URL
|
||||
|
||||
### v0.8.2
|
||||
|
||||
- 移除输出中的调试信息
|
||||
|
||||
### v0.8.0 (Previous Version)
|
||||
|
||||
**主要功能:**
|
||||
|
||||
- 添加高分辨率 PNG 导出(9 倍分辨率,约 1-2MB 文件大小)
|
||||
- 实现完整的控制面板,包含缩放控制(+/-/重置)
|
||||
- 添加展开层级选择(全部/2级/3级)
|
||||
- 集成全屏模式,自动适应
|
||||
- 添加手动主题切换按钮(亮色/暗色)
|
||||
- 实现 4 级优先级的自动主题检测
|
||||
|
||||
**改进项:**
|
||||
|
||||
- 优化字体层级(H1:22px 粗体,H2:18px 粗体)
|
||||
- 增强深色模式,完整的主题支持
|
||||
- 改进 PNG 导出技术(SVG 转 Canvas,处理 foreignObject)
|
||||
- 在导出的 PNG 图片中保持主题
|
||||
- 增强安全性,按钮事件使用非冒泡机制
|
||||
|
||||
**Bug 修复:**
|
||||
|
||||
- 修复跨域 iframe 中的主题检测问题
|
||||
- 解决 SVG 中 HTML 内容的 PNG 导出问题
|
||||
- 改进与 OpenWebUI 主题系统的兼容性
|
||||
|
||||
### v0.7.2
|
||||
|
||||
- 优化文本提取逻辑,自动过滤 HTML 代码块
|
||||
- 改进错误处理和用户反馈
|
||||
- 增强导出功能的兼容性
|
||||
- 优化 UI 样式和交互体验
|
||||
|
||||
---
|
||||
|
||||
## 许可证
|
||||
|
||||
本插件采用 MIT 许可证发布。
|
||||
|
||||
## 贡献
|
||||
|
||||
欢迎提交问题报告和改进建议!请访问项目仓库:[awesome-openwebui](https://github.com/Fu-Jie/awesome-openwebui)
|
||||
|
||||
---
|
||||
|
||||
## 相关资源
|
||||
|
||||
- [Markmap 官方网站](https://markmap.js.org/)
|
||||
- [OpenWebUI 文档](https://docs.openwebui.com/)
|
||||
- [D3.js 官方网站](https://d3js.org/)
|
||||
1. **文本准备**:提供结构清晰、层次分明的文本内容。
|
||||
2. **模型选择**:日常使用推荐 `gemini-2.5-flash` 等快速模型。
|
||||
3. **导出质量**:PNG 适合演示分享,SVG 适合进一步矢量编辑。
|
||||
|
||||
Reference in New Issue
Block a user