@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(): ModelMessage[];
        get threadId(): string;
        addMessage(message: ModelMessage): void;
        hasToolCall(toolName: string): boolean;
        lastAgentMessage(): AssistantModelMessage;
        lastMessage(): ModelMessage;
        lastToolCall(toolName: string): ToolModelMessage;
        lastUserMessage(): UserModelMessage;
    }

    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: ModelMessage

        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 agent message from the execution state.

      Returns AssistantModelMessage

      The last agent message.

    • Retrieves the last message from the execution state.

      Returns ModelMessage

      The last message.

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

      Parameters

      • toolName: string

        The name of the tool.

      Returns ToolModelMessage

      The last tool call message.

    • Retrieves the last user message from the execution state.

      Returns UserModelMessage

      The last user message.