Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 of 3 tasks
736957964 opened this issue Jun 14, 2024 · 3 comments
Open
1 of 3 tasks
Labels
bug Something isn't working

Comments

@736957964
Copy link

提交 issue 前,请先确认:

  • 我已看过 FAQ,此问题不在列表中
  • 我已看过其他 issue,他们不能解决我的问题
  • 我认为这不是 Mirai 或者 OpenAI 的 BUG

表现
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)

运行环境:

  • 操作系统:w11
  • Docker: ?
  • 项目版本:ags.v2.5.2

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

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

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

@736957964 736957964 added the bug Something isn't working label Jun 14, 2024
@736957964
Copy link
Author

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

@xuaowen
Copy link

xuaowen commented Jun 23, 2024

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

@xuaowen
Copy link

xuaowen commented Jun 23, 2024

` 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)`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants