- 👋 Hi, I’m @chrisyy
- 👀 I’m interested in crypto/blockchain/minecraft
- 🌱 I’m currently working in web3
chrisyy2003 / nonebot-plugin-gpt3 Goto Github PK
View Code? Open in Web Editor NEWA nonebot plugin base on OpenAI API (gpt-3.5-turbo)
A nonebot plugin base on OpenAI API (gpt-3.5-turbo)
使用pip install nonebot-plugin-gpt3 playwright -U安装插件并在bot.py里加上nonebot.load_plugin('nonebot_plugin_gpt3')后,bot无法启动,发生如下报错
已经下载了README.md里的rustup-steup.exe并安装,但是没有手动配置环境变量,在cmd中输入rustup -V后有以下输出:
rustup 1.25.1 (bb60b1e89 2022-07-12)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active rustc
version is rustc 1.66.0 (69f9c33d7 2022-12-12)
就在今天,OPENai更新了gpt-3.5-turbo语言模型
设置人格、重置会话等操作需要为管理员
现在国内ip似乎 api也不给用了
自己配置好所有的文件之后跑起来报错未配置apikey,检查之后apikey是已经填写并保存的状态,劳烦大佬看看是什么问题
以下是运行时控制台的显示内容
(kugel) D:\kugelblyat\mai-bot-main>python bot.py
04-13 08:45:54 [SUCCESS] nonebot | NoneBot is initializing...
04-13 08:45:54 [INFO] nonebot | Current Env: dev
04-13 08:45:55 [WARNING] nonebot_plugin_gpt3 | 没有配置api key
04-13 08:45:55 [INFO] nonebot_plugin_gpt3 | 加载代理: 无
04-13 08:45:55 [INFO] nonebot_plugin_gpt3 | 加载默认人格:
04-13 08:45:55 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_gpt3"
04-13 08:45:57 [SUCCESS] nonebot | Succeeded to load plugin "maimaidx" from "src.plugins.maimaidx"
04-13 08:45:57 [SUCCESS] nonebot | Succeeded to load plugin "public" from "src.plugins.public"
04-13 08:45:57 [SUCCESS] nonebot | Running NoneBot...
04-13 08:45:57 [INFO] uvicorn | Started server process [2588]
04-13 08:45:57 [INFO] uvicorn | Waiting for application startup.
04-13 08:45:57 [INFO] uvicorn | Application startup complete.
04-13 08:45:57 [INFO] uvicorn | Uvicorn running on http://127.0.0.1:10219 (Press CTRL+C to quit)
04-13 08:46:00 [INFO] uvicorn | ('127.0.0.1', 60610) - "WebSocket /onebot/v11/ws" [accepted]
04-13 08:46:02 [INFO] nonebot | OneBot V11 | Bot 1976405702 connected
04-13 08:46:02 [INFO] websockets | connection open
apikey文件位置正确里面的api也是自己填写好了的
02-22 18:49:15 [INFO] nonebot_plugin_gocqhttp | [机器人QQ] 收到群 群名(群号) 内 群友(群友QQ号) 的消息: /gpt3 (-562778938)
02-22 18:49:15 [SUCCESS] nonebot | OneBot V11 3463402239 | [message.group.normal]: Message -562778938 from 群友QQ号@[群:群号] '/gpt3'
02-22 18:49:15 [INFO] nonebot | Event will be handled by Matcher(type='message', module=nonebot_plugin_gpt3)
02-22 18:49:15 [INFO] nonebot | Matcher(type='message', module=nonebot_plugin_gpt3) running complete
大佬你好,想问一下能不能关闭预置人格?
text-chat-davinci-002-20230126
配置文件添加一个时间参数,超过x秒后自动结束聊天并提醒会话超时聊天结束(?)
用pip安装插件时下载完成但是无法安装
pip install 这个插件时下载的了,最后没有安装
其次我在隔壁的大佬那里白嫖到了免费API的方法,奈何自己毫无语言基础
求大佬能增加一个免费API的功能
下面是大佬写出的东西
免KEY接口分析.docx
建议新增个人维度的每天提问次数CD限制,方便控制频率,不然免费API额度很快会被用完
关于人格设置 我输入了人格设置 猫娘 机器人给的反应是全局人格设置成功 但是其实人格还是AI助手 而且有时候设置还会出现双重人格
我是AI猫娘这种情况... 不知道是我的问题还是此插件的bug 我已经重新卸载安装后依然如此 而且不知道该插件是否支持自定义人格保存呢
03-01 14:22:27 [INFO] nonebot | Event will be handled by Matcher(type='message', module=nonebot_plugin_gpt3)
03-01 14:22:27 [INFO] nonebot | Matcher(type='message', module=nonebot_plugin_gpt3) running complete
03-01 14:22:27 [ERROR] nonebot | Running Matcher(type='message', module=nonebot_plugin_gpt3) failed.
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/root/nb/.venv/lib/python3.10/site-packages/nonebot/__init__.py", line 273, in run
get_driver().run(*args, **kwargs)
File "/root/nb/.venv/lib/python3.10/site-packages/nonebot/drivers/fastapi.py", line 187, in run
uvicorn.run(
File "/root/nb/.venv/lib/python3.10/site-packages/uvicorn/main.py", line 569, in run
server.run()
File "/root/nb/.venv/lib/python3.10/site-packages/uvicorn/server.py", line 60, in run
return asyncio.run(self.serve(sockets=sockets))
File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/root/nb/.venv/lib/python3.10/site-packages/nonebot/message.py", line 141, in _check_matcher
await _run_matcher(Matcher, bot, event, state, stack, dependency_cache)
> File "/root/nb/.venv/lib/python3.10/site-packages/nonebot/message.py", line 187, in _run_matcher
await matcher.run(bot, event, state, stack, dependency_cache)
File "/root/nb/.venv/lib/python3.10/site-packages/nonebot/internal/matcher/matcher.py", line 732, in run
await self.simple_run(bot, event, state, stack, dependency_cache)
File "/root/nb/.venv/lib/python3.10/site-packages/nonebot/internal/matcher/matcher.py", line 707, in simple_run
await handler(
File "/root/nb/.venv/lib/python3.10/site-packages/nonebot/dependencies/__init__.py", line 108, in __call__
return await cast(Callable[..., Awaitable[R]], self.call)(**values)
File "/root/nb/.venv/lib/python3.10/site-packages/nonebot_plugin_gpt3/__init__.py", line 335, in handle_chat
resp = await get_user_session(session_id).get_chat_response(msg)
TypeError: Session.get_chat_response() missing 1 required positional argument: 'is_admin'
逆向库地址:https://github.com/acheong08/ChatGPT
如果可以,能不能加入accessToken,SessionToken认证登录呢?
03-08 16:43:12 [SUCCESS] nonebot | ONEBOT V11 2545044071 | [message.group.normal]: Message 470695935 from 1270217000@[群:925353737] 'gpt 原神是否有抄袭塞尔达'
03-08 16:43:12 [INFO] nonebot | Event message.group.normal is ignored
一升rc版本插件都炸完了:(
之前询问过作者关于“You requested a model that is not compatible with this engine.”的报错,后来发现是单IP使用多个API同时遍历访问时速度过快会导致openai官方ban掉所有的api, 作者能否考虑重写逻辑? 在不使用proxy的情况下,比如说重复使用单个账号(可能出现速度报错)一直到余额耗尽,换下一个账号。
为什么我的gpt3说今年是2020年,是OpenAI开放的是2020年的库吗
发生错误: Error communicating with OpenAI: HTTPSConnectionPool(host='api.openai.com', port=443): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x0000029AA7BEEB20>: Failed to establish a new connection: [WinError 10060] 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。'))
大佬你好,请问一下这个报错是因为API被墙的缘故吗,配置文件里可以支持写代理吗
你没 require 快加上!不然会爆炸的!
我这里全部都配置好之后请求聊天,但是chatgpt接口返回提示:
发生错误: Incorrect API key provided: sk-hZr8S***************************************iYP8. You can find your API key at https://beta.openai.com.
我确认我的key完全正确没有错误,所以这是什么鬼,重新生成了好几次也还是key返回错误
你们有遇见这种怪问题吗
怎么解决的
发生未知错误:<calss 'anyio.EndOfStream'>
总是回答:作为AI语言模型,没有真正的身份和个性
回复后触发,后台无报错
发送消息,机器人回复error,是哪里出错了。日志如下
06-27 15:22:48 [SUCCESS] nonebot | OneBot V11 3568483338 | [message.private.friend]: Message 971437277 from '.xxx'
06-27 15:22:48 [DEBUG] nonebot | Checking for matchers in priority 10...
06-27 15:22:48 [DEBUG] nonebot | Checking for matchers in priority 100...
06-27 15:22:48 [INFO] nonebot | Event will be handled by Matcher(type='message', module=nonebot_plugin_gpt3)
06-27 15:22:48 [DEBUG] nonebot | Running Matcher(type='message', module=nonebot_plugin_gpt3)
06-27 15:22:48 [DEBUG] nonebot | Running handler Dependent(call=_)
06-27 15:22:49 [DEBUG] nonebot | OneBot V11 | Calling API send_msg
06-27 15:22:49 [INFO] nonebot | Matcher(type='message', module=nonebot_plugin_gpt3) running complete
06-27 15:22:49 [DEBUG] nonebot | Stop event propagation
06-27 15:22:49 [DEBUG] nonebot | Checking for matchers completed
我的nonebot是部署在docker中的,不知道是否可以从环境变量中读取配置
但是chatgpt网站还能用 能对接token吗
是密钥有问题吗
powershell启动go-cqhttp的时候提示账号密码错误或账号被冻结,但是我账号密码都正确,而且扫码登录也是相同的提示
rt
01-11 12:56:36 [SUCCESS] nonebot | OneBot V11 738386129 | [message.private.friend]: Message 1516341372 from 3258447421 "/gpt3 你好"
01-11 12:56:36 [INFO] nonebot | Event will be handled by Matcher(type='message', module=nonebot_plugin_gpt3)
01-11 12:56:36 [INFO] nonebot | Matcher(type='message', module=nonebot_plugin_gpt3) running complete
01-11 12:56:36 [ERROR] nonebot | Running Matcher(type='message', module=nonebot_plugin_gpt3) failed.
Traceback (most recent call last):
File "c:\Zsy_files\Zsy_bot\ghcp\Zsybot\bot.py", line 59, in
nonebot.run(app="mp_main:app")
File "C:\Zsy_files\Python\lib\site-packages\nonebot_init_.py", line 273, in run
get_driver().run(*args, **kwargs)
File "C:\Zsy_files\Python\lib\site-packages\nonebot\drivers\fastapi.py", line 172,
in run
uvicorn.run(
File "C:\Zsy_files\Python\lib\site-packages\uvicorn\main.py", line 569, in run
server.run()
File "C:\Zsy_files\Python\lib\site-packages\uvicorn\server.py", line 60, in run
return asyncio.run(self.serve(sockets=sockets))
File "C:\Zsy_files\Python\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "C:\Zsy_files\Python\lib\asyncio\base_events.py", line 636, in run_until_complete
self.run_forever()
File "C:\Zsy_files\Python\lib\asyncio\windows_events.py", line 321, in run_forever
super().run_forever()
File "C:\Zsy_files\Python\lib\asyncio\base_events.py", line 603, in run_forever
self._run_once()
File "C:\Zsy_files\Python\lib\asyncio\base_events.py", line 1899, in _run_once
handle._run()
File "C:\Zsy_files\Python\lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "C:\Zsy_files\Python\lib\site-packages\nonebot\message.py", line 142, in _check_matcher
await _run_matcher(Matcher, bot, event, state, stack, dependency_cache)
File "C:\Zsy_files\Python\lib\site-packages\nonebot\message.py", line 188, in run_matcher
await matcher.run(bot, event, state, stack, dependency_cache)
File "C:\Zsy_files\Python\lib\site-packages\nonebot\internal\matcher\matcher.py", line 727, in run
await self.simple_run(bot, event, state, stack, dependency_cache)
File "C:\Zsy_files\Python\lib\site-packages\nonebot\internal\matcher\matcher.py", line 702, in simple_run
await handler(
File "C:\Zsy_files\Python\lib\site-packages\nonebot\dependencies_init.py", line 108, in call
return await cast(Callable[..., Awaitable[R]], self.call)(**values)
File "C:\Zsy_files\Python\lib\site-packages\nonebot_plugin_gpt3_init_.py", line
169, in _
resp = await get_user_session(session_id).get_chat_response(msg)
File "C:\Zsy_files\Python\lib\site-packages\nonebot_plugin_gpt3_init_.py", line
81, in get_chat_response
if ok:
UnboundLocalError: local variable 'ok' referenced before assignment
使用插件时出现以下报错:
“You requested a model that is not compatible with this engine.”
与https://community.openai.com/t/error-you-requested-a-model-that-is-not-compatible-with-this-engine-when-using-codex-in-playground/35153/1 存在相同的问题。
02-25 16:12:14 [ERROR] nonebot | Failed to import "nonebot_plugin_gpt3"
Traceback (most recent call last):
File "", line 14, in
File "/opt/openai-bot/.venv/lib/python3.9/site-packages/nonebot/plugin/load.py", line 122, in load_from_toml
return load_all_plugins(plugins, plugin_dirs)
File "/opt/openai-bot/.venv/lib/python3.9/site-packages/nonebot/plugin/load.py", line 59, in load_all_plugins
return manager.load_all_plugins()
File "/opt/openai-bot/.venv/lib/python3.9/site-packages/nonebot/plugin/manager.py", line 168, in load_all_plugins
return set(
File "/opt/openai-bot/.venv/lib/python3.9/site-packages/nonebot/plugin/manager.py", line 169, in
filter(None, (self.load_plugin(name) for name in self.available_plugins))
File "/opt/openai-bot/.venv/lib/python3.9/site-packages/nonebot/plugin/manager.py", line 141, in load_plugin
module = importlib.import_module(name)
File "/usr/lib/python3.9/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1030, in _gcd_import
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 680, in _load_unlocked
File "/opt/openai-bot/.venv/lib/python3.9/site-packages/nonebot/plugin/manager.py", line 233, in exec_module
super().exec_module(module)
File "", line 790, in exec_module
File "", line 228, in _call_with_frames_removed
File "/opt/openai-bot/.venv/lib/python3.9/site-packages/nonebot_plugin_gpt3/init.py", line 10, in
from .config import *
File "/opt/openai-bot/.venv/lib/python3.9/site-packages/nonebot_plugin_gpt3/config.py", line 24, in
config = Config.parse_obj(global_config)
File "pydantic/main.py", line 527, in pydantic.main.BaseModel.parse_obj
return cls(**obj)
File "pydantic/env_settings.py", line 39, in pydantic.env_settings.BaseSettings.init
super().init(
File "pydantic/main.py", line 342, in pydantic.main.BaseModel.init
raise validation_error
pydantic.error_wrappers.ValidationError: 1 validation error for Config
gpt3_api_key_list_from_env
value is not a valid list (type=type_error.list)
系统环境&软件版本:Python3.9、Debian11、NoneBot2
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.