Skip to main content

Nonebot2 plugin for using llm

Project description

nonebot

nonebot-plugin-anywhere-llm

为你的 nonebot2 插件提供 LLM 接口

license Python NoneBot

✨ 特性

  • 🚀 快速:开箱即用的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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nonebot_plugin_anywhere_llm-0.6.7.11.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file nonebot_plugin_anywhere_llm-0.6.7.11.tar.gz.

File metadata

File hashes

Hashes for nonebot_plugin_anywhere_llm-0.6.7.11.tar.gz
Algorithm Hash digest
SHA256 5b06313df9f7ace7e800c6b0d729af0e7b04fb2abda4666117ec5bf32c10c5be
MD5 2458e390daae3e52d24c7268e4630812
BLAKE2b-256 c47bc14c1f857e4e16e389f541363ed1bd089b2d6c092834a408092f6339a5b9

See more details on using hashes here.

File details

Details for the file nonebot_plugin_anywhere_llm-0.6.7.11-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_anywhere_llm-0.6.7.11-py3-none-any.whl
Algorithm Hash digest
SHA256 9eb813b1f6fa8c0c5c3a3fc5fd84f80870ffec1c5f3fcd5e4266f06ea6e64306
MD5 eac8b445ddafc5e1486de77a6f7c04af
BLAKE2b-256 34600afc910796630d82df6e7323f785c19da124e7906fc833c24d1bad2d58dd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page