No project description provided
Project description
This is the unofficial API
Installation
pip install kirbacterai
Code example
import asyncio
from kirbacterai import Client
async def main():
client = Client()
await client.auth_as_guest()
# You can use client.auth_with_token(token) instead
link = "https://c.ai/c/0FGHpcylr6O0l46xHrTMzRGnqAU6beVz0k3i294wbUQ"
character = await client.get_character_from_link(link)
chat = await character.chat_create()
character_reply = await chat.send_message("Hello!")
print(character_reply)
asyncio.get_event_loop().run_until_complete(main())
Using an Access Token
Some parts of the API, like managing a conversation requires for you to be logged in using an accessToken
.
To get it, you can open your browser, go to the character.ai website in localStorage
.
— To do so:
❒ Open the Character AI website in your browser
❒ Open the developer tools F12
and go to the Application
tab.
❒ Go to the Storage
section and click on Local Storage
.
❒ Look for the @@auth0spajs@@::dyD3gE281MqgISG7FuIXYhL2WEknqZzv::https://auth0.character.ai/::openid profile email offline_access
key.
❒ Open the body and copy the access token.
![image](https://pypi-camo.freetls.fastly.net/c42d848fc7f53f5ad63d26fd31808f2a6be29189/68747470733a2f2f6769746875622e636f6d2f4b697262795265646975732f43686172616374657241492f6173736574732f3134323035303239342f38396138303465312d316435312d346361612d613031652d363832346330383931326566)
Node.js version
Most of the stuff was taken from another JavaScript repository:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
kirbacterai-0.0.3.tar.gz
(7.6 kB
view hashes)
Built Distribution
Close
Hashes for kirbacterai-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52cf8028ecdb5ddb94ce4d4242818d7677ce2fad95649ff1a77ebb6c6de95cde |
|
MD5 | 80270700fea3f2d257d70c12340b5783 |
|
BLAKE2b-256 | ef086b7cb346a963ed07493d1ddf4f5f40752e7a83bcbd11abaa04d1ec0c52c4 |