Skip to content

The agent engineering platform.

community: Google Vertex AI Search now returns the website title as part of the document metadata (#30688)

German Molina5fb261ce277e
diff --git a/libs/community/langchain_community/retrievers/google_vertex_ai_search.py b/libs/community/langchain_community/retrievers/google_vertex_ai_search.py
index e6945b9420..1cc261695d 100644
--- a/libs/community/langchain_community/retrievers/google_vertex_ai_search.py
+++ b/libs/community/langchain_community/retrievers/google_vertex_ai_search.py
@@ -167,6 +167,8 @@ class _BaseGoogleVertexAISearchRetriever(BaseModel):
doc_metadata = document_dict.get("struct_data", {})
doc_metadata["id"] = document_dict["id"]
doc_metadata["source"] = derived_struct_data.get("link", "")
+ if derived_struct_data.get("title") is not None:
+ doc_metadata["title"] = derived_struct_data.get("title")
if chunk_type not in derived_struct_data:
continue