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

Exception has occurred: JSONDecodeError #56

Closed
realpack opened this issue Oct 6, 2023 · 3 comments
Closed

Exception has occurred: JSONDecodeError #56

realpack opened this issue Oct 6, 2023 · 3 comments

Comments

@realpack
Copy link

realpack commented Oct 6, 2023

image

from characterai import PyCAI

client = PyCAI('-')
chat = client.chat.get_chat('gs_RN6o6wkLTOYRB18UDC1bDb3YFfzvPhsaDHfIFfCs')
Exception has occurred: JSONDecodeError
Expecting value: line 1 column 1 (char 0)
StopIteration: 0

During handling of the above exception, another exception occurred:

  File "C:\Users\Aurus\CharAI\main.py", line 4, in <module>
    chat = client.chat.get_chat('gs_RN6o6wkLTOYRB18UdC1bDb3YFfzvPhsaDHfIFfCs')
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
@kramcat
Copy link
Owner

kramcat commented Oct 6, 2023

The chat ID is not like the usual IDs, are you sure you entered it correctly?

@realpack
Copy link
Author

realpack commented Oct 6, 2023

The chat ID is not like the usual IDs, are you sure you entered it correctly?

Yes, I just copied from the url after the char=

its chat2

I changed one letter slightly to make charid more anonymous)

@kramcat
Copy link
Owner

kramcat commented Oct 6, 2023

if this is chat2, then you need to use the right class, go to the documentation. For chat2 you must use async version

@realpack realpack closed this as completed Oct 7, 2023
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