Skip to content

Commit b732445

Browse files
authored
Remove multi search (#2093)
* Remove multi-search from CLI * Remove multi-search from API * Flatten vector_store config * Push hydrated vector store down to embed_text * Remove outputs from config * Remove multi-search notebook/docs * Add missing response_type in basic search API * Fix basic search context and id mapping * Fix v1 migration notebook * Fix query entity search tests
1 parent 715be61 commit b732445

File tree

21 files changed

+195
-1970
lines changed

21 files changed

+195
-1970
lines changed

docs/examples_notebooks/index_migration_to_v1.ipynb

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -204,21 +204,29 @@
204204
"source": [
205205
"from graphrag.cache.factory import CacheFactory\n",
206206
"from graphrag.callbacks.noop_workflow_callbacks import NoopWorkflowCallbacks\n",
207-
"from graphrag.config.get_vector_store_settings import get_vector_store_settings\n",
208207
"from graphrag.index.workflows.generate_text_embeddings import generate_text_embeddings\n",
208+
"from graphrag.language_model.manager import ModelManager\n",
209+
"from graphrag.tokenizer.get_tokenizer import get_tokenizer\n",
209210
"\n",
210211
"# We only need to re-run the embeddings workflow, to ensure that embeddings for all required search fields are in place\n",
211212
"# We'll construct the context and run this function flow directly to avoid everything else\n",
212213
"\n",
213-
"\n",
214-
"vector_store_config = get_vector_store_settings(config)\n",
215214
"model_config = config.get_language_model_config(config.embed_text.model_id)\n",
216215
"callbacks = NoopWorkflowCallbacks()\n",
217216
"cache_config = config.cache.model_dump() # type: ignore\n",
218217
"cache = CacheFactory().create_cache(\n",
219218
" cache_type=cache_config[\"type\"], # type: ignore\n",
220219
" **cache_config,\n",
221220
")\n",
221+
"model = ModelManager().get_or_create_embedding_model(\n",
222+
" name=\"text_embedding\",\n",
223+
" model_type=model_config.type,\n",
224+
" config=model_config,\n",
225+
" callbacks=callbacks,\n",
226+
" cache=cache,\n",
227+
")\n",
228+
"\n",
229+
"tokenizer = get_tokenizer(model_config)\n",
222230
"\n",
223231
"await generate_text_embeddings(\n",
224232
" documents=None,\n",
@@ -227,11 +235,12 @@
227235
" entities=final_entities,\n",
228236
" community_reports=final_community_reports,\n",
229237
" callbacks=callbacks,\n",
230-
" cache=cache,\n",
231-
" model_config=model_config,\n",
238+
" model=model,\n",
239+
" tokenizer=tokenizer,\n",
232240
" batch_size=config.embed_text.batch_size,\n",
233241
" batch_max_tokens=config.embed_text.batch_max_tokens,\n",
234-
" vector_store_config=vector_store_config,\n",
242+
" num_threads=model_config.concurrent_requests,\n",
243+
" vector_store_config=config.vector_store,\n",
235244
" embedded_fields=config.embed_text.names,\n",
236245
")"
237246
]

0 commit comments

Comments
 (0)