一个支持多平台的帮助插件,基于 LLM 解析 Github 仓库或代码。
Project description
nonebot-plugin-llm-helper
✨ 一个支持多平台的帮助插件,基于 LLM 解析 Github 仓库或代码。 ✨
📖 介绍
LLM-Helper 是一个智能的 NoneBot2 帮助插件,它利用大语言模型(LLM)自动分析插件代码和文档,为用户提供详细的插件使用说明。该插件能够:
- 🔍 智能解析:自动扫描并分析所有已安装的插件。
- 🤖 AI 生成:使用 LLM 解析插件代码和 README 文档。
- 📚 详细帮助:生成包含命令、参数、用法示例的完整帮助文档。
- 🔄 实时更新:支持重新生成插件的帮助文档。
- 🔎 智能搜索:支持按关键词搜索插件和命令。
✨ 特性
- 自动发现:启动时自动扫描所有用户插件。
- 智能缓存:缓存生成的帮助文档,提高响应速度。
- 多平台支持:支持所有 NoneBot2 适配器。
- 灵活配置:支持 OpenAi 兼容格式,支持大多数的模型。
- 错误重试:内置重试机制,提高稳定性。
[!TIP] 本插件所生成的帮助文档很大程度上依赖于 LLM 的能力,故所生成的内容仅供参考。
💿 安装
使用 nb-cli 安装
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 |
重试间隔时间(秒) |
配置示例
# 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
🔧 工作原理
- 插件扫描:启动时自动扫描所有已安装的用户插件。
- 元数据提取:获取插件的元数据信息和文件路径。
- 文档获取:尝试从 GitHub 获取插件的 README 文档。
- 代码分析:使用 LLM 分析插件代码结构和功能。
- 帮助生成:生成包含命令、参数、用法的详细帮助文档。
- 缓存存储:将生成的帮助文档缓存到本地。
📄 许可证
本项目采用 GPL-3.0 许可证 - 查看 LICENSE 文件了解详情。
🙏 鸣谢
如果这个项目对你有帮助,请给它一个 ⭐️ 十分感谢!
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nonebot_plugin_llm_helper-0.0.1.tar.gz.
File metadata
- Download URL: nonebot_plugin_llm_helper-0.0.1.tar.gz
- Upload date:
- Size: 20.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.13.1 Darwin/23.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ce6329a4e20f962b8ff53a0e5197998cb96ddb84b0a38052af1d53e5a723764f
|
|
| MD5 |
a8dd6a91d29ffc264ed1e5e7f6532390
|
|
| BLAKE2b-256 |
3af75fbb83dba8bae420132e9e0f84016e6eec2b24869e88469e4c82fb398343
|
File details
Details for the file nonebot_plugin_llm_helper-0.0.1-py3-none-any.whl.
File metadata
- Download URL: nonebot_plugin_llm_helper-0.0.1-py3-none-any.whl
- Upload date:
- Size: 24.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.13.1 Darwin/23.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a77ab390dbd9d68e4f037e334857f44224e4b8368432de030ea1b2fc3294194b
|
|
| MD5 |
528a8fd4f71c0ada3190fb8e06593611
|
|
| BLAKE2b-256 |
79e6fd988dd9b506666cf60b3610fdbafc3ccf4f66e7c66e15200c40af34dcf7
|