From 0f8ec35d4c2255c055bc7c2f97a9f1e39dd1aaeb Mon Sep 17 00:00:00 2001 From: Vasilije <8619304+Vasilije1990@users.noreply.github.com> Date: Sat, 1 Jun 2024 18:41:08 +0200 Subject: [PATCH 1/3] fix for cognee --- cognee/tests/test_library.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/cognee/tests/test_library.py b/cognee/tests/test_library.py index eaac864bc..3d1a1b922 100755 --- a/cognee/tests/test_library.py +++ b/cognee/tests/test_library.py @@ -57,6 +57,20 @@ async def main(): await cognee.cognify([ "cs_explanations"]) + search_results = cognee.search("SIMILARITY", "computer science") + if len(search_results) == 0: + print("The similarity search results list is empty.") + raise Exception("The search results list is empty.") + else: + print("The search results list is not empty.") + + # search_results = cognee.search("SIMILARITY", "computer science") + # if len(search_results) == 0: + # print("The similarity search results list is empty.") + # raise Exception("The search results list is empty.") + # else: + # print("The search results list is not empty.") + if __name__ == "__main__": import asyncio From b7df2dacc745ceaa6843a100d15ad95081ee246c Mon Sep 17 00:00:00 2001 From: Vasilije <8619304+Vasilije1990@users.noreply.github.com> Date: Sat, 1 Jun 2024 21:43:29 +0200 Subject: [PATCH 2/3] updated tests --- cognee/tests/test_library.py | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/cognee/tests/test_library.py b/cognee/tests/test_library.py index 3d1a1b922..a0256a9aa 100755 --- a/cognee/tests/test_library.py +++ b/cognee/tests/test_library.py @@ -45,6 +45,31 @@ async def main(): Some notable LLMs are OpenAI's GPT series of models (e.g., GPT-3.5 and GPT-4, used in ChatGPT and Microsoft Copilot), Google's PaLM and Gemini (the latter of which is currently used in the chatbot of the same name), xAI's Grok, Meta's LLaMA family of open-source models, Anthropic's Claude models, Mistral AI's open source models, and Databricks' open source DBRX. """ + + await cognee.cognify([ "cs_explanations"]) + + search_results = cognee.search("SIMILARITY", "computer science") + assert len(search_results) != 0, "The search results list is empty." + print("The search results list is not empty.") + + search_results = cognee.search("CATEGORIES", "DefaultGraphModel__default_user") + assert len(search_results) != 0, "The search results list is empty." + print("The search results list is not empty.") + + + search_results = cognee.search("NEIGHBOR", "DefaultGraphModel__default_user") + assert len(search_results) != 0, "The search results list is empty." + print("The search results list is not empty.") + + + search_results = cognee.search("SUMMARY", "Work and computers") + assert len(search_results) != 0, "The search results list is empty." + print("The search results list is not empty.") + + search_results = cognee.search("ADJACENT", "DefaultGraphModel__default_user") + assert len(search_results) != 0, "The search results list is empty." + print("The search results list is not empty.") + # # dataset_name = "cs_explanations" # await cognee.add( @@ -55,15 +80,6 @@ async def main(): # dataset_name # ) - await cognee.cognify([ "cs_explanations"]) - - search_results = cognee.search("SIMILARITY", "computer science") - if len(search_results) == 0: - print("The similarity search results list is empty.") - raise Exception("The search results list is empty.") - else: - print("The search results list is not empty.") - # search_results = cognee.search("SIMILARITY", "computer science") # if len(search_results) == 0: # print("The similarity search results list is empty.") From 460583a40fd9808844c5bf4c40e02c2f35c39bca Mon Sep 17 00:00:00 2001 From: Vasilije <8619304+Vasilije1990@users.noreply.github.com> Date: Sun, 2 Jun 2024 18:08:29 +0200 Subject: [PATCH 3/3] added gitignore updates --- .gitignore | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index cd1c887f3..9cb75f3e5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,9 @@ - +.data .env +.local.env +.prod.env +cognee/.data/ + # Byte-compiled / optimized / DLL files __pycache__/