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 2 column 9 (char 9) #7

Open
vitalickck opened this issue Nov 21, 2023 · 3 comments

Comments

@vitalickck
Copy link

vitalickck commented Nov 21, 2023

Hello!
Here is my code:

from claude import Claude

cookie = "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"
claude = Claude(cookie)

prompt = "Hello, Claude!"
response=claude.get_answer(prompt)
print(response)

Here is the error

Traceback (most recent call last):
  File "C:\Users\spz\Desktop\333.py", line 4, in <module>
    claude = Claude(cookie)
  File "C:\Users\spz\AppData\Local\Programs\Python\Python310\lib\site-packages\claude.py", line 12, in __init__
    self.organisation_uuid=self.get_organisation_uuid()
  File "C:\Users\spz\AppData\Local\Programs\Python\Python310\lib\site-packages\claude.py", line 40, in get_organisation_uuid
    data = response.json()
  File "C:\Users\spz\AppData\Local\Programs\Python\Python310\lib\site-packages\curl_cffi\requests\models.py", line 64, in json
    return loads(self.content, **kw)
  File "C:\Users\spz\AppData\Local\Programs\Python\Python310\lib\json\__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "C:\Users\spz\AppData\Local\Programs\Python\Python310\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Users\spz\AppData\Local\Programs\Python\Python310\lib\json\decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 2 column 9 (char 9)

What am I doing wrong? How to fix this error?
I'm a beginner, so I'd be glad if you could tell me how to run it to make it work.

@D4RKGEEK
Copy link

I investigated and monitored the "append_message" POST request in Claude. It appears that they've updated their model, which we typically include in the header. This modification seems to be causing an issue. I've just learned that they have recently removed cookie-related elements from the header, and I believe this alteration is the root cause of the problem.

@vitalickck
Copy link
Author

Is there any way to solve this problem?

@Nipun1212
Copy link
Owner

hi I got exam going on I'll fix it after that, claude updated their api a while ago and hence it's causing the issues

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