Playgroundο
Experiment with different indices, models, and more.
- class llama_index.playground.base.Playground(indices: ~typing.List[~llama_index.indices.base.BaseGPTIndex], retriever_modes: ~typing.Dict[~typing.Type[~llama_index.indices.base.BaseGPTIndex], ~typing.List[str]] = {<class 'llama_index.indices.tree.base.GPTTreeIndex'>: ['select_leaf', 'select_leaf_embedding', 'all_leaf', 'root'], <class 'llama_index.indices.list.base.GPTListIndex'>: ['default', 'embedding'], <class 'llama_index.indices.vector_store.base.GPTVectorStoreIndex'>: ['default']})ο
Experiment with indices, models, embeddings, retriever_modes, and more.
- compare(query_text: str, to_pandas: Optional[bool] = True) Union[DataFrame, List[Dict[str, Any]]] ο
Compare index outputs on an input query.
- Parameters
query_text (str) β Query to run all indices on.
to_pandas (Optional[bool]) β Return results in a pandas dataframe. True by default.
- Returns
The output of each index along with other data, such as the time it took to compute. Results are stored in a Pandas Dataframe or a list of Dicts.
- classmethod from_docs(documents: ~typing.List[~llama_index.readers.schema.base.Document], index_classes: ~typing.List[~typing.Type[~llama_index.indices.base.BaseGPTIndex]] = [<class 'llama_index.indices.vector_store.base.GPTVectorStoreIndex'>, <class 'llama_index.indices.tree.base.GPTTreeIndex'>, <class 'llama_index.indices.list.base.GPTListIndex'>], retriever_modes: ~typing.Dict[~typing.Type[~llama_index.indices.base.BaseGPTIndex], ~typing.List[str]] = {<class 'llama_index.indices.tree.base.GPTTreeIndex'>: ['select_leaf', 'select_leaf_embedding', 'all_leaf', 'root'], <class 'llama_index.indices.list.base.GPTListIndex'>: ['default', 'embedding'], <class 'llama_index.indices.vector_store.base.GPTVectorStoreIndex'>: ['default']}, **kwargs: ~typing.Any) Playground ο
Initialize with Documents using the default list of indices.
- Parameters
documents β A List of Documents to experiment with.
- property indices: List[BaseGPTIndex]ο
Get Playgroundβs indices.
- property retriever_modes: dictο
Get Playgroundβs indices.