-
Notifications
You must be signed in to change notification settings - Fork 337
[DRAFT] feat!: Upgrade A2A to v1.0 #556
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
Conversation
|
This is a pretty good start on converting the types generation from the a2a.json to the a2a.proto. My main concern is that this is going to be a breaking change because the existing typing are based on Pydantic models, not Protobuf. This would need to be handled carefully to prevent breaking changes. |
This updates the SDK to be A2A v1.0 compliant, all types are generated from the v1.0 a2a.proto. JSONRPC/HTTP+JSON transports are converted to use the a2a types encoded using ProtoJSON directly from the generated types.
754cd73 to
b348735
Compare
|
@holtskinner if we assume this is going to be done from 1.0 only, spec which is not released yet, where we acknowledge breaking changes are acceptable, would this be acceptable for the python SDK ? |
BREAKING CHANGE: Replace Pydantic-based type system with protobuf types - Update all source files to use proto types directly from a2a_pb2 - Replace model_dump() with MessageToDict() for JSON serialization - Replace model_copy(deep=True) with CopyFrom() for proto cloning - Update Part usage from Part(root=TextPart(...)) to Part(text=...) - Update Role enum from Role.user to Role.ROLE_USER - Update TaskState enum to use TASK_STATE_* prefix - Add new types module with proto imports and SDK-specific extras - Add proto_utils module with identity conversion utilities - Fix REST handler resource name formats for push notification configs - Fix gRPC handler to use SubscribeToTask instead of TaskSubscription - Fix database task store to handle proto objects from ORM - Update all test files for proto patterns and assertions Tested: 601 tests passing, 23 skipped (expected - DB/crypto deps) Signed-off-by: Luca Muscariello <[email protected]>
- Fix agent_app.py Part access pattern for proto (HasField/direct access) - Fix ClientEvent handling in E2E tests (StreamResponse, not Task) - Fix notifications_app.py to serialize proto Task to dict - Update SetTaskPushNotificationConfigRequest interface in handlers - Update default_request_handler to use request.parent instead of name - Update jsonrpc_handler to pass full request to handler - Update unit tests to use SetTaskPushNotificationConfigRequest Signed-off-by: Luca Muscariello <[email protected]>
|
superseded by #572 |
## Summary This PR migrates the a2a-python SDK from Pydantic-based types to protobuf-generated types, completing the upgrade to A2A v1.0. Fixes #559 ## Breaking Changes - Replace Pydantic-based type system with protobuf types from `a2a_pb2` - Update `Part` usage from `Part(root=TextPart(text=...))` to `Part(text=...)` - Update `Role` enum from `Role.user`/`Role.agent` to `Role.ROLE_USER`/`Role.ROLE_AGENT` - Update `TaskState` enum to use `TASK_STATE_*` prefix ## Changes - Update all source files to use proto types directly from `a2a_pb2` - Replace `model_dump()` with `MessageToDict()` for JSON serialization - Replace `model_copy(deep=True)` with `CopyFrom()` for proto cloning - Add new types module with proto imports and SDK-specific extras - Add `proto_utils` module with identity conversion utilities - Fix REST handler resource name formats for push notification configs - Fix gRPC handler to use `SubscribeToTask` instead of `TaskSubscription` - Fix database task store to handle proto objects from ORM - Update all test files for proto patterns and assertions - Fix spelling check failures by updating allow list - Fix inclusive language check failures: - Replace `master` with `main` in documentation - Rename `Dummy` classes to `Mock` in tests ## Testing - **601 tests passing** - 23 tests skipped (expected - require DB connections or cryptography deps) ## Related Builds on top of PR #556 Release-As: 1.0.0 --------- Signed-off-by: Luca Muscariello <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Sam Betts <[email protected]> Co-authored-by: Lukasz Kawka <[email protected]> Co-authored-by: Agent2Agent (A2A) Bot <[email protected]> Co-authored-by: Didier Durand <[email protected]> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Iva Sokolaj <[email protected]> Co-authored-by: Will Chen <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Description
This updates the SDK to be A2A v1.0 compliant, all types are generated from the v1.0 a2a.proto. JSONRPC/HTTP+JSON transports are converted to use the a2a types encoded using ProtoJSON directly from the generated types.
Thank you for opening a Pull Request!
Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
CONTRIBUTINGGuide.fix:which represents bug fixes, and correlates to a SemVer patch.feat:represents a new feature, and correlates to a SemVer minor.feat!:, orfix!:,refactor!:, etc., which represent a breaking change (indicated by the!) and will result in a SemVer major.bash scripts/format.shfrom the repository root to format)Fixes #559