Nonebot2 plugin for using llm
Project description
✨ 特性
- 🚀 快速:开箱即用的LLM集成能力
- 🛠️ 可扩展:提供灵活的 config 与 prompt 设置
- 🏗️ 易用性:简单的 API 设计,方便上手
📦 安装
方式 1:通过 pip 安装
pip install nonebot-plugin-anywhere-llm
🚀 快速使用
配置
.env
OPENAI_API_KEY="sk-ivwnsnscugorsxqvncgbysxkcsnkccwagebmdqoluuwjlkmk"
OPENAI_MODEL="deepseek-ai/DeepSeek-R1-Distill-Qwen-7B"
OPENAI_BASE_URL="https://api.siliconflow.cn/v1" # 代理地址
插件内使用
LLMService = require('nonebot_anywhere_llm').LLMService
LLMParams = require('nonebot_anywhere_llm').LLMParams
my_params = LLMParams(
model= "deepseek-ai/DeepSeek-R1-Distill-Qwen-7B",
)
llm = LLMService(my_params)
test_matcher = on_command("test")
@test_matcher.handle()
async def handle_ask(matcher: Matcher, event: MessageEvent):
output = await llm.generate('回复测试')
await matcher.finish(output)
📜 许可证
本项目基于 MIT License 许可证发布。
💡 喜欢这个项目?欢迎 Star⭐,让更多人看到!
Project details
Release history Release notifications | RSS feed
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_anywhere_llm-0.6.7.11.tar.gz.
File metadata
- Download URL: nonebot_plugin_anywhere_llm-0.6.7.11.tar.gz
- Upload date:
- Size: 9.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.1 CPython/3.11.8 Linux/6.8.0-55-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b06313df9f7ace7e800c6b0d729af0e7b04fb2abda4666117ec5bf32c10c5be
|
|
| MD5 |
2458e390daae3e52d24c7268e4630812
|
|
| BLAKE2b-256 |
c47bc14c1f857e4e16e389f541363ed1bd089b2d6c092834a408092f6339a5b9
|
File details
Details for the file nonebot_plugin_anywhere_llm-0.6.7.11-py3-none-any.whl.
File metadata
- Download URL: nonebot_plugin_anywhere_llm-0.6.7.11-py3-none-any.whl
- Upload date:
- Size: 14.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.1 CPython/3.11.8 Linux/6.8.0-55-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9eb813b1f6fa8c0c5c3a3fc5fd84f80870ffec1c5f3fcd5e4266f06ea6e64306
|
|
| MD5 |
eac8b445ddafc5e1486de77a6f7c04af
|
|
| BLAKE2b-256 |
34600afc910796630d82df6e7323f785c19da124e7906fc833c24d1bad2d58dd
|