Skip to content

The agent engineering platform.

fixed an UnboundLocalError when no documents are found (#12995)

Leonid Kuliginf3fcdea57471
diff --git a/libs/langchain/langchain/retrievers/google_vertex_ai_search.py b/libs/langchain/langchain/retrievers/google_vertex_ai_search.py
index 8dc8cd6d8b..0e0c165c53 100644
--- a/libs/langchain/langchain/retrievers/google_vertex_ai_search.py
+++ b/libs/langchain/langchain/retrievers/google_vertex_ai_search.py
@@ -160,6 +160,7 @@ class _BaseGoogleVertexAISearchRetriever(BaseModel):
from google.protobuf.json_format import MessageToDict
documents: List[Document] = []
+ chunk_type = "extractive_answers"
for result in results:
document_dict = MessageToDict(