aymara_ai.lib.uploads#

Functions#

upload_file([client, http_client, file_name, ...])

Helper to upload file content (from Path or bytes) and return (FileReference).

upload_file_async([client, http_client, file_name, ...])

Async helper to upload file content (from Path or bytes) and return (FileReference).

Module Contents#

aymara_ai.lib.uploads.upload_file(client=None, http_client=None, file_name=None, file_content=None, content_type=None)#

Helper to upload file content (from Path or bytes) and return (FileReference). Both client and http_client are optional and will be constructed if not provided. file_name is optional and will be defaulted based on content_type or to ‘file.png’. content_type is optional and will be guessed from file_name if not provided.

Parameters:
  • client (Optional[aymara_ai.AymaraAI])

  • http_client (Optional[httpx.Client])

  • file_name (Optional[str])

  • file_content (Union[pathlib.Path, bytes, None])

  • content_type (Optional[str])

Return type:

aymara_ai.types.shared_params.FileReference

async aymara_ai.lib.uploads.upload_file_async(client=None, http_client=None, file_name=None, file_content=None, content_type=None)#

Async helper to upload file content (from Path or bytes) and return (FileReference). Both client and http_client are optional and will be constructed if not provided. file_name is optional and will be defaulted based on content_type or to ‘file.png’. content_type is optional and will be guessed from file_name if not provided.

Parameters:
  • client (Optional[aymara_ai.AsyncAymaraAI])

  • http_client (Optional[httpx.AsyncClient])

  • file_name (Optional[str])

  • file_content (Union[pathlib.Path, bytes, None])

  • content_type (Optional[str])

Return type:

aymara_ai.types.shared_params.FileReference