diff --git a/cognee/api/v1/cognify/cognify.py b/cognee/api/v1/cognify/cognify.py index d15b5e293..59ee075ed 100644 --- a/cognee/api/v1/cognify/cognify.py +++ b/cognee/api/v1/cognify/cognify.py @@ -179,8 +179,10 @@ async def cognify( """ tasks = await get_default_tasks(user, graph_model, chunker, chunk_size, ontology_file_path) + # By calling get pipeline executor we get a function that will have the cognee_pipeline run in the background or a function that we will need to wait for pipeline_executor_func = get_pipeline_executor(run_in_background=run_in_background) + # Run the cognee_pipeline in the background or blocking based on executor return await pipeline_executor_func( pipeline=cognee_pipeline, tasks=tasks, diff --git a/cognee/tests/test_search_db.py b/cognee/tests/test_search_db.py index e7e11637f..ce0d8d473 100644 --- a/cognee/tests/test_search_db.py +++ b/cognee/tests/test_search_db.py @@ -113,17 +113,17 @@ async def main(): completion_gk = await cognee.search( query_type=SearchType.GRAPH_COMPLETION, - query_text="Next to which country is Germany located?", + query_text="Where is germany located, next to which country?", save_interaction=True, ) completion_cot = await cognee.search( query_type=SearchType.GRAPH_COMPLETION_COT, - query_text="Next to which country is Germany located?", + query_text="What is the country next to germany??", save_interaction=True, ) completion_ext = await cognee.search( query_type=SearchType.GRAPH_COMPLETION_CONTEXT_EXTENSION, - query_text="Next to which country is Germany located?", + query_text="What is the name of the country next to germany", save_interaction=True, )