BagelReader#

class llama_index.readers.BagelReader(collection_name: str)#

Bases: BaseReader

Reader for Bagel files.

Methods Summary

create_documents(results)

Create documents from the results.

load_data([query_vector, query_texts, ...])

Get the top n_results documents for provided query_embeddings or query_texts.

Methods Documentation

create_documents(results: Any) Any#

Create documents from the results.

Parameters

results – Results from the query.

Returns

List of documents.

load_data(query_vector: Optional[Union[Sequence[float], Sequence[int], List[Union[Sequence[float], Sequence[int]]]]] = None, query_texts: Optional[Union[str, List[str]]] = None, limit: int = 10, where: Optional[Dict[Union[str, Literal['$and', '$or']], Union[str, int, float, Dict[Union[Literal['$gt', '$gte', '$lt', '$lte', '$ne', '$eq'], Literal['$and', '$or']], Union[str, int, float]], List[Dict[Union[str, Literal['$and', '$or']], Union[str, int, float, Dict[Union[Literal['$gt', '$gte', '$lt', '$lte', '$ne', '$eq'], Literal['$and', '$or']], Union[str, int, float]], List[Where]]]]]]] = None, where_document: Optional[Dict[Union[Literal['$contains'], Literal['$and', '$or']], Union[str, List[Dict[Union[Literal['$contains'], Literal['$and', '$or']], Union[str, List[WhereDocument]]]]]]] = None, include: List[Literal['documents', 'embeddings', 'metadatas', 'distances']] = ['metadatas', 'documents', 'embeddings', 'distances']) Any#

Get the top n_results documents for provided query_embeddings or query_texts.

Parameters
  • query_embeddings – The embeddings to get the closes neighbors of. Optional.

  • query_texts – The document texts to get the closes neighbors of. Optional.

  • n_results – The number of neighbors to return for each query. Optional.

  • where – A Where type dict used to filter results by. Optional.

  • where_document – A WhereDocument type dict used to filter. Optional.

  • include – A list of what to include in the results. Optional.

Returns

Llama Index Document(s) with the closest embeddings to the query_embeddings or query_texts.