-
Notifications
You must be signed in to change notification settings - Fork 330
Update to specification from a4afeea788b3877101f7a63c2e50091709490058 #618
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
base: main
Are you sure you want to change the base?
Update to specification from a4afeea788b3877101f7a63c2e50091709490058 #618
Conversation
Summary of ChangesHello @a2a-bot, 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 introduces significant updates to the A2A protocol specification, primarily focusing on enhancing multi-tenancy capabilities and refining the API surface. It includes the addition of new functionalities for task management and agent card retrieval, alongside a comprehensive restructuring and renaming of existing fields and RPC methods to improve clarity and adherence to best practices. The changes also involve a detailed adjustment of field optionality and requirements, ensuring a more robust and flexible protocol definition. Highlights
Using Gemini Code AssistThe 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 by creating a comment using either
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 Limitations & Feedback Gemini Code Assist 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. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. 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
|
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.
Code Review
This pull request updates the generated gRPC and Pydantic type files based on a new version of the A2A specification (v0.3.0). The changes introduce several breaking changes, including renaming RPC methods and message fields, and adding new methods.
While the generated files themselves seem correct, this pull request is incomplete and will likely break the build. The client and server implementations in src/a2a/client/transports/grpc.py and src/a2a/server/request_handlers/grpc_handler.py that consume this generated code have not been updated to reflect these breaking changes.
I've added specific comments highlighting some of the key breaking changes, such as:
- RPC method renames (e.g.,
TaskSubscriptiontoSubscribeToTask). - Addition of new RPC methods (e.g.,
ListTasks) that require implementation. - Renaming of message fields (e.g.,
Message.contenttoMessage.parts).
Please update the consuming code to align with the new API definitions in this PR before merging.
| self.SubscribeToTask = channel.unary_stream( | ||
| '/a2a.v1.A2AService/SubscribeToTask', | ||
| request_serializer=a2a__pb2.SubscribeToTaskRequest.SerializeToString, | ||
| response_deserializer=a2a__pb2.StreamResponse.FromString, | ||
| _registered_method=True) |
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.
| self.SetTaskPushNotificationConfig = channel.unary_unary( | ||
| '/a2a.v1.A2AService/SetTaskPushNotificationConfig', | ||
| request_serializer=a2a__pb2.SetTaskPushNotificationConfigRequest.SerializeToString, | ||
| response_deserializer=a2a__pb2.TaskPushNotificationConfig.FromString, | ||
| _registered_method=True) |
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.
| self.GetExtendedAgentCard = channel.unary_unary( | ||
| '/a2a.v1.A2AService/GetExtendedAgentCard', | ||
| request_serializer=a2a__pb2.GetExtendedAgentCardRequest.SerializeToString, | ||
| response_deserializer=a2a__pb2.AgentCard.FromString, | ||
| _registered_method=True) |
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.
| self.ListTasks = channel.unary_unary( | ||
| '/a2a.v1.A2AService/ListTasks', | ||
| request_serializer=a2a__pb2.ListTasksRequest.SerializeToString, | ||
| response_deserializer=a2a__pb2.ListTasksResponse.FromString, | ||
| _registered_method=True) |
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.
| __slots__ = ("accepted_output_modes", "push_notification_config", "history_length", "blocking") | ||
| ACCEPTED_OUTPUT_MODES_FIELD_NUMBER: _ClassVar[int] | ||
| PUSH_NOTIFICATION_FIELD_NUMBER: _ClassVar[int] | ||
| PUSH_NOTIFICATION_CONFIG_FIELD_NUMBER: _ClassVar[int] | ||
| HISTORY_LENGTH_FIELD_NUMBER: _ClassVar[int] | ||
| BLOCKING_FIELD_NUMBER: _ClassVar[int] | ||
| accepted_output_modes: _containers.RepeatedScalarFieldContainer[str] | ||
| push_notification: PushNotificationConfig | ||
| push_notification_config: PushNotificationConfig | ||
| history_length: int | ||
| blocking: bool | ||
| def __init__(self, accepted_output_modes: _Optional[_Iterable[str]] = ..., push_notification: _Optional[_Union[PushNotificationConfig, _Mapping]] = ..., history_length: _Optional[int] = ..., blocking: _Optional[bool] = ...) -> None: ... | ||
| def __init__(self, accepted_output_modes: _Optional[_Iterable[str]] = ..., push_notification_config: _Optional[_Union[PushNotificationConfig, _Mapping]] = ..., history_length: _Optional[int] = ..., blocking: _Optional[bool] = ...) -> None: ... |
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.
| __slots__ = ("message_id", "context_id", "task_id", "role", "parts", "metadata", "extensions", "reference_task_ids") | ||
| MESSAGE_ID_FIELD_NUMBER: _ClassVar[int] | ||
| CONTEXT_ID_FIELD_NUMBER: _ClassVar[int] | ||
| TASK_ID_FIELD_NUMBER: _ClassVar[int] | ||
| ROLE_FIELD_NUMBER: _ClassVar[int] | ||
| CONTENT_FIELD_NUMBER: _ClassVar[int] | ||
| PARTS_FIELD_NUMBER: _ClassVar[int] | ||
| METADATA_FIELD_NUMBER: _ClassVar[int] | ||
| EXTENSIONS_FIELD_NUMBER: _ClassVar[int] | ||
| REFERENCE_TASK_IDS_FIELD_NUMBER: _ClassVar[int] | ||
| message_id: str | ||
| context_id: str | ||
| task_id: str | ||
| role: Role | ||
| content: _containers.RepeatedCompositeFieldContainer[Part] | ||
| parts: _containers.RepeatedCompositeFieldContainer[Part] | ||
| metadata: _struct_pb2.Struct | ||
| extensions: _containers.RepeatedScalarFieldContainer[str] | ||
| def __init__(self, message_id: _Optional[str] = ..., context_id: _Optional[str] = ..., task_id: _Optional[str] = ..., role: _Optional[_Union[Role, str]] = ..., content: _Optional[_Iterable[_Union[Part, _Mapping]]] = ..., metadata: _Optional[_Union[_struct_pb2.Struct, _Mapping]] = ..., extensions: _Optional[_Iterable[str]] = ...) -> None: ... | ||
| reference_task_ids: _containers.RepeatedScalarFieldContainer[str] | ||
| def __init__(self, message_id: _Optional[str] = ..., context_id: _Optional[str] = ..., task_id: _Optional[str] = ..., role: _Optional[_Union[Role, str]] = ..., parts: _Optional[_Iterable[_Union[Part, _Mapping]]] = ..., metadata: _Optional[_Union[_struct_pb2.Struct, _Mapping]] = ..., extensions: _Optional[_Iterable[str]] = ..., reference_task_ids: _Optional[_Iterable[str]] = ...) -> None: ... |
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.
| __slots__ = ("tenant", "message", "configuration", "metadata") | ||
| TENANT_FIELD_NUMBER: _ClassVar[int] | ||
| MESSAGE_FIELD_NUMBER: _ClassVar[int] | ||
| CONFIGURATION_FIELD_NUMBER: _ClassVar[int] | ||
| METADATA_FIELD_NUMBER: _ClassVar[int] | ||
| request: Message | ||
| tenant: str | ||
| message: Message | ||
| configuration: SendMessageConfiguration | ||
| metadata: _struct_pb2.Struct | ||
| def __init__(self, request: _Optional[_Union[Message, _Mapping]] = ..., configuration: _Optional[_Union[SendMessageConfiguration, _Mapping]] = ..., metadata: _Optional[_Union[_struct_pb2.Struct, _Mapping]] = ...) -> None: ... | ||
| def __init__(self, tenant: _Optional[str] = ..., message: _Optional[_Union[Message, _Mapping]] = ..., configuration: _Optional[_Union[SendMessageConfiguration, _Mapping]] = ..., metadata: _Optional[_Union[_struct_pb2.Struct, _Mapping]] = ...) -> None: ... |
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.
| __slots__ = ("task", "message") | ||
| TASK_FIELD_NUMBER: _ClassVar[int] | ||
| MSG_FIELD_NUMBER: _ClassVar[int] | ||
| MESSAGE_FIELD_NUMBER: _ClassVar[int] | ||
| task: Task | ||
| msg: Message | ||
| def __init__(self, task: _Optional[_Union[Task, _Mapping]] = ..., msg: _Optional[_Union[Message, _Mapping]] = ...) -> None: ... | ||
| message: Message | ||
| def __init__(self, task: _Optional[_Union[Task, _Mapping]] = ..., message: _Optional[_Union[Message, _Mapping]] = ...) -> None: ... |
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.
| __slots__ = ("task", "message", "status_update", "artifact_update") | ||
| TASK_FIELD_NUMBER: _ClassVar[int] | ||
| MSG_FIELD_NUMBER: _ClassVar[int] | ||
| MESSAGE_FIELD_NUMBER: _ClassVar[int] | ||
| STATUS_UPDATE_FIELD_NUMBER: _ClassVar[int] | ||
| ARTIFACT_UPDATE_FIELD_NUMBER: _ClassVar[int] | ||
| task: Task | ||
| msg: Message | ||
| message: Message | ||
| status_update: TaskStatusUpdateEvent | ||
| artifact_update: TaskArtifactUpdateEvent | ||
| def __init__(self, task: _Optional[_Union[Task, _Mapping]] = ..., msg: _Optional[_Union[Message, _Mapping]] = ..., status_update: _Optional[_Union[TaskStatusUpdateEvent, _Mapping]] = ..., artifact_update: _Optional[_Union[TaskArtifactUpdateEvent, _Mapping]] = ...) -> None: ... | ||
| def __init__(self, task: _Optional[_Union[Task, _Mapping]] = ..., message: _Optional[_Union[Message, _Mapping]] = ..., status_update: _Optional[_Union[TaskStatusUpdateEvent, _Mapping]] = ..., artifact_update: _Optional[_Union[TaskArtifactUpdateEvent, _Mapping]] = ...) -> None: ... |
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.
| __slots__ = ("file_with_uri", "file_with_bytes", "media_type", "name") | ||
| FILE_WITH_URI_FIELD_NUMBER: _ClassVar[int] | ||
| FILE_WITH_BYTES_FIELD_NUMBER: _ClassVar[int] | ||
| MIME_TYPE_FIELD_NUMBER: _ClassVar[int] | ||
| MEDIA_TYPE_FIELD_NUMBER: _ClassVar[int] | ||
| NAME_FIELD_NUMBER: _ClassVar[int] | ||
| file_with_uri: str | ||
| file_with_bytes: bytes | ||
| mime_type: str | ||
| media_type: str | ||
| name: str | ||
| def __init__(self, file_with_uri: _Optional[str] = ..., file_with_bytes: _Optional[bytes] = ..., mime_type: _Optional[str] = ..., name: _Optional[str] = ...) -> None: ... | ||
| def __init__(self, file_with_uri: _Optional[str] = ..., file_with_bytes: _Optional[bytes] = ..., media_type: _Optional[str] = ..., name: _Optional[str] = ...) -> None: ... |
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.
Commit: a2aproject/A2A@a4afeea