Skip to content

feat(context-grounding): add start_batch_transform_from_attachment primitive - #1920

Merged
cfauchere merged 5 commits into
mainfrom
feat/batch-transform-from-attachment
Sep 29, 2026
Merged

cfauchere merged 5 commits into
mainfrom
feat/batch-transform-from-attachment

Conversation

@cfauchere

Copy link
Copy Markdown
Contributor

What

Adds a single-call primitive that creates the ephemeral index and starts the Batch Transform task in one server operation, mirroring the DeepRag from-attachments shape from #1872. Callers no longer need to create the index separately and wait for ingestion before starting the task.

Changes

  • New SDK methods start_batch_transform_from_attachment(_async) on ContextGroundingService, hitting POST /ecs_/v2/batchrag/create (vdbs BatchRagController.CreateAsync — the collection-level Create action registered in the OData model).
  • CreateBatchTransform interrupt model gains an optional attachment: str field; the ephemeral-index validator now accepts attachment as an alternative to index_id, and rejects combining attachment with index_id/index_name.
  • UiPathResumeTriggerCreator dispatches to the new SDK method when CreateBatchTransform.attachment is set; the existing start_batch_transform_ephemeral_async / start_batch_transform_async paths are untouched (both marked @deprecated).

Why

The two-step flow (create ephemeral index → wait for ingestion → create Batch Transform task) collapses into one server call.

Notes

  • vdbs BatchRagAdhocCreateRequest.Attachments is a List<Guid> but validated as exactly one entry, so the SDK argument is single (attachment: str) and wrapped into [attachment] at the boundary.
  • Endpoint URL is POST /ecs_/v2/batchrag/create based on vdbs' OData config (EnableUnqualifiedOperationCall = true + the collection action Create on the BatchRag entity set). Worth a smoke test against a running vdbs before merge to confirm the route resolves.

…imitive

Adds a single-call primitive that creates the ephemeral index and starts the
Batch Transform task in one server operation, mirroring the DeepRag from-attachments
shape from #1872.

Changes
- New SDK methods start_batch_transform_from_attachment(_async) on
  ContextGroundingService, hitting POST /ecs_/v2/batchrag/create (vdbs'
  BatchRagController.CreateAsync, collection-level Create action).
- CreateBatchTransform interrupt model gains an optional attachment: str field;
  the validator rejects combining it with index_id or index_name.
- UiPathResumeTriggerCreator dispatches to the new SDK method when
  CreateBatchTransform.attachment is set; existing start_batch_transform_ephemeral
  and start_batch_transform_async paths are untouched (deprecated).

Note
The vdbs endpoint takes a list on the wire but validates exactly one attachment,
so the SDK argument is single (attachment: str) and gets wrapped into a list of
one at the boundary.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@github-actions github-actions Bot added test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-integrations labels Sep 29, 2026
@cfauchere
cfauchere marked this pull request as ready for review September 29, 2026 19:57
Copilot AI balanced review requested due to automatic review settings September 29, 2026 19:57

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

Domain exclusions are incorrectly transmitted when web-search grounding is disabled.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Adds one-call Batch Transform creation from an attachment, integrating it with resume triggers.

Changes:

  • Adds synchronous and asynchronous attachment-based service methods.
  • Extends interrupt validation and dispatch.
  • Adds tests and bumps uipath-platform to 0.2.33.
File Description
packages/​uipath/​uv.lock Updates platform dependency version.
packages/​uipath-platform/​uv.lock Updates package lock version.
packages/​uipath-platform/​pyproject.toml Bumps package version.
packages/​uipath-platform/​src/​uipath/​platform/​common/​interrupt_models.py Adds attachment support and validation.
packages/​uipath-platform/​src/​uipath/​platform/​context_grounding/​_context_grounding_service.py Implements the new service calls.
packages/​uipath-platform/​src/​uipath/​platform/​resume_triggers/​_protocol.py Dispatches attachment-based transforms.
packages/​uipath-platform/​tests/​services/​test_context_grounding_service.py Tests request construction and responses.
packages/​uipath-platform/​tests/​services/​test_hitl.py Tests trigger routing and validation.

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

…ing on

Makes the server-side contract explicit in the docstrings: exclude_domains
requires enable_web_search_grounding=True; the server rejects the combination
otherwise (BatchRagAdhocCreateRequest.Validate).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
output_columns: List[BatchTransformOutputColumn],
attachment: str,
enable_web_search_grounding: bool = False,
exclude_domains: Optional[List[str]] = None,

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.

We don't expose exclude_domains in the other batch transform create methods. seems a little inconsistent. should we add it to them? does the other api support it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch — the API supports it on both endpoints, the SDK just never plumbed it through the on-index path. Added exclude_domains to start_batch_transform / _async in 16f96b2 so the two live methods are aligned. Deprecated _ephemeral variants left as-is.

output_columns (list[BatchTransformOutputColumn]): The output columns to add into the csv.
attachment (str): The attachment id to transform. Exactly one attachment is supported today.
enable_web_search_grounding (bool): Whether to enable web search. Defaults to False.
exclude_domains (list[str], optional): Domains to exclude from web search grounding.

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.

domain is a little vague maybe. should we add an example like wikipedia.org? not sure if it would get rejected if you include the www or if adding /subpage onto the end is supported

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The specifics (www prefix, subpaths) are server-side validation on vdbs; I'd rather not document them here since they can drift. The field name conveys the concept, and the server returns a clear 400 on invalid entries.

Clement Fauchere and others added 3 commits September 29, 2026 15:46
Closes the SDK gap flagged in review: vdbs' BatchRagCreateRequest accepts
excludeDomains on the on-index create endpoint too, but the SDK never plumbed
it through. Adds the parameter to start_batch_transform / _async so the new
from-attachment primitive isn't the only path that exposes it.

Server-side validation stays authoritative: excludeDomains requires
enable_web_search_grounding=True; the server rejects the combination
otherwise. Documented in the docstring.

Deprecated _ephemeral variants left as-is.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
CLI/SDK alignment test caught this: the SDK now exposes exclude_domains on
start_batch_transform, so the CLI's context-grounding batch-transform start
command has to expose it too.

Adds --exclude-domain (repeatable click.option(multiple=True)) that maps to
the SDK's list[str] argument.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
CI check-dependency-bumps flagged that uipath still pinned
uipath-platform>=0.2.31 while this PR bumped uipath-platform to 0.2.33 — a
standalone install of uipath could otherwise resolve an older uipath-platform
that doesn't have the from-attachment primitive. Raises the pin to >=0.2.33.

CI check-versions flagged that packages/uipath had CLI changes without a
version bump; 2.14.26 -> 2.14.27.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

🚨 Heads up: uipath-langchain cross-tests are FAILING 🚨

Your changes may break the uipath-langchain-python integration.

⚠️ These checks are NOT enforced by branch protection rules. Please review the failures before merging.

🔍 Inspect the failed run →

@sonarqubecloud

Copy link
Copy Markdown

@cfauchere
cfauchere merged commit 841e97e into main Sep 29, 2026
182 checks passed
@cfauchere
cfauchere deleted the feat/batch-transform-from-attachment branch September 29, 2026 22:01
ashishupadhyay88 added a commit that referenced this pull request Sep 30, 2026
main released 0.2.33 (#1920), so this PR moves to the next version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 test:uipath-runtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants