kramcat / CharacterAI

Unofficial Python API for character.ai
https://docs.kram.cat
MIT License
378 stars 51 forks source link

Is this code still working? I only get timeouts... #19

Closed tschesnok closed 9 months ago

tschesnok commented 1 year ago

I'm able to retrieve my account information via client.user.info() so the token is correct! (this is good :) But then any send_message call ends up in a timeout. I'm a "+" user so there should be no access issues. Works fine in a browser at the same time. xxx = obvious obfuscation. I can't get telegram to work..

Here is my code:

from characterai import pyCAI client = pyCAI('9xxxxxxxxxxxxxxxxx4') print (client.user.info() )

while True: message = input('You: ') data = client.chat.send_message('ixxxxxxxxxxxxxxxxM', message, wait=True) print(f"{data['src_char']['participant']['name']}: {data['replies'][0]['text']}")

tschesnok commented 1 year ago

It seems one needs to replace beta with plus in all the URLs to get it to work with a plus membership.

haoyu6427 commented 1 year ago

data is {"abort": true, "error": "500 Internal Server Error" }. Can we solve this problem by subscribing to the membership?

tschesnok commented 1 year ago

I'm not sure. I just know I have it working today. So the code still works. In my case I'm paying for plus and changed all URLs in the code to "plus". You should always run a browser at the same time and see what the browser version says. There could always be performance related timeouts on their part, right?

kramcat commented 1 year ago

Try again on v0.6.0

Fadlay commented 12 months ago

@kramcat where i can get pyCAI('TOKEN')?

KubaPro010 commented 12 months ago

@Fadlay Read the readme first, go into the docs and check (https://pycai.gitbook.io/welcome/api/values)

Fadlay commented 12 months ago

@KubaPro010 oke thankss bro

tschesnok commented 11 months ago

"Try again on v0.6.0"

Well.. that does not fix the API for plus accounts. Code is the old code with "Beta" in the title. Perhaps I'm missing something... but I would think that many people playing with the API are probably "plus" account holders.

kramcat commented 10 months ago

Added plus in v0.7.0

kramcat commented 9 months ago

fixed on v0.8.0