Skip to content

Conversation

@Pouyanpi
Copy link
Collaborator

@Pouyanpi Pouyanpi commented Feb 2, 2025

Unified Output Mapping for Action Responses

This PR introduces a unified mechanism for interpreting the outputs of various actions by adding dedicated mapping functions. These mapping functions determine whether an action’s response should trigger a block (e.g., refuse to respond) based on consistent thresholds and criteria.

Why?

Output mapping is essential because our actions currently return heterogeneous result types and semantics, making it challenging to consistently determine whether an action’s output should be blocked or not.

Key Changes:

  • The @action decorator has been extended to accept an optional output_mapping parameter. This mapping is stored in the action’s metadata and is used to interpret the result of the action.
  • mapping functions added to all actions in the guardrails library
  • adding kwargs arg to all actions
  • adding tests

@Pouyanpi Pouyanpi changed the base branch from develop to feat/output-rails-streaming-mvp February 2, 2025 17:47
@Pouyanpi Pouyanpi requested a review from cparisien February 2, 2025 17:49
@Pouyanpi Pouyanpi mentioned this pull request Feb 2, 2025
6 tasks
@Pouyanpi Pouyanpi changed the base branch from feat/output-rails-streaming-mvp to develop February 3, 2025 07:28
@Pouyanpi
Copy link
Collaborator Author

Pouyanpi commented Feb 3, 2025

required by #966

Copy link
Collaborator Author

@Pouyanpi Pouyanpi left a comment

Choose a reason for hiding this comment

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

need to make a change to one function name

@Pouyanpi Pouyanpi force-pushed the feat/guardrails-library-output-mapping branch from 7cf2d1a to 608bb45 Compare February 3, 2025 10:19
@Pouyanpi Pouyanpi self-assigned this Feb 3, 2025
@Pouyanpi Pouyanpi added enhancement New feature or request status: in review labels Feb 3, 2025
@Pouyanpi Pouyanpi merged commit c58f262 into develop Feb 3, 2025
6 checks passed
@Pouyanpi Pouyanpi mentioned this pull request Mar 21, 2025
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request status: in review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants