From cd0d321edac5ff06fdabeaf27235762d829efddf Mon Sep 17 00:00:00 2001 From: Vasilije <8619304+Vasilije1990@users.noreply.github.com> Date: Mon, 7 Apr 2025 11:46:48 +0200 Subject: [PATCH] feat: Rename COMPLETION to RAG_COMPLETION (#701) ## Description ## 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/modules/search/methods/search.py | 2 +- cognee/modules/search/types/SearchType.py | 2 +- cognee/tests/test_custom_model.py | 2 +- notebooks/graphrag_vs_rag.ipynb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cognee/modules/search/methods/search.py b/cognee/modules/search/methods/search.py index c9e1262bb..4a79a29a8 100644 --- a/cognee/modules/search/methods/search.py +++ b/cognee/modules/search/methods/search.py @@ -57,7 +57,7 @@ async def specific_search( SearchType.SUMMARIES: SummariesRetriever().get_completion, SearchType.INSIGHTS: InsightsRetriever().get_completion, SearchType.CHUNKS: ChunksRetriever().get_completion, - SearchType.COMPLETION: CompletionRetriever( + SearchType.RAG_COMPLETION: CompletionRetriever( system_prompt_path=system_prompt_path ).get_completion, SearchType.GRAPH_COMPLETION: GraphCompletionRetriever( diff --git a/cognee/modules/search/types/SearchType.py b/cognee/modules/search/types/SearchType.py index ac2150f02..9c6a84483 100644 --- a/cognee/modules/search/types/SearchType.py +++ b/cognee/modules/search/types/SearchType.py @@ -5,7 +5,7 @@ class SearchType(Enum): SUMMARIES = "SUMMARIES" INSIGHTS = "INSIGHTS" CHUNKS = "CHUNKS" - COMPLETION = "COMPLETION" + RAG_COMPLETION = "RAG_COMPLETION" GRAPH_COMPLETION = "GRAPH_COMPLETION" GRAPH_SUMMARY_COMPLETION = "GRAPH_SUMMARY_COMPLETION" CODE = "CODE" diff --git a/cognee/tests/test_custom_model.py b/cognee/tests/test_custom_model.py index 97d1e6610..fb91c279e 100755 --- a/cognee/tests/test_custom_model.py +++ b/cognee/tests/test_custom_model.py @@ -77,7 +77,7 @@ async def main(): print(completion) # Completion query that uses document chunks to form context. - completion = await cognee.search(SearchType.COMPLETION, "What is Python?") + completion = await cognee.search(SearchType.RAG_COMPLETION, "What is Python?") assert len(completion) != 0, "Completion search didn't return any result." print("Completion result is:") print(completion) diff --git a/notebooks/graphrag_vs_rag.ipynb b/notebooks/graphrag_vs_rag.ipynb index 8cfb49529..29d8db019 100644 --- a/notebooks/graphrag_vs_rag.ipynb +++ b/notebooks/graphrag_vs_rag.ipynb @@ -160,7 +160,7 @@ "metadata": {}, "cell_type": "code", "source": [ - "search_results = await cognee.search(SearchType.COMPLETION, \"Tell me who are the people mentioned?\")\n", + "search_results = await cognee.search(SearchType.RAG_COMPLETION, \"Tell me who are the people mentioned?\")\n", "\n", "print(\"\\n\\nAnswer based on RAG:\\n\")\n", "for result in search_results:\n",