AIAgentExtensions.RunAIAgentAsync 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 |
|---|---|
| RunAIAgentAsync(AIAgent, ILoggerFactory, String) |
Runs an AI agent asynchronously with an optional logger factory. |
| RunAIAgentAsync(AIAgent, IServiceProvider, String) |
Runs an AI agent asynchronously using the provided service provider. |
| RunAIAgentAsync(IServiceProvider, AIAgent, String) |
Runs an AI agent asynchronously using the service provider's dependencies. |
RunAIAgentAsync(AIAgent, ILoggerFactory, String)
- Source:
- AIAgentExtensions.cs
Runs an AI agent asynchronously with an optional logger factory.
public static System.Threading.Tasks.Task RunAIAgentAsync(this Microsoft.Agents.AI.AIAgent agent, Microsoft.Extensions.Logging.ILoggerFactory? loggerFactory = default, string telemetrySourceName = "Agents");
static member RunAIAgentAsync : Microsoft.Agents.AI.AIAgent * Microsoft.Extensions.Logging.ILoggerFactory * string -> System.Threading.Tasks.Task
<Extension()>
Public Function RunAIAgentAsync (agent As AIAgent, Optional loggerFactory As ILoggerFactory = Nothing, Optional telemetrySourceName As String = "Agents") As Task
Parameters
- agent
- AIAgent
The AI agent to run.
- loggerFactory
- ILoggerFactory
Optional logger factory for creating loggers.
- telemetrySourceName
- String
The name of the telemetry source. Defaults to "Agents".
Returns
A task that represents the asynchronous operation.
Applies to
RunAIAgentAsync(AIAgent, IServiceProvider, String)
- Source:
- AIAgentExtensions.cs
Runs an AI agent asynchronously using the provided service provider.
public static System.Threading.Tasks.Task RunAIAgentAsync(this Microsoft.Agents.AI.AIAgent agent, IServiceProvider sp, string telemetrySourceName = "Agents");
static member RunAIAgentAsync : Microsoft.Agents.AI.AIAgent * IServiceProvider * string -> System.Threading.Tasks.Task
<Extension()>
Public Function RunAIAgentAsync (agent As AIAgent, sp As IServiceProvider, Optional telemetrySourceName As String = "Agents") As Task
Parameters
- agent
- AIAgent
The AI agent to run.
The service provider for dependency injection.
- telemetrySourceName
- String
The name of the telemetry source. Defaults to "Agents".
Returns
A task that represents the asynchronous operation.
Applies to
RunAIAgentAsync(IServiceProvider, AIAgent, String)
- Source:
- AIAgentExtensions.cs
Runs an AI agent asynchronously using the service provider's dependencies.
public static System.Threading.Tasks.Task RunAIAgentAsync(this IServiceProvider sp, Microsoft.Agents.AI.AIAgent? agent = default, string telemetrySourceName = "Agents");
static member RunAIAgentAsync : IServiceProvider * Microsoft.Agents.AI.AIAgent * string -> System.Threading.Tasks.Task
<Extension()>
Public Function RunAIAgentAsync (sp As IServiceProvider, Optional agent As AIAgent = Nothing, Optional telemetrySourceName As String = "Agents") As Task
Parameters
The service provider for dependency injection.
- agent
- AIAgent
Optional AI agent to run. If null, retrieves from service provider.
- telemetrySourceName
- String
The name of the telemetry source. Defaults to "Agents".
Returns
A task that represents the asynchronous operation.