{"record":{"id":"a3323f233753634f","repo":"run-llama/llama_index","slug":"invalid-mode-mode","errorCode":null,"errorMessage":"Invalid mode: {mode}","messagePattern":"Invalid mode: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"llama-index-core/llama_index/core/postprocessor/node.py","lineNumber":360,"sourceCode":"                query_str=query_bundle.query_str,\n            )\n            raw_pred = cast(str, raw_pred)\n            mode = self._parse_prediction(raw_pred)\n\n            logger.debug(f\"> Postprocessor Predicted mode: {mode}\")\n            if self.verbose:\n                print(f\"> Postprocessor Predicted mode: {mode}\")\n\n            if mode == \"next\":\n                all_nodes.update(get_forward_nodes(node, self.num_nodes, self.docstore))\n            elif mode == \"previous\":\n                all_nodes.update(\n                    get_backward_nodes(node, self.num_nodes, self.docstore)\n                )\n            elif mode == \"none\":\n                pass\n            else:\n                raise ValueError(f\"Invalid mode: {mode}\")\n\n        sorted_nodes = sorted(all_nodes.values(), key=lambda x: x.node.node_id)\n        return list(sorted_nodes)\n\n\nclass LongContextReorder(BaseNodePostprocessor):\n    \"\"\"\n    Models struggle to access significant details found\n    in the center of extended contexts. A study\n    (https://arxiv.org/abs/2307.03172) observed that the best\n    performance typically arises when crucial data is positioned\n    at the start or conclusion of the input context. Additionally,\n    as the input context lengthens, performance drops notably, even\n    in models designed for long contexts.\".\n    \"\"\"\n\n    @classmethod\n    def class_name(cls) -> str:","sourceCodeStart":342,"sourceCodeEnd":378,"githubUrl":"https://github.com/run-llama/llama_index/blob/afd0fef371831f9bda13e5af7167cf4e981278ab/llama-index-core/llama_index/core/postprocessor/node.py#L342-L378","documentation":"Error \"Invalid mode: {mode}\" thrown in run-llama/llama_index.","triggerScenarios":"Thrown at llama-index-core/llama_index/core/postprocessor/node.py:360 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a valid mode for this postprocessor; check the class documentation for allowed values.","Correct the mode argument."],"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-15T17:31:12.345Z"}