community: AzureSearch: fix reranking for empty lists (#27104)

**Description:** 
  Fix reranking for empty lists 

**Issue:** 
```
ValueError: not enough values to unpack (expected 3, got 0)
    documents, scores, vectors = map(list, zip(*docs))
  File langchain_community/vectorstores/azuresearch.py", line 1680, in _reorder_results_with_maximal_marginal_relevance
```

Co-authored-by: Oleksii Pokotylo <oleksii.pokotylo@pwc.com>
This commit is contained in:
Oleksii Pokotylo 2024-10-07 21:27:09 +02:00 committed by GitHub
parent 8454a742d7
commit 37ca468d03
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1769,6 +1769,8 @@ def _reorder_results_with_maximal_marginal_relevance(
)
for result in results
]
if not docs:
return []
documents, scores, vectors = map(list, zip(*docs))
# Get the new order of results.