-
Notifications
You must be signed in to change notification settings - Fork 279
Update to specification from a8b45dcc429a5571ef8a24c36336bf84b89bbd7f #454
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
Update to specification from a8b45dcc429a5571ef8a24c36336bf84b89bbd7f #454
Conversation
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.
Summary of Changes
Hello @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 primarily focuses on evolving the A2A gRPC specification by introducing a new metadata capability to the Part message. This enhancement provides a standardized way to attach arbitrary structured data, improving the extensibility and information richness of message components. The changes are reflected in the regenerated Python protobuf files, ensuring compatibility and proper type hinting for the updated schema.
Highlights
- Protobuf Specification Update: The core A2A gRPC specification has been updated to include a new
metadatafield within thePartmessage. This field is of typegoogle.protobuf.Struct, allowing for flexible, structured data to be associated with message parts. - Generated Code Regeneration: The Python protobuf generated files (
a2a_pb2.pyanda2a_pb2.pyi) have been regenerated to reflect the updated specification, ensuring the Python client library is in sync with the latest schema.
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 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
-
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. ↩
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 protobuf specification to add a metadata field to the Part message. While the generated files a2a_pb2.py and a2a_pb2.pyi correctly reflect this change, the pull request is incomplete. It's missing the necessary changes in src/a2a/utils/proto_utils.py to handle the serialization and deserialization of this new field, which will lead to data loss and potential runtime errors. I've added a critical comment highlighting the issue. Please include the necessary changes to proto_utils.py and any other related files (like types.py and its corresponding tests) to make this PR complete.
| class Part(_message.Message): | ||
| __slots__ = ("text", "file", "data") | ||
| __slots__ = ("text", "file", "data", "metadata") | ||
| TEXT_FIELD_NUMBER: _ClassVar[int] | ||
| FILE_FIELD_NUMBER: _ClassVar[int] | ||
| DATA_FIELD_NUMBER: _ClassVar[int] | ||
| METADATA_FIELD_NUMBER: _ClassVar[int] | ||
| text: str | ||
| file: FilePart | ||
| data: DataPart | ||
| def __init__(self, text: _Optional[str] = ..., file: _Optional[_Union[FilePart, _Mapping]] = ..., data: _Optional[_Union[DataPart, _Mapping]] = ...) -> None: ... | ||
| metadata: _struct_pb2.Struct | ||
| def __init__(self, text: _Optional[str] = ..., file: _Optional[_Union[FilePart, _Mapping]] = ..., data: _Optional[_Union[DataPart, _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.
The addition of the metadata field to the Part message is a breaking change that is not fully implemented in this PR. The utility functions in src/a2a/utils/proto_utils.py for converting between protobuf messages and Python types have not been updated to handle this new field.
Specifically, ToProto.part and FromProto.part will not process the metadata, leading to data loss during serialization and deserialization.
This is a critical issue. Please update proto_utils.py and any other relevant files (e.g., src/a2a/types.py and associated tests) to fully support this change.
|
Replaced with #455 |
Commit: a2aproject/A2A@a8b45dc