Update page_index.py

This commit is contained in:
Savio Dsouza 2026-06-17 20:26:02 +05:30 committed by GitHub
parent 150d3aa28c
commit 56e73a9ef1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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'])