diff --git a/llama-index-integrations/indices/llama-index-indices-managed-vertexai/llama_index/indices/managed/vertexai/retriever.py b/llama-index-integrations/indices/llama-index-indices-managed-vertexai/llama_index/indices/managed/vertexai/retriever.py index 7a43a268abc2f8f85798837b55c432226872ee3a..4225441b478f8007420eecf311eec18f6cf53803 100644 --- a/llama-index-integrations/indices/llama-index-indices-managed-vertexai/llama_index/indices/managed/vertexai/retriever.py +++ b/llama-index-integrations/indices/llama-index-indices-managed-vertexai/llama_index/indices/managed/vertexai/retriever.py @@ -34,7 +34,16 @@ class VertexAIRetriever(BaseRetriever): if response.contexts: return [ - NodeWithScore(node=TextNode(text=context.text), score=context.distance) + NodeWithScore( + node=TextNode( + text=context.text, + metadata={ + "source_uri": context.source_uri, + "source_display_name": context.source_display_name, + }, + ), + score=context.distance, + ) for context in response.contexts.contexts ] else: diff --git a/llama-index-integrations/indices/llama-index-indices-managed-vertexai/pyproject.toml b/llama-index-integrations/indices/llama-index-indices-managed-vertexai/pyproject.toml index 9aaaf6d7d7e6a5cee9ad3f6532884add0b93bed4..5af3ff2892ffc340a41b153ffdf37a3c19ef019e 100644 --- a/llama-index-integrations/indices/llama-index-indices-managed-vertexai/pyproject.toml +++ b/llama-index-integrations/indices/llama-index-indices-managed-vertexai/pyproject.toml @@ -30,7 +30,7 @@ exclude = ["**/BUILD"] license = "MIT" name = "llama-index-indices-managed-vertexai" readme = "README.md" -version = "0.2.0" +version = "0.2.1" [tool.poetry.dependencies] python = ">=3.9,<4.0" diff --git a/llama-index-integrations/indices/llama-index-indices-managed-vertexai/tests/test_indices_managed_vertexai.py b/llama-index-integrations/indices/llama-index-indices-managed-vertexai/tests/test_indices_managed_vertexai.py index d04481dde1a5246a310d8a03453c77aae870d31b..c5f093205402a3707813e4d21f70a44cf5bdda7e 100644 --- a/llama-index-integrations/indices/llama-index-indices-managed-vertexai/tests/test_indices_managed_vertexai.py +++ b/llama-index-integrations/indices/llama-index-indices-managed-vertexai/tests/test_indices_managed_vertexai.py @@ -1,7 +1,12 @@ from llama_index.core.indices.managed.base import BaseManagedIndex +from llama_index.core.base.base_retriever import BaseRetriever from llama_index.indices.managed.vertexai import VertexAIIndex +from llama_index.indices.managed.vertexai import VertexAIRetriever def test_class(): names_of_base_classes = [b.__name__ for b in VertexAIIndex.__mro__] assert BaseManagedIndex.__name__ in names_of_base_classes + + names_of_base_classes = [b.__name__ for b in VertexAIRetriever.__mro__] + assert BaseRetriever.__name__ in names_of_base_classes