Skip to content

Conversation

@apetraru-uipath
Copy link
Contributor

Simplify Guardrails Service Response Handling

Summary

Simplified the GuardrailsService.evaluate_guardrail() method to prioritize the new API response format while maintaining backwards compatibility with the legacy format.

Changes

Implementation

  • Simplified response parsing logic: The service now checks for the new result field first, then falls back to the legacy validation_passed field for backwards compatibility
  • Removed complex skip field handling: The simplified implementation no longer processes the skip field from legacy responses, as the new API format uses the result field directly

Benefits

  • Cleaner code: Reduced complexity in response parsing logic
  • Better maintainability: Clearer separation between new and legacy API formats
  • Future-ready: Aligned with the new API response format while supporting legacy clients

@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 Jan 15, 2026
@apetraru-uipath apetraru-uipath force-pushed the feat/new_guardrails_result_support branch 3 times, most recently from b679f20 to 4714ae3 Compare January 15, 2026 08:44
@apetraru-uipath apetraru-uipath force-pushed the feat/new_guardrails_result_support branch from 4714ae3 to cf326e8 Compare January 15, 2026 09:56
@apetraru-uipath apetraru-uipath merged commit a04293a into main Jan 15, 2026
89 checks passed
@apetraru-uipath apetraru-uipath deleted the feat/new_guardrails_result_support branch January 15, 2026 10:08
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.

3 participants