ServiceCollectionExtensions.AddAgentCore 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
| Name | Description |
|---|---|
| AddAgentCore(IHostApplicationBuilder) |
Adds the core agent services.
|
| AddAgentCore<TAdapter>(IServiceCollection) |
Adds core services required for Agent functionality, including the specified cloud adapter, to the application's dependency injection container. |
| AddAgentCore<TAdapter>(IHostApplicationBuilder) |
Adds the core agent services using a derived CloudAdapter.
|
AddAgentCore(IHostApplicationBuilder)
Adds the core agent services.
IConnections, which uses IConfiguration for settings.IChannelServiceClientFactoryfor ConnectorClient and UserTokenClient creations.CloudAdapter, this is the default adapter that works with Azure Bot Service and Activity Protocol Agents.
public static Microsoft.Extensions.Hosting.IHostApplicationBuilder AddAgentCore(this Microsoft.Extensions.Hosting.IHostApplicationBuilder builder);
static member AddAgentCore : Microsoft.Extensions.Hosting.IHostApplicationBuilder -> Microsoft.Extensions.Hosting.IHostApplicationBuilder
<Extension()>
Public Function AddAgentCore (builder As IHostApplicationBuilder) As IHostApplicationBuilder
Parameters
- builder
- IHostApplicationBuilder
Returns
The same instance of IHostApplicationBuilder to allow for method chaining.
Applies to
AddAgentCore<TAdapter>(IServiceCollection)
Adds core services required for Agent functionality, including the specified cloud adapter, to the application's dependency injection container.
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddAgentCore<TAdapter>(this Microsoft.Extensions.DependencyInjection.IServiceCollection services) where TAdapter : Microsoft.Agents.Hosting.AspNetCore.CloudAdapter;
static member AddAgentCore : Microsoft.Extensions.DependencyInjection.IServiceCollection -> Microsoft.Extensions.DependencyInjection.IServiceCollection (requires 'Adapter :> Microsoft.Agents.Hosting.AspNetCore.CloudAdapter)
<Extension()>
Public Function AddAgentCore(Of TAdapter As CloudAdapter) (services As IServiceCollection) As IServiceCollection
Type Parameters
- TAdapter
The type of cloud adapter to register. Must inherit from CloudAdapter.
Parameters
- services
- IServiceCollection
The service collection to which the agent core services will be added.
Returns
Remarks
This method registers essential services such as IConnections and IChannelServiceClientFactory if they are not already present. It also adds the specified CloudAdapter implementation, enabling integration with Azure Bot Service and Activity Protocol Agents.
Applies to
AddAgentCore<TAdapter>(IHostApplicationBuilder)
Adds the core agent services using a derived CloudAdapter.
IConnections, which uses IConfiguration for settings.IChannelServiceClientFactoryfor ConnectorClient and UserTokenClient creations.CloudAdapter, this is the default adapter that works with Azure Bot Service and Activity Protocol Agents.
public static Microsoft.Extensions.Hosting.IHostApplicationBuilder AddAgentCore<TAdapter>(this Microsoft.Extensions.Hosting.IHostApplicationBuilder builder) where TAdapter : Microsoft.Agents.Hosting.AspNetCore.CloudAdapter;
static member AddAgentCore : Microsoft.Extensions.Hosting.IHostApplicationBuilder -> Microsoft.Extensions.Hosting.IHostApplicationBuilder (requires 'Adapter :> Microsoft.Agents.Hosting.AspNetCore.CloudAdapter)
<Extension()>
Public Function AddAgentCore(Of TAdapter As CloudAdapter) (builder As IHostApplicationBuilder) As IHostApplicationBuilder
Type Parameters
- TAdapter
Parameters
- builder
- IHostApplicationBuilder
Returns
The same instance of IHostApplicationBuilder to allow for method chaining.