Skip to main content

文心一言 Nonebot 插件

Project description

NoneBotPluginLogo

NoneBotPluginText

nonebot-plugin-ernie

✨ 简单的文心一言 AI 对话插件 ✨

license pypi python

📖 介绍

  • 本插件使用千帆大模型的ERNIE-Bot-turbo API进行对话请求,使用前需根据API调用指南创建一个千帆应用以获取API Key、Secret Key。
  • 文心一言 API 目前暂时不支持连续对话生成,仅能响应单句。

💿 安装

使用 nb-cli 安装(推荐) 在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装
nb plugin install nonebot-plugin-ernie
使用包管理器安装 在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令
pip
pip install nonebot-plugin-ernie
pdm
pdm add nonebot-plugin-ernie
poetry
poetry add nonebot-plugin-ernie
conda
conda install nonebot-plugin-ernie

打开 nonebot2 项目根目录下的 pyproject.toml 文件, 在 [tool.nonebot] 部分追加写入

plugins = ["nonebot_plugin_example"]
手动安装
git clone https://github.com/Noctulus/nonebot-plugin-ernie.git

下载完成后在bot项目的pyproject.toml文件手动添加插件:

plugin_dirs = ["xxxxxx","xxxxxx",......,"下载完成的插件路径/nonebot-plugin-ernie"]

⚙️ 配置

在 nonebot2 项目的.env文件中添加下表中的必填配置

配置项 必填 默认值 说明
wenxin_ak 百度智能云千帆的access key
wenxin_sk 百度智能云千帆的secret key

🎉 使用

指令表

指令 权限 需要@ 范围 说明
一言 全部 全部 使用文心一言 API 进行对话生成

效果图

效果图

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_ernie-0.2.5.tar.gz (4.2 kB view hashes)

Uploaded Source

Built Distribution

nonebot_plugin_ernie-0.2.5-py3-none-any.whl (5.0 kB view hashes)

Uploaded Python 3

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