def _convert_unstructured_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

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

        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