ReadonlymessagesThe history of messages in the conversation.
ReadonlythreadThe ID of the conversation thread.
Adds an agent message to the conversation. If no content is provided, the agent under test will generate a message.
Optionalcontent: string | ModelMessageThe content of the agent message.
Ends the scenario with a failure.
Optionalreasoning: stringOptional reasoning for the failure.
The final result of the scenario.
Invokes the judge agent to evaluate the current state.
Optionalcontent: string | ModelMessageOptional message to the judge.
The result of the scenario if the judge makes a final decision.
Adds a message to the conversation.
The message to add.
Proceeds with the scenario automatically for a number of turns.
Optionalturns: numberThe number of turns to proceed. Defaults to running until the scenario ends.
OptionalonTurn: (state: ScenarioExecutionStateLike) => void | Promise<void>Optional callback executed at the end of each turn.
OptionalonStep: (state: ScenarioExecutionStateLike) => void | Promise<void>Optional callback executed after each agent interaction.
The result of the scenario if it ends.
Ends the scenario with a success.
Optionalreasoning: stringOptional reasoning for the success.
The final result of the scenario.
Adds a user message to the conversation. If no content is provided, the user simulator will generate a message.
Optionalcontent: string | ModelMessageThe content of the user message.
The execution context for a scenario script. This provides the functions to control the flow of the scenario.