{"record":{"id":"4b5787a43092efd7","repo":"run-llama/llama_index","slug":"cannot-specify-both-query-str-and-query-bundle-4b5787","errorCode":null,"errorMessage":"Cannot specify both query_str and query_bundle","messagePattern":"Cannot specify both query_str and query_bundle","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"llama-index-core/llama_index/core/postprocessor/types.py","lineNumber":43,"sourceCode":"\n    def _get_prompt_modules(self) -> PromptMixinType:\n        \"\"\"Get prompt modules.\"\"\"\n        return {}\n\n    # implement class_name so users don't have to worry about it when extending\n    @classmethod\n    def class_name(cls) -> str:\n        return \"BaseNodePostprocessor\"\n\n    def postprocess_nodes(\n        self,\n        nodes: List[NodeWithScore],\n        query_bundle: Optional[QueryBundle] = None,\n        query_str: Optional[str] = None,\n    ) -> List[NodeWithScore]:\n        \"\"\"Postprocess nodes.\"\"\"\n        if query_str is not None and query_bundle is not None:\n            raise ValueError(\"Cannot specify both query_str and query_bundle\")\n        elif query_str is not None:\n            query_bundle = QueryBundle(query_str)\n        else:\n            pass\n        return self._postprocess_nodes(nodes, query_bundle)\n\n    @abstractmethod\n    def _postprocess_nodes(\n        self,\n        nodes: List[NodeWithScore],\n        query_bundle: Optional[QueryBundle] = None,\n    ) -> List[NodeWithScore]:\n        \"\"\"Postprocess nodes.\"\"\"\n\n    async def apostprocess_nodes(\n        self,\n        nodes: List[NodeWithScore],\n        query_bundle: Optional[QueryBundle] = None,","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/run-llama/llama_index/blob/afd0fef371831f9bda13e5af7167cf4e981278ab/llama-index-core/llama_index/core/postprocessor/types.py#L25-L61","documentation":"Error \"Cannot specify both query_str and query_bundle\" thrown in run-llama/llama_index.","triggerScenarios":"Thrown at llama-index-core/llama_index/core/postprocessor/types.py:43 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass either query_str or query_bundle, not both.","Remove one of the two arguments."],"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"}