From 93d0a9c59108ece48f9329a4175757fe586bf877 Mon Sep 17 00:00:00 2001 From: Omar Safwat <64784749+amoor22@users.noreply.github.com> Date: Sat, 3 May 2025 15:37:45 +0400 Subject: [PATCH] Fix missing function parameter in search.py In the `_reduce_response` function, a format call is made on the `self.reduce_system_prompt` string which contains a placeholder for `max_length` which is not provided in the format call. --- graphrag/query/structured_search/global_search/search.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphrag/query/structured_search/global_search/search.py b/graphrag/query/structured_search/global_search/search.py index b7f75a43ee..12c31bf4ad 100644 --- a/graphrag/query/structured_search/global_search/search.py +++ b/graphrag/query/structured_search/global_search/search.py @@ -371,7 +371,7 @@ async def _reduce_response( text_data = "\n\n".join(data) search_prompt = self.reduce_system_prompt.format( - report_data=text_data, response_type=self.response_type + report_data=text_data, response_type=self.response_type, max_length=self.reduce_max_length ) if self.allow_general_knowledge: search_prompt += "\n" + self.general_knowledge_inclusion_prompt