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] API Error Report: Frequent JSONDecodeError with deepseek-reasoner Model #606

Closed
pythonbabaa opened this issue Feb 7, 2025 · 1 comment

Comments

@pythonbabaa
Copy link

pythonbabaa commented Feb 7, 2025

Issue Description

I am running a series of AI agents using langgraph. Each agent sends API call to deepseek-reasoner model. Sometimes, it gets stuck at first agent, sometimes second or third. I have also implemented five retries per agent but all five retries produce same error.

When making API calls to the deepseek-reasoner model, I am consistently receiving a JSONDecodeError: Expecting value error. This occurs even when the API returns an HTTP 200 status code, but the response body appears to be empty or malformed.

Here is a snippet of the code I am using:

from langchain_openai import ChatOpenAI

llm_deepseek = ChatOpenAI(
model='deepseek-reasoner',
base_url="https://api.deepseek.com/",
api_key="<my_api_key>",
temperature=0,
model_kwargs={"response_format": {"type": "text"}}
)
response = llm_deepseek.invoke("formatted_prompt")

Error Details

The full traceback of the error is as follows:

JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Image

Image

Steps Taken

To troubleshoot, I have:

Verified that my API key is valid and has sufficient quota.

Checked the API status page ([status.deepseek.com](http://status.deepseek.com/)) for any ongoing issues.

Implemented retry logic and fallback mechanisms, but the issue persists.
@mowentian
Copy link
Contributor

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

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

2 participants