Open jynn12 opened 5 months ago
This error only occurs with chat2. All you have to do is go to the beta.character.ai website and open the chat with a character you want to chat with. Then you go to the link and change chat2 to chat like this:
https://beta.character.ai/chat2?char=xxx https://beta.character.ai/chat?char=xxx
That's it. You don't have to change anything in the code.
@unhingedsoul Thanks, it works now:)
It looks like there are some misunderstood things here, so I think I should note something. The error occurred because the server's response to the API request wasn't JSON; probably it is returning:
there is no history between user and character
in this case.
@Karvp Nope, It has a chat history...like a really REALLY long chat history...
Its been around 2 weeks since I've been chatting with this bot using this code
Also, it seems that CharacterAI is using CloudFlare now? Could that be interfering with the code?
Also, it seems that CharacterAI is using CloudFlare now? Could that be interfering with the code?
@jynn12 As long as you don't spam requests, imo :v
@Karvp Nah, the same code works on other characters, but not on the one I am using. Its chat and not chat2 btw
@Karvp Nah, the same code works on other characters, but not on the one I am using. Its chat and not chat2 btw
Seems tricky. Try inspecting the code 😄
Btw, srr for the unclear reply
@Karvp Well, when I wrote this code, only me and God knows how it works. Now only God knows...
I'll try stripping the other functions from the code and will update here...
@Karvp Nah, the same code works on other characters, but not on the one I am using. Its chat and not chat2 btw
im also using chat instead of chat2, but in my case, its works on one history of a character but not on other. oh, also it gives me this on send_message
instead of get_chat
. i tried debugging it, and it seems that characterai website returns 500 status code(internal server error) and api on line 67 tries parsing it to json which raises the error
oh nvm, i did not notice that second history was using chat2, but for anyone wondering this fix from above should do:
This error only occurs with chat2. All you have to do is go to the beta.character.ai website and open the chat with a character you want to chat with. Then you go to the link and change chat2 to chat like this:
https://beta.character.ai/chat2?char=xxx https://beta.character.ai/chat?char=xxx
That's it. You don't have to change anything in the code.
(i get other error tho, but i think thats a separate issue)
edit: the other error was from pprint
This error only occurs with chat2. All you have to do is go to the beta.character.ai website and open the chat with a character you want to chat with. Then you go to the link and change chat2 to chat like this:
https://beta.character.ai/chat2?char=xxx https://beta.character.ai/chat?char=xxx
That's it. You don't have to change anything in the code.
Hey, So I've tried to use the input the following link: https://beta.character.ai/chat?char=4WOVrCApi4JYwfYwU2e5eDeFalLOkGBw6IfUZPX1XVQ&source=recent-chats
But i received the following error
File /opt/conda/lib/python3.10/site-packages/characterai/characterai.py:74, in PyCAI.request(url, session, token, method, data, split, neo)
72 raise errors.ServerError(data['comment'])
73 elif str(data).startswith("{'detail': 'Auth"):
---> 74 raise errors.AuthError('Invalid token')
75 elif str(data).startswith("{'status': 'Error"):
76 raise errors.ServerError(data['status'])
AuthError: Invalid token```
@AaronJohnson02 In your case, just check ur token
check with the new version
When I enter the character URL, I get this error