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

Failed to parse response: error decoding response body #3

Open
jansenmtan opened this issue Jan 28, 2025 · 0 comments
Open

Failed to parse response: error decoding response body #3

jansenmtan opened this issue Jan 28, 2025 · 0 comments

Comments

@jansenmtan
Copy link

Installed deepclaude to my server machine.
Tried to run the README's API Usage Basic Example script:

import requests
import os

# Get API keys from environment variables
deepseek_api_key = os.getenv('DEEPSEEK_API_KEY')
anthropic_api_key = os.getenv('ANTHROPIC_API_KEY')

# Check if the keys exist
if not deepseek_api_key or not anthropic_api_key:
    raise ValueError("Missing required API keys in environment variables")

response = requests.post(
    "http://127.0.0.1:1337/",
    headers={
        "X-DeepSeek-API-Token": deepseek_api_key,
        "X-Anthropic-API-Token": anthropic_api_key
    },
    json={
        "messages": [
            {"role": "user", "content": "How many 'r's in the word 'strawberry'?"}
        ]
    }
)

print(response.json())

Server reports a 400 after 5 min:

2025-01-27T23:46:07.945397Z DEBUG request{method=POST uri=/ version=HTTP/1.1}: tower_http::trace::on_request: started processing request
2025-01-27T23:51:08.044308Z DEBUG request{method=POST uri=/ version=HTTP/1.1}: tower_http::trace::on_response: finished processing request latency=301924 ms status=400

Response reports a DeepSeek API error:

>python3 deepclaude-testing.py
{'error': {'message': 'DeepSeek API Error: Failed to parse response: error decoding response body', 'type': 'deepseek_parse_error'}}

This issue could be related to the issue with https://deepclaude.com/chat where the first user prompt seemingly does nothing, but subsequent prompts respond almost instantly. In that case, the prompts probably skip DeepSeek and go straight to Anthropic (this makes sense since I see records of usage in the Anthropic console but not in the DeepSeek console at the times of prompting).

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

1 participant