nemoguardrails.actions.output_mapping
nemoguardrails.actions.output_mapping
Module Contents
Functions
API
A fallback output mapping if an action does not provide one.
- For a boolean result: assume True means allowed (so block if False).
- For a numeric result: use 0.5 as a threshold (block if the value is less).
- Otherwise, assume the result is allowed.
Determines if an action result is not allowed using its attached mapping.
Parameters:
result
The value returned by the action.
action_func
The action function (whose metadata contains the mapping).
Returns: bool
True if the mapping indicates that the output should be blocked, False otherwise.