Skip to content

The agent engineering platform.

community[patch]: fix semantic answer bug in AzureSearch vector store (#18938)

Clément Taminesa6cbb755a769
diff --git a/libs/community/langchain_community/vectorstores/azuresearch.py b/libs/community/langchain_community/vectorstores/azuresearch.py
index 90fca0ba04..4474e16ad4 100644
--- a/libs/community/langchain_community/vectorstores/azuresearch.py
+++ b/libs/community/langchain_community/vectorstores/azuresearch.py
@@ -604,7 +604,7 @@ class AzureSearch(VectorStore):
if result.get("@search.captions")
else {},
"answers": semantic_answers_dict.get(
- json.loads(result["metadata"]).get("key"),
+ result.get(FIELDS_ID, ""),
"",
),
},