Skip to content

feat: add set_conversational_output tool + generate-output prompt for conversational agents#1785

Merged
maxduu merged 7 commits into
mainfrom
convo-agent-output
Jul 7, 2026
Merged

feat: add set_conversational_output tool + generate-output prompt for conversational agents#1785
maxduu merged 7 commits into
mainfrom
convo-agent-output

Conversation

@maxduu

@maxduu maxduu commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Two additive changes in uipath/agent/react/:

  1. New flow-control tool definition set_conversational_output — a framework-internal tool bound by the langchain runtime's GENERATE_CONVERSATIONAL_OUTPUT node to reliably extract structured output fields from a conversational agent's turn. Mirrors the existing end_execution/raise_error shape.
  2. New generate-output instruction prompt — the framework-internal HumanMessage appended to the extraction LLM call, telling the model to fill the tool's args from the conversation with per-turn priority and "N/A"-placeholder rules for un-yet-determinable required fields.

Context

Part of a four-PR series enabling reliable structured-output extraction for conversational agents. This PR only adds primitives to `uipath`; the graph wiring lives in uipath-langchain, the runtime gating in uipath-agents, and the FPS field in uipath-runtime.

Related PRs

Part of a coordinated four-repo change. Each PR is independently reviewable, but they land together:

Test plan

  • `uv run pytest packages/uipath/tests/agent/react/test_conversational_prompts.py` (26 tests pass)
  • `ruff check` + `ruff format --check` clean

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.

Pull request overview

Adds framework primitives in uipath.agent.react to support reliable structured-output extraction for conversational agents by introducing a new flow-control tool (set_conversational_output) and a dedicated generate-output instruction prompt used during extraction.

Changes:

  • Added SET_CONVERSATIONAL_OUTPUT_TOOL (and supporting enum + placeholder schema model) to the ReAct flow-control tool set.
  • Added _GENERATE_OUTPUT_INSTRUCTION + get_generate_output_prompt() to provide an internal instruction prompt for structured-output extraction.
  • Added tests validating the presence and key constraints of the generate-output prompt.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
packages/uipath/src/uipath/agent/react/tools.py Adds the new flow-control tool name, placeholder args schema model, and exported tool config.
packages/uipath/src/uipath/agent/react/conversational_prompts.py Adds the generate-output instruction constant and accessor used during structured-output extraction.
packages/uipath/src/uipath/agent/react/init.py Exports the new tool constant, schema model, and prompt accessor.
packages/uipath/tests/agent/react/test_conversational_prompts.py Adds tests for the new generate-output prompt accessor.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/uipath/tests/agent/react/test_conversational_prompts.py Outdated
Comment thread packages/uipath/src/uipath/agent/react/conversational_prompts.py Outdated
Comment thread packages/uipath/src/uipath/agent/react/tools.py
@maxduu maxduu force-pushed the convo-agent-output branch from 0aeaf50 to bf12bff Compare July 7, 2026 17:04
@sonarqubecloud

sonarqubecloud Bot commented Jul 7, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Jul 7, 2026

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 →

@maxduu maxduu changed the title feat: add set_conversational_output tool + generate-output prompt for conversational agents feat: add set_conversational_output tool + generate-output prompt for conversational agents Jul 7, 2026
@maxduu maxduu merged commit b8d2f65 into main Jul 7, 2026
161 of 164 checks passed
@maxduu maxduu deleted the convo-agent-output branch July 7, 2026 17:39
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