From 56e73a9ef1c81941301701732928b44e66089f20 Mon Sep 17 00:00:00 2001 From: Savio Dsouza Date: Wed, 17 Jun 2026 20:26:02 +0530 Subject: [PATCH] Update page_index.py --- pageindex/page_index.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pageindex/page_index.py b/pageindex/page_index.py index 4e0c6b1..19c36fd 100644 --- a/pageindex/page_index.py +++ b/pageindex/page_index.py @@ -847,7 +847,12 @@ async def single_toc_item_index_fixer(section_title, content, model=None): } Directly return the final JSON structure. Do not output anything else.""" - prompt = toc_extractor_prompt + '\nSection Title:\n' + str(section_title) + '\nDocument pages:\n' + content + prompt = ( + __SYSTEM_HARDENING + toc_ectractor_prompt + + '\nSection Title:\n' + _secure_doc_text(str(section_title)) + + '\nDocument pages:\n' + _secure_doc_text(content) + ) + response = await llm_acompletion(model=model, prompt=prompt) json_content = extract_json(response) return convert_physical_index_to_int(json_content['physical_index'])