📖 介绍 
利用 LLM 将自然语言转换为机器人指令 / Convert natural language messages into bot commands using LLMs
💿 安装
以下提到的方法任选 其一 即可
[推荐] 使用 nb-cli 安装
在 Bot 的根目录下打开命令行, 输入以下指令即可安装nb plugin install nonebot-plugin-llm-extension
使用包管理器安装
pip install nonebot-plugin-llm-extension
# or, use poetry
poetry add nonebot-plugin-llm-extension
# or, use pdm
pdm add nonebot-plugin-llm-extension
# or, use uv
uv add nonebot-plugin-llm-extension
⚙️ 配置
在项目的配置文件中添加下表中配置:
其实这里并不建议使用 deepseek
| 配置项 | 默认值 | 说明 |
|---|---|---|
| llm_extension__api_key | 无 | API 密钥 |
| llm_extension__base_url | https://api.deepseek.com/v1 | API 端点 |
| llm_extension__model | deepseek-reasoner | 模型名 |
🎉 使用
from nonebot_plugin_llm_extension import LLMExtension
from nonebot_plugin_alconna import on_alconna, Args, Alconna, CommandMeta
weather = on_alconna(
Alconna(
"weather",
Args["location?#地区", str],
meta=CommandMeta(
description="今日天气",
example="/天气 陕西汉中"
)
),
use_cmd_start=True,
extension=[LLMExtension],
)
通过提供完善的命令元信息,可以让 LLM 更准确地理解命令意图,从而提高自然语言到指令的转换准确率
📸 效果图
理论上,这里应该有一张图片
💖 鸣谢
KomoriDev/Starify:提供了引人注目的徽章
📄 许可证
本项目使用 MIT 许可证开源
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Metadata
Release files for nonebot-plugin-llm-extension 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nonebot_plugin_llm_extension-0.1.1.tar.gz | 6.1 kB | Without provenance | Details for nonebot_plugin_llm_extension-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nonebot_plugin_llm_extension-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for nonebot_plugin_llm_extension-0.1.1-py3-none-any.whl |
Total release size: 13.8 kB
Release files / nonebot_plugin_llm_extension-0.1.1.tar.gz
| Download URL | nonebot_plugin_llm_extension-0.1.1.tar.gz |
|---|---|
| Size | 6.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0e98e983c5d7f27aa4c20fea5f741e4262efd09a463a6b4921948584283a5bef
|
|
BLAKE2b-256 checksum How to use checksums |
2e4f8b93ca653eb9aee60356399701fdf0ab1daceac4b737f1f96941935a6f7d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.8.22
|
Release files / nonebot_plugin_llm_extension-0.1.1-py3-none-any.whl
| Download URL | nonebot_plugin_llm_extension-0.1.1-py3-none-any.whl |
|---|---|
| Size | 7.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cf80d9ac5a4f971f66e9679fa591417b7a342566f73390cc2b7f633a90d7dc81
|
|
BLAKE2b-256 checksum How to use checksums |
5eb0cb244d12507525de56bd79f2223ae1546d663094aa4e46012c63b698b94a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.8.22
|
Security for nonebot-plugin-llm-extension 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.