AIAgentExtensions.AsBuilder(AIAgent) 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.
Creates a new AIAgentBuilder using the specified agent as the foundation for the builder pipeline.
public static Microsoft.Agents.AI.AIAgentBuilder AsBuilder(this Microsoft.Agents.AI.AIAgent innerAgent);
static member AsBuilder : Microsoft.Agents.AI.AIAgent -> Microsoft.Agents.AI.AIAgentBuilder
<Extension()>
Public Function AsBuilder (innerAgent As AIAgent) As AIAgentBuilder
Parameters
Returns
A new AIAgentBuilder instance configured with the specified inner agent.
Exceptions
innerAgent is null.
Remarks
This method provides a convenient way to convert an existing AIAgent instance into a builder pattern, enabling easily wrapping the agent in layers of additional functionality. It is functionally equivalent to using the AIAgentBuilder(AIAgent) constructor directly, but provides a more fluent API when working with existing agent instances.