kramcat / CharacterAI

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

sync examples dont even work #105

Closed fw-real closed 4 months ago

fw-real commented 5 months ago

i am following the examples word for word and none of the sync chat files even work, errors are below

with chat2 it raises this:

CHAR ID: 6DjCDvAaH0vuCQmQeeaqASkpiURG6vNzhPO4I67LCyI
Traceback (most recent call last):
  File "c:\Users\Chiranjeevi\Documents\character-ai proj\client.py", line 9, in <module>
    with client.connect() as chat:
         ^^^^^^^^^^^^^^^^
  File "C:\Users\Chiranjeevi\AppData\Local\Programs\Python\Python312\Lib\site-packages\characterai\pycai\methods\chat2.py", line 459, in __call__
    return WSConnect(token=token, init=init)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: WSConnect.__init__() got an unexpected keyword argument 'init'

chat1 raises this:

CHAR: 6DjCDvAaH0vuCQmQeeaqASkpiURG6vNzhPO4I67LCyI
Traceback (most recent call last):
  File "c:\Users\Chiranjeevi\Documents\character-ai proj\client.py", line 9, in <module>
    new = client.chat1.new_chat(char)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Chiranjeevi\AppData\Local\Programs\Python\Python312\Lib\site-packages\characterai\pycai\methods\utils.py", line 127, in wrapper
    result = func(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Chiranjeevi\AppData\Local\Programs\Python\Python312\Lib\site-packages\characterai\pycai\methods\chat1.py", line 108, in new_chat
    return chat1.NewChat.model_validate(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Chiranjeevi\AppData\Local\Programs\Python\Python312\Lib\site-packages\pydantic\main.py", line 509, in model_validate
    return cls.__pydantic_validator__.validate_python(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pydantic_core._pydantic_core.ValidationError: 2 validation errors for NewChat
participants.0.user.account.mobile_onboarding_complete
  Input should be a valid integer [type=int_type, input_value=None, input_type=NoneType]
    For further information visit https://errors.pydantic.dev/2.6/v/int_type
speech
  Input should be a valid string [type=string_type, input_value=None, input_type=NoneType]
    For further information visit https://errors.pydantic.dev/2.6/v/string_type
fw-real commented 4 months ago

closing issue, fixed by using older versions