MessageExtensions<TState>.OnFetchTask Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| OnFetchTask(Regex, FetchTaskHandlerAsync<TState>) |
Registers a handler to process the initial fetch task for an Action based message extension. |
| OnFetchTask(String, FetchTaskHandlerAsync<TState>) |
Registers a handler to process the initial fetch task for an Action based message extension. |
| OnFetchTask(RouteSelectorAsync, FetchTaskHandlerAsync<TState>) |
Registers a handler to process the initial fetch task for an Action based message extension. |
| OnFetchTask(MultipleRouteSelector, FetchTaskHandlerAsync<TState>) |
Registers a handler to process the initial fetch task for an Action based message extension. |
OnFetchTask(Regex, FetchTaskHandlerAsync<TState>)
Registers a handler to process the initial fetch task for an Action based message extension.
public Microsoft.Teams.AI.Application<TState> OnFetchTask(System.Text.RegularExpressions.Regex commandIdPattern, Microsoft.Teams.AI.FetchTaskHandlerAsync<TState> handler);
member this.OnFetchTask : System.Text.RegularExpressions.Regex * Microsoft.Teams.AI.FetchTaskHandlerAsync<'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 OnFetchTask (commandIdPattern As Regex, handler As FetchTaskHandlerAsync(Of TState)) As Application(Of TState)
Parameters
- commandIdPattern
- Regex
Regular expression to match against the ID of the commands to register the handler for.
- handler
- FetchTaskHandlerAsync<TState>
Function to call when the command is received.
Returns
The application instance for chaining purposes.
Applies to
OnFetchTask(String, FetchTaskHandlerAsync<TState>)
Registers a handler to process the initial fetch task for an Action based message extension.
public Microsoft.Teams.AI.Application<TState> OnFetchTask(string commandId, Microsoft.Teams.AI.FetchTaskHandlerAsync<TState> handler);
member this.OnFetchTask : string * Microsoft.Teams.AI.FetchTaskHandlerAsync<'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 OnFetchTask (commandId As String, handler As FetchTaskHandlerAsync(Of TState)) As Application(Of TState)
Parameters
- commandId
- String
ID of the commands to register the handler for.
- handler
- FetchTaskHandlerAsync<TState>
Function to call when the command is received.
Returns
The application instance for chaining purposes.
Applies to
OnFetchTask(RouteSelectorAsync, FetchTaskHandlerAsync<TState>)
Registers a handler to process the initial fetch task for an Action based message extension.
public Microsoft.Teams.AI.Application<TState> OnFetchTask(Microsoft.Teams.AI.RouteSelectorAsync routeSelector, Microsoft.Teams.AI.FetchTaskHandlerAsync<TState> handler);
member this.OnFetchTask : Microsoft.Teams.AI.RouteSelectorAsync * Microsoft.Teams.AI.FetchTaskHandlerAsync<'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 OnFetchTask (routeSelector As RouteSelectorAsync, handler As FetchTaskHandlerAsync(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
- FetchTaskHandlerAsync<TState>
Function to call when the route is triggered.
Returns
The application instance for chaining purposes.
Applies to
OnFetchTask(MultipleRouteSelector, FetchTaskHandlerAsync<TState>)
Registers a handler to process the initial fetch task for an Action based message extension.
public Microsoft.Teams.AI.Application<TState> OnFetchTask(Microsoft.Teams.AI.MultipleRouteSelector routeSelectors, Microsoft.Teams.AI.FetchTaskHandlerAsync<TState> handler);
member this.OnFetchTask : Microsoft.Teams.AI.MultipleRouteSelector * Microsoft.Teams.AI.FetchTaskHandlerAsync<'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 OnFetchTask (routeSelectors As MultipleRouteSelector, handler As FetchTaskHandlerAsync(Of TState)) As Application(Of TState)
Parameters
- routeSelectors
- MultipleRouteSelector
Combination of String, Regex, and RouteSelectorAsync selectors.
- handler
- FetchTaskHandlerAsync<TState>
Function to call when the route is triggered.
Returns
The application instance for chaining purposes.