Share via


AgentApplicationOptions Class

Definition

Options for the AgentApplication class. AgentApplicationOptions can be constructed via IConfiguration values or programmatically.

public class AgentApplicationOptions
type AgentApplicationOptions = class
Public Class AgentApplicationOptions
Inheritance
AgentApplicationOptions
Derived

Constructors

AgentApplicationOptions(IServiceProvider, IConfiguration, IChannelAdapter, IStorage, UserAuthorizationOptions, AdaptiveCardsOptions, IList<IInputFileDownloader>, String)

Creates AgentApplicationOptions from IConfiguration and DI.

"AgentApplication": {
  "StartTypingTimer": false,
  "RemoveRecipientMention": true,
  "NormalizeMentions": true,

  "UserAuthorization": {  // omit to disable User Authorization
    "Default": "graph",
    "AutoSignIn": {true | false},
    "Handlers": {
      "graph": {
        "Settings": {
          "AzureBotOAuthConnectionName": null
        }
      }
    }
  },

  "AdaptiveCards" : {     // optional
  }
}

Typically this is used by injection:

builder.Services.AddSingleton<AgentApplicationOptions<();

Or by using the Hosting.AspNetCore extension

builder.AddAgentApplicationOptions();
AgentApplicationOptions(IStorage)

Constructs AgentApplicationOptions programmatically.

var options = new AgentApplicationOptions(storageInstance)
{
  StartTypingTimer = true,

  ...

  UserAuthorization = new UserAuthorizationOptions()   // if required
  {
    ...
  }

  AdaptiveCards = new AdaptiveCardsOptions()  // if required
  {
  }
};
<remarks> This will set the `TurnStateFactory` property with the default TurnStateFactory . </remarks>
AgentApplicationOptions(TurnStateFactory)

Properties

Adapter

The IChannelAdapter to use in cases on proactive.

AdaptiveCards

Optional. Options used to customize the processing of Adaptive Card requests.

FileDownloaders

Optional. Array of input file download plugins to use.

NormalizeMentions

Optional. If true, the Agent will automatically normalize mentions across channels. Defaults to true.

RemoveRecipientMention

Optional. If true, the Agent will automatically remove mentions of the Agents name from incoming messages. Defaults to true.

StartTypingTimer

Optional. If true, the Agent will automatically start a typing timer when messages are received. This allows the Agent to automatically indicate that it's received the message and is processing the request. Defaults to true.

TurnStateFactory

Optional. Factory used to create a custom turn state instance.

UserAuthorization

Optional. Options used to enable user authorization for the application.

Applies to

See also