_参考游乐场:
游乐场
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', 'llm'], <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.
- 参数
query_text (str) -- Query to run all indices on.
to_pandas (Optional[bool]) -- Return results in a pandas dataframe. True by default.
- 返回
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', 'llm'], <class 'llama_index.indices.vector_store.base.GPTVectorStoreIndex'>: ['default']}, **kwargs: ~typing.Any) Playground
Initialize with Documents using the default list of indices.
- 参数
documents -- A List of Documents to experiment with.
- property indices: List[BaseGPTIndex]
Get Playground's indices.
- property retriever_modes: dict
Get Playground's indices.