feat: add set_conversational_output tool + generate-output prompt for conversational agents#1785
Conversation
There was a problem hiding this comment.
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.
0aeaf50 to
bf12bff
Compare
|
🚨 Heads up:
|
set_conversational_output tool + generate-output prompt for conversational agents


Summary
Two additive changes in
uipath/agent/react/:set_conversational_output— a framework-internal tool bound by the langchain runtime'sGENERATE_CONVERSATIONAL_OUTPUTnode to reliably extract structured output fields from a conversational agent's turn. Mirrors the existingend_execution/raise_errorshape."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:
conversationalService.enableOutputsFPS flag onUiPathRuntimeContext.set_conversational_outputflow-control tool + generate-output prompt primitives.GENERATE_CONVERSATIONAL_OUTPUTgraph node, router path, and terminate extraction (the main change).Test plan