From f3fcdea5747106f6f4752630d16afbcca752caff Mon Sep 17 00:00:00 2001 From: Leonid Kuligin Date: Mon, 20 Nov 2023 18:41:14 +0100 Subject: [PATCH] fixed an UnboundLocalError when no documents are found (#12995) Replace this entire comment with: - **Description:** fixed a bug - **Issue:** the issue # #12780 --- libs/langchain/langchain/retrievers/google_vertex_ai_search.py | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/langchain/langchain/retrievers/google_vertex_ai_search.py b/libs/langchain/langchain/retrievers/google_vertex_ai_search.py index 8dc8cd6d8b9..0e0c165c53e 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(