Fact Checking Predicates
has_facts
Check if actual text contains all facts from reference.actual- Text to checkreference- Facts that should be presentstrict- Require explicit statements (default: False)
Trueif all reference facts are in actual,Falseotherwise
has_unsupported_facts
Detect hallucinations - facts in actual not supported by reference.actual- Text to check for unsupported factsreference- Source of truthstrict- Require explicit statements (default: False)
Trueif actual contains unsupported facts,Falseotherwise
has_conflicting_facts
Check if actual text contradicts reference.actual- Text to checkreference- Source of truthstrict- Require explicit statements (default: False)
Trueif actual contradicts reference,Falseotherwise
matches_facts
Bidirectional fact matching - both texts should have same facts.actual- Text to checkreference- Expected factsstrict- Require explicit statements (default: False)
Trueif both texts contain same facts,Falseotherwise
Topics & Policy Predicates
has_topics
Check if text discusses all required topics.actual- Text to checktopics- Comma-separated list of required topicsstrict- Require explicit mentions (default: False)
Trueif all topics are covered,Falseotherwise
follows_policy
Check if text complies with specified policies.actual- Text to checkpolicy- Policy requirements (natural language)strict- Require strict compliance (default: False)
Trueif text follows policy,Falseotherwise
Style & Structure Predicates
matches_writing_style
Check if two texts have similar writing style.actual- Text to checkreference- Style examplestrict- Require close match (default: False)
Trueif styles match,Falseotherwise
matches_writing_layout
Check if two texts have similar document structure.actual- Text to checkreference- Structure templatestrict- Require exact structure (default: False)
Trueif structures match,Falseotherwise
Predicate Base Classes
Predicate
Base class for custom predicates.PredicateResult
Result object from predicate evaluation.passed- Whether assertion passedscore- Numerical score (0.0-1.0)confidence- Confidence in evaluationmessage- Error message if failedreasoning- Explanation (if enabled)