{"record":{"id":"51ae10c9e56fd534","repo":"run-llama/llama_index","slug":"invalid-prediction-raw-pred","errorCode":null,"errorMessage":"Invalid prediction: {raw_pred}","messagePattern":"Invalid prediction: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"llama-index-core/llama_index/core/postprocessor/node.py","lineNumber":311,"sourceCode":"    infer_prev_next_tmpl: str = Field(default=DEFAULT_INFER_PREV_NEXT_TMPL)\n    refine_prev_next_tmpl: str = Field(default=DEFAULT_REFINE_INFER_PREV_NEXT_TMPL)\n    verbose: bool = Field(default=False)\n    response_mode: ResponseMode = Field(default=ResponseMode.COMPACT)\n\n    @classmethod\n    def class_name(cls) -> str:\n        return \"AutoPrevNextNodePostprocessor\"\n\n    def _parse_prediction(self, raw_pred: str) -> str:\n        \"\"\"Parse prediction.\"\"\"\n        pred = raw_pred.strip().lower()\n        if \"previous\" in pred:\n            return \"previous\"\n        elif \"next\" in pred:\n            return \"next\"\n        elif \"none\" in pred:\n            return \"none\"\n        raise ValueError(f\"Invalid prediction: {raw_pred}\")\n\n    def _postprocess_nodes(\n        self,\n        nodes: List[NodeWithScore],\n        query_bundle: Optional[QueryBundle] = None,\n    ) -> List[NodeWithScore]:\n        \"\"\"Postprocess nodes.\"\"\"\n        llm = self.llm or Settings.llm\n\n        if query_bundle is None:\n            raise ValueError(\"Missing query bundle.\")\n\n        infer_prev_next_prompt = PromptTemplate(\n            self.infer_prev_next_tmpl,\n        )\n        refine_infer_prev_next_prompt = PromptTemplate(self.refine_prev_next_tmpl)\n\n        all_nodes: Dict[str, NodeWithScore] = {}","sourceCodeStart":293,"sourceCodeEnd":329,"githubUrl":"https://github.com/run-llama/llama_index/blob/afd0fef371831f9bda13e5af7167cf4e981278ab/llama-index-core/llama_index/core/postprocessor/node.py#L293-L329","documentation":"Error \"Invalid prediction: {raw_pred}\" thrown in run-llama/llama_index.","triggerScenarios":"Thrown at llama-index-core/llama_index/core/postprocessor/node.py:311 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the LLM returns a parseable relevance prediction (e.g. yes/no or a score in the expected format).","Adjust the prompt or add output fixing so predictions match the expected format."],"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"}