MessageRouteBuilder Class

Definition

Provides a concrete builder for routing message activities in an AgentApplication.

public class MessageRouteBuilder : Microsoft.Agents.Builder.App.MessageRouteBuilderBase<Microsoft.Agents.Builder.App.MessageRouteBuilder>
type MessageRouteBuilder = class
    inherit MessageRouteBuilderBase<MessageRouteBuilder>
Public Class MessageRouteBuilder
Inherits MessageRouteBuilderBase(Of MessageRouteBuilder)
Inheritance

Remarks

Use MessageRouteBuilder when you need a message route that uses the standard RouteHandler delegate. This type inherits the message-specific matching behavior from MessageRouteBuilderBase<TBuilder>, including filtering by message text, regular expression, channel, and agentic routing options.

Constructors

Name Description
MessageRouteBuilder()

Fields

Name Description
_route (Inherited from RouteBuilderBase<TBuilder>)
_text (Inherited from MessageRouteBuilderBase<TBuilder>)
_textPattern (Inherited from MessageRouteBuilderBase<TBuilder>)

Methods

Name Description
AsAgentic(Boolean)

Configures the route to operate in agentic mode, enabling behaviors associated with agentic processing.

(Inherited from RouteBuilderBase<TBuilder>)
AsInvoke(Boolean)

For message routes, the invoke flag is ignored to prevent misconfiguration.

(Inherited from MessageRouteBuilderBase<TBuilder>)
AsNonTerminal()

Marks the current route as non-terminal and returns the updated builder instance.

(Inherited from RouteBuilderBase<TBuilder>)
Build()

Builds and returns the configured route instance after validating required components.

(Inherited from RouteBuilderBase<TBuilder>)
Create()

Creates a new instance of the MessageRouteBuilder class for constructing route definitions.

PreBuild() (Inherited from MessageRouteBuilderBase<TBuilder>)
WithChannelId(ChannelId)

Sets the channel identifier for the route and returns the builder instance for method chaining.

(Inherited from RouteBuilderBase<TBuilder>)
WithHandler(RouteHandler)

Assigns the specified route handler to the current route and returns the updated builder instance.

WithOAuthHandlers(Func<ITurnContext,String[]>)

Configures OAuth handler functions for the route using the specified delegate.

(Inherited from RouteBuilderBase<TBuilder>)
WithOAuthHandlers(String)

Configures the builder to use one or more OAuth authentication handlers specified in a delimited string.

(Inherited from RouteBuilderBase<TBuilder>)
WithOAuthHandlers(String[])

Configures the route to use the specified OAuth authentication handlers.

(Inherited from RouteBuilderBase<TBuilder>)
WithOrderRank(UInt16)

Sets the order rank for the route and returns the current builder instance for further configuration.

(Inherited from RouteBuilderBase<TBuilder>)
WithSelector(RouteSelector)

Sets a custom route selector used to determine how incoming requests are matched to this route builder.

(Inherited from MessageRouteBuilderBase<TBuilder>)
WithText(Regex)

Adds a text pattern selector to the route, matching incoming message activities whose text satisfies the specified regular expression.

(Inherited from MessageRouteBuilderBase<TBuilder>)
WithText(String)

Adds a selector to the route that matches incoming message activities with text equal to the specified value, ignoring case.

(Inherited from MessageRouteBuilderBase<TBuilder>)

Applies to