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

Return not_found_error when send message #104

Open
thanhthanhha opened this issue Aug 31, 2024 · 2 comments
Open

Return not_found_error when send message #104

thanhthanhha opened this issue Aug 31, 2024 · 2 comments

Comments

@thanhthanhha
Copy link

response = claude_api.send_message(prompt, conversation_id)
Traceback (most recent call last):
File "", line 1, in
File "D:\Git\claude-api\backend\env\lib\site-packages\claude_api.py", line 135, in send_message
data = json.loads(json_str)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\json_init_.py", line 346, in loads
return _default_decoder.decode(s)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\json\decoder.py", line 340, in decode
raise JSONDecodeError("Extra data", s, end)
json.decoder.JSONDecodeError: Extra data: line 1 column 4 (char 3)

I print the full response and get this
JSON string: ":"error","error":{"type":"not_found_error","message":"Not Found"}}

JSON string: ['{"type":"error","error":{"type":"not_found_error","message":"Not Found"}}']

JSON string: ":"error","error":{"type":"not_found_error","message":"Not Found"}}

@thanhthanhha
Copy link
Author

I have resolved the issue myself the problem is with send_message on claude_api.py, claude has changed the payload and URL for sending message also the code is not using try except so its might be harder to debug

@billyrudi
Copy link

Hi, can you share the solution? thanks

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