Factual Consistency
Ensure AI outputs stay factually consistent. Detect contradictions and improve trustworthiness.
Code Example:
prompt = "Angela Merkel is a politician in Germany and leader of the CDU."
response = "This text is about economics"
evaluator.add_test(
test_names=["factual_consistency_guardrail"],
data={'prompt':prompt,
'response': response,
},
arguments={'model': 'gpt-4', 'threshold': 1.0},
).run()
evaluator.print_results()
Last updated
Was this helpful?

