Language

A2AClientExtensions.AsAIAgent Method

Definition

Overloads

Name Description
AsAIAgent(IA2AClient, A2AAgentOptions, ILoggerFactory)

Retrieves an instance of AIAgent for an existing A2A agent.

AsAIAgent(IA2AClient, String, String, String, ILoggerFactory)

Retrieves an instance of AIAgent for an existing A2A agent.

AsAIAgent(IA2AClient, A2AAgentOptions, ILoggerFactory)

Retrieves an instance of AIAgent for an existing A2A agent.

public static Microsoft.Agents.AI.AIAgent AsAIAgent(this A2A.IA2AClient client, Microsoft.Agents.AI.A2A.A2AAgentOptions options, Microsoft.Extensions.Logging.ILoggerFactory? loggerFactory = default);
static member AsAIAgent : A2A.IA2AClient * Microsoft.Agents.AI.A2A.A2AAgentOptions * Microsoft.Extensions.Logging.ILoggerFactory -> Microsoft.Agents.AI.AIAgent
<Extension()>
Public Function AsAIAgent (client As IA2AClient, options As A2AAgentOptions, Optional loggerFactory As ILoggerFactory = Nothing) As AIAgent

Parameters

client
A2A.IA2AClient

The A2A.IA2AClient to use for the agent.

options
A2AAgentOptions

Configuration options that control the agent's identity, including its identifier, name, and description.

loggerFactory
ILoggerFactory

Optional logger factory for enabling logging within the agent.

Returns

An AIAgent instance backed by the A2A agent.

Remarks

This method can be used to access A2A agents that support the Direct Configuration / Private Discovery discovery mechanism.

Applies to

AsAIAgent(IA2AClient, String, String, String, ILoggerFactory)

Retrieves an instance of AIAgent for an existing A2A agent.

public static Microsoft.Agents.AI.AIAgent AsAIAgent(this A2A.IA2AClient client, string? id = default, string? name = default, string? description = default, Microsoft.Extensions.Logging.ILoggerFactory? loggerFactory = default);
static member AsAIAgent : A2A.IA2AClient * string * string * string * Microsoft.Extensions.Logging.ILoggerFactory -> Microsoft.Agents.AI.AIAgent
<Extension()>
Public Function AsAIAgent (client As IA2AClient, Optional id As String = Nothing, Optional name As String = Nothing, Optional description As String = Nothing, Optional loggerFactory As ILoggerFactory = Nothing) As AIAgent

Parameters

client
A2A.IA2AClient

The A2A.IA2AClient to use for the agent.

id
String

The unique identifier for the agent.

name
String

The name of the agent.

description
String

The description of the agent.

loggerFactory
ILoggerFactory

Optional logger factory for enabling logging within the agent.

Returns

An AIAgent instance backed by the A2A agent.

Remarks

This method can be used to access A2A agents that support the Direct Configuration / Private Discovery discovery mechanism.

Applies to