mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-31 16:39:20 +00:00
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:
parent
8454a742d7
commit
37ca468d03
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user