async def transform_query_pipeline(
        self, ctx: Context, ev: TextExtractEvent
    ) -> QueryEvent:
        """Search the transformed query with Tavily API."""
        relevant_text = ev.relevant_text
        relevancy_results = ctx.data["relevancy_results"]
        query_str = ctx.data["query_str"]

        # If any document is found irrelevant, transform the query string for better search results.
        if "no" in relevancy_results:
            transformed_query_str = (
                ctx.data["transform_query_pipeline"]
                .run(query_str=query_str)
                .message.content
            )
            # Conduct a search with the transformed query string and collect the results.
            search_results = ctx.data["tavily_tool"].search(
                transformed_query_str, max_results=5
            )
            search_text = "\n".join([result.text for result in search_results])
        else:
            search_text = ""

        return QueryEvent(relevant_text=relevant_text, search_text=search_text)
Search the transformed query with Tavily API.
llama-index-packs/llama-index-packs-corrective-rag/llama_index/packs/corrective_rag/base.py