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

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

Open
TravelDailyTeam opened this issue Oct 9, 2023 · 2 comments

Comments

@TravelDailyTeam
Copy link

发现Chat里面background_tasks.add_task(client.send_message, prompt, conversation_id) 这里会报错,就是说send_message函数出现了报错

ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "D:\miniconda3\envs\py310\lib\site-packages\uvicorn\protocols\http\httptools_impl.py", line 435, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
  File "D:\miniconda3\envs\py310\lib\site-packages\uvicorn\middleware\proxy_headers.py", line 78, in __call__
    return await self.app(scope, receive, send)
  File "D:\miniconda3\envs\py310\lib\site-packages\fastapi\applications.py", line 290, in __call__
    await super().__call__(scope, receive, send)
  File "D:\miniconda3\envs\py310\lib\site-packages\starlette\applications.py", line 122, in __call__
    await self.middleware_stack(scope, receive, send)
  File "D:\miniconda3\envs\py310\lib\site-packages\starlette\middleware\errors.py", line 184, in __call__
    raise exc
  File "D:\miniconda3\envs\py310\lib\site-packages\starlette\middleware\errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "D:\miniconda3\envs\py310\lib\site-packages\starlette\middleware\cors.py", line 83, in __call__
    await self.app(scope, receive, send)
  File "D:\miniconda3\envs\py310\lib\site-packages\starlette\middleware\exceptions.py", line 79, in __call__
    raise exc
  File "D:\miniconda3\envs\py310\lib\site-packages\starlette\middleware\exceptions.py", line 68, in __call__
    await self.app(scope, receive, sender)
  File "D:\miniconda3\envs\py310\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 20, in __call__
    raise e
  File "D:\miniconda3\envs\py310\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 17, in __call__
    await self.app(scope, receive, send)
  File "D:\miniconda3\envs\py310\lib\site-packages\starlette\routing.py", line 718, in __call__
    await route.handle(scope, receive, send)
  File "D:\miniconda3\envs\py310\lib\site-packages\starlette\routing.py", line 276, in handle
    await self.app(scope, receive, send)
  File "D:\miniconda3\envs\py310\lib\site-packages\starlette\routing.py", line 66, in app
    response = await func(request)
  File "D:\miniconda3\envs\py310\lib\site-packages\fastapi\routing.py", line 241, in app
    raw_response = await run_endpoint_function(
  File "D:\miniconda3\envs\py310\lib\site-packages\fastapi\routing.py", line 167, in run_endpoint_function
    return await dependant.call(**values)
  File "c:\Users\TD\Desktop\python\LC server\APP\fastapi\main.py", line 150, in create_chat
    return client.send_message(prompt, conversation_id)
  File "c:\Users\TD\Desktop\python\LC server\APP\fastapi\claude_api.py", line 179, in send_message
    data = json.loads(json_str)
  File "D:\miniconda3\envs\py310\lib\json\__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "D:\miniconda3\envs\py310\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "D:\miniconda3\envs\py310\lib\json\decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

请问有人遇到过吗

@zigui123340
Copy link

@Mou-Mou-L
Copy link

@zigui123340 @TravelDailyTeam 两位大佬解决了没 我也遇到这个情况了 查询记录没问题 send和chat时候出现这个问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants