{"record":{"id":"2b50f8206d6edffa","repo":"run-llama/llama_index","slug":"playground-must-be-initialized-with-a-nonempty-lis","errorCode":null,"errorMessage":"Playground must be initialized with a nonempty list of Documents.","messagePattern":"Playground must be initialized with a nonempty list of Documents\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"llama-index-core/llama_index/core/playground/base.py","lineNumber":74,"sourceCode":"        self.index_colors = get_color_mapping(index_range)\n\n    @classmethod\n    def from_docs(\n        cls,\n        documents: List[Document],\n        index_classes: List[Type[BaseIndex]] = DEFAULT_INDEX_CLASSES,\n        retriever_modes: INDEX_SPECIFIC_QUERY_MODES_TYPE = DEFAULT_MODES,\n        **kwargs: Any,\n    ) -> Playground:\n        \"\"\"\n        Initialize with Documents using the default list of indices.\n\n        Args:\n            documents: A List of Documents to experiment with.\n\n        \"\"\"\n        if len(documents) == 0:\n            raise ValueError(\n                \"Playground must be initialized with a nonempty list of Documents.\"\n            )\n\n        indices = [\n            index_class.from_documents(documents, **kwargs)\n            for index_class in index_classes\n        ]\n        return cls(indices, retriever_modes)\n\n    def _validate_indices(self, indices: List[BaseIndex]) -> None:\n        \"\"\"Validate a list of indices.\"\"\"\n        if len(indices) == 0:\n            raise ValueError(\"Playground must have a non-empty list of indices.\")\n        for index in indices:\n            if not isinstance(index, BaseIndex):\n                raise ValueError(\n                    \"Every index in Playground should be an instance of BaseIndex.\"\n                )","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/run-llama/llama_index/blob/afd0fef371831f9bda13e5af7167cf4e981278ab/llama-index-core/llama_index/core/playground/base.py#L56-L92","documentation":"Error \"Playground must be initialized with a nonempty list of Documents.\" thrown in run-llama/llama_index.","triggerScenarios":"Thrown at llama-index-core/llama_index/core/playground/base.py:74 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Initialize Playground with a non-empty list of Document objects.","Load documents first and pass them to the Playground constructor."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"afd0fef371831f9bda13e5af7167cf4e981278ab","analyzedAt":"2026-08-15T05:42:58.429Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}