Share via


AgentApplicationOptions Constructors

Definition

Overloads

AgentApplicationOptions(TurnStateFactory)
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(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(TurnStateFactory)

public AgentApplicationOptions(Microsoft.Agents.Builder.App.TurnStateFactory turnStateFactory);
new Microsoft.Agents.Builder.App.AgentApplicationOptions : Microsoft.Agents.Builder.App.TurnStateFactory -> Microsoft.Agents.Builder.App.AgentApplicationOptions
Public Sub New (turnStateFactory As TurnStateFactory)

Parameters

turnStateFactory
TurnStateFactory

Applies to

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>
public AgentApplicationOptions(Microsoft.Agents.Storage.IStorage storage);
new Microsoft.Agents.Builder.App.AgentApplicationOptions : Microsoft.Agents.Storage.IStorage -> Microsoft.Agents.Builder.App.AgentApplicationOptions
Public Sub New (storage As IStorage)

Parameters

storage
IStorage

Applies to

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();
public AgentApplicationOptions(IServiceProvider sp, Microsoft.Extensions.Configuration.IConfiguration configuration, Microsoft.Agents.Builder.IChannelAdapter channelAdapter, Microsoft.Agents.Storage.IStorage storage = default, Microsoft.Agents.Builder.App.UserAuth.UserAuthorizationOptions authOptions = default, Microsoft.Agents.Builder.App.AdaptiveCards.AdaptiveCardsOptions cardOptions = default, System.Collections.Generic.IList<Microsoft.Agents.Builder.App.IInputFileDownloader> fileDownloaders = default, string configKey = "AgentApplication");
new Microsoft.Agents.Builder.App.AgentApplicationOptions : IServiceProvider * Microsoft.Extensions.Configuration.IConfiguration * Microsoft.Agents.Builder.IChannelAdapter * Microsoft.Agents.Storage.IStorage * Microsoft.Agents.Builder.App.UserAuth.UserAuthorizationOptions * Microsoft.Agents.Builder.App.AdaptiveCards.AdaptiveCardsOptions * System.Collections.Generic.IList<Microsoft.Agents.Builder.App.IInputFileDownloader> * string -> Microsoft.Agents.Builder.App.AgentApplicationOptions
Public Sub New (sp As IServiceProvider, configuration As IConfiguration, channelAdapter As IChannelAdapter, Optional storage As IStorage = Nothing, Optional authOptions As UserAuthorizationOptions = Nothing, Optional cardOptions As AdaptiveCardsOptions = Nothing, Optional fileDownloaders As IList(Of IInputFileDownloader) = Nothing, Optional configKey As String = "AgentApplication")

Parameters

configuration
IConfiguration
channelAdapter
IChannelAdapter
storage
IStorage

The IStorage used by TurnState and User Authorization.

cardOptions
AdaptiveCardsOptions
fileDownloaders
IList<IInputFileDownloader>
configKey
String

Applies to