-
Notifications
You must be signed in to change notification settings - Fork 3.1k
feat: local mode for the PageIndex SDK (v0.2.9) #389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
rejojer
wants to merge
36
commits into
main
Choose a base branch
from
sdk-local
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 26 commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
7e7c46a
feat: add local mode to the PageIndex SDK client
rejojer d413de2
chore: package pageindex 0.3.0.dev4 for PyPI
rejojer 3425ae1
docs: add SDK section to README; move the agentic demo onto the SDK
rejojer 26f595e
refactor: rebuild cloud_api on the 0.2.8 client text
rejojer 80fbaf9
refactor: drop the local retrieval endpoints — cloud-only, deprecated
rejojer fd2ba98
feat: manifest.json — one-file document listings for the local store
rejojer cd44ef0
fix: align local doc_id prefix and createdAt format with the cloud
rejojer b9e1955
feat: optional metadata tags on submit_document (both modes)
rejojer 7c1c855
docs: state that createdAt is UTC and show how to localize it
rejojer cc2b352
fix: createdAt carries milliseconds, matching the cloud's datetime(3)
rejojer 319eea2
fix: createdAt at millisecond precision, matching the timestamp(3) co…
rejojer a2aad2c
chore: trim non-essential comments
rejojer d4bf06c
fix: close the local_store crash and corruption holes found in review
rejojer a612527
docs: correct two docstring claims and the pymupdf note
rejojer bffb116
chore: target 0.2.9 for the local-mode release
rejojer ca06874
ci: publish to PyPI on version tags
rejojer 3937da3
chore: tighten the store docstring to essentials
rejojer e6de437
fix: contain invalid-UTF-8 corruption; fail loud on unreadable data f…
rejojer 608c9cc
feat: LocalClient and CloudClient for explicit mode selection
rejojer 7d07924
feat: explicit-mode clients PageIndexCloudClient and PageIndexLocalCl…
rejojer 85482c5
fix local mode edge cases
rejojer 16b7a71
fix: keep the litellm/ prefix normalization the demo depends on
rejojer 3562145
fix: restore the published 0.2.8 helper signatures the cookbooks call
rejojer 871e840
perf: resolve the indexing stack lazily from pageindex/__init__
rejojer 0954f81
fix: wrap PDF read failures in PageIndexAPIError on local submit
rejojer bc71c2f
fix: address code review findings across local mode and publish workflow
rejojer 96a48b0
fix: tighten CI permissions, timestamp format, import style, and docs…
rejojer 75052d4
fix: accept GOOGLE_API_KEY for Gemini; mark pre-releases in GitHub
rejojer c19ba54
fix: preserve print_tree backward compat with 0.2.8 positional call
rejojer a97059c
refactor: print_tree param order — exclude_fields second for 0.2.8 co…
rejojer feb10c0
refactor: remove _require_llm_key pre-check entirely
rejojer 6d1f83d
fix: let LLM provider errors propagate instead of wrapping them
rejojer 75ecbd9
refactor: catch only RuntimeError instead of isinstance check on openai
rejojer 6eb38c1
fix: restore createdAt to 6-digit .177000 format matching cloud DATET…
rejojer e6c0f4a
fix: resolve 15 review findings from PR #389
rejojer 158ce78
fix: close publish workflow injection and detect flash silent summary…
rejojer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| name: Publish to PyPI | ||
|
|
||
| # Release flow (the git tag IS the version — nothing to bump in the repo): | ||
| # 1. git tag -a v0.2.9 -m "Release 0.2.9" | ||
| # 2. git push origin v0.2.9 | ||
| # 3. This workflow derives the version from the tag, injects it into | ||
| # pyproject.toml, builds, publishes to PyPI via OIDC trusted publishing | ||
| # (no stored secret), and creates a GitHub Release with generated notes. | ||
| # | ||
| # The tag must be a PEP 440 version with a leading `v`: | ||
| # v0.2.9 v0.2.9rc1 v0.2.9.dev1 | ||
| # PyPI rejects duplicate version uploads, so each tag must be a new version. | ||
| # Plain `pip install pageindex` skips dev/rc pre-releases — install one | ||
| # explicitly with `pip install pageindex==0.2.9.dev1`. | ||
| # | ||
| # One-time setup this workflow depends on: | ||
| # - PyPI: add a Trusted Publisher on the `pageindex` project pointing at | ||
| # repo VectifyAI/PageIndex, workflow `publish.yml`, environment `pypi`. | ||
| # - GitHub: create an Environment named `pypi` (Settings -> Environments). | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - "v*" | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| python-version: ["3.10", "3.13"] | ||
| name: test py${{ matrix.python-version }} | ||
| timeout-minutes: 15 | ||
| steps: | ||
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | ||
| - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| cache: pip | ||
| - run: pip install -r requirements.txt pytest | ||
| - run: python -m pytest -q | ||
|
|
||
| publish: | ||
| needs: test | ||
| runs-on: ubuntu-latest | ||
| environment: pypi | ||
| permissions: | ||
| id-token: write # OIDC trusted publishing to PyPI | ||
| contents: write # create the GitHub Release | ||
| steps: | ||
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | ||
|
|
||
| - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 | ||
| with: | ||
| python-version: "3.12" | ||
|
|
||
| - name: Set version from tag and build | ||
| run: | | ||
| set -euo pipefail | ||
| python -m pip install --upgrade build packaging | ||
| VERSION="${GITHUB_REF_NAME#v}" | ||
| echo "Publishing version: $VERSION" | ||
| # Fail early on a malformed tag instead of publishing a junk version. | ||
| python -c "from packaging.version import Version; Version('$VERSION')" | ||
| # The git tag is the single source of truth; overwrite the static | ||
| # placeholder in [tool.poetry] so the built artifacts carry $VERSION. | ||
| sed -i "s/^version = .*/version = \"$VERSION\"/" pyproject.toml | ||
| grep '^version = ' pyproject.toml | ||
| python -m build | ||
|
|
||
| - name: Publish to PyPI | ||
| uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # release/v1.14.0 | ||
|
|
||
| - name: Create GitHub Release | ||
| uses: softprops/action-gh-release@718ea10b132b3b2eba29c1007bb80653f286566b # v3.0.1 | ||
| with: | ||
| tag_name: ${{ github.ref_name }} | ||
| name: ${{ github.ref_name }} | ||
| generate_release_notes: true | ||
| files: dist/* | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,3 +4,5 @@ __pycache__ | |
| .env* | ||
| .venv/ | ||
| logs/ | ||
| .pageindex/ | ||
| dist/ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.