-
Notifications
You must be signed in to change notification settings - Fork 271
feat: introduce TransportProtocol validation #527
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?
feat: introduce TransportProtocol validation #527
Conversation
Summary of ChangesHello @martimfasantos, 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 improves the type safety and consistency of transport protocol definitions within the A2A agent types. By refactoring relevant fields to use a newly introduced 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 is a great step towards improving type safety by introducing the TransportProtocol enum and using it in AgentInterface and AgentCard instead of raw strings. The refactoring to move the enum definition to a more logical place is also a good cleanup.
I've added a few low-severity suggestions to align the new enum member names with common Python conventions for constants (UPPER_SNAKE_CASE), which should improve readability.
One thing to consider is that the tests in tests/test_types.py don't seem to be updated to reflect these type changes. While the existing tests might still pass due to Pydantic's type coercion, it would be beneficial to add or update tests to explicitly validate the new TransportProtocol enum usage, including default values and handling of invalid inputs.
Overall, this is a solid improvement.
This pull request improves the way transport protocols are used by some of the classes in A2A agent types by updating relevant fields to use it instead of plain strings.
Transport protocol type safety improvements:
transportfield in theAgentInterfaceclass to use the newTransportProtocolenum instead of a string, including updating example values.preferred_transportfield in theAgentCardclass to use the newTransportProtocolenum, set its default toTransportProtocol.jsonrpc, and updated example values.