Nonebot2's plugin of ChatGPT
Project description
📖 介绍
自用的使用浏览器ChatGPT接入Nonebot2
使用条件
需要纯净ip用来过cf,另外根据使用账号数量需要相应多的内存
💿 安装
使用 nb-cli 安装
在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装nb plugin install nonebot-plugin-gpt
使用包管理器安装
在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令pip
pip install nonebot-plugin-gpt
pdm
pdm add nonebot-plugin-gpt
poetry
poetry add nonebot-plugin-gpt
conda
conda install nonebot-plugin-gpt
打开 nonebot2 项目根目录下的 pyproject.toml
文件, 在 [tool.nonebot]
部分追加写入
plugins = ["nonebot_plugin_gpt"]
⚙️ 配置
在 nonebot2 项目的.env
文件中添加下表中的必填配置
配置项 | 必填 | 默认值 | 说明 |
---|---|---|---|
gpt_session | 是 | 无 | openai账号密码 |
gpt_proxy | 否 | 无 | 使用的代理 |
arkose_status | 否 | false | gpt是否开启了arkose验证 |
group_chat | 否 | true | 群里开启多人识别 |
begin_sleep_time | 否 | false | 关闭启动等待时间(建议账号数量小于5才开启) |
gpt_chat_priority | 否 | 90 | gpt聊天响应优先级 |
gpt_command_priority | 否 | 19 | gpt命令响应优先级 |
gpt_white_list_mode | 否 | true | 聊天白名单模式 |
gpt_replay_to_replay | 否 | false | 是否响应"回复消息" |
gpt_ban_str | 否 | 无 | 黑名单屏蔽词列表 |
# 配置示例
# 当mode为空或者为openai时,建议提前手动登录一次获取session_token填入,mode目前不支持苹果账号
gpt_session='[
{
"email": "xxxx@hotmail.com",
"password": "xxxx",
"session_token": "ey....",
},
{
"email": "aaaa@sss.com",
"password": "xxxx",
"mode": "google",
},
]'
# 屏蔽词
gpt_ban_str='[
"我是猪",
"你是猪",
]'
🎉 使用
指令表
指令 | 权限 | 需要@ | 范围 | 说明 |
---|---|---|---|---|
@bot 聊天内容... | 无/白名单 | 是 | 群聊/私聊 | @或者叫名+内容 开始聊天,随所有者白名单模式设置改变 |
初始化 | 无/白名单 | 是 | 群聊/私聊 | 初始化 <人设名> |
重置 | 无/白名单 | 是 | 群聊/私聊 | 回到初始化人设后的第二句话时 |
重置上一句 | 无/白名单 | 是 | 群聊/私聊 | 刷新上一句的回答 |
回到过去 | 无/白名单 | 是 | 群聊/私聊 | 回到过去 <对话序号/p_id/最后一次出现的关键词> ,回到括号内的对话时间点 |
人设列表 | 无/白名单 | 是 | 群聊/私聊 | 查看可用人设列表 |
查看人设 | 无/白名单 | 是 | 群聊/私聊 | 查看人设的具体内容 |
添加人设 | 无/白名单 | 是 | 群聊/私聊 | 添加人设 (人设名) |
历史聊天 | 无/白名单 | 是 | 群聊/私聊 | 查看当前人格历史聊天记录 |
删除人设 | 超级管理员 | 是 | 群聊/私聊 | 删除人设 (人设名) |
工作状态 | 超级管理员 | 是 | 群聊/私聊 | 查看当前所有账号的工作状态 |
黑名单列表 | 超级管理员 | 是 | 群聊/私聊 | 查看黑名单列表 |
解黑 | 超级管理员 | 是 | 群聊/私聊 | 解黑 <账号> ,解除黑名单 |
白名单列表 | 超级管理员 | 是 | 群聊/私聊 | 查看白名单列表 |
添加白名单 | 超级管理员 | 是 | 群聊/私聊 | 添加白名单 <账号/群号> (个人/群) ,添加白名单,最后不写默认为群 |
删除白名单 | 超级管理员 | 是 | 群聊/私聊 | 删除白名单 <账号/群号> (个人/群) ,删除白名单,最后不写默认为群 |
<为必填内容>,(为选填内容)
待续
自用挺久了,匆忙改改发出来,很多东西还没补充
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-gpt-0.0.1.tar.gz
(11.9 kB
view hashes)
Built Distribution
Close
Hashes for nonebot_plugin_gpt-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd513d05faf6d809bab9368a8502441d6b9328d45639bbdf5b571e318bfa891f |
|
MD5 | 7b3429c347fee67f8669e3c828c5223a |
|
BLAKE2b-256 | 9eb86ff2ceb6dd31631075134b243476d781ff00db99554c6802be320e29e5fa |