-
Notifications
You must be signed in to change notification settings - Fork 325
feat(spec): Update A2A types from specification 🤖 #347
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
holtskinner
merged 1 commit into
main
from
auto-update-a2a-types-23d5c5967b50c6df0d0a8434446a241a75aab09c
Jul 24, 2025
Merged
Changes from all commits
Commits
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
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -75,16 +75,23 @@ class AgentExtension(A2ABaseModel): | |||||||||||||
| class AgentInterface(A2ABaseModel): | ||||||||||||||
| """ | ||||||||||||||
| Declares a combination of a target URL and a transport protocol for interacting with the agent. | ||||||||||||||
| This allows agents to expose the same functionality over multiple transport mechanisms. | ||||||||||||||
| """ | ||||||||||||||
|
|
||||||||||||||
| transport: str | ||||||||||||||
| transport: str = Field(..., examples=['JSONRPC', 'GRPC', 'HTTP+JSON']) | ||||||||||||||
| """ | ||||||||||||||
| The transport protocol supported at this URL. This is a string to allow for future | ||||||||||||||
| extension. Core supported transports include 'JSONRPC', 'GRPC', and 'HTTP+JSON'. | ||||||||||||||
| The transport protocol supported at this URL. | ||||||||||||||
| """ | ||||||||||||||
| url: str | ||||||||||||||
| url: str = Field( | ||||||||||||||
| ..., | ||||||||||||||
| examples=[ | ||||||||||||||
| 'https://api.example.com/a2a/v1', | ||||||||||||||
| 'https://grpc.example.com/a2a', | ||||||||||||||
| 'https://rest.example.com/v1', | ||||||||||||||
| ], | ||||||||||||||
| ) | ||||||||||||||
| """ | ||||||||||||||
| The URL where this interface is available. | ||||||||||||||
| The URL where this interface is available. Must be a valid absolute HTTPS URL in production. | ||||||||||||||
| """ | ||||||||||||||
|
|
||||||||||||||
|
|
||||||||||||||
|
|
@@ -928,6 +935,16 @@ class TextPart(A2ABaseModel): | |||||||||||||
| """ | ||||||||||||||
|
|
||||||||||||||
|
|
||||||||||||||
| class TransportProtocol(str, Enum): | ||||||||||||||
| """ | ||||||||||||||
| Supported A2A transport protocols. | ||||||||||||||
| """ | ||||||||||||||
|
|
||||||||||||||
| jsonrpc = 'JSONRPC' | ||||||||||||||
| grpc = 'GRPC' | ||||||||||||||
| http_json = 'HTTP+JSON' | ||||||||||||||
|
|
||||||||||||||
|
|
||||||||||||||
| class UnsupportedOperationError(A2ABaseModel): | ||||||||||||||
| """ | ||||||||||||||
| An A2A-specific error indicating that the requested operation is not supported by the agent. | ||||||||||||||
|
|
@@ -1615,7 +1632,16 @@ class AgentCard(A2ABaseModel): | |||||||||||||
| additional_interfaces: list[AgentInterface] | None = None | ||||||||||||||
| """ | ||||||||||||||
| A list of additional supported interfaces (transport and URL combinations). | ||||||||||||||
| A client can use any of these to communicate with the agent. | ||||||||||||||
| This allows agents to expose multiple transports, potentially at different URLs. | ||||||||||||||
|
|
||||||||||||||
| Best practices: | ||||||||||||||
| - SHOULD include all supported transports for completeness | ||||||||||||||
| - SHOULD include an entry matching the main 'url' and 'preferredTransport' | ||||||||||||||
| - MAY reuse URLs if multiple transports are available at the same endpoint | ||||||||||||||
| - MUST accurately declare the transport available at each URL | ||||||||||||||
|
|
||||||||||||||
| Clients can select any interface from this list based on their transport capabilities | ||||||||||||||
| and preferences. This enables transport negotiation and fallback scenarios. | ||||||||||||||
| """ | ||||||||||||||
| capabilities: AgentCapabilities | ||||||||||||||
| """ | ||||||||||||||
|
|
@@ -1650,9 +1676,16 @@ class AgentCard(A2ABaseModel): | |||||||||||||
| """ | ||||||||||||||
| A human-readable name for the agent. | ||||||||||||||
| """ | ||||||||||||||
| preferred_transport: str | None = None | ||||||||||||||
| preferred_transport: str | None = Field( | ||||||||||||||
| default='JSONRPC', examples=['JSONRPC', 'GRPC', 'HTTP+JSON'] | ||||||||||||||
| ) | ||||||||||||||
|
Comment on lines
+1679
to
+1681
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The
Suggested change
|
||||||||||||||
| """ | ||||||||||||||
| The transport protocol for the preferred endpoint. Defaults to 'JSONRPC' if not specified. | ||||||||||||||
| The transport protocol for the preferred endpoint (the main 'url' field). | ||||||||||||||
| If not specified, defaults to 'JSONRPC'. | ||||||||||||||
|
|
||||||||||||||
| IMPORTANT: The transport specified here MUST be available at the main 'url'. | ||||||||||||||
| This creates a binding between the main URL and its supported transport protocol. | ||||||||||||||
| Clients should prefer this transport and URL combination when both are supported. | ||||||||||||||
| """ | ||||||||||||||
| protocol_version: str | None = '0.2.6' | ||||||||||||||
| """ | ||||||||||||||
|
|
@@ -1681,9 +1714,10 @@ class AgentCard(A2ABaseModel): | |||||||||||||
| If true, the agent can provide an extended agent card with additional details | ||||||||||||||
| to authenticated users. Defaults to false. | ||||||||||||||
| """ | ||||||||||||||
| url: str | ||||||||||||||
| url: str = Field(..., examples=['https://api.example.com/a2a/v1']) | ||||||||||||||
| """ | ||||||||||||||
| The preferred endpoint URL for interacting with the agent. | ||||||||||||||
| This URL MUST support the transport specified by 'preferredTransport'. | ||||||||||||||
| """ | ||||||||||||||
| version: str = Field(..., examples=['1.0.0']) | ||||||||||||||
| """ | ||||||||||||||
|
|
||||||||||||||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using the
TransportProtocolenum here for thetransportfield instead ofstr. This provides better type safety and validation.