kramcat / CharacterAI

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

Getting chat fails if account has chats with multiple characters #51

Closed K0shachiyamyatA closed 9 months ago

K0shachiyamyatA commented 10 months ago

https://beta.character.ai/chat2?char=gIor6bOT0GtU7tTNvAvc1NxAW5O7AyqdBx-cApcH9wk

if account has multiple characters chats(?) i think the link will have chat2 instead of chat. And this will not allow API to get character`s history.

        async def get_chat(
            self, char: str = None, *,
            wait: bool = False, token: str = None,
            **kwargs
        ):
            return await _PostResponse(
                post_link='chat/history/continue/',
                data={
                    'character_external_id': char,
                    **kwargs
                },
                wait=wait, token=token
            )
K0shachiyamyatA commented 10 months ago

UPD: manually removing 2 from the link and starting the chat like that seems to fix the issue. But i would like the library to handle this case for me.

kramcat commented 10 months ago

chat2 is a different version of chat, which the library does not support yet

Psyk0loge commented 9 months ago

chat2 is a different version of chat, which the library does not support yet

is there a way to change the chat used in characterai or is the library not working at the moment?

K0shachiyamyatA commented 9 months ago

chat2 is a different version of chat, which the library does not support yet

is there a way to change the chat used in characterai or is the library not working at the moment?

Check my previous comment.

Psyk0loge commented 9 months ago

okay, I see that removing the number manually will work, but automatically it does not work yet right?

kramcat commented 9 months ago

fixed on v0.8.0