abacusai.api_class.document_retriever — AbacusAI documentation

# abacusai.api_class.document_retriever

## Attributes

`DocumentRetrieverConfig` |

## Classes

`ApiClass` | Helper class that provides a standard way to create an ABC using
`VectorStoreTextEncoder` | Generic enumeration.
`VectorStoreConfig` | Config for indexing options of a document retriever. Default values of optional arguments are heuristically selected by the Abacus.AI platform based on the underlying data.

## Module Contents

class abacusai.api_class.document_retriever.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.document_retriever.VectorStoreTextEncoder

  Bases: `ApiEnum`

  Generic enumeration.

  Derive from this class to define new enumerations.

  E5 = 'E5'
  OPENAI = 'OPENAI'
  SENTENCE_BERT = 'SENTENCE_BERT'
  E5_SMALL = 'E5_SMALL'

class abacusai.api_class.document_retriever.VectorStoreConfig

  Bases: `abacusai.api_class.abstract.ApiClass`

  Config for indexing options of a document retriever. Default values of optional arguments are heuristically selected by the Abacus.AI platform based on the underlying data.

  Parameters:

    - chunk_size (int) – The size of text chunks in the vector store.

    - chunk_overlap_fraction (float) – The fraction of overlap between chunks.

    - text_encoder (VectorStoreTextEncoder) – Encoder used to index texts from the documents.

    - chunk_size_factors (list) – Chunking data with multiple sizes. The specified list of factors are used to calculate more sizes, in addition to chunk_size.

    - score_multiplier_column (str) – If provided, will use the values in this metadata column to modify the relevance score of returned chunks for all queries.

    - prune_vectors (bool) – Transform vectors using SVD so that the average component of vectors in the corpus are removed.

  chunk_size: int
  chunk_overlap_fraction: float
  text_encoder: abacusai.api_class.enums.VectorStoreTextEncoder
  chunk_size_factors: list
  score_multiplier_column: str
  prune_vectors: bool

abacusai.api_class.document_retriever.DocumentRetrieverConfig