lss233 / chatgpt-mirai-qq-bot

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

[BUG] json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) #1351

Open 736957964 opened 2 weeks ago

736957964 commented 2 weeks ago

提交 issue 前,请先确认:

表现
File "F:\chat\Windows-quickstart-go-cqhttp-refs.tags.v2.5.2\python3.11\Lib\site-packages\revChatGPT\V3.py", line 287, in ask_stream_async resp: dict = json.loads(line) │ │ └ 'ype html><meta name="viewport" content="width... │ └ <function loads at 0x0000022BBB434FE0> └ <module 'json' from 'F:\chat\Windows-quickstart-go-cqhttp-refs.tags.v2.5.2\python3.11\python311.zip\json\init.pyc'>

File "json__init__.py", line 346, in loads

File "json\decoder.py", line 337, in decode

File "json\decoder.py", line 355, in raw_decode

json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

运行环境:

复现步骤
描述你是如何触发这个 BUG 的 运行后进行对话 一直提示 [OneBot] 尝试发送消息:出现故障!如果这个问题持 续出现,请和我说“重置会话” 来开启一段新的会话,或者发送 “回滚对话” 来回溯到上一条对话,你上一条说的我就当作没看见。 原因:Expecting value: line 1 column 1 (char 0) 预期行为
返回chatgpt的回复

截图
相关日志、聊天记录的截图,没有可跳过

其他内容
此处填写其他内容,没有可跳过

736957964 commented 2 weeks ago

尝试打印过拿到的数据 给的是一个html的片段 最后处理报错了

xuaowen commented 5 days ago

我遇到的是完全一致的问题

xuaowen commented 5 days ago

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

File "C:\0000\chatgpt\framework\platforms\http_service_legacy.py", line 107, in process_request await handle_message( └ <function handle_message at 0x000001856E9D3D80>

File "C:\0000\chatgpt\framework\universal.py", line 264, in handle_message await action(request, response) │ │ └ <framework.request.Response object at 0x000001856E3D7BD0> │ └ <framework.platforms.http_service_legacy.BotRequest object at 0x000001856E37A910> └ functools.partial(<bound method MiddlewareConcurrentLock.handle_request of <framework.middlewares.concurrentlock.MiddlewareCo...

File "C:\0000\chatgpt\framework\middlewares\concurrentlock.py", line 44, in handle_request await _next(request, response) │ │ └ <framework.request.Response object at 0x000001856E3D7BD0> │ └ <framework.platforms.http_service_legacy.BotRequest object at 0x000001856E37A910> └ functools.partial(<bound method Middleware.handle_request of <framework.middlewares.baiducloud.MiddlewareBaiduCloud object at...

File "C:\0000\chatgpt\framework\middlewares\middleware.py", line 8, in handle_request return await _next(request, response) │ │ └ <framework.request.Response object at 0x000001856E3D7BD0> │ └ <framework.platforms.http_service_legacy.BotRequest object at 0x000001856E37A910> └ functools.partial(<bound method MiddlewareRatelimit.handle_request of <framework.middlewares.ratelimit.MiddlewareRatelimit ob...

File "C:\0000\chatgpt\framework\middlewares\ratelimit.py", line 24, in handle_request await _next(request, response) │ │ └ <framework.request.Response object at 0x000001856E3D7BD0> │ └ <framework.platforms.http_service_legacy.BotRequest object at 0x000001856E37A910> └ functools.partial(<bound method MiddlewareTimeout.handle_request of <framework.middlewares.timeout.MiddlewareTimeout object a...

File "C:\0000\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='yiyan', error_format='出现故障!如果这个问题持续出现,请和我说“重置会话” 来开启一段新的会话,或者发送 “回滚对话” ... │ │ │ └ Config(onebot=Onebot(manager_qq=0), mirai=None, telegram=None, discord=None, http=HttpService(host='0.0.0.0', port=8234, debu... │ │ └ <Task finished name='Task-24' coro=<handle_message.._request_func() done, defined at C:\0000\chatgpt\framework\univer... │ └ <function wait_for at 0x0000018542939DA0> └ <module 'asyncio' from 'C:\0000\python3.11\python311.zip\asyncio\init.pyc'>

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

File "C:\0000\chatgpt\framework\universal.py", line 255, in _request_func await context.input(prompt=request.message) │ │ │ └ MessageChain([Plain(text='你好')]) │ │ └ <framework.platforms.http_service_legacy.BotRequest object at 0x000001856E37A910> │ └ <function AsyncPromptExecutionContext.input at 0x000001856E8689A0> └ <framework.conversation.AsyncPromptExecutionContext object at 0x00000185484D95D0>

File "C:\0000\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': 'NewWorld'}, 'output': {}, 'tts_engine': {}} │ │ │ │ └ <framework.conversation.AsyncPromptExecutionContext object at 0x00000185484D95D0> │ │ │ └ <function YiyanAdapter.ask at 0x000001856E240A40> │ │ └ <framework.llm.baidu.yiyan.YiyanAdapter object at 0x000001856EB3B410> │ └ <framework.conversation.ConversationContext object at 0x000001856EB3BC90> └ <framework.conversation.AsyncPromptExecutionContext object at 0x00000185484D95D0>

File "C:\0000\chatgpt\framework\llm\baidu\yiyan.py", line 92, in ask self.client.headers['Acs-Token'] = await self.get_sign() │ │ │ │ └ <function YiyanAdapter.get_sign at 0x000001856E240B80> │ │ │ └ <framework.llm.baidu.yiyan.YiyanAdapter object at 0x000001856EB3B410> │ │ └ <property object at 0x0000018544FBAB60> │ └ <httpx.AsyncClient object at 0x000001856E244C10> └ <framework.llm.baidu.yiyan.YiyanAdapter object at 0x000001856EB3B410>

File "C:\0000\chatgpt\framework\llm\baidu\yiyan.py", line 189, in get_sign return req.json()['acs'] │ └ <function Response.json at 0x0000018544E4C040> └ <Response [502 Bad Gateway]>

File "C:\0000\python3.11\Lib\site-packages\httpx_models.py", line 756, in json return jsonlib.loads(self.text, **kwargs) │ │ │ │ └ {} │ │ │ └ <property object at 0x0000018544E376F0> │ │ └ <Response [502 Bad Gateway]> │ └ <function loads at 0x000001854317D620> └ <module 'json' from 'C:\0000\python3.11\python311.zip\json\init.pyc'>

File "json__init__.py", line 346, in loads

File "json\decoder.py", line 337, in decode

File "json\decoder.py", line 355, in raw_decode

json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)`