diff --git a/cognee/infrastructure/llm/prompts/patch_gen_instructions.txt b/cognee/infrastructure/llm/prompts/patch_gen_instructions.txt new file mode 100644 index 000000000..1553753ab --- /dev/null +++ b/cognee/infrastructure/llm/prompts/patch_gen_instructions.txt @@ -0,0 +1,3 @@ +I need you to solve this issue by looking at the provided knowledge graph and +generating a single patch file that I can apply directly to this repository using git apply. +Please respond with a single patch file in the following format. \ No newline at end of file diff --git a/evals/eval_swe_bench.py b/evals/eval_swe_bench.py index c0ab6d67e..e5b8643c1 100644 --- a/evals/eval_swe_bench.py +++ b/evals/eval_swe_bench.py @@ -12,6 +12,7 @@ from cognee.api.v1.cognify.code_graph_pipeline import code_graph_pipeline from cognee.api.v1.search import SearchType from cognee.infrastructure.databases.graph import get_graph_engine from cognee.infrastructure.llm.get_llm_client import get_llm_client +from cognee.infrastructure.llm.prompts import read_query_prompt from evals.eval_utils import download_instances @@ -29,12 +30,7 @@ async def generate_patch_with_cognee(instance, search_type=SearchType.CHUNKS): graph_str = f.read() problem_statement = instance['problem_statement'] - instructions = ( - "I need you to solve this issue by looking at the provided knowledge graph and by " - + "generating a single patch file that I can apply directly to this repository " - + "using git apply. Please respond with a single patch " - + "file in the following format." - ) + instructions = read_query_prompt("patch_gen_instructions.txt") prompt = "\n".join([ instructions,