TaskModules<TState>.OnFetch Method

Definition

Overloads

OnFetch(MultipleRouteSelector, FetchHandlerAsync<TState>)

Registers a handler to process the initial fetch of the task module.

OnFetch(RouteSelectorAsync, FetchHandlerAsync<TState>)

Registers a handler to process the initial fetch of the task module.

OnFetch(String, FetchHandlerAsync<TState>)

Registers a handler to process the initial fetch of the task module.

OnFetch(Regex, FetchHandlerAsync<TState>)

Registers a handler to process the initial fetch of the task module.

OnFetch(MultipleRouteSelector, FetchHandlerAsync<TState>)

Registers a handler to process the initial fetch of the task module.

public Microsoft.Teams.AI.Application<TState> OnFetch(Microsoft.Teams.AI.MultipleRouteSelector routeSelectors, Microsoft.Teams.AI.FetchHandlerAsync<TState> handler);
member this.OnFetch : Microsoft.Teams.AI.MultipleRouteSelector * Microsoft.Teams.AI.FetchHandlerAsync<'State (requires 'State :> Microsoft.Teams.AI.State.TurnState and 'State : (new : unit -> 'State))> -> Microsoft.Teams.AI.Application<'State (requires 'State :> Microsoft.Teams.AI.State.TurnState and 'State : (new : unit -> 'State))>
Public Function OnFetch (routeSelectors As MultipleRouteSelector, handler As FetchHandlerAsync(Of TState)) As Application(Of TState)

Parameters

routeSelectors
MultipleRouteSelector

Combination of String, Regex, and RouteSelectorAsync selectors.

handler
FetchHandlerAsync<TState>

Function to call when the route is triggered.

Returns

The application instance for chaining purposes.

Applies to

OnFetch(RouteSelectorAsync, FetchHandlerAsync<TState>)

Registers a handler to process the initial fetch of the task module.

public Microsoft.Teams.AI.Application<TState> OnFetch(Microsoft.Teams.AI.RouteSelectorAsync routeSelector, Microsoft.Teams.AI.FetchHandlerAsync<TState> handler);
member this.OnFetch : Microsoft.Teams.AI.RouteSelectorAsync * Microsoft.Teams.AI.FetchHandlerAsync<'State (requires 'State :> Microsoft.Teams.AI.State.TurnState and 'State : (new : unit -> 'State))> -> Microsoft.Teams.AI.Application<'State (requires 'State :> Microsoft.Teams.AI.State.TurnState and 'State : (new : unit -> 'State))>
Public Function OnFetch (routeSelector As RouteSelectorAsync, handler As FetchHandlerAsync(Of TState)) As Application(Of TState)

Parameters

routeSelector
RouteSelectorAsync

Function that's used to select a route. The function returning true triggers the route.

handler
FetchHandlerAsync<TState>

Function to call when the route is triggered.

Returns

The application instance for chaining purposes.

Applies to

OnFetch(String, FetchHandlerAsync<TState>)

Registers a handler to process the initial fetch of the task module.

public Microsoft.Teams.AI.Application<TState> OnFetch(string verb, Microsoft.Teams.AI.FetchHandlerAsync<TState> handler);
member this.OnFetch : string * Microsoft.Teams.AI.FetchHandlerAsync<'State (requires 'State :> Microsoft.Teams.AI.State.TurnState and 'State : (new : unit -> 'State))> -> Microsoft.Teams.AI.Application<'State (requires 'State :> Microsoft.Teams.AI.State.TurnState and 'State : (new : unit -> 'State))>
Public Function OnFetch (verb As String, handler As FetchHandlerAsync(Of TState)) As Application(Of TState)

Parameters

verb
String

Name of the verb to register the handler for.

handler
FetchHandlerAsync<TState>

Function to call when the route is triggered.

Returns

The application instance for chaining purposes.

Applies to

OnFetch(Regex, FetchHandlerAsync<TState>)

Registers a handler to process the initial fetch of the task module.

public Microsoft.Teams.AI.Application<TState> OnFetch(System.Text.RegularExpressions.Regex verbPattern, Microsoft.Teams.AI.FetchHandlerAsync<TState> handler);
member this.OnFetch : System.Text.RegularExpressions.Regex * Microsoft.Teams.AI.FetchHandlerAsync<'State (requires 'State :> Microsoft.Teams.AI.State.TurnState and 'State : (new : unit -> 'State))> -> Microsoft.Teams.AI.Application<'State (requires 'State :> Microsoft.Teams.AI.State.TurnState and 'State : (new : unit -> 'State))>
Public Function OnFetch (verbPattern As Regex, handler As FetchHandlerAsync(Of TState)) As Application(Of TState)

Parameters

verbPattern
Regex

Regular expression to match against the verbs to register the handler for.

handler
FetchHandlerAsync<TState>

Function to call when the route is triggered.

Returns

The application instance for chaining purposes.

Applies to