interface AgentExecutor {
    cancelTask: ((taskId, eventBus) => Promise<void>);
    execute: ((requestContext, eventBus) => Promise<void>);
}

Properties

Properties

cancelTask: ((taskId, eventBus) => Promise<void>)

Method to explicitly cancel a running task. The implementation should handle the logic of stopping the execution and publishing the final 'canceled' status event on the provided event bus.

Type declaration

    • (taskId, eventBus): Promise<void>
    • Parameters

      • taskId: string

        The ID of the task to cancel.

      • eventBus: ExecutionEventBus

        The event bus associated with the task's execution.

      Returns Promise<void>

execute: ((requestContext, eventBus) => Promise<void>)

Executes the agent logic based on the request context and publishes events.

Type declaration

    • (requestContext, eventBus): Promise<void>
    • Parameters

      Returns Promise<void>