def semantic_search(
        self,
        query: str,
    ) -> List[Dict]:
        """
        Makes a query to a Vectara corpus and returns the top search results from the retrieved documents.

        Parameters
        ----------
            query (str): The input query from the user.

        Returns
        -------
            List[Dict]: A list of retrieved documents with their associated metadata

        """
        response = self.retriever._retrieve(query_bundle=QueryBundle(query_str=query))

        if len(response) == 0:
            return []

        return [
            {
                "text": doc.node.text_resource.text,
                "citation_metadata": doc.node.metadata,
            }
            for doc in response
        ]

        Makes a query to a Vectara corpus and returns the top search results from the retrieved documents.

        Parameters
        ----------
            query (str): The input query from the user.

        Returns
        -------
            List[Dict]: A list of retrieved documents with their associated metadata

        
llama-index-integrations/tools/llama-index-tools-vectara-query/llama_index/tools/vectara_query/base.py