fix(compat): allow DataPart.data to accept Any to align with spec#823
fix(compat): allow DataPart.data to accept Any to align with spec#823Akshat8510 wants to merge 1 commit intoa2aproject:1.0-devfrom
Conversation
Signed-off-by: Akshat Kumar <akshat230405@gmail.com>
Summary of ChangesHello, 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 addresses a compatibility issue by broadening the accepted data type for the Highlights
Changelog
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
|
|
@gemini-code-assist/gemini review |
There was a problem hiding this comment.
Code Review
This pull request updates the type hint for DataPart.data in src/a2a/compat/v0_3/types.py from dict[str, Any] to Any. As described, this change aligns the type with the A2A specification, which permits any valid JSON type for this field, not just objects. The change is a targeted modification to the type hint. I have reviewed the changes and have no further comments.
There was a problem hiding this comment.
Code Review
This pull request updates the type hint for DataPart.data in the v0.3 compatibility layer from dict[str, Any] to Any. This change correctly aligns the type definition with the A2A specification, which allows the data field to be any valid JSON value, not just an object. The change is accurate and appropriate.
|
Hey @Akshat8510, thanks for taking a look, please see #714 (comment), this is working as intended. |
Closes #714
Changes:
DataPart.datatype hint fromdict[str, Any]toAnyinsrc/a2a/compat/v0_3/types.py.Context:
Following the 1.0-dev refactor, the
DataPartclass now resides in thecompat/v0_3layer. This change ensures that the compatibility layer aligns with the A2A specification (wheredatacan be an object, array, string, etc.).I verified that the new 1.0
types(generated from Protobuf) use thePartmessage, which already correctly handles these types.