@langwatch/scenario
    Preparing search index...

    Function proceed

    • Let the scenario proceed automatically for a specified number of turns.

      This function allows the scenario to run automatically with the normal agent interaction flow (user -> agent -> judge evaluation). You can optionally provide callbacks to execute custom logic at each turn or step.

      Parameters

      • Optionalturns: number

        Number of turns to proceed automatically. If undefined, proceeds until the judge agent decides to end the scenario or max_turns is reached.

      • OptionalonTurn: (state: ScenarioExecutionStateLike) => void | Promise<void>

        Optional callback function called at the end of each turn.

      • OptionalonStep: (state: ScenarioExecutionStateLike) => void | Promise<void>

        Optional callback function called after each agent interaction.

      Returns ScriptStep

      A ScriptStep function that can be used in scenario scripts.