@langwatch/scenario
    Preparing search index...

    Interface ScenarioExecutionStateLike

    Defines the state of a scenario execution.

    interface ScenarioExecutionStateLike {
        config: ScenarioConfig;
        description: string;
        get currentTurn(): number;
        get messages(): CoreMessage[];
        get threadId(): string;
        addMessage(message: CoreMessage): void;
        hasToolCall(toolName: string): boolean;
        lastMessage(): CoreMessage;
        lastToolCall(toolName: string): CoreToolMessage;
        lastUserMessage(): CoreMessage;
    }

    Implemented by

    Index

    Properties

    The scenario configuration.

    description: string

    The scenario description.

    Accessors

    Methods

    • Adds a message to the scenario's execution state.

      Parameters

      • message: CoreMessage

        The core message to add.

      Returns void

    • Checks if a tool call for a specific tool exists in the execution state.

      Parameters

      • toolName: string

        The name of the tool.

      Returns boolean

      True if the tool call exists, false otherwise.

    • Retrieves the last message from the execution state.

      Returns CoreMessage

      The last message.

    • Retrieves the last tool call message for a specific tool.

      Parameters

      • toolName: string

        The name of the tool.

      Returns CoreToolMessage

      The last tool call message.

    • Retrieves the last user message from the execution state.

      Returns CoreMessage

      The last user message.