nemoguardrails.library.llama_guard.actions
nemoguardrails.library.llama_guard.actions
Module Contents
Functions
Data
API
async
Checks user messages using the configured Llama Guard model and the configured prompt containing the safety guidelines.
async
Check the bot response using the configured Llama Guard model and the configured prompt containing the safety guidelines.
Mapping for llama_guard_check_output.
Returns: bool
True if the response should be blocked (i.e. if “allowed” is False),
Parses the response from the Llama Guard LLM and returns a tuple of:
- Whether the response is safe or not.
- If not safe, a list of the violated policies.