lss233 / chatgpt-mirai-qq-bot

🚀 一键部署!真正的 AI 聊天机器人!支持ChatGPT、文心一言、讯飞星火、Bing、Bard、ChatGLM、POE,多账号,人设调教,虚拟女仆、图片渲染、语音发送 | 支持 QQ、Telegram、Discord、微信 等平台
GNU Affero General Public License v3.0
12.52k stars 1.52k forks source link

无法请求 #1209

Open hi-enico opened 9 months ago

hi-enico commented 9 months ago

提交 issue 前,请先确认:

运行环境:

复现步骤
1.与v2版本(使用v2.5.3版本没有问题)一样正常启动 2.进入web页面配置账号、代理服务器、默认ai(chatgpt-api) 3.给机器人发送消息

输出日志
Active code page: 65001 2023-09-28 14:07:33.642 | DEBUG | framework.accounts.manager:register_type:35 - [AccountManager] 注册账号类型:chatgpt-web 2023-09-28 14:07:33.642 | DEBUG | framework.accounts.manager:register_type:35 - [AccountManager] 注册账号类型:openai-api 2023-09-28 14:07:33.642 | DEBUG | framework.accounts.manager:register_type:35 - [AccountManager] 注册账号类型:baidu 2023-09-28 14:07:33.642 | DEBUG | framework.accounts.manager:register_type:35 - [AccountManager] 注册账号类型:slack 2023-09-28 14:07:33.642 | DEBUG | framework.accounts.manager:register_type:35 - [AccountManager] 注册账号类型:bard 2023-09-28 14:07:33.642 | DEBUG | framework.accounts.manager:register_type:35 - [AccountManager] 注册账号类型:bing 2023-09-28 14:07:33.642 | DEBUG | framework.accounts.manager:register_type:35 - [AccountManager] 注册账号类型:bing 2023-09-28 14:07:33.642 | DEBUG | framework.accounts.manager:register_type:35 - [AccountManager] 注册账号类型:bing 2023-09-28 14:07:33.642 | DEBUG | framework.accounts.manager:register_type:35 - [AccountManager] 注册账号类型:chatglm 2023-09-28 14:07:33.642 | DEBUG | framework.accounts.manager:register_type:35 - [AccountManager] 注册账号类型:poe-token 2023-09-28 14:07:33.642 | DEBUG | framework.accounts.manager:register_type:35 - [AccountManager] 注册账号类型:poe-token 2023-09-28 14:07:33.642 | DEBUG | framework.accounts.manager:register_type:35 - [AccountManager] 注册账号类型:poe-token 2023-09-28 14:07:33.642 | DEBUG | framework.accounts.manager:register_type:35 - [AccountManager] 注册账号类型:poe-token 2023-09-28 14:07:33.642 | DEBUG | framework.accounts.manager:register_type:35 - [AccountManager] 注册账号类型:poe-token 2023-09-28 14:07:33.642 | DEBUG | framework.accounts.manager:register_type:35 - [AccountManager] 注册账号类型:poe-token 2023-09-28 14:07:33.642 | DEBUG | framework.accounts.manager:register_type:35 - [AccountManager] 注册账号类型:poe-token 2023-09-28 14:07:33.642 | DEBUG | framework.accounts.manager:register_type:35 - [AccountManager] 注册账号类型:poe-token 2023-09-28 14:07:33.642 | DEBUG | framework.accounts.manager:register_type:35 - [AccountManager] 注册账号类型:poe-token 2023-09-28 14:07:33.642 | DEBUG | framework.accounts.manager:register_type:35 - [AccountManager] 注册账号类型:xinghuo-cookie 2023-09-28 14:07:33.720 | SUCCESS | config:scan_prompts:784 - 检查预设:catgirl <==> ./prompts\catgirl.yml [成功] 2023-09-28 14:07:33.720 | SUCCESS | config:scan_prompts:784 - 检查预设:default <==> ./prompts\default.yml [成功] 2023-09-28 14:07:33.720 | INFO | config:check_proxy:863 - [代理测试] 正在检查代理配置:http://127.0.0.1:10801 2023-09-28 14:07:34.235 | SUCCESS | config:check_proxy:871 - [代理测试] 连接成功! C:\Users\Administrator\Desktop\Windows-quickstart-go-cqhttp-refs.tags.v3.0.0-alpha2\python3.11\Lib\site-packages\pydub\utils.py:170: RuntimeWarning: Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work warn("Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work", RuntimeWarning) 2023-09-28 14:07:34.251 | DEBUG | framework.tts.tts:register:198 - 初始化 TTS 引擎:edge 2023-09-28 14:07:35.068 | SUCCESS | framework.accounts.manager:login_account:56 - [AccountManager] 登录成功: openai-api2023-09-28 14:07:35.436 | SUCCESS | framework.accounts.manager:login_account:56 - [AccountManager] 登录成功: bing 2023-09-28 14:07:35.436 | DEBUG | framework.accounts.manager:load_accounts:85 - [AccountManager] 登录完毕,共有 2/2 个账号成功登录。 2023-09-28 14:07:40.150 | DEBUG | framework.platforms.http_service_legacy:clear_request_dict:157 - Watch and clean request_dic. 2023-09-28 14:07:40.150 | INFO | main:setup_web_service:53 - 启动 HTTP API 中…… 2023-09-28 14:07:40.150 | INFO | main:setup_web_service:55 - OneBot 地址:ws://0.0.0.0:8080/ws 2023-09-28 14:07:40.150 | INFO | main:setup_web_service:55 - Web 管理页面 地址:http://0.0.0.0:8080/ 2023-09-28 14:07:40.150 | SUCCESS | framework.platforms.onebot_bot:startup:387 - OneBot 服务启动完毕,接收消息中…… 2023-09-28 14:07:40.150 | INFO | hypercorn.logging:info:106 - Running on http://0.0.0.0:8080 (CTRL + C to quit) [2023-09-28 14:07:40,150] Running on http://0.0.0.0:8080 (CTRL + C to quit) 2023-09-28 14:07:41.138 | INFO | hypercorn.logging:access:88 - 127.0.0.1:65314 GET /ws 1.1 101 - 0 [2023-09-28 14:07:41,138] 127.0.0.1:65314 GET /ws 1.1 101 - 0 2023-09-28 14:08:05.321 | DEBUG | framework.platforms.onebotbot::180 - 私聊消息:你好 2023-09-28 14:08:05.321 | DEBUG | framework.universal:handle_message:123 - 尝试使用 default_ai=chatgpt-api 来创建对话上下文 2023-09-28 14:08:05.676 | DEBUG | framework.prompt_engine:execute_action_block:133 - [Prompt execution] completed action: system/use-tts-engine, name: None, result: None 2023-09-28 14:08:05.691 | DEBUG | framework.middlewares.timeout:create_timeout_task:51 - [Timeout] 开始计时…… 2023-09-28 14:08:05.691 | DEBUG | framework.prompt_engine:execute_action_block:133 - [Prompt execution] completed action: system/text, name: None, result: 你好 2023-09-28 14:08:06.458 | ERROR | framework.universal:handle_message:290 - 无法请求 () Traceback (most recent call last):

