Skip to content

Commit

Permalink
Fix GoogleEnterpriseSearchRetriever (langchain-ai#10546)
Browse files Browse the repository at this point in the history
Replace this entire comment with:
- Description: fixed Google Enterprise Search Retriever where it was
consistently returning empty results,
- Issue: related to [issue
8219](langchain-ai#8219),
  - Dependencies: no dependencies,
  - Tag maintainer: @hwchase17 ,
  - Twitter handle: [Tomas Piaggio](https://twitter.com/TomasPiaggio)!
  • Loading branch information
Tom Piaggio authored Sep 13, 2023
1 parent 73b9ca5 commit d1f2075
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,10 @@ def _convert_unstructured_search_response(
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":
Expand Down

0 comments on commit d1f2075

Please sign in to comment.