CharacterAI icon indicating copy to clipboard operation
CharacterAI copied to clipboard

PyCAI.chat.send_message() missing 1 required positional argument: 'history_id'

Open Pavex53 opened this issue 1 year ago • 6 comments

I have multiple problems. I can only find Character ID and my char_token. But no history ID. There is none. If I try other scripts, I get same error like others with Json.

Pavex53 avatar Mar 28 '24 14:03 Pavex53

where did you find your char_token??

vAdrian2424 avatar Mar 28 '24 20:03 vAdrian2424

where did you find your char_token??

You need to open the chat with your character in beta version. Write beta.character.ai etc. with normal version you can't see it

Pavex53 avatar Mar 29 '24 00:03 Pavex53

did anyone find the history_id?

AritraMalik804 avatar Apr 01 '24 09:04 AritraMalik804

Didn't find it yet

Pavex53 avatar Apr 02 '24 02:04 Pavex53

I know it's quite late but still hope this helpful to someone.

The history id is the value returned when you call get_chat() below a key named 'external_id'. You can see it quite clear in this example:

# ...
    data = client.chat.send_message(
        chat['external_id'], tgt, message
    )
# ...

For the json error, you might want to try #93

Karvp avatar Apr 08 '24 10:04 Karvp

He fixed it his code works now

Pavex53 avatar Apr 13 '24 01:04 Pavex53