def _get_relevant_documents(
        self, query: str, *, run_manager
    ) -> List[Document]:
        """
        An internal method to accomplish three tasks:

        1. Get relevant documents.
        2. Evaluate documents with a specified feedback function.
        3. Filter out documents that do not meet the minimum threshold.

        Args:
            query: str - the query string to search for relevant documents.

            run_manager: RunManager - the run manager to handle document retrieval.

        Returns:
        - List[Document]: a list of filtered, relevant documents.
        """
        # Get relevant docs using super class:
        docs = super()._get_relevant_documents(query, run_manager=run_manager)

        # Evaluate the filter on each, in parallel.
        with threading_utils.ThreadPoolExecutor(
            max_workers=max(1, len(docs))
        ) as ex:
            future_to_doc = {
                ex.submit(
                    lambda doc=doc: self.feedback(query, doc.page_content)
                ): doc
                for doc in docs
            }
            filtered = []
            for future in as_completed(future_to_doc):
                doc = future_to_doc[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(doc)

        # Return only the filtered ones.
        return filtered

        An internal method to accomplish three tasks:

        1. Get relevant documents.
        2. Evaluate documents with a specified feedback function.
        3. Filter out documents that do not meet the minimum threshold.

        Args:
            query: str - the query string to search for relevant documents.

            run_manager: RunManager - the run manager to handle document retrieval.

        Returns:
        - List[Document]: a list of filtered, relevant documents.
        
src/apps/langchain/trulens/apps/langchain/guardrails.py