Xtr4F / PyCharacterAI

An unofficial Python api wrapper for character.ai
https://character.ai/
MIT License
40 stars 11 forks source link

generate speech error #9

Closed GDjkhp closed 2 months ago

GDjkhp commented 2 months ago

My production server is connected to Germany and I get this error, but it works perfectly on my machine, why is that?

image

chat, greeting_message = await client.chat.create_chat(character_id)
print(f"{greeting_message.author_name}: {greeting_message.get_primary_candidate().text}")

while True:
    message = input(f"[{me.name}]: ")
    chat = await client.chat.fetch_chat(chat.chat_id)
    answer = await client.chat.send_message(character_id, chat.chat_id, message)
    print(f"[{answer.author_name}]: {answer.get_primary_candidate().text}")
    speech = await client.utils.generate_speech(chat.chat_id, answer.turn_id, answer.get_primary_candidate().candidate_id, voices[0].voice_id, return_url=True) 
GDjkhp commented 2 months ago

it's borken in the latest version of curl_cffi, downgrading to 0.6.2 fixes this

Xtr4F commented 2 months ago

Oh, I see. The latest version really broke some post requests. Thanks for the feedback, I downgraded the version to 0.7.1 in setup.py and now it should work without any problems.