mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-02 13:08:57 +00:00
community: Replaced hardcoded "metadata" with FIELDS_METADATA variable in semantic_hybrid_search_with_score_and_rerank (#15642)
- **Description:** This PR is to fix a bug in semantic_hybrid_search_with_score_and_rerank() function in langchain_community/vectorstores/azuresearch.py. The hardcoded "metadata" name is replaced with FIELDS_METADATA variable with an if block to check if the metadata column exists or not. - **Issue:** Fixed #15581 - **Dependencies:** No - **Twitter handle:** None Co-authored-by: H161961 <Raunak.Raunak@Honeywell.com>
This commit is contained in:
parent
472f70c54b
commit
64f5968a81
@ -653,7 +653,10 @@ class AzureSearch(VectorStore):
|
|||||||
if result.get("@search.captions")
|
if result.get("@search.captions")
|
||||||
else {},
|
else {},
|
||||||
"answers": semantic_answers_dict.get(
|
"answers": semantic_answers_dict.get(
|
||||||
json.loads(result["metadata"]).get("key"), ""
|
json.loads(result[FIELDS_METADATA]).get("key")
|
||||||
|
if FIELDS_METADATA in result
|
||||||
|
else "",
|
||||||
|
"",
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user