A Nonebot plugin for interacting with Dify
Project description
nonebot-plugin-dify
📖 介绍
基于 NoneBot2,该插件用于对接LLMOps平台Dify。
💿 安装
使用 nb-cli 安装
在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装
nb plugin install nonebot-plugin-dify
使用包管理器安装
在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令
如pip
pip install nonebot-plugin-dify
然后打开 nonebot2 项目根目录下的 pyproject.toml
文件, 在 [tool.nonebot]
部分追加写入
plugins = ["nonebot_plugin_dify"]
⚙️ 配置
在 nonebot2 项目的.env
文件中添加下表中的配置
配置项 | 必填 | 默认值 | 说明 |
---|---|---|---|
DIFY_API_BASE | 否 | https://api.dify.ai/v1 | DIFY API地址,支持自建 |
DIFY_API_KEY | 是 | 无 | DIFY API KEY |
DIFY_APP_TYPE | 否 | chatbot | DIFY APP 类型 |
DIFY_IMAGE_UPLOAD_ENABLE | 否 | False | 是否开启上传图片,需要LLM模型支持图片识别 注意暂不支持 DISCORD |
DIFY_EXPIRES_IN_SECONDS | 否 | 3600 | 会话过期时间 |
🎉 使用
对接不同Bot的例子
.env
# 对接`ONEBOT`
ONEBOT_ACCESS_TOKEN=xxxxxx
# 对接`TELEGRAM`
TELEGRAM_BOTS=[{"token": "1111:xxxx"}]
# 对接`DISCORD`
DISCORD_BOTS=[{"token": "xxxxxxxxxxxxx"}]
👍 特别感谢
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
nonebot_plugin_dify-0.1.2.tar.gz
(14.0 kB
view details)
Built Distribution
File details
Details for the file nonebot_plugin_dify-0.1.2.tar.gz
.
File metadata
- Download URL: nonebot_plugin_dify-0.1.2.tar.gz
- Upload date:
- Size: 14.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06a5d6401a7ec581510a15c00b25b670b4a011632efa16c664b793db090434e9 |
|
MD5 | ef8ed3d769919f26124de6ee72e827f3 |
|
BLAKE2b-256 | 7fd293cea686e27555c212b19a2f064b26a70d438676e1a7dd0d5468ef5523aa |
File details
Details for the file nonebot_plugin_dify-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: nonebot_plugin_dify-0.1.2-py3-none-any.whl
- Upload date:
- Size: 15.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f37b2b94fd92838ccfa2ce78398e45e891fcf9bedc12dd2b565b00fea1abcb8 |
|
MD5 | b54f596ca437adff27d5fa79ddd35d54 |
|
BLAKE2b-256 | fc5ffaf30b2d2e1920da834ee2044740ea5a9966bb8387861dcefb6399d31ee3 |