@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: { criteria: string[] }

        Optional options object with inline criteria to evaluate.

      Returns ScriptStep

      A ScriptStep function that can be used in scenario scripts.