nemoguardrails.library.self_check.output_check.actions

View as Markdown

Module Contents

Functions

NameDescription
self_check_outputChecks if the output from the bot.

Data

log

API

nemoguardrails.library.self_check.output_check.actions.self_check_output(
llm_task_manager: nemoguardrails.llm.taskmanager.LLMTaskManager,
context: typing.Optional[dict] = None,
llm: typing.Optional[nemoguardrails.types.LLMModel] = None,
config: typing.Optional[nemoguardrails.RailsConfig] = None,
kwargs = {}
)
async

Checks if the output from the bot.

Prompt the LLM, using the self_check_output task prompt, to determine if the output from the bot should be allowed or not.

The LLM call should return “yes” if the output is bad and should be blocked (this is consistent with self_check_input_prompt).

Returns:

True if the output should be allowed, False otherwise.

nemoguardrails.library.self_check.output_check.actions.log = logging.getLogger(__name__)