AgentApplicationOptions Constructors
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
| Name | Description |
|---|---|
| AgentApplicationOptions(TurnStateFactory, ILoggerFactory) | |
| AgentApplicationOptions(IStorage, ILoggerFactory) |
Constructs AgentApplicationOptions programmatically.
<remarks>
This will set the `TurnStateFactory` property with the default TurnStateFactory .
</remarks>
|
| AgentApplicationOptions(IServiceProvider, IConfiguration, IChannelAdapter, IStorage, UserAuthorizationOptions, AdaptiveCardsOptions, IList<IInputFileDownloader>, String, ILoggerFactory) |
Creates AgentApplicationOptions from IConfiguration and DI.
Typically this is used by injection:
Or by using the Hosting.AspNetCore extension
|
AgentApplicationOptions(TurnStateFactory, ILoggerFactory)
public AgentApplicationOptions(Microsoft.Agents.Builder.App.TurnStateFactory turnStateFactory, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory = default);
new Microsoft.Agents.Builder.App.AgentApplicationOptions : Microsoft.Agents.Builder.App.TurnStateFactory * Microsoft.Extensions.Logging.ILoggerFactory -> Microsoft.Agents.Builder.App.AgentApplicationOptions
Public Sub New (turnStateFactory As TurnStateFactory, Optional loggerFactory As ILoggerFactory = Nothing)
Parameters
- turnStateFactory
- TurnStateFactory
- loggerFactory
- ILoggerFactory
Applies to
AgentApplicationOptions(IStorage, ILoggerFactory)
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, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory = default);
new Microsoft.Agents.Builder.App.AgentApplicationOptions : Microsoft.Agents.Storage.IStorage * Microsoft.Extensions.Logging.ILoggerFactory -> Microsoft.Agents.Builder.App.AgentApplicationOptions
Public Sub New (storage As IStorage, Optional loggerFactory As ILoggerFactory = Nothing)
Parameters
- storage
- IStorage
- loggerFactory
- ILoggerFactory
Applies to
AgentApplicationOptions(IServiceProvider, IConfiguration, IChannelAdapter, IStorage, UserAuthorizationOptions, AdaptiveCardsOptions, IList<IInputFileDownloader>, String, ILoggerFactory)
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", Microsoft.Extensions.Logging.ILoggerFactory loggerFactory = default);
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.Extensions.Logging.ILoggerFactory -> 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", Optional loggerFactory As ILoggerFactory = Nothing)
Parameters
- configuration
- IConfiguration
- channelAdapter
- IChannelAdapter
- storage
- IStorage
The IStorage used by TurnState and User Authorization.
- authOptions
- UserAuthorizationOptions
- cardOptions
- AdaptiveCardsOptions
- fileDownloaders
- IList<IInputFileDownloader>
- configKey
- String
- loggerFactory
- ILoggerFactory