def test_from_docs(patch_llm_predictor, patch_token_text_splitter) -> None:
    """Test initialization via a list of documents."""
    documents = [
        Document(text="I can't carry it for you."),
        Document(text="But I can carry you!"),
    ]

    playground = Playground.from_docs(documents=documents)

    assert len(playground.indices) == len(DEFAULT_INDEX_CLASSES)
    assert len(playground.retriever_modes) == len(DEFAULT_MODES)

    with pytest.raises(ValueError):
        playground = Playground.from_docs(documents=documents, retriever_modes={})
Test initialization via a list of documents.
llama-index-core/tests/playground/test_base.py