nemoguardrails.library.autoalign.actions
Module Contents
Functions
Data
API
Calls Autoalign Factchecker API and checks if the user message is factually answered by the bot message
Scores below factcheck_threshold block. Configuration, transport,
status, and response parsing failures propagate to the caller.
Parameters:
Task manager containing the AutoAlign configuration.
Runtime context containing the user and bot messages.
Minimum score required to allow the response.
Whether to log detected violations.
Optional caller-owned HTTP client.
Returns: RailOutcome
An allow or block outcome containing the score and threshold.
Checks the groundedness for the text using the given documents and provides a fact-checking score
Calls AutoAlign groundedness check API and checks whether the bot message is factually grounded according to given documents
Scores below factcheck_threshold block. Configuration, transport,
status, and response parsing failures propagate to the caller.
Parameters:
Task manager containing the AutoAlign configuration.
Runtime context containing the bot message and documents.
Minimum score required to allow the response.
Whether to log detected violations.
Optional caller-owned HTTP client.
Additional action parameters.
Returns: RailOutcome
An allow or block outcome containing the score and threshold.
Checks whether the given text passes through the applied guardrails.
Calls AutoAlign API for the user message and guardrail configuration provided
Guardrail matches block, PII redactions transform the user message, and other results allow it. Configuration, transport, status, and response parsing failures propagate to the caller.
Parameters:
Task manager containing the AutoAlign configuration.
Runtime context containing the user message.
Whether to log detected violations.
Whether violation messages include toxic phrases.
Optional caller-owned HTTP client.
Additional action parameters.
Returns: RailOutcome
An allow, block, or user-message transform outcome.
Calls AutoAlign API for the bot message and guardrail configuration provided
Guardrail matches block, PII redactions transform the bot message, and other results allow it. Configuration, transport, status, and response parsing failures propagate to the caller.
Parameters:
Task manager containing the AutoAlign configuration.
Runtime context containing the bot message.
Whether to log detected violations.
Whether violation messages include toxic phrases.
Optional caller-owned HTTP client.
Additional action parameters.
Returns: RailOutcome
An allow, block, or bot-message transform outcome.
Processes the output provided AutoAlign API