From fe049b0555a719eafdb2b9abcc450b57661dce85 Mon Sep 17 00:00:00 2001 From: Cristiano Hoshikawa Date: Fri, 9 Jan 2026 23:13:51 -0300 Subject: [PATCH] first commit --- files/graphrag_rerank.py | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/files/graphrag_rerank.py b/files/graphrag_rerank.py index 308b595..fd144e8 100644 --- a/files/graphrag_rerank.py +++ b/files/graphrag_rerank.py @@ -617,16 +617,22 @@ def chat(): Graph evidence: {graph_context} - Rules: + Decision rules: - Answer ONLY with YES, NO or PARTIAL - Do NOT assume anything not explicitly stated - If value differs, answer PARTIAL - If not found, answer NO - Return ONLY valid JSON: + OUTPUT CONSTRAINTS (MANDATORY): + - Return ONLY a valid JSON object + - Do NOT include explanations, comments, markdown, lists, or code fences + - Do NOT write any text before or after the JSON + - The response must start with an opening curly brace and end with a closing curly brace + + JSON schema (return exactly this structure): {{ "answer": "YES | NO | PARTIAL", - "justification": "", + "justification": "", "evidence": [ {{ "quote": "", @@ -763,16 +769,22 @@ Document evidence: Graph evidence: {graph_context} -Rules: +Decision rules: - Answer ONLY with YES, NO or PARTIAL - Do NOT assume anything not explicitly stated - If value differs, answer PARTIAL - If not found, answer NO -Return ONLY valid JSON: +OUTPUT CONSTRAINTS (MANDATORY): +- Return ONLY a valid JSON object +- Do NOT include explanations, comments, markdown, lists, or code fences +- Do NOT write any text before or after the JSON +- The response must start with an opening curly brace and end with a closing curly brace + +JSON schema (return exactly this structure): {{ "answer": "YES | NO | PARTIAL", - "justification": "", + "justification": "", "evidence": [ {{ "quote": "",