AIAgentExtensions.MapA2A 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 |
|---|---|
| MapA2A(AIAgent, ITaskManager, ILoggerFactory, AgentSessionStore, AgentRunMode, JsonSerializerOptions) |
Attaches A2A (Agent2Agent) messaging capabilities via Message processing to the specified AIAgent. |
| MapA2A(AIAgent, AgentCard, ITaskManager, ILoggerFactory, AgentSessionStore, AgentRunMode, JsonSerializerOptions) |
Attaches A2A (Agent2Agent) messaging capabilities via Message processing to the specified AIAgent. |
MapA2A(AIAgent, ITaskManager, ILoggerFactory, AgentSessionStore, AgentRunMode, JsonSerializerOptions)
Attaches A2A (Agent2Agent) messaging capabilities via Message processing to the specified AIAgent.
public static A2A.ITaskManager MapA2A(this Microsoft.Agents.AI.AIAgent agent, A2A.ITaskManager? taskManager = default, Microsoft.Extensions.Logging.ILoggerFactory? loggerFactory = default, Microsoft.Agents.AI.Hosting.AgentSessionStore? agentSessionStore = default, Microsoft.Agents.AI.Hosting.A2A.AgentRunMode? runMode = default, System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = default);
static member MapA2A : Microsoft.Agents.AI.AIAgent * A2A.ITaskManager * Microsoft.Extensions.Logging.ILoggerFactory * Microsoft.Agents.AI.Hosting.AgentSessionStore * Microsoft.Agents.AI.Hosting.A2A.AgentRunMode * System.Text.Json.JsonSerializerOptions -> A2A.ITaskManager
<Extension()>
Public Function MapA2A (agent As AIAgent, Optional taskManager As ITaskManager = Nothing, Optional loggerFactory As ILoggerFactory = Nothing, Optional agentSessionStore As AgentSessionStore = Nothing, Optional runMode As AgentRunMode = Nothing, Optional jsonSerializerOptions As JsonSerializerOptions = Nothing) As ITaskManager
Parameters
- agent
- AIAgent
Agent to attach A2A messaging processing capabilities to.
- taskManager
- A2A.ITaskManager
Instance of A2A.TaskManager to configure for A2A messaging. New instance will be created if not passed.
- loggerFactory
- ILoggerFactory
The logger factory to use for creating ILogger instances.
- agentSessionStore
- AgentSessionStore
The store to store session contents and metadata.
- runMode
- AgentRunMode
Controls the response behavior of the agent run.
- jsonSerializerOptions
- JsonSerializerOptions
Optional JsonSerializerOptions for serializing and deserializing continuation tokens. Use this when the agent's continuation token contains custom types not registered in the default options. Falls back to DefaultOptions if not provided.
Returns
The configured A2A.TaskManager.
Applies to
MapA2A(AIAgent, AgentCard, ITaskManager, ILoggerFactory, AgentSessionStore, AgentRunMode, JsonSerializerOptions)
Attaches A2A (Agent2Agent) messaging capabilities via Message processing to the specified AIAgent.
public static A2A.ITaskManager MapA2A(this Microsoft.Agents.AI.AIAgent agent, A2A.AgentCard agentCard, A2A.ITaskManager? taskManager = default, Microsoft.Extensions.Logging.ILoggerFactory? loggerFactory = default, Microsoft.Agents.AI.Hosting.AgentSessionStore? agentSessionStore = default, Microsoft.Agents.AI.Hosting.A2A.AgentRunMode? runMode = default, System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = default);
static member MapA2A : Microsoft.Agents.AI.AIAgent * A2A.AgentCard * A2A.ITaskManager * Microsoft.Extensions.Logging.ILoggerFactory * Microsoft.Agents.AI.Hosting.AgentSessionStore * Microsoft.Agents.AI.Hosting.A2A.AgentRunMode * System.Text.Json.JsonSerializerOptions -> A2A.ITaskManager
<Extension()>
Public Function MapA2A (agent As AIAgent, agentCard As AgentCard, Optional taskManager As ITaskManager = Nothing, Optional loggerFactory As ILoggerFactory = Nothing, Optional agentSessionStore As AgentSessionStore = Nothing, Optional runMode As AgentRunMode = Nothing, Optional jsonSerializerOptions As JsonSerializerOptions = Nothing) As ITaskManager
Parameters
- agent
- AIAgent
Agent to attach A2A messaging processing capabilities to.
- agentCard
- A2A.AgentCard
The agent card to return on query.
- taskManager
- A2A.ITaskManager
Instance of A2A.TaskManager to configure for A2A messaging. New instance will be created if not passed.
- loggerFactory
- ILoggerFactory
The logger factory to use for creating ILogger instances.
- agentSessionStore
- AgentSessionStore
The store to store session contents and metadata.
- runMode
- AgentRunMode
Controls the response behavior of the agent run.
- jsonSerializerOptions
- JsonSerializerOptions
Optional JsonSerializerOptions for serializing and deserializing continuation tokens. Use this when the agent's continuation token contains custom types not registered in the default options. Falls back to DefaultOptions if not provided.
Returns
The configured A2A.TaskManager.