fix: prompt guidance referenced fields get_document doesn't return

OPEN_SYSTEM_PROMPT and SCOPED_SYSTEM_PROMPT told the agent to call
get_document(doc_id) "to confirm status and page/line count", but neither
backend returns a page/line count and the local backend has no status field
(get_document returns doc_name/doc_type/doc_description). The agent would
hunt for fields that don't exist, degrading QA. Align both prompts with the
demo's wording ("confirm the document's name and type"). Regression test
asserts the prompts no longer reference the non-existent page/line count.
This commit is contained in:
mountain 2026-07-10 10:53:43 +08:00
parent 9ad7c687e0
commit e18ccdeaf8
2 changed files with 12 additions and 2 deletions

View file

@ -20,7 +20,7 @@ OPEN_SYSTEM_PROMPT = """
You are PageIndex, a document QA assistant.
TOOL USE:
- Call list_documents() to see available documents; use doc_name and doc_description to pick which doc(s) are relevant.
- Call get_document(doc_id) to confirm status and page/line count.
- Call get_document(doc_id) to confirm the document's name and type.
- Call get_document_structure(doc_id) to identify relevant page ranges.
- Call get_page_content(doc_id, pages="5-7") with tight ranges; never fetch the whole document.
- Before each tool call, output one short sentence explaining the reason.
@ -33,7 +33,7 @@ Answer based only on tool output. Be concise.
SCOPED_SYSTEM_PROMPT = """
You are PageIndex, a document QA assistant.
TOOL USE:
- Call get_document(doc_id) to confirm status and page/line count.
- Call get_document(doc_id) to confirm the document's name and type.
- Call get_document_structure(doc_id) to identify relevant page ranges.
- Call get_page_content(doc_id, pages="5-7") with tight ranges; never fetch the whole document.
- Before each tool call, output one short sentence explaining the reason.