From 2f74727bb980c6ef40689f47d2c6a4c1f889f34f Mon Sep 17 00:00:00 2001 From: Kevin Hu Date: Mon, 25 Aug 2025 09:41:52 +0800 Subject: [PATCH] Fix: meta data error. (#9670) ### What problem does this PR solve? ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- graphrag/general/index.py | 2 +- rag/prompts/prompts.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/graphrag/general/index.py b/graphrag/general/index.py index 345f83850..ac7fb9607 100644 --- a/graphrag/general/index.py +++ b/graphrag/general/index.py @@ -57,7 +57,7 @@ async def run_graphrag( ): chunks.append(d["content_with_weight"]) - with trio.fail_after(max(120, len(chunks)*120)): + with trio.fail_after(max(120, len(chunks)*60*10)): subgraph = await generate_subgraph( LightKGExt if "method" not in row["kb_parser_config"].get("graphrag", {}) or row["kb_parser_config"]["graphrag"]["method"] != "general" diff --git a/rag/prompts/prompts.py b/rag/prompts/prompts.py index 1e6255b35..40750a1ef 100644 --- a/rag/prompts/prompts.py +++ b/rag/prompts/prompts.py @@ -114,6 +114,8 @@ def kb_prompt(kbinfos, max_tokens, hash_id=False): docs = {d.id: d.meta_fields for d in docs} def draw_node(k, line): + if line is not None and not isinstance(line, str): + line = str(line) if not line: return "" return f"\nā”œā”€ā”€ {k}: " + re.sub(r"\n+", " ", line, flags=re.DOTALL)