The factuality rule is used to verify the accuracy of the LLM generated content against a set of references of known facts or trusted sources.

Parameters:

  • type: factuality (specifies the rule type)
  • value: An array of known facts or statements to check against
  • expected: Usually set to pass to ensure the content aligns with the provided facts
  • threshold: A number between 0 and 1 representing the confidence level for factual accuracy (e.g., 0.9 for 90% confidence)