abacusai.api_class.blob_input — AbacusAI documentation

# abacusai.api_class.blob_input

## Classes

`ApiClass` | Helper class that provides a standard way to create an ABC using
`BlobInput` | Binary large object input data.

## Module Contents

class abacusai.api_class.blob_input.ApiClass

  Bases: `abc.ABC`

  Helper class that provides a standard way to create an ABC using inheritance.

  _upper_snake_case_keys: bool
  _support_kwargs: bool
  __post_init__()
  classmethod _get_builder()
  __str__()

    Return str(self).

  _repr_html_()
  __getitem__(item)
    Parameters:

      item (str)

  __setitem__(item, value)
    Parameters:

      - item (str)

      - value (Any)

  _unset_item(item)
    Parameters:

      item (str)

  get(item, default=None)
    Parameters:

      - item (str)

      - default (Any)

  pop(item, default=NotImplemented)
    Parameters:

      - item (str)

      - default (Any)

  to_dict()

    Standardizes converting an ApiClass to dictionary. Keys of response dictionary are converted to camel case. This also validates the fields ( type, value, etc ) received in the dictionary.

  classmethod from_dict(input_dict)
    Parameters:

      input_dict (dict)

class abacusai.api_class.blob_input.BlobInput

  Bases: `abacusai.api_class.abstract.ApiClass`

  Binary large object input data.

  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.

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

      file_path (str)

    Return type:

      BlobInput

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

      - contents (bytes)

      - filename (str)

      - mime_type (str)

    Return type:

      BlobInput