{"record":{"id":"6308c5f4c19bbdd5","repo":"run-llama/llama_index","slug":"query-bundle-must-be-provided","errorCode":null,"errorMessage":"Query bundle must be provided.","messagePattern":"Query bundle must be provided\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"llama-index-core/llama_index/core/postprocessor/llm_rerank.py","lineNumber":118,"sourceCode":"    ) -> List[NodeWithScore]:\n        raw_choices, relevances = self._parse_choice_select_answer_fn(\n            raw_response, len(nodes_batch)\n        )\n        choice_idxs = [int(choice) - 1 for choice in raw_choices]\n        choice_nodes = [nodes_batch[idx] for idx in choice_idxs]\n        relevances = relevances or [1.0 for _ in choice_nodes]\n        return [\n            NodeWithScore(node=node, score=relevance)\n            for node, relevance in zip(choice_nodes, relevances)\n        ]\n\n    def _postprocess_nodes(\n        self,\n        nodes: List[NodeWithScore],\n        query_bundle: Optional[QueryBundle] = None,\n    ) -> List[NodeWithScore]:\n        if query_bundle is None:\n            raise ValueError(\"Query bundle must be provided.\")\n        if len(nodes) == 0:\n            return []\n\n        initial_results: List[NodeWithScore] = []\n        for nodes_batch in self._get_node_batches(nodes):\n            # call each batch independently\n            raw_response = self.llm.predict(\n                self.choice_select_prompt,\n                **self._get_predict_kwargs(nodes_batch, query_bundle.query_str),\n            )\n            initial_results.extend(self._parse_raw_response(raw_response, nodes_batch))\n\n        return sorted(initial_results, key=lambda x: x.score or 0.0, reverse=True)[\n            : self.top_n\n        ]\n\n    async def _apostprocess_nodes(\n        self,","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/run-llama/llama_index/blob/afd0fef371831f9bda13e5af7167cf4e981278ab/llama-index-core/llama_index/core/postprocessor/llm_rerank.py#L100-L136","documentation":"Error \"Query bundle must be provided.\" thrown in run-llama/llama_index.","triggerScenarios":"Thrown at llama-index-core/llama_index/core/postprocessor/llm_rerank.py:118 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a query_bundle when calling the LLMRerank postprocessor.","Ensure the query bundle is forwarded through the query engine pipeline."],"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"}