nonebot-plugin-llm-helper


Namenonebot-plugin-llm-helper JSON
Version 0.0.3 PyPI version JSON
download
home_pagehttps://github.com/Lonely-Sails/nonebot-plugin-llm-helper
Summary一个支持多平台的帮助插件,基于 LLM 解析 Github 仓库或代码。
upload_time2025-07-15 05:18:47
maintainerNone
docs_urlNone
authorLonely-Sails
requires_python<4.0,>=3.8
licenseGPL3
keywords nonebot nonebot2 helper llm ai
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <div align="center">
  <a href="https://v2.nonebot.dev/store"><img src="https://github.com/A-kirami/nonebot-plugin-template/blob/resources/nbp_logo.png" width="180" height="180" alt="NoneBotPluginLogo"></a>
  <br>
  <p><img src="https://github.com/A-kirami/nonebot-plugin-template/blob/resources/NoneBotPlugin.svg" width="240" alt="NoneBotPluginText"></p>
</div>

<div align="center">

# nonebot-plugin-llm-helper

_✨ 一个支持多平台的帮助插件,基于 LLM 解析 Github 仓库或代码。 ✨_

</div>

## 📖 介绍

LLM-Helper 是一个智能的 NoneBot2 帮助插件,它利用大语言模型(LLM)自动分析插件代码和文档,为用户提供详细的插件使用说明。该插件能够:

- 🔍 **智能解析**:自动扫描并分析所有已安装的插件。
- 🤖 **AI 生成**:使用 LLM 解析插件代码和 README 文档。
- 📚 **详细帮助**:生成包含命令、参数、用法示例的完整帮助文档。
- 🔄 **实时更新**:支持重新生成插件的帮助文档。
- 🔎 **智能搜索**:支持按关键词搜索插件和命令。

## ✨ 特性

- **自动发现**:启动时自动扫描所有用户插件。
- **智能缓存**:缓存生成的帮助文档,提高响应速度。
- **多平台支持**:支持所有 NoneBot2 适配器。
- **灵活配置**:支持 OpenAi 兼容格式,支持大多数的模型。
- **错误重试**:内置重试机制,提高稳定性。

> [!TIP]
> 本插件所生成的帮助文档很大程度上依赖于 LLM 的能力,故所生成的内容仅供参考。

## 💿 安装

### 使用 nb-cli 安装

```bash
nb plugin install nonebot-plugin-llm-helper
```

## ⚙️ 配置

在 NoneBot2 项目的 `.env` 文件中添加以下配置:


| 配置项 | 必填 | 默认值 | 说明 |
|:------:|:----:|:------:|:----:|
| `llm_helper_api_key` | 是 | 无 | LLM API 密钥 |
| `llm_helper_model` | 是 | 无 | 使用的 LLM 模型名称 |
| `llm_helper_base_url` | 否 | 无 | LLM API 基础地址 |
| `github_proxy` | 否 | `https://gh-proxy.com/` | GitHub 代理地址 |
| `llm_helper_timeout` | 否 | `600` | LLM 请求超时时间(秒) |
| `llm_helper_max_retries` | 否 | `3` | 最大重试次数 |
| `llm_helper_retry_delay` | 否 | `10` | 重试间隔时间(秒) |

### 配置示例

```env
# OpenAi Api 兼容配置
llm_helper_api_key=your_api_key_here
llm_helper_model=deepseek-chat
llm_helper_base_url=https://api.deepseek.com

# 网络配置
github_proxy=https://gh-proxy.com/
llm_helper_timeout=600
llm_helper_max_retries=3
llm_helper_retry_delay=10
```

## 🎉 使用

### 基础命令

| 命令 | 别名 | 说明 |
|:----:|:----:|:----:|
| `/llm-help [插件名]` | `/help [插件名]` | 查看指定插件的详细帮助 |
| `/llm-help list` | `/help list` | 查看所有插件列表 |
| `/llm-help search [关键词]` | `/help search [关键词]` | 搜索插件和命令 |
| `/llm-help regenerate [插件名]` | `/help regen [插件名]` | 重新生成插件的帮助文档 |

