From 42d33fcd001a535a494a31eadcd172c260a50912 Mon Sep 17 00:00:00 2001 From: hajdul88 <52442977+hajdul88@users.noreply.github.com> Date: Tue, 26 Aug 2025 15:52:10 +0200 Subject: [PATCH] fix: fixes search test behaviour and adds comments to new pipeline executor logic (#1293) ## Description fix: fixes search test behaviour and adds comments to new pipeline executor logic ## DCO Affirmation I affirm that all code in every commit of this pull request conforms to the terms of the Topoteretes Developer Certificate of Origin. --- cognee/api/v1/cognify/cognify.py | 2 ++ cognee/tests/test_search_db.py | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) 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, )