Skip to content

feat(documents): move the documents service to DU Framework v2 - #1929

Open
alexandrujircan wants to merge 2 commits into
mainfrom
feat/documents-framework-v2
Open

alexandrujircan wants to merge 2 commits into
mainfrom
feat/documents-framework-v2

Conversation

@alexandrujircan

Copy link
Copy Markdown
Collaborator

Summary

  • DocumentsService now calls DU Framework with api-version=2.0, and the tag-based routes use the v2 shape projects/{id}/tags/{tag}/...
  • responses are accepted in camelCase or PascalCase. v2 returns PascalCase for orgs that have du-enable-v2-pascal-case-responses on. Document Processing payloads (ExtractionResult, ClassificationResult) are passed through unchanged
  • URL path segments are percent-encoded, so a tag supplied by a user or an LLM can no longer add path segments
  • allowChangeOfDocumentType is now sent inside the validation configuration, which is where v2 expects it
  • FieldType gains FieldGroup and MonetaryQuantity. IXP v2 returns both, and without them parsing data_projection fails
  • uipath-platform 0.2.34 → 0.2.35

Method signatures and return types are unchanged.

What SDK users will notice

These come from the Framework v2 contract:

  • field IDs are prefixed with the document type or group, e.g. Invoices.name, Default.Invoice.InvoiceNumber. Code that looks fields up by FieldId has to switch to FieldName, which is unchanged
  • IXP results use FieldGroup instead of Table → Header/Body
  • data_projection has one entry per field group instead of one per table row
  • Validation Station opens in Compact mode instead of Classic

Framework issues found (not fixed here)

  • v2 data_projection drops rows of multi-value groups. On alpha, a bank statement with 19 transactions has 1 in data_projection, while v1.1 returns all 19. CreateFromExtractionResultV2 takes only the first value. All rows are still in extraction_result.results_document.
  • The validated data_projection is likely empty for IXP v2. ValidationService.cs still builds it with the v1 builder, which only looks for Table fields.

Testing

  • Unit tests:
    • updated every URL mock and validation-body check to the v2 shapes
    • added tests for PascalCase responses (classify, IXP extraction, validation polling), IXP v2 FieldGroup/MonetaryQuantity results, and tag percent-encoding
    • the new tests fail with the normalization or the encoding removed
  • uipath-platform: 1782 passed, ruff clean, mypy clean
  • Live on an alpha tenant that has PascalCase responses on. Everything passed:
    • classify and extract on Pretrained, Modern (tag and version) and IXP (tag and version)
    • IXP start and retrieve
    • IXP extraction validation, and Modern classification validation by tag
    • 4 IXP bench templates

🤖 Generated with Claude Code

- send api-version=2.0 and use the v2 tags/{tag} routes
- read PascalCase responses, which v2 returns for orgs with
  du-enable-v2-pascal-case-responses on
- percent-encode URL path segments, so a tag cannot change the route
- send allowChangeOfDocumentType inside the validation configuration
- add the FieldGroup and MonetaryQuantity field types returned by IXP v2

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 7, 2026 09:43
@github-actions github-actions Bot added test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-integrations labels Oct 7, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The downstream packages/uipath/uv.lock remains pinned to 0.2.34 and can break its propagated locked CI job.

Review effort: Balanced
Findings: 1 High severity · 1 Low severity

Open (2)
What changed in this PR

Migrates DocumentsService to DU Framework v2 while preserving existing APIs.

Changes:

  • Updates v2 routes, response casing normalization, and URL encoding.
  • Adds v2 field types and validation configuration.
  • Expands tests and bumps the package version.
File Description
packages/​uipath-platform/​src/​uipath/​platform/​documents/​_documents_service.py Implements Framework v2 requests and normalization.
packages/​uipath-platform/​src/​uipath/​platform/​documents/​documents.py Adds v2 field types and documentation.
packages/​uipath-platform/​tests/​services/​test_documents_service.py Updates and expands v2 coverage.
packages/​uipath-platform/​tests/​services/​tests_data/​documents_service/​ixp_extraction_response_v2.json Adds an IXP v2 response fixture.
packages/​uipath-platform/​pyproject.toml Bumps the package version.
packages/​uipath-platform/​uv.lock Updates the local locked package version.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread packages/uipath-platform/pyproject.toml
Comment thread packages/uipath-platform/src/uipath/platform/documents/documents.py Outdated
… async

- pick versioned or tagged routes in one helper per route family instead of
  repeating the branch in every sync and async method
- share the operation status check between the sync and async retrieve
- regenerate the uipath lockfile for uipath-platform 0.2.35
- document that field IDs are prefixed by document type and field group

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@sonarqubecloud

sonarqubecloud Bot commented Oct 7, 2026

Copy link
Copy Markdown

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:uipath-integrations test:uipath-langchain Triggers tests in the uipath-langchain-python repository

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants