Xtr4F / PyCharacterAI

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

Sync version #13

Open GearStarter opened 1 month ago

GearStarter commented 1 month ago

Hi. Will there be a sync api version in the future? I understand that async is a priority, sometimes it is more convenient to work with sync.

For example, communication between two characters. I can't call two asyncio.run(main()) at the same time.

asyncio.run(char_first())
asyncio.run(char_sec())
Xtr4F commented 3 weeks ago

I don't think that's planned in the near future. The current library used for working with websockets (aiohttp) is asynchronous, as the name implies, and I can't use other libraries as they don't support proxies, which was the main reason for switching to aiohttp and dropping the sychronous version. If anything, I'm open to any suggestions.

What about communication with two characters, you don't need to call asyncio.run() multiple times, you can use asynchronous tasks asyncio.create_task() to run multiple coroutines concurrently.

I hope it helped.