文心一言 Nonebot 插件
Project description
📖 介绍
- 本插件使用千帆大模型的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
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
Built Distribution
Close
Hashes for nonebot_plugin_ernie-0.2.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0665d732edc2b2263d341747352e874eaaa53a399a78d2c702a32ee70b6f6bb8 |
|
MD5 | 3fc47ec063cb195c9a33f2065c8bec31 |
|
BLAKE2b-256 | a5bda56afbeea68e35423d50b1f3d2b393cf0b41b54f371e9c064bf6289fefd8 |
Close
Hashes for nonebot_plugin_ernie-0.2.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cfc1def26cae7d819bf0f78759ebfb5cb99b5e378d41d1aa658e14644b6d34dc |
|
MD5 | 95da4befeb95ee5e3a5775fbd2ddf589 |
|
BLAKE2b-256 | 83db23a6989c3de2bf4d54e99d8323ff12ce95a74a757aa5eefb9632e9cd089f |