Share via


AgentApplication.OnBeforeTurn(TurnEventHandler) Method

Definition

Add a handler that will execute before the turn's activity handler logic is processed.
Handler returns true to continue execution of the current turn. Handler returning false prevents the turn from running, but the Agents state is still saved, which lets you track the reason why the turn was not processed. It also means you can use this as a way to call into the dialog system. For example, you could use the OAuthPrompt to sign the user in before allowing the AI system to run.

public Microsoft.Agents.Builder.App.AgentApplication OnBeforeTurn(Microsoft.Agents.Builder.App.TurnEventHandler handler);
member this.OnBeforeTurn : Microsoft.Agents.Builder.App.TurnEventHandler -> Microsoft.Agents.Builder.App.AgentApplication
Public Function OnBeforeTurn (handler As TurnEventHandler) As AgentApplication

Parameters

handler
TurnEventHandler

Function to call before turn execution.

Returns

The application instance for chaining purposes.

Applies to