mirror of
https://github.com/VectifyAI/PageIndex.git
synced 2026-07-15 21:11: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
|
|
@ -6,7 +6,7 @@ from typing import Any, Iterator
|
|||
|
||||
import requests
|
||||
|
||||
from .errors import PageIndexAPIError
|
||||
from .errors import AUTH_HINT, PageIndexAPIError
|
||||
|
||||
# Single source of truth for the cloud API base URL — imported by the modern
|
||||
# CloudBackend (as API_BASE) and PageIndexClient so a staging/migration change
|
||||
|
|
@ -47,7 +47,10 @@ class LegacyCloudAPI:
|
|||
raise PageIndexAPIError(f"{error_prefix}: {e}") from e
|
||||
|
||||
if response.status_code != 200:
|
||||
raise PageIndexAPIError(f"{error_prefix}: {response.text}")
|
||||
msg = f"{error_prefix}: {response.text}"
|
||||
if response.status_code == 401:
|
||||
msg += f" — {AUTH_HINT}"
|
||||
raise PageIndexAPIError(msg)
|
||||
return response
|
||||
|
||||
def submit_document(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue