nemoguardrails.library.self_check.facts.actions

View as Markdown

Module Contents

Functions

NameDescription
mapping_self_check_factsMapping for self_check_facts.
self_check_factsChecks the facts for the bot response by appropriately prompting the base llm.

Data

log

API

nemoguardrails.library.self_check.facts.actions.mapping_self_check_facts(
result: float
) -> bool

Mapping for self_check_facts.

Expects result to be a numeric score (float) representing the factual accuracy. Returns True (i.e. block the output) if the score is below 0.5.

nemoguardrails.library.self_check.facts.actions.self_check_facts(
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 the facts for the bot response by appropriately prompting the base llm.

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