Planner interface

A planner is responsible for generating a plan that the AI system will execute.

Methods

beginTask(TurnContext, TState, AI<TState>)

Starts a new task.

continueTask(TurnContext, TState, AI<TState>)

Continues the current task.

Method Details

beginTask(TurnContext, TState, AI<TState>)

Starts a new task.

function beginTask(context: TurnContext, state: TState, ai: AI<TState>): Promise<Plan>

Parameters

context

TurnContext

Context for the current turn of conversation.

state

TState

Application state for the current turn of conversation.

ai

AI<TState>

The AI system that is generating the plan.

Returns

Promise<Plan>

The plan that was generated.

Remarks

This method is called when the AI system is ready to start a new task. The planner should generate a plan that the AI system will execute. Returning an empty plan signals that there is no work to be performed.

The planner should take the users input from state.temp.input.

continueTask(TurnContext, TState, AI<TState>)

Continues the current task.

function continueTask(context: TurnContext, state: TState, ai: AI<TState>): Promise<Plan>

Parameters

context

TurnContext

Context for the current turn of conversation.

state

TState

Application state for the current turn of conversation.

ai

AI<TState>

The AI system that is generating the plan.

Returns

Promise<Plan>

The plan that was generated.

Remarks

This method is called when the AI system has finished executing the previous plan and is ready to continue the current task. The planner should generate a plan that the AI system will execute. Returning an empty plan signals that the task is completed and there is no work to be performed.

The output from the last plan step that was executed is passed to the planner via state.temp.input.