Module: RubyLLM::Tribunal::Assertions::Deterministic

Defined in:
lib/ruby_llm/tribunal/assertions/deterministic.rb

Overview

Deterministic assertions that don't require LLM calls.

Fast, free, and should run first before expensive LLM-based checks.

Class Method Summary collapse

Class Method Details

.evaluate(type, output, opts = {}) ⇒ Array

Evaluates a deterministic assertion.

Examples:

evaluate(:contains, "Hello world", value: "world")
#=> [:pass, { matched: ["world"] }]

Parameters:

  • type (Symbol)

    The assertion type

  • output (String)

    The output to evaluate

  • opts (Hash) (defaults to: {})

    Options for the assertion

Returns:

  • (Array)

    [:pass, details] or [:fail, details]



21
22
23
# File 'lib/ruby_llm/tribunal/assertions/deterministic.rb', line 21

def evaluate(type, output, opts = {})
  send(:"evaluate_#{type}", output, opts)
end