-
Notifications
You must be signed in to change notification settings - Fork 1.9k
.NET: Implement Task support for A2A Hosting package #3732
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 27 commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
9f5a02c
implement task support?
DeagleGross 0e642e1
some metadata + session store impl
DeagleGross a4238c2
address PR comments x1
DeagleGross f7ce096
API reivew
DeagleGross d1e5f99
llast changes
DeagleGross 6ec30f0
More test
DeagleGross ed0fb38
Merge branch 'main' into dmkorolev/a2a-tasks
DeagleGross 256121e
remove unsued import
DeagleGross 45622d5
Merge branch 'dmkorolev/a2a-tasks' of https://github.com/microsoft/ag…
DeagleGross 124407e
fix moq override
DeagleGross cef0b21
Merge branch 'main' into dmkorolev/a2a-tasks
DeagleGross 2d30ce8
Merge branch 'main' into dmkorolev/a2a-tasks
DeagleGross 1dceb1d
Merge branch 'dmkorolev/a2a-tasks' of https://github.com/microsoft/ag…
DeagleGross 9966c42
refactoring
DeagleGross 4c3b19c
ontaskupdated
DeagleGross febd97e
adjust to delegate
DeagleGross 4a3b642
Merge branch 'main' into dmkorolev/a2a-tasks
DeagleGross b400bd8
Merge branch 'dmkorolev/a2a-tasks' of https://github.com/microsoft/ag…
DeagleGross 5bb5939
fix encoding
DeagleGross 5f63b8e
address PR comments: rework
DeagleGross 579faaf
init 1
DeagleGross 3de0627
renaming
DeagleGross ea428fb
fix tests
DeagleGross a2b47ac
fix comment
DeagleGross 797f234
Merge branch 'main' into dmkorolev/a2a-tasks
DeagleGross d84213f
runmode rename
DeagleGross 3aba021
rename
DeagleGross da94d01
rename
DeagleGross 732900e
use exxperimental api, allow experimental on project level
DeagleGross a59ae7b
throw on refereceTaskIds
DeagleGross 8f1836b
Merge branch 'main' into dmkorolev/a2a-tasks
DeagleGross File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
dotnet/src/Microsoft.Agents.AI.Hosting.A2A/A2AHostingJsonUtilities.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| // Copyright (c) Microsoft. All rights reserved. | ||
|
|
||
| using System.Text.Json; | ||
|
|
||
| namespace Microsoft.Agents.AI.Hosting.A2A; | ||
|
|
||
| /// <summary> | ||
| /// Provides JSON serialization options for A2A Hosting APIs to support AOT and trimming. | ||
| /// </summary> | ||
| public static class A2AHostingJsonUtilities | ||
| { | ||
| /// <summary> | ||
| /// Gets the default <see cref="JsonSerializerOptions"/> instance used for A2A Hosting serialization. | ||
| /// </summary> | ||
| public static JsonSerializerOptions DefaultOptions { get; } = CreateDefaultOptions(); | ||
|
|
||
| private static JsonSerializerOptions CreateDefaultOptions() | ||
| { | ||
| JsonSerializerOptions options = new(global::A2A.A2AJsonUtilities.DefaultOptions); | ||
|
|
||
| // Chain in the resolvers from both AgentAbstractionsJsonUtilities and the A2A SDK context. | ||
| // AgentAbstractionsJsonUtilities is first to ensure M.E.AI types (e.g. ResponseContinuationToken) | ||
| // are handled via its resolver, followed by the A2A SDK resolver for protocol types. | ||
| options.TypeInfoResolverChain.Clear(); | ||
| options.TypeInfoResolverChain.Add(AgentAbstractionsJsonUtilities.DefaultOptions.TypeInfoResolver!); | ||
| options.TypeInfoResolverChain.Add(global::A2A.A2AJsonUtilities.DefaultOptions.TypeInfoResolver!); | ||
|
|
||
| options.MakeReadOnly(); | ||
| return options; | ||
| } | ||
| } | ||
21 changes: 21 additions & 0 deletions
21
dotnet/src/Microsoft.Agents.AI.Hosting.A2A/A2ARunDecisionContext.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| // Copyright (c) Microsoft. All rights reserved. | ||
|
|
||
| using A2A; | ||
|
|
||
| namespace Microsoft.Agents.AI.Hosting.A2A; | ||
|
|
||
| /// <summary> | ||
| /// Provides context for a custom A2A run mode decision. | ||
| /// </summary> | ||
| public sealed class A2ARunDecisionContext | ||
| { | ||
| internal A2ARunDecisionContext(MessageSendParams messageSendParams) | ||
| { | ||
| this.MessageSendParams = messageSendParams; | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Gets the parameters of the incoming A2A message that triggered this run. | ||
| /// </summary> | ||
| public MessageSendParams MessageSendParams { get; } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.