abacusai.api_class.blob_input

Classes

Blob

An object for storing and passing file data.

BlobInput

An object for storing and passing file data.

Module Contents

class abacusai.api_class.blob_input.Blob(contents, mime_type=None, filename=None, size=None)

Bases: abacusai.api_class.abstract.ApiClass

An object for storing and passing file data. In AI Agents, if a function accepts file upload as an argument, the uploaded file is passed as a Blob object. If a function returns a Blob object, it will be rendered as a file download.

Parameters:
  • contents (bytes) – The binary contents of the blob.

  • mime_type (str) – The mime type of the blob.

  • filename (str) – The original filename of the blob.

  • size (int) – The size of the blob in bytes.

filename: str
contents: bytes
mime_type: str
size: int
classmethod from_local_file(file_path)
Parameters:

file_path (str)

Return type:

Blob

classmethod from_contents(contents, filename=None, mime_type=None)
Parameters:
Return type:

Blob

class abacusai.api_class.blob_input.BlobInput(filename=None, contents=None, mime_type=None, size=None)

Bases: Blob

An object for storing and passing file data. In AI Agents, if a function accepts file upload as an argument, the uploaded file is passed as a BlobInput object.

Parameters:
  • filename (str) – The original filename of the blob.

  • contents (bytes) – The binary contents of the blob.

  • mime_type (str) – The mime type of the blob.

  • size (int) – The size of the blob in bytes.