nemoguardrails.library.patronusai.actions
Module Contents
Functions
Data
API
Check if evaluations in the Patronus API response pass based on the success strategy. “all_pass” requires all evaluators to pass for success. “any_pass” requires only one evaluator to pass for success.
Parses the response from the Patronus Lynx LLM and returns a tuple of:
- Whether the response is hallucinated or not.
- A reasoning trace explaining the decision.
Check the user message, bot response, and/or provided context for issues based on the Patronus Evaluate API
Mapping for patronus_api_check_output.
Block (return True) if “pass” is False.
Make a call to the Patronus Evaluate API.
Returns a dictionary of the API response JSON if successful, or None if a server error occurs.
- Server errors will cause the guardrail to block the bot response
Raises a ValueError for client errors (400-499), as these indicate invalid requests.
Check the bot response for hallucinations based on the given chunks using the configured Patronus Lynx model.
Mapping for patronus_lynx_check_output_hallucination.
Block (return True) if “hallucination” is True.