// Copyright (c) Microsoft. All rights reserved. using Microsoft.Agents.AI; using Microsoft.Agents.AI.A2A; using Microsoft.Extensions.Logging; namespace A2A; /// /// Provides extension methods for /// to simplify the creation of A2A agents. /// /// /// These extensions bridge the gap between A2A SDK client objects /// and the Microsoft Extensions AI Agent framework. /// /// They allow developers to easily create AI agents that can interact /// with A2A agents by handling the conversion from A2A clients to /// instances that implement the interface. /// /// public static class A2AClientExtensions { /// /// Retrieves an instance of for an existing A2A agent. /// /// /// This method can be used to create AI agents for A2A agents whose hosts support the /// Direct Configuration / Private Discovery /// discovery mechanism. /// /// The to use for the agent. /// The unique identifier for the agent. /// The the name of the agent. /// The description of the agent. /// The display name of the agent. /// Optional logger factory for enabling logging within the agent. /// An instance backed by the A2A agent. public static AIAgent GetAIAgent(this A2AClient client, string? id = null, string? name = null, string? description = null, string? displayName = null, ILoggerFactory? loggerFactory = null) => new A2AAgent(client, id, name, description, displayName, loggerFactory); }