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] Frequent JSONDecodeError with DeepSeek API #599

Closed
zyuanat opened this issue Feb 7, 2025 · 6 comments
Closed

[BUG] Frequent JSONDecodeError with DeepSeek API #599

zyuanat opened this issue Feb 7, 2025 · 6 comments

Comments

@zyuanat
Copy link

zyuanat commented Feb 7, 2025

"raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)"

This problem frequently occurs when I use the deepseek-API and has been going on for several days. Even the deepseek sample request (shown below) has this error frequently.

from openai import OpenAI

client = OpenAI(api_key="<DeepSeek API Key>", base_url="https://api.deepseek.com")

response = client.chat.completions.create(
    model="deepseek-chat",
    messages=[
        {"role": "system", "content": "You are a helpful assistant"},
        {"role": "user", "content": "Hello"},
    ],
    stream=False
)
@baocai27
Copy link

baocai27 commented Feb 8, 2025

我在调用api的时候也遇到了这个问题,应该是服务本身的问题,合理猜测服务器负载太高了

@mowentian
Copy link
Contributor

For API-related performance updates, please visit: https://status.deepseek.com/

@2261176860
Copy link

你好,问题解决了吗,我现在运行还是这个结果。示例代码有时能运行有时会报以上这个错误,自己写的代码则是从来没有成功过

@fabioquinzi
Copy link

fabioquinzi commented Feb 11, 2025

same here, it just happens randomly every now and then, I just added retry logic to go through, but it's quite unpredictable at the moment. the Status says everything is up and running correctly, while it isn't really.
Although it's useful to know this error specifically is due to some faults of the API itself and not of the code used to invoke the API

@zyuanat
Copy link
Author

zyuanat commented Feb 11, 2025

你好,问题解决了吗,我现在运行还是这个结果。示例代码有时能运行有时会报以上这个错误,自己写的代码则是从来没有成功过

没解决,我这边的情况和你说的简直一模一样

@zyuanat
Copy link
Author

zyuanat commented Feb 11, 2025

same here, it just happens randomly every now and then, I just added retry logic to go through, but it's quite unpredictable at the moment. the Status says everything is up and running correctly, while it isn't really. Although it's useful to know this error specifically is due to some faults of the API itself and not of the code used to invoke the API

Exactly, I was misled into thinking it was some json formatting issues with my own code and wasted 2 days debugging it

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

5 participants