Init embedding_model_dims in all vectordbs (#2572)

This commit is contained in:
Dev Khant
2025-04-19 10:53:01 +05:30
committed by GitHub
parent 78912928bc
commit 3ee4768c14
7 changed files with 9 additions and 5 deletions

View File

@@ -37,7 +37,7 @@ class OpenSearchDB(VectorStoreBase):
)
self.collection_name = config.collection_name
self.vector_dim = config.embedding_model_dims
self.embedding_model_dims = config.embedding_model_dims
# Create index only if auto_create_index is True
if config.auto_create_index:
@@ -54,7 +54,7 @@ class OpenSearchDB(VectorStoreBase):
"text": {"type": "text"},
"vector": {
"type": "knn_vector",
"dimension": self.vector_dim,
"dimension": self.embedding_model_dims,
"method": {"engine": "lucene", "name": "hnsw", "space_type": "cosinesimil"},
},
"metadata": {"type": "object", "properties": {"user_id": {"type": "keyword"}}},