Skip to main content

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


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)

Uploaded Source

Built Distribution

nonebot_plugin_dify-0.1.2-py3-none-any.whl (15.6 kB view details)

Uploaded Python 3

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

Hashes for nonebot_plugin_dify-0.1.2.tar.gz
Algorithm Hash digest
SHA256 06a5d6401a7ec581510a15c00b25b670b4a011632efa16c664b793db090434e9
MD5 ef8ed3d769919f26124de6ee72e827f3
BLAKE2b-256 7fd293cea686e27555c212b19a2f064b26a70d438676e1a7dd0d5468ef5523aa

See more details on using hashes here.

File details

Details for the file nonebot_plugin_dify-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_dify-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1f37b2b94fd92838ccfa2ce78398e45e891fcf9bedc12dd2b565b00fea1abcb8
MD5 b54f596ca437adff27d5fa79ddd35d54
BLAKE2b-256 fc5ffaf30b2d2e1920da834ee2044740ea5a9966bb8387861dcefb6399d31ee3

See more details on using hashes here.

Supported by

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