@langwatch/scenario
    Preparing search index...

    Function judge

    • Invoke the judge agent to evaluate the current conversation state.

      When criteria are provided inline, the judge evaluates only those criteria as a checkpoint: if all pass, the scenario continues; if any fail, the scenario fails immediately. This is the preferred way to pass criteria when using scripts.

      When no criteria are provided, the judge uses its own configured criteria and returns a final verdict (success or failure), ending the scenario.

      Parameters

      • Optionaloptions: { context?: string; criteria?: string[] }

        Optional options object with inline criteria and/or context to evaluate.

        • criteria: Criteria to evaluate (overrides judge's configured criteria).
        • context: Additional context for the judge, e.g. filesystem state or command output. Included in the judge's prompt under <additional_context>.

      Returns ScriptStep

      A ScriptStep function that can be used in scenario scripts.