### 使用示例

#### 查看所有插件列表

```
/help list
```

#### 查看特定插件帮助

```
/help nonebot_plugin_weather
```

#### 搜索与天气相关命令

```
/help search 天气
```

#### 重新生成插件帮助

```
/help regenerate nonebot_plugin_weather
```

## 🔧 工作原理

1. **插件扫描**:启动时自动扫描所有已安装的用户插件。
2. **元数据提取**:获取插件的元数据信息和文件路径。
3. **文档获取**:尝试从 GitHub 获取插件的 README 文档。
4. **代码分析**:使用 LLM 分析插件代码结构和功能。
5. **帮助生成**:生成包含命令、参数、用法的详细帮助文档。
6. **缓存存储**:将生成的帮助文档缓存到本地。

## 📄 许可证

本项目采用 GPL-3.0 许可证 - 查看 [LICENSE](LICENSE) 文件了解详情。

## 🙏 鸣谢

- [NoneBot2](https://github.com/nonebot/nonebot2) - 优秀的机器人框架。
- [Alconna](https://github.com/ArcletProject/Alconna) - 强大的命令解析器。

---

<div align="center">

**如果这个项目对你有帮助,请给它一个 ⭐️ 十分感谢!**

</div>

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Lonely-Sails/nonebot-plugin-llm-helper",
    "name": "nonebot-plugin-llm-helper",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.8",
    "maintainer_email": null,
    "keywords": "nonebot, nonebot2, helper, llm, ai",
    "author": "Lonely-Sails",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/82/8b/3432c9427dbb81e71adcf66a93e79e36bd6bd4faaa85f2b94cd744e0d2ba/nonebot_plugin_llm_helper-0.0.3.tar.gz",
    "platform": null,
    "description": "<div align=\"center\">\n  <a href=\"https://v2.nonebot.dev/store\"><img src=\"https://github.com/A-kirami/nonebot-plugin-template/blob/resources/nbp_logo.png\" width=\"180\" height=\"180\" alt=\"NoneBotPluginLogo\"></a>\n  <br>\n  <p><img src=\"https://github.com/A-kirami/nonebot-plugin-template/blob/resources/NoneBotPlugin.svg\" width=\"240\" alt=\"NoneBotPluginText\"></p>\n</div>\n\n<div align=\"center\">\n\n# nonebot-plugin-llm-helper\n\n_\u2728 \u4e00\u4e2a\u652f\u6301\u591a\u5e73\u53f0\u7684\u5e2e\u52a9\u63d2\u4ef6\uff0c\u57fa\u4e8e LLM \u89e3\u6790 Github \u4ed3\u5e93\u6216\u4ee3\u7801\u3002 \u2728_\n\n</div>\n\n## \ud83d\udcd6 \u4ecb\u7ecd\n\nLLM-Helper \u662f\u4e00\u4e2a\u667a\u80fd\u7684 NoneBot2 \u5e2e\u52a9\u63d2\u4ef6\uff0c\u5b83\u5229\u7528\u5927\u8bed\u8a00\u6a21\u578b\uff08LLM\uff09\u81ea\u52a8\u5206\u6790\u63d2\u4ef6\u4ee3\u7801\u548c\u6587\u6863\uff0c\u4e3a\u7528\u6237\u63d0\u4f9b\u8be6\u7ec6\u7684\u63d2\u4ef6\u4f7f\u7528\u8bf4\u660e\u3002\u8be5\u63d2\u4ef6\u80fd\u591f\uff1a\n\n- \ud83d\udd0d **\u667a\u80fd\u89e3\u6790**\uff1a\u81ea\u52a8\u626b\u63cf\u5e76\u5206\u6790\u6240\u6709\u5df2\u5b89\u88c5\u7684\u63d2\u4ef6\u3002\n- \ud83e\udd16 **AI \u751f\u6210**\uff1a\u4f7f\u7528 LLM \u89e3\u6790\u63d2\u4ef6\u4ee3\u7801\u548c README \u6587\u6863\u3002\n- \ud83d\udcda **\u8be6\u7ec6\u5e2e\u52a9**\uff1a\u751f\u6210\u5305\u542b\u547d\u4ee4\u3001\u53c2\u6570\u3001\u7528\u6cd5\u793a\u4f8b\u7684\u5b8c\u6574\u5e2e\u52a9\u6587\u6863\u3002\n- \ud83d\udd04 **\u5b9e\u65f6\u66f4\u65b0**\uff1a\u652f\u6301\u91cd\u65b0\u751f\u6210\u63d2\u4ef6\u7684\u5e2e\u52a9\u6587\u6863\u3002\n- \ud83d\udd0e **\u667a\u80fd\u641c\u7d22**\uff1a\u652f\u6301\u6309\u5173\u952e\u8bcd\u641c\u7d22\u63d2\u4ef6\u548c\u547d\u4ee4\u3002\n\n## \u2728 \u7279\u6027\n\n- **\u81ea\u52a8\u53d1\u73b0**\uff1a\u542f\u52a8\u65f6\u81ea\u52a8\u626b\u63cf\u6240\u6709\u7528\u6237\u63d2\u4ef6\u3002\n- **\u667a\u80fd\u7f13\u5b58**\uff1a\u7f13\u5b58\u751f\u6210\u7684\u5e2e\u52a9\u6587\u6863\uff0c\u63d0\u9ad8\u54cd\u5e94\u901f\u5ea6\u3002\n- **\u591a\u5e73\u53f0\u652f\u6301**\uff1a\u652f\u6301\u6240\u6709 NoneBot2 \u9002\u914d\u5668\u3002\n- **\u7075\u6d3b\u914d\u7f6e**\uff1a\u652f\u6301 OpenAi \u517c\u5bb9\u683c\u5f0f\uff0c\u652f\u6301\u5927\u591a\u6570\u7684\u6a21\u578b\u3002\n- **\u9519\u8bef\u91cd\u8bd5**\uff1a\u5185\u7f6e\u91cd\u8bd5\u673a\u5236\uff0c\u63d0\u9ad8\u7a33\u5b9a\u6027\u3002\n\n> [!TIP]\n> \u672c\u63d2\u4ef6\u6240\u751f\u6210\u7684\u5e2e\u52a9\u6587\u6863\u5f88\u5927\u7a0b\u5ea6\u4e0a\u4f9d\u8d56\u4e8e LLM \u7684\u80fd\u529b\uff0c\u6545\u6240\u751f\u6210\u7684\u5185\u5bb9\u4ec5\u4f9b\u53c2\u8003\u3002\n\n## \ud83d\udcbf \u5b89\u88c5\n\n### \u4f7f\u7528 nb-cli \u5b89\u88c5\n\n```bash\nnb plugin install nonebot-plugin-llm-helper\n```\n\n## \u2699\ufe0f \u914d\u7f6e\n\n\u5728 NoneBot2 \u9879\u76ee\u7684 `.env` \u6587\u4ef6\u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u914d\u7f6e\uff1a\n\n\n| \u914d\u7f6e\u9879 | \u5fc5\u586b | \u9ed8\u8ba4\u503c | \u8bf4\u660e |\n|:------:|:----:|:------:|:----:|\n| `llm_helper_api_key` | \u662f | \u65e0 | LLM API \u5bc6\u94a5 |\n| `llm_helper_model` | \u662f | \u65e0 | \u4f7f\u7528\u7684 LLM \u6a21\u578b\u540d\u79f0 |\n| `llm_helper_base_url` | \u5426 | \u65e0 | LLM API \u57fa\u7840\u5730\u5740 |\n| `github_proxy` | \u5426 | `https://gh-proxy.com/` | GitHub \u4ee3\u7406\u5730\u5740 |\n| `llm_helper_timeout` | \u5426 | `600` | LLM \u8bf7\u6c42\u8d85\u65f6\u65f6\u95f4\uff08\u79d2\uff09 |\n| `llm_helper_max_retries` | \u5426 | `3` | \u6700\u5927\u91cd\u8bd5\u6b21\u6570 |\n| `llm_helper_retry_delay` | \u5426 | `10` | \u91cd\u8bd5\u95f4\u9694\u65f6\u95f4\uff08\u79d2\uff09 |\n\n### \u914d\u7f6e\u793a\u4f8b\n\n```env\n# OpenAi Api \u517c\u5bb9\u914d\u7f6e\nllm_helper_api_key=your_api_key_here\nllm_helper_model=deepseek-chat\nllm_helper_base_url=https://api.deepseek.com\n\n# \u7f51\u7edc\u914d\u7f6e\ngithub_proxy=https://gh-proxy.com/\nllm_helper_timeout=600\nllm_helper_max_retries=3\nllm_helper_retry_delay=10\n```\n\n## \ud83c\udf89 \u4f7f\u7528\n\n### \u57fa\u7840\u547d\u4ee4\n\n| \u547d\u4ee4 | \u522b\u540d | \u8bf4\u660e |\n|:----:|:----:|:----:|\n| `/llm-help [\u63d2\u4ef6\u540d]` | `/help [\u63d2\u4ef6\u540d]` | \u67e5\u770b\u6307\u5b9a\u63d2\u4ef6\u7684\u8be6\u7ec6\u5e2e\u52a9 |\n| `/llm-help list` | `/help list` | \u67e5\u770b\u6240\u6709\u63d2\u4ef6\u5217\u8868 |\n| `/llm-help search [\u5173\u952e\u8bcd]` | `/help search [\u5173\u952e\u8bcd]` | \u641c\u7d22\u63d2\u4ef6\u548c\u547d\u4ee4 |\n| `/llm-help regenerate [\u63d2\u4ef6\u540d]` | `/help regen [\u63d2\u4ef6\u540d]` | \u91cd\u65b0\u751f\u6210\u63d2\u4ef6\u7684\u5e2e\u52a9\u6587\u6863 |\n\n### \u4f7f\u7528\u793a\u4f8b\n\n#### \u67e5\u770b\u6240\u6709\u63d2\u4ef6\u5217\u8868\n\n```\n/help list\n```\n\n#### \u67e5\u770b\u7279\u5b9a\u63d2\u4ef6\u5e2e\u52a9\n\n```\n/help nonebot_plugin_weather\n```\n\n#### \u641c\u7d22\u4e0e\u5929\u6c14\u76f8\u5173\u547d\u4ee4\n\n```\n/help search \u5929\u6c14\n```\n\n#### \u91cd\u65b0\u751f\u6210\u63d2\u4ef6\u5e2e\u52a9\n\n```\n/help regenerate nonebot_plugin_weather\n```\n\n## \ud83d\udd27 \u5de5\u4f5c\u539f\u7406\n\n1. **\u63d2\u4ef6\u626b\u63cf**\uff1a\u542f\u52a8\u65f6\u81ea\u52a8\u626b\u63cf\u6240\u6709\u5df2\u5b89\u88c5\u7684\u7528\u6237\u63d2\u4ef6\u3002\n2. **\u5143\u6570\u636e\u63d0\u53d6**\uff1a\u83b7\u53d6\u63d2\u4ef6\u7684\u5143\u6570\u636e\u4fe1\u606f\u548c\u6587\u4ef6\u8def\u5f84\u3002\n3. **\u6587\u6863\u83b7\u53d6**\uff1a\u5c1d\u8bd5\u4ece GitHub \u83b7\u53d6\u63d2\u4ef6\u7684 README \u6587\u6863\u3002\n4. **\u4ee3\u7801\u5206\u6790**\uff1a\u4f7f\u7528 LLM \u5206\u6790\u63d2\u4ef6\u4ee3\u7801\u7ed3\u6784\u548c\u529f\u80fd\u3002\n5. **\u5e2e\u52a9\u751f\u6210**\uff1a\u751f\u6210\u5305\u542b\u547d\u4ee4\u3001\u53c2\u6570\u3001\u7528\u6cd5\u7684\u8be6\u7ec6\u5e2e\u52a9\u6587\u6863\u3002\n6. **\u7f13\u5b58\u5b58\u50a8**\uff1a\u5c06\u751f\u6210\u7684\u5e2e\u52a9\u6587\u6863\u7f13\u5b58\u5230\u672c\u5730\u3002\n\n## \ud83d\udcc4 \u8bb8\u53ef\u8bc1\n\n\u672c\u9879\u76ee\u91c7\u7528 GPL-3.0 \u8bb8\u53ef\u8bc1 - \u67e5\u770b [LICENSE](LICENSE) \u6587\u4ef6\u4e86\u89e3\u8be6\u60c5\u3002\n\n## \ud83d\ude4f \u9e23\u8c22\n\n- [NoneBot2](https://github.com/nonebot/nonebot2) - \u4f18\u79c0\u7684\u673a\u5668\u4eba\u6846\u67b6\u3002\n- [Alconna](https://github.com/ArcletProject/Alconna) - \u5f3a\u5927\u7684\u547d\u4ee4\u89e3\u6790\u5668\u3002\n\n---\n\n<div align=\"center\">\n\n**\u5982\u679c\u8fd9\u4e2a\u9879\u76ee\u5bf9\u4f60\u6709\u5e2e\u52a9\uff0c\u8bf7\u7ed9\u5b83\u4e00\u4e2a \u2b50\ufe0f \u5341\u5206\u611f\u8c22\uff01**\n\n</div>\n",
    "bugtrack_url": null,
    "license": "GPL3",
    "summary": "\u4e00\u4e2a\u652f\u6301\u591a\u5e73\u53f0\u7684\u5e2e\u52a9\u63d2\u4ef6\uff0c\u57fa\u4e8e LLM \u89e3\u6790 Github \u4ed3\u5e93\u6216\u4ee3\u7801\u3002",
    "version": "0.0.3",
    "project_urls": {
        "Documentation": "https://github.com/Lonely-Sails/nonebot-plugin-llm-helper#readme",
        "Homepage": "https://github.com/Lonely-Sails/nonebot-plugin-llm-helper",
        "Repository": "https://github.com/Lonely-Sails/nonebot-plugin-llm-helper"
    },
    "split_keywords": [
        "nonebot",
        " nonebot2",
        " helper",
        " llm",
        " ai"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "02bbf2d0637f2e5293c4ab59210bf8625e4b203b7ba9724c9bccf40665f50823",
                "md5": "2dc5c7cfb39db2eb36f2f02b72396cc1",
                "sha256": "306df912a0dc5e152c2c8f83df5f37dae40557e5dff9e559fdab7c4247836156"
            },
            "downloads": -1,
            "filename": "nonebot_plugin_llm_helper-0.0.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2dc5c7cfb39db2eb36f2f02b72396cc1",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.8",
            "size": 23978,
            "upload_time": "2025-07-15T05:18:45",
            "upload_time_iso_8601": "2025-07-15T05:18:45.956182Z",
            "url": "https://files.pythonhosted.org/packages/02/bb/f2d0637f2e5293c4ab59210bf8625e4b203b7ba9724c9bccf40665f50823/nonebot_plugin_llm_helper-0.0.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "828b3432c9427dbb81e71adcf66a93e79e36bd6bd4faaa85f2b94cd744e0d2ba",
                "md5": "b151fc9f4bd8e1626b0afabe7cf27edf",
                "sha256": "cc3aeba8ce1efcc433f20b8c3364b0b387f56f2e60e6acdf2aedc283f17c433f"
            },
            "downloads": -1,
            "filename": "nonebot_plugin_llm_helper-0.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "b151fc9f4bd8e1626b0afabe7cf27edf",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.8",
            "size": 20837,
            "upload_time": "2025-07-15T05:18:47",
            "upload_time_iso_8601": "2025-07-15T05:18:47.320137Z",
            "url": "https://files.pythonhosted.org/packages/82/8b/3432c9427dbb81e71adcf66a93e79e36bd6bd4faaa85f2b94cd744e0d2ba/nonebot_plugin_llm_helper-0.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-15 05:18:47",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Lonely-Sails",
    "github_project": "nonebot-plugin-llm-helper",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "nonebot-plugin-llm-helper"
}
        
Elapsed time: 0.87911s