Fix `GoogleEnterpriseSearchRetriever` (#10546)

Replace this entire comment with:
- Description: fixed Google Enterprise Search Retriever where it was
consistently returning empty results,
- Issue: related to [issue
8219](https://github.com/langchain-ai/langchain/issues/8219),
  - Dependencies: no dependencies,
  - Tag maintainer: @hwchase17 ,
  - Twitter handle: [Tomas Piaggio](https://twitter.com/TomasPiaggio)!
pull/4507/head
Tom Piaggio 12 months ago committed by GitHub
parent 73b9ca54cb
commit d1f2075bde
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -156,7 +156,10 @@ class GoogleCloudEnterpriseSearchRetriever(BaseRetriever):
else "extractive_segments"
)
for chunk in derived_struct_data.get(chunk_type, []):
if chunk_type not in derived_struct_data:
continue
for chunk in derived_struct_data[chunk_type]:
doc_metadata["source"] = derived_struct_data.get("link", "")
if chunk_type == "extractive_answers":

Loading…
Cancel
Save