rageval - v0.1.1
    Preparing search index...

    Function jsonInstruction

    • Builds the standard JSON instruction appended to every judge prompt.

      When includeReasoning is false, the prompt still accepts a reasoning field but marks it as optional — this avoids confusing models that always include it. When true, reasoning is explicitly required and described as the step-by-step analysis the model performed.

      Parameters

      • includeReasoning: boolean

        When true, the returned instruction requires the LLM to provide a reasoning field explaining its score. When false, reasoning is optional.

      Returns string

      A multi-line string to append verbatim to any judge prompt.

      import { jsonInstruction } from 'rageval'

      // Without reasoning (default in evaluate())
      const compact = jsonInstruction(false)
      // Prompts: {"score": <0.0–1.0>} (reasoning optional)

      // With reasoning (when includeReasoning: true is passed to evaluate())
      const verbose = jsonInstruction(true)
      // Prompts: {"score": <0.0–1.0>, "reasoning": "<your step-by-step analysis>"}