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模型支持图片识别,
同时需要nonebot_plugin_alconna支持相应Adapter
DIFY_EXPIRES_IN_SECONDS 3600 会话过期时间

🎉 使用

对接不同Bot的例子

具体支持哪些平台请参考nonebot_plugin_alconna

.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.4.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

nonebot_plugin_dify-0.1.4-py3-none-any.whl (16.0 kB view details)

Uploaded Python 3

File details

Details for the file nonebot_plugin_dify-0.1.4.tar.gz.

File metadata

  • Download URL: nonebot_plugin_dify-0.1.4.tar.gz
  • Upload date:
  • Size: 14.3 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.4.tar.gz
Algorithm Hash digest
SHA256 e2b320bf06bfc3653212280410da1e3f5b7868515c13e1f9f65720d263d770e4
MD5 5573a75168f88dac67dc0d11af847e01
BLAKE2b-256 698e6abdcd67a6145f985dd888a4015f6d90e7447a47145adba62af61ca30920

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nonebot_plugin_dify-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e254ea0ef64bbda359ae45775d3a7bdd058d4ad94f83d4e954f65aef09df8696
MD5 6d34ed478985dec23d606c5356685099
BLAKE2b-256 22702e5df6b7ac15c9ac43c1105da4dc34dcd7fe94b295dbd3aeec5338646b02

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