def query(self, query: QueryBundle, **kwargs) -> List[NodeWithScore]:
        """
        An extended query method that will:

        1. Query the engine with the given query bundle (like before).
        2. Evaluate nodes with a specified feedback function.
        3. Filter out nodes that do not meet the minimum threshold.
        4. Synthesize with only the filtered nodes.

        Args:
            query (QueryBundle): The query bundle to search for relevant nodes.
            **kwargs: additional keyword arguments.

        Returns:
            List[NodeWithScore]: a list of filtered, relevant nodes.
        """
        # Get relevant docs using super class:
        nodes = self.query_engine.retrieve(query_bundle=query)

        with ThreadPoolExecutor(max_workers=max(1, len(nodes))) as ex:
            future_to_node = {
                ex.submit(
                    lambda node=node: self.feedback(query, node.node.get_text())
                ): node
                for node in nodes
            }
            filtered = []
            for future in as_completed(future_to_node):
                node = future_to_node[future]
                result = future.result()
                if not isinstance(result, float):
                    raise ValueError(
                        "Guardrails can only be used with feedback functions that return a float."
                    )
                if (
                    self.feedback.higher_is_better and result > self.threshold
                ) or (
                    not self.feedback.higher_is_better
                    and result < self.threshold
                ):
                    filtered.append(node)

        filtered_nodes = list(filtered)
        return self.query_engine.synthesize(
            query_bundle=query, nodes=filtered_nodes, **kwargs
        )

        An extended query method that will:

        1. Query the engine with the given query bundle (like before).
        2. Evaluate nodes with a specified feedback function.
        3. Filter out nodes that do not meet the minimum threshold.
        4. Synthesize with only the filtered nodes.

        Args:
            query (QueryBundle): The query bundle to search for relevant nodes.
            **kwargs: additional keyword arguments.

        Returns:
            List[NodeWithScore]: a list of filtered, relevant nodes.
        
src/apps/llamaindex/trulens/apps/llamaindex/guardrails.py