Skip to content

The agent engineering platform.

BUGFIX: Use embedding key in azure_cosmos_db index creation (#13919)

Enric Soler Rastrolloc156d0281acc
diff --git a/libs/langchain/langchain/vectorstores/azure_cosmos_db.py b/libs/langchain/langchain/vectorstores/azure_cosmos_db.py
index 156b729fe2..c3997471d4 100644
--- a/libs/langchain/langchain/vectorstores/azure_cosmos_db.py
+++ b/libs/langchain/langchain/vectorstores/azure_cosmos_db.py
@@ -221,7 +221,7 @@ class AzureCosmosDBVectorSearch(VectorStore):
"indexes": [
{
"name": self._index_name,
- "key": {"vectorContent": "cosmosSearch"},
+ "key": {self._embedding_key: "cosmosSearch"},
"cosmosSearchOptions": {
"kind": "vector-ivf",
"numLists": num_lists,