run-llama/llama_index · error · ValueError
Playground must have a non-empty list of indices.
Error message
Playground must have a non-empty list of indices.
What it means
Error "Playground must have a non-empty list of indices." thrown in run-llama/llama_index.
Source
Thrown at llama-index-core/llama_index/core/playground/base.py:87
Args:
documents: A List of Documents to experiment with.
"""
if len(documents) == 0:
raise ValueError(
"Playground must be initialized with a nonempty list of Documents."
)
indices = [
index_class.from_documents(documents, **kwargs)
for index_class in index_classes
]
return cls(indices, retriever_modes)
def _validate_indices(self, indices: List[BaseIndex]) -> None:
"""Validate a list of indices."""
if len(indices) == 0:
raise ValueError("Playground must have a non-empty list of indices.")
for index in indices:
if not isinstance(index, BaseIndex):
raise ValueError(
"Every index in Playground should be an instance of BaseIndex."
)
@property
def indices(self) -> List[BaseIndex]:
"""Get Playground's indices."""
return self._indices
@indices.setter
def indices(self, indices: List[BaseIndex]) -> None:
"""Set Playground's indices."""
self._validate_indices(indices)
self._indices = indices
def _validate_modes(self, retriever_modes: INDEX_SPECIFIC_QUERY_MODES_TYPE) -> None:View on GitHub (pinned to afd0fef371)
Solutions
- Pass at least one index to Playground, or let it build default indices from the documents.
- Remove the empty indices list and allow indices to be built from documents.
When it happens
Trigger: Thrown at llama-index-core/llama_index/core/playground/base.py:87 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of run-llama/llama_index@afd0fef371 (2026-08-15).
Data as JSON: /api/errors/934d1c46877ce4af.
Report an issue: GitHub.