chore: trim non-essential comments

This commit is contained in:
Ray 2026-07-24 03:32:27 +08:00
parent 3bde8fe46e
commit b43b56ed04
5 changed files with 4 additions and 25 deletions

View file

@ -9,8 +9,6 @@ _chatgpt_key = _os.getenv("CHATGPT_API_KEY")
if not _os.getenv("OPENAI_API_KEY") and _chatgpt_key:
_os.environ["OPENAI_API_KEY"] = _chatgpt_key
# Legacy (pre-SDK) exports. Cheap to import eagerly: litellm/PyPDF2 load
# inside the functions that use them, not at module import.
from .index.page_index import * # noqa: E402
from .index.page_index_md import md_to_tree
from .retrieve import get_document, get_document_structure, get_page_content
@ -71,8 +69,6 @@ __all__ = [
def __getattr__(name):
# `pageindex.utils` / `pageindex.page_index_md` attribute access without an
# explicit submodule import.
if name in ("utils", "page_index_md"):
import importlib
return importlib.import_module(f".{name}", __name__)

View file

@ -1,8 +1,4 @@
# pageindex/page_index.py
# Compatibility shim. The PDF indexing pipeline now lives in
# pageindex/index/page_index.py (the single source of truth). This module
# re-exports it so legacy imports (`from pageindex.page_index import ...`,
# `from pageindex import page_index`) keep working.
# pageindex/page_index.py — re-exports from index/page_index.py
import sys
import types
from .index.page_index import * # noqa: F401,F403,E402

View file

@ -1,9 +1,2 @@
# pageindex/page_index_md.py
# Compatibility shim. The Markdown indexing pipeline now lives in
# pageindex/index/page_index_md.py (the single source of truth). This module
# re-exports it so legacy imports keep working.
#
# The canonical md_to_tree coerces legacy 'yes'/'no' string flags itself (a
# bare 'no' would otherwise be truthy) — this shim used to duplicate that
# coercion in its own wrapper; now it just re-exports the canonical function.
# pageindex/page_index_md.py — re-exports from index/page_index_md.py
from .index.page_index_md import * # noqa: F401,F403,E402

View file

@ -1,8 +1,5 @@
# pageindex/tokens.py
# Leaf utility so both the parser and index layers can count tokens without
# the parser reaching back into pageindex.index (a reverse/horizontal
# dependency). Depends only on litellm (imported lazily — it's several
# seconds and a network fetch, and cloud-only paths never need it).
# Shared by parser and index layers (avoids a reverse dependency).
def count_tokens(text, model=None):

View file

@ -1,7 +1,4 @@
# pageindex/utils.py
# Compatibility shim. The indexing utilities now live in pageindex/index/utils.py,
# which is the single source of truth. This module re-exports them so legacy
# imports (`from pageindex.utils import ...`) keep working.
# pageindex/utils.py — re-exports from index/utils.py
from .index.utils import * # noqa: F401,F403,E402
# Legacy 0.2.x alias. index.utils keeps it private (_config) so its star-export
# can't shadow the pageindex.config submodule; re-expose it only in this shim.