Repository navigation
feat(context-grounding): read a page range of an indexed document - #1946
Open
SummerWangUiPath wants to merge 1 commit into
Open
SummerWangUiPath wants to merge 1 commit into
SummerWangUiPath wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The additive changes follow existing SDK patterns, include focused coverage, and have no identified blocking issues.
No open issues 🎉
What changed in this PR
Adds deterministic document page-range reading to the UiPath SDK and an opt-in setting for agents to expose a page-reading tool.
Changes:
- Adds synchronous and asynchronous page-reading methods and response models.
- Adds the backward-compatible
readPagessetting and focused tests. - Updates SDK documentation, package versions, and the platform dependency minimum.
| File | Description |
|---|---|
| packages/uipath/uv.lock | Updates SDK and platform versions. |
| packages/uipath/tests/agent/models/test_agent.py | Tests setting defaults, parsing, and serialization. |
| packages/uipath/src/uipath/agent/models/agent.py | Adds the readPages opt-in setting. |
| packages/uipath/src/uipath/_resources/SDK_REFERENCE.md | Documents both page-reading methods. |
| packages/uipath/pyproject.toml | Bumps SDK version and platform dependency minimum. |
| packages/uipath-platform/uv.lock | Updates platform version. |
| packages/uipath-platform/tests/services/test_context_grounding_service.py | Tests requests, responses, headers, and errors. |
| packages/uipath-platform/src/uipath/platform/context_grounding/context_grounding.py | Defines page and page-range response models. |
| packages/uipath-platform/src/uipath/platform/context_grounding/_context_grounding_service.py | Implements synchronous and asynchronous page reads. |
| packages/uipath-platform/src/uipath/platform/context_grounding/__init__.py | Exports the new response models. |
| packages/uipath-platform/pyproject.toml | Bumps platform version. |
Review effort: Balanced
Adds context_grounding.read_pages(_async), which calls ECS POST /v2/indexes/{id}/ReadPages
for one document's pages, and the agent.json context setting readPages that lets an agent
opt into a page-reading tool.
SummerWangUiPath
force-pushed
the
feat/context-read-pages
branch
from
October 19, 2026 18:42
7518eac to
7798971
Compare
🚨 Heads up:
|
|
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.



Why
Agents built on a context index can only search it. When a user names pages ("summarize pages 57 and 58") or a search hit continues on the next page, the agent has no way to read those pages. ECS adds a deterministic page read for one document,
POST /v2/indexes/{indexId}/ReadPages(behind thePageRangeEnabledflag). This PR adds the SDK call for it and theagent.jsonsetting that lets an agent opt into a page-reading tool.What
uipath-platform:context_grounding.read_pages(name, source_document_id, start_page, end_page, folder_key=None, folder_path=None, include_system_indexes=False)andread_pages_async.unified_search, then post{ sourceDocumentId, range: { from, to } }with the folder and job-key headers.page_numberin search results. ECS allows at most 20 per call and validates the range itself.ContextGroundingPageRange:source_document_id,source,reference,pages(ContextGroundingPage:page_number,content),missing_pages(past the end of the document),has_previous,has_next.uipath:AgentContextSettings.read_pages(aliasreadPages, defaultFalse). It's theagent.jsonfield that turns the page tool on for a context, followingsearchDuringIngestion.SDK_REFERENCE.mdlists the two new methods.The consumer side is UiPath/uipath-langchain-python#1163 (a
<context>_read_pagestool next to the context's search tool), which is blocked on this being released.Backward compatibility
agent.jsonwithoutreadPagesreads asFalse, so nothing changes for existing agents.extra="allow"), so the toggle does nothing there; the version pins prevent that combination.Testing
uipath-platform: 3 new tests (5 runs; the 2 async tests run under both anyio backends). They cover the sync and async calls (URL, body, folder and job-key headers, user agent, parsed result) and the 400 path raisingEnrichedException. The full suite passes.uipath: 5 new tests covering the default, alias and field-name parsing, round-trip, and reachingAgentContextResourceConfig. The full suite passes.ruff check,ruff format --check,mypyand the httpx linter are clean for both packages;check_dependency_version_bumps.pypasses.uipath run agent.json) with these packages and the langchain change read pages through the new endpoint and answered from them.Versions
uipath-platform0.2.40 → 0.2.41;uipath2.14.41 → 2.14.42, with itsuipath-platformlower bound raised to 0.2.41.Development Packages
uipath-platform
uipath