client = PyCAI("XXXXXXXXXXXXXXXXXXXXXXX")
client.start()
char = 'XXXXXXXXXXXXXXXXXXXXX'
chat = client.chat.get_chat(char)
participants = chat['participants']
if not participants[0]['is_human']:
tgt = participants[0]['user']['username']
else:
tgt = participants[1]['user']['username']
while True:
message = input('You:')
data = client.chat.send_message(
chat['external_id'], tgt, message
)
name = data['src_char']['participant']['name']
text = data['replies'][0]['text']
print(f"{name}: {text}")```
```Traceback (most recent call last):
File "<module1>", line 37, in <module>
File "C:\Users\luvut\AppData\Local\Programs\Python\Python310\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "C:\Users\luvut\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 646, in run_until_complete
return future.result()
File "<module1>", line 13, in main
File "C:\Users\luvut\AppData\Local\Programs\Python\Python310\lib\site-packages\characterai\pyasynccai.py", line 567, in get_chat
return await _PostResponse(
File "C:\Users\luvut\AppData\Local\Programs\Python\Python310\lib\site-packages\characterai\pyasynccai.py", line 79, in _PostResponse
raise errors.ServerError(response.status_text)
characterai.errors.ServerError: Not Found```