From 7a2fc617a875bcfe9a7f9394ef64d9b3c8785127 Mon Sep 17 00:00:00 2001 From: Leon Luithlen Date: Mon, 18 Nov 2024 14:00:14 +0100 Subject: [PATCH 1/2] Rename remaining 'query' keyword args in cognee.search to 'query_text' --- cognee/tests/test_code_generation.py | 2 +- docs/quickstart.md | 2 +- examples/python/dynamic_steps_example.py | 2 +- examples/python/simple_example.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cognee/tests/test_code_generation.py b/cognee/tests/test_code_generation.py index aad59ace8..a21925585 100755 --- a/cognee/tests/test_code_generation.py +++ b/cognee/tests/test_code_generation.py @@ -26,7 +26,7 @@ async def main(): await render_graph(None, include_nodes = True, include_labels = True) - search_results = await cognee.search(SearchType.CHUNKS, query = "Student") + search_results = await cognee.search(SearchType.CHUNKS, query_text = "Student") assert len(search_results) != 0, "The search results list is empty." print("\n\nExtracted chunks are:\n") for result in search_results: diff --git a/docs/quickstart.md b/docs/quickstart.md index 828fb249d..35c46e4f9 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -59,7 +59,7 @@ await cognee.add(text) # Add a new piece of information await cognee.cognify() # Use LLMs and cognee to create knowledge -search_results = await cognee.search("INSIGHTS", {'query': 'Tell me about NLP'}) # Query cognee for the knowledge +search_results = await cognee.search("INSIGHTS", {'query_text': 'Tell me about NLP'}) # Query cognee for the knowledge for result_text in search_results: print(result_text) diff --git a/examples/python/dynamic_steps_example.py b/examples/python/dynamic_steps_example.py index 309aea82c..194450599 100644 --- a/examples/python/dynamic_steps_example.py +++ b/examples/python/dynamic_steps_example.py @@ -209,7 +209,7 @@ async def main(enable_steps): if enable_steps.get("search_insights"): search_results = await cognee.search( SearchType.INSIGHTS, - {'query': 'Which applicant has the most relevant experience in data science?'} + query_text='Which applicant has the most relevant experience in data science?' ) print("Search results:") for result_text in search_results: diff --git a/examples/python/simple_example.py b/examples/python/simple_example.py index 4e0e61834..707705056 100644 --- a/examples/python/simple_example.py +++ b/examples/python/simple_example.py @@ -27,7 +27,7 @@ async def main(): # Query cognee for insights on the added text search_results = await cognee.search( - SearchType.INSIGHTS, query='Tell me about NLP' + SearchType.INSIGHTS, query_text='Tell me about NLP' ) # Display search results From bb404f51f9c472c2fcbeaae1f7328d0685d2f772 Mon Sep 17 00:00:00 2001 From: Boris Date: Mon, 18 Nov 2024 17:50:15 +0100 Subject: [PATCH 2/2] Update docs/quickstart.md --- docs/quickstart.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/quickstart.md b/docs/quickstart.md index 35c46e4f9..0cdc2645c 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -59,7 +59,7 @@ await cognee.add(text) # Add a new piece of information await cognee.cognify() # Use LLMs and cognee to create knowledge -search_results = await cognee.search("INSIGHTS", {'query_text': 'Tell me about NLP'}) # Query cognee for the knowledge +search_results = await cognee.search(SearchType.INSIGHTS, query_text='Tell me about NLP') # Query cognee for the knowledge for result_text in search_results: print(result_text)