nemoguardrails.actions.actions
Module Contents
Classes
Functions
Data
API
Bases: typing.TypedDict
execute_async
is_system_action
name
output_mapping
Dataclass
Data class representing the result of an action.
context_updates
events
return_value
Decorator to mark a function or class as an action.
Parameters:
is_system_action
Flag indicating if the action is a system action.
name
The name to associate with the action.
execute_async
Whether the function should be executed in async mode.
output_mapping
A function to interpret the action’s result. It accepts the return value (e.g. the first element of a tuple) and return True if the output is not safe.
Returns: Callable[[T], T]
The decorated function or class.