A2A 0.1.0-preview.1
dotnet add package A2A --version 0.1.0-preview.1
NuGet\Install-Package A2A -Version 0.1.0-preview.1
<PackageReference Include="A2A" Version="0.1.0-preview.1" />
<PackageVersion Include="A2A" Version="0.1.0-preview.1" />
<PackageReference Include="A2A" />
paket add A2A --version 0.1.0-preview.1
#r "nuget: A2A, 0.1.0-preview.1"
#:package A2A@0.1.0-preview.1
#addin nuget:?package=A2A&version=0.1.0-preview.1&prerelease
#tool nuget:?package=A2A&version=0.1.0-preview.1&prerelease
A2A: A .NET implementation of the Google A2A protocol
Interact with agents using the A2A protocol in .NET applications. This library is designed to be used with ASP.NET Core applications and provides a simple way to add A2A support to your agents.
Status
This library has implemented the majority of the protocol v0.2.1, however there are likely some scenarios that are still not complete. The biggest piece of functionality that is missing is client callbacks using push notifications.
Overview
Library: A2A
This library contains the core A2A protocol implementation. It includes the following classes:
A2AClient
: Used for making A2A requests to an agent.TaskManager
: Provides standardized support for managing tasks and task execution.ITaskStore
: An interface for abstracting the storage of tasks.InMemoryTaskStore
is a simple in-memory implementation.
Library: A2A.AspNetCore
This library adds the MapA2A extension method that allows you to add A2A support to an Agent hosted at the specified path.
var echoAgent = new EchoAgent();
var echoTaskManager = new TaskManager();
echoAgent.Attach(echoTaskManager);
app.MapA2A(echoTaskManager,"/echo");
Agent Integration Example
Each agent instance should be given its own TaskManager
instance. The TaskManager
is responsible for managing the tasks and their execution. It is an implementation decision as to whether a single agent instance processes many tasks or whether an agent instance is created for each task.
using A2A;
public class EchoAgent
{
private TaskManager? _TaskManager;
public void Attach(TaskManager taskManager)
{
_TaskManager = taskManager;
taskManager.OnTaskCreated = ExecuteAgentTask;
taskManager.OnTaskUpdated = ExecuteAgentTask;
}
public async Task ExecuteAgentTask(AgentTask task) {
if (_TaskManager == null) {
throw new Exception("TaskManager is not attached.");
}
// Set Status to working
await _TaskManager.UpdateStatusAsync(task.Id, TaskState.Working);
var message = task.History!.Last().Parts.First().AsTextPart().Text;
var artifact = new Artifact() {
Parts = [new TextPart() {
Text = $"Echo: {message}"
}]
};
await _TaskManager.ReturnArtifactAsync(new TaskIdParams() {Id = task.Id}, artifact);
await _TaskManager.UpdateStatusAsync(task.Id, TaskState.Completed, final: true);
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Microsoft.Extensions.Logging (>= 9.0.6)
- System.Linq.AsyncEnumerable (>= 10.0.0-preview.5.25277.114)
- System.Net.ServerSentEvents (>= 10.0.0-preview.5.25277.114)
- System.Text.Json (>= 8.0.5)
-
net8.0
- Microsoft.Extensions.Logging (>= 9.0.6)
- System.Linq.AsyncEnumerable (>= 10.0.0-preview.5.25277.114)
- System.Net.ServerSentEvents (>= 10.0.0-preview.5.25277.114)
-
net9.0
- Microsoft.Extensions.Logging (>= 9.0.6)
- System.Linq.AsyncEnumerable (>= 10.0.0-preview.5.25277.114)
- System.Net.ServerSentEvents (>= 10.0.0-preview.5.25277.114)
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on A2A:
Repository | Stars |
---|---|
Azure-Samples/eShopLite
eShopLite is a set of reference .NET applications implementing an eCommerce site with features like Semantic Search, MCP, Reasoning models and more.
|
Version | Downloads | Last Updated |
---|