File "C:\Users\Administrator\Desktop\Windows-quickstart-go-cqhttp-refs.tags.v3.0.0-alpha2\chatgpt\framework\llm\openai\api.py", line 106, in ask async for resp in self.bot.ask_stream_async(prompt=prompt, │ │ │ └ '你好' │ │ └ <function Chatbot.ask_stream_async at 0x0000029660B02480> │ └ <revChatGPT.V3.Chatbot object at 0x00000296675BFF10> └ <framework.llm.openai.api.ChatGPTAPIAdapter object at 0x00000296674D0A50>

File "C:\Users\Administrator\Desktop\Windows-quickstart-go-cqhttp-refs.tags.v3.0.0-alpha2\python3.11\Lib\site-packages\revChatGPT\V3.py", line 319, in ask_stream_async raise t.APIConnectionError( │ └ <class 'revChatGPT.typings.APIConnectionError'> └ <module 'revChatGPT.typings' from 'C:\Users\Administrator\Desktop\Windows-quickstart-go-cqhttp-refs.tags.v3.0.0-alpha2\p... revChatGPT.typings.APIConnectionError: 404 Not Found { "error": { "message": "Invalid URL (POST /v1/chat/completions/chat/completions)", "type": "invalid_request_error", "param": null, "code": null } }

Please check if there is a problem with your network connection Please check that the input is correct, or you can resolve this issue by filing an issue

Project URL: https://github.com/acheong08/ChatGPT

The above exception was the direct cause of the following exception:

Traceback (most recent call last):

File "C:\Users\Administrator\Desktop\Windows-quickstart-go-cqhttp-refs.tags.v3.0.0-alpha2\chatgpt\bot.py", line 99, in loop.run_until_complete(asyncio.gather(*bots)) │ │ │ │ └ [<coroutine object setup_web_service at 0x0000029660B2BB00>] │ │ │ └ <function gather at 0x000002965A56B560> │ │ └ <module 'asyncio' from 'C:\Users\Administrator\Desktop\Windows-quickstart-go-cqhttp-refs.tags.v3.0.0-alpha2\python3.11\... │ └ <function BaseEventLoop.run_until_complete at 0x000002965A9982C0> └

File "asyncio\base_events.py", line 640, in run_until_complete sock.setblocking(False)

File "asyncio\windows_events.py", line 321, in run_forever

File "asyncio\base_events.py", line 607, in run_forever sock.close()

File "asyncio\base_events.py", line 1922, in _run_once

File "asyncio\events.py", line 80, in _run self._loop = loop │ └ <member '_loop' of 'Handle' objects> └ <Handle Task.task_wakeup()>

File "C:\Users\Administrator\Desktop\Windows-quickstart-go-cqhttp-refs.tags.v3.0.0-alpha2\chatgpt\framework\platforms\onebotbot.py", line 194, in await handle_message(request, response) │ │ └ <framework.request.Response object at 0x00000296675C6AD0> │ └ <framework.request.Request object at 0x0000029665F78D90> └ <function handle_message at 0x00000296674762A0>

File "C:\Users\Administrator\Desktop\Windows-quickstart-go-cqhttp-refs.tags.v3.0.0-alpha2\chatgpt\framework\universal.py", line 264, in handle_message await action(request, response) │ │ └ <framework.request.Response object at 0x00000296675C6AD0> │ └ <framework.request.Request object at 0x0000029665F78D90> └ functools.partial(<bound method MiddlewareConcurrentLock.handle_request of <framework.middlewares.concurrentlock.MiddlewareCo...

File "C:\Users\Administrator\Desktop\Windows-quickstart-go-cqhttp-refs.tags.v3.0.0-alpha2\chatgpt\framework\middlewares\concurrentlock.py", line 44, in handle_request await _next(request, response) │ │ └ <framework.request.Response object at 0x00000296675C6AD0> │ └ <framework.request.Request object at 0x0000029665F78D90> └ functools.partial(<bound method Middleware.handle_request of <framework.middlewares.baiducloud.MiddlewareBaiduCloud object at...

File "C:\Users\Administrator\Desktop\Windows-quickstart-go-cqhttp-refs.tags.v3.0.0-alpha2\chatgpt\framework\middlewares\middleware.py", line 8, in handle_request return await _next(request, response) │ │ └ <framework.request.Response object at 0x00000296675C6AD0> │ └ <framework.request.Request object at 0x0000029665F78D90> └ functools.partial(<bound method MiddlewareRatelimit.handle_request of <framework.middlewares.ratelimit.MiddlewareRatelimit ob...

File "C:\Users\Administrator\Desktop\Windows-quickstart-go-cqhttp-refs.tags.v3.0.0-alpha2\chatgpt\framework\middlewares\ratelimit.py", line 24, in handle_request await _next(request, response) │ │ └ <framework.request.Response object at 0x00000296675C6AD0> │ └ <framework.request.Request object at 0x0000029665F78D90> └ functools.partial(<bound method MiddlewareTimeout.handle_request of <framework.middlewares.timeout.MiddlewareTimeout object a...

File "C:\Users\Administrator\Desktop\Windows-quickstart-go-cqhttp-refs.tags.v3.0.0-alpha2\chatgpt\framework\middlewares\timeout.py", line 28, in handle_request await asyncio.wait_for(coro_task, config.response.max_timeout) │ │ │ │ │ └ 600.0 │ │ │ │ └ Response(mode='mixed', buffer_delay=15.0, default_ai='chatgpt-api', error_format='出现故障!如果这个问题持续出现,请和我说“重置会话” 来开启一段新的会话,或者发送 “... │ │ │ └ Config(onebot=Onebot(manager_qq=1602196180), mirai=None, telegram=None, discord=None, http=HttpService(host='0.0.0.0', port=8... │ │ └ <Task finished name='Task-33' coro=<handle_message.._request_func() done, defined at C:\Users\Administrator\Desktop\W... │ └ <function wait_for at 0x000002965A56AFC0> └ <module 'asyncio' from 'C:\Users\Administrator\Desktop\Windows-quickstart-go-cqhttp-refs.tags.v3.0.0-alpha2\python3.11\...

File "asyncio\tasks.py", line 479, in wait_for for f in todo:

File "C:\Users\Administrator\Desktop\Windows-quickstart-go-cqhttp-refs.tags.v3.0.0-alpha2\chatgpt\framework\universal.py", line 255, in _request_func await context.input(prompt=request.message) │ │ │ └ MessageChain([Plain(text='你好')]) │ │ └ <framework.request.Request object at 0x0000029665F78D90> │ └ <function AsyncPromptExecutionContext.input at 0x00000296672B7D80> └ <framework.conversation.AsyncPromptExecutionContext object at 0x0000029667D00250>

File "C:\Users\Administrator\Desktop\Windows-quickstart-go-cqhttp-refs.tags.v3.0.0-alpha2\chatgpt\framework\conversation.py", line 71, in input async for item in self.conversation.llm_adapter.ask(self.variables["input"]["message"]): │ │ │ │ │ └ {'input': {'message': '你好'}, 'user': {'nickname': 'Enico'}, 'output': {}, 'tts_engine': {}} │ │ │ │ └ <framework.conversation.AsyncPromptExecutionContext object at 0x0000029667D00250> │ │ │ └ <function ChatGPTAPIAdapter.ask at 0x0000029665F619E0> │ │ └ <framework.llm.openai.api.ChatGPTAPIAdapter object at 0x00000296674D0A50> │ └ <framework.conversation.ConversationContext object at 0x00000296672AA610> └ <framework.conversation.AsyncPromptExecutionContext object at 0x0000029667D00250>

File "C:\Users\Administrator\Desktop\Windows-quickstart-go-cqhttp-refs.tags.v3.0.0-alpha2\chatgpt\framework\llm\openai\api.py", line 116, in ask raise LlmRequestFailedException("chatgpt-api") from e └ <class 'framework.exceptions.LlmRequestFailedException'>

framework.exceptions.LlmRequestFailedException: 无法请求 ()