Skip to content

fix: enum values in input schema#1422

Merged
cotovanu-cristian merged 1 commit intomainfrom
fix/enum-text-tokens
Mar 6, 2026
Merged

fix: enum values in input schema#1422
cotovanu-cristian merged 1 commit intomainfrom
fix/enum-text-tokens

Conversation

@cotovanu-cristian
Copy link
Collaborator

@cotovanu-cristian cotovanu-cristian commented Mar 6, 2026

Summary

This PR fixes prompt interpolation for enum-backed input fields so the LLM receives the actual enum value instead of the enum member name. In the failing case, risk_tolerance=low was being rendered as DynamicEnum.KEY_0, which
changed the prompt semantics and led to invalid model behavior.

Changes

  • Update prompt argument serialization to unwrap enum-like values before converting them to strings
  • Preserve existing JSON serialization behavior for lists, dicts, and booleans
  • Add a unit test covering string-enum interpolation

Why

Agent prompts must reflect the validated input payload exactly. Passing enum member names instead of their values breaks downstream reasoning and can cause the model to branch incorrectly.

@cotovanu-cristian cotovanu-cristian marked this pull request as ready for review March 6, 2026 20:48
@cotovanu-cristian cotovanu-cristian enabled auto-merge (squash) March 6, 2026 20:49
@github-actions github-actions bot added test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-llamaindex Triggers tests in the uipath-llamaindex-python repository labels Mar 6, 2026
@cotovanu-cristian cotovanu-cristian merged commit 85fba8b into main Mar 6, 2026
80 checks passed
@cotovanu-cristian cotovanu-cristian deleted the fix/enum-text-tokens branch March 6, 2026 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants