Skip to content

Comments

feat: add AdditionalInterfaces and PreferredTransport props#34

Merged
SergeyMenshykh merged 5 commits intoa2aproject:mainfrom
SergeyMenshykh:add-additional-transport
Jul 8, 2025
Merged

feat: add AdditionalInterfaces and PreferredTransport props#34
SergeyMenshykh merged 5 commits intoa2aproject:mainfrom
SergeyMenshykh:add-additional-transport

Conversation

@SergeyMenshykh
Copy link
Collaborator

This PR adds transport-related properties introduced in v0.2.4 of the A2A spec to the agent card.

Contributes to: #23

@SergeyMenshykh SergeyMenshykh self-assigned this Jul 7, 2025
@SergeyMenshykh SergeyMenshykh changed the title .Net: Add AdditionalInterfaces and PreferredTransport props feat: add AdditionalInterfaces and PreferredTransport props Jul 7, 2025
@SergeyMenshykh SergeyMenshykh enabled auto-merge July 7, 2025 17:26
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary of Changes

Hello @SergeyMenshykh, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly updates the A2A .NET library by integrating new transport-related properties as defined in version 0.2.4 of the A2A specification. It introduces new data models to represent agent communication interfaces and transport protocols, enhancing the AgentCard's ability to describe an agent's connectivity. Additionally, it includes polyfills to ensure these new features are compatible with a wider range of .NET frameworks.

Highlights

  • AgentCard Model Enhancement: I've updated the AgentCard.cs model to include two new properties: AdditionalInterfaces (a list of AgentInterface objects) and PreferredTransport (an AgentTransport object). These additions align the AgentCard with version 0.2.4 of the A2A specification, allowing agents to announce multiple supported transports and a preferred communication method.
  • New AgentInterface Model: I've introduced a new AgentInterface.cs file, defining a class that encapsulates a target URL and its corresponding AgentTransport. This model is crucial for declaring specific endpoints and the transport protocols they support.
  • New AgentTransport Value Type: I've added AgentTransport.cs, a new readonly struct that represents different transport protocols (e.g., JSONRPC). This struct provides value equality, ensures proper JSON serialization/deserialization, and includes a static JsonRpc property for convenience.
  • C# Language Feature Polyfills: To ensure compatibility and enable the use of modern C# features like required members and init accessors across various .NET target frameworks, I've included polyfills for CompilerFeatureRequiredAttribute, IsExternalInit, and RequiredMemberAttribute under the Polyfills directory.
  • Unit Tests for AgentTransport: I've added a new unit test file, AgentTransportTests.cs, to thoroughly validate the functionality of the AgentTransport struct, covering its constructor, equality comparisons (including case-insensitivity), ToString() method, and JSON serialization/deserialization.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This PR introduces transport-related properties to the AgentCard, aligning with the A2A specification. Key feedback includes:

  • Using a JsonConverter for AgentTransport to ensure correct JSON serialization.
  • Adding URL validation to the Url property in AgentInterface.

@SergeyMenshykh SergeyMenshykh marked this pull request as draft July 7, 2025 17:31
auto-merge was automatically disabled July 7, 2025 17:31

Pull request was converted to draft

@SergeyMenshykh SergeyMenshykh marked this pull request as ready for review July 7, 2025 19:57
@SergeyMenshykh SergeyMenshykh enabled auto-merge July 7, 2025 21:18
@SergeyMenshykh SergeyMenshykh added this pull request to the merge queue Jul 8, 2025
Merged via the queue into a2aproject:main with commit fb8fc36 Jul 8, 2025
4 checks passed
@SergeyMenshykh SergeyMenshykh deleted the add-additional-transport branch July 8, 2025 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants