mirror of
https://github.com/VectifyAI/PageIndex.git
synced 2026-07-18 21:21:05 +02:00
fix: address max-effort review findings
- clamp LLM-derived page indices in _get_text_of_pages and get_text_of_pdf_pages_with_labels; dedupe get_text_of_pdf_pages - guard _normalize_tree and folders/documents iterations against explicit nulls in cloud API responses - coerce cloud OCR page numbers to int before filtering in get_page_content - folder cache: raise on missing folder id instead of caching None; stop caching name-not-found so later lookups can succeed - defang doc_id in agent doc-context prompt - append api-key hint to 401 errors (request, legacy and streaming paths) - remove stale legacy JSON workspace sample data unreadable by the SQLite storage
This commit is contained in:
parent
9ad54122bb
commit
3ff04d501a
7 changed files with 70 additions and 323 deletions
|
|
@ -65,7 +65,7 @@ def wrap_with_doc_context(docs: list[dict], question: str) -> str:
|
|||
"""
|
||||
lines = []
|
||||
for d in docs:
|
||||
line = f"- {d['doc_id']}: {_defang_delimiters(d.get('doc_name', ''))}"
|
||||
line = f"- {_defang_delimiters(str(d['doc_id']))}: {_defang_delimiters(d.get('doc_name', ''))}"
|
||||
desc = d.get("doc_description") or ""
|
||||
if desc:
|
||||
line += f" — {_defang_delimiters(desc)}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue