File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
tests/integration/vector_stores Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -95,6 +95,12 @@ def _validate_embeddings_schema(self) -> None:
9595 if name not in all_embeddings :
9696 msg = f"vector_store.embeddings_schema contains an invalid embedding schema name: { name } . Please rerun `graphrag init` and select the correct embedding schema names."
9797 raise ValueError (msg )
98+
99+ if self .type == VectorStoreType .CosmosDB :
100+ for id_field in self .embeddings_schema .values ():
101+ if id_field .id_field != "id" :
102+ msg = "When using CosmosDB, the id_field in embeddings_schema must be 'id'. Please rerun `graphrag init` and set the id_field to 'id'."
103+ raise ValueError (msg )
98104
99105 @model_validator (mode = "after" )
100106 def _validate_model (self ):
Original file line number Diff line number Diff line change @@ -110,7 +110,7 @@ def test_vector_store_customization():
110110 vector_store = CosmosDBVectorStore (
111111 vector_store_schema_config = VectorStoreSchemaConfig (
112112 index_name = "text-embeddings" ,
113- id_field = "id " ,
113+ id_field = "id_custom " ,
114114 text_field = "text_custom" ,
115115 vector_field = "vector_custom" ,
116116 attributes_field = "attributes_custom" ,
You can’t perform that action at this time.
0 commit comments