LoopAgent 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 |
|---|---|
| LoopAgent(AIAgent, LoopEvaluator, LoopAgentOptions, ILoggerFactory) |
Initializes a new instance of the LoopAgent class with a single evaluator. |
| LoopAgent(AIAgent, IEnumerable<LoopEvaluator>, LoopAgentOptions, ILoggerFactory) |
Initializes a new instance of the LoopAgent class with one or more evaluators. |
LoopAgent(AIAgent, LoopEvaluator, LoopAgentOptions, ILoggerFactory)
Initializes a new instance of the LoopAgent class with a single evaluator.
public LoopAgent(Microsoft.Agents.AI.AIAgent innerAgent, Microsoft.Agents.AI.LoopEvaluator evaluator, Microsoft.Agents.AI.LoopAgentOptions? options = default, Microsoft.Extensions.Logging.ILoggerFactory? loggerFactory = default);
new Microsoft.Agents.AI.LoopAgent : Microsoft.Agents.AI.AIAgent * Microsoft.Agents.AI.LoopEvaluator * Microsoft.Agents.AI.LoopAgentOptions * Microsoft.Extensions.Logging.ILoggerFactory -> Microsoft.Agents.AI.LoopAgent
Public Sub New (innerAgent As AIAgent, evaluator As LoopEvaluator, Optional options As LoopAgentOptions = Nothing, Optional loggerFactory As ILoggerFactory = Nothing)
Parameters
- innerAgent
- AIAgent
The underlying agent to invoke in a loop.
- evaluator
- LoopEvaluator
The LoopEvaluator that decides whether to re-invoke the agent.
- options
- LoopAgentOptions
Optional configuration for the loop. When null, defaults are used.
- loggerFactory
- ILoggerFactory
Optional factory used to create the loop's logger.
Exceptions
innerAgent or evaluator is null.
MaxIterations is less than 1.
Applies to
LoopAgent(AIAgent, IEnumerable<LoopEvaluator>, LoopAgentOptions, ILoggerFactory)
Initializes a new instance of the LoopAgent class with one or more evaluators.
public LoopAgent(Microsoft.Agents.AI.AIAgent innerAgent, System.Collections.Generic.IEnumerable<Microsoft.Agents.AI.LoopEvaluator> evaluators, Microsoft.Agents.AI.LoopAgentOptions? options = default, Microsoft.Extensions.Logging.ILoggerFactory? loggerFactory = default);
new Microsoft.Agents.AI.LoopAgent : Microsoft.Agents.AI.AIAgent * seq<Microsoft.Agents.AI.LoopEvaluator> * Microsoft.Agents.AI.LoopAgentOptions * Microsoft.Extensions.Logging.ILoggerFactory -> Microsoft.Agents.AI.LoopAgent
Public Sub New (innerAgent As AIAgent, evaluators As IEnumerable(Of LoopEvaluator), Optional options As LoopAgentOptions = Nothing, Optional loggerFactory As ILoggerFactory = Nothing)
Parameters
- innerAgent
- AIAgent
The underlying agent to invoke in a loop.
- evaluators
- IEnumerable<LoopEvaluator>
The ordered collection of LoopEvaluator that decide whether to re-invoke the agent. They are evaluated in order after each iteration and the first that asks to re-invoke wins.
- options
- LoopAgentOptions
Optional configuration for the loop. When null, defaults are used.
- loggerFactory
- ILoggerFactory
Optional factory used to create the loop's logger.
Exceptions
innerAgent or evaluators is null, or evaluators contains a null element.
evaluators is empty.
MaxIterations is less than 1.