def _convert_website_datastore_response(
        self, results: Sequence[SearchResult], chunk_type: str
    ) -> List[NodeWithScore]:
        """Converts a sequence of search results to a list of LLamaindex note_with_score."""
        note_with_score: List[NodeWithScore] = []

        for result in results:
            document_dict = MessageToDict(
                result.document._pb, preserving_proto_field_name=True
            )

            derived_struct_data = document_dict.get("derived_struct_data")
            if not derived_struct_data:
                continue

            if chunk_type not in derived_struct_data:
                continue

            text_field = "snippet" if chunk_type == "snippets" else "content"

            for chunk in derived_struct_data[chunk_type]:
                score = chunk.get("relevanceScore", 0)
                note_with_score.append(
                    NodeWithScore(
                        node=TextNode(text=chunk.get(text_field, "")),
                        score=score,
                    )
                )

        if not note_with_score:
            print(f"No {chunk_type} could be found.")
            if chunk_type == "extractive_answers":
                print(
                    "Make sure that your data store is using Advanced Website "
                    "Indexing.\n"
                    "https://cloud.google.com/generative-ai-app-builder/docs/about-advanced-features#advanced-website-indexing"
                )

        return note_with_score
Converts a sequence of search results to a list of LLamaindex note_with_score.
llama-index-integrations/retrievers/llama-index-retrievers-vertexai-search/llama_index/retrievers/vertexai_search/base.py