Skip to content
Snippets Groups Projects
Unverified Commit 7db4088e authored by Philippe Laflamme's avatar Philippe Laflamme Committed by GitHub
Browse files

Add textnode metadata (#17814)

parent c1b70315
No related branches found
No related tags found
No related merge requests found
......@@ -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:
......
......@@ -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"
......
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment