Image

class characterai.types.other.Image

Image from server

This class has a download() function that can be used to download a picture. If you are using the async version of the library, this function will be async

Parameters:
  • url (str) – Incomplete URL

  • type (str) – Image type

async download(self, path: str = None, width: int = 400, type: str = 'user')

Download any picture

EXAMPLE:

await data.avatar.download('FILE.PNG')
Parameters:
  • path (str, optional) – The path to the file or the file name. If no path is specified, a file will be created with a name from the server

  • width (int, optional) – File resolution. Default is 400

Returns:

Downloaded file