feat(helpers): add non-text Part extractors and artifact update events#1017
Open
martimfasantos wants to merge 1 commit intoa2aproject:mainfrom
Open
feat(helpers): add non-text Part extractors and artifact update events#1017martimfasantos wants to merge 1 commit intoa2aproject:mainfrom
martimfasantos wants to merge 1 commit intoa2aproject:mainfrom
Conversation
🧪 Code Coverage (vs
|
| Base | PR | Delta | |
|---|---|---|---|
| src/a2a/helpers/proto_helpers.py | 95.45% | 96.00% | 🟢 +0.55% |
| src/a2a/server/events/event_queue_v2.py | 91.71% | 91.19% | 🔴 -0.52% |
| src/a2a/utils/telemetry.py | 91.41% | 90.63% | 🔴 -0.78% |
| Total | 93.03% | 93.01% | 🔴 -0.01% |
Generated by coverage-comment.yml
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the src/a2a/helpers/init.py file to include and export a variety of new helper functions for creating data, raw, text, and URL-based artifacts, messages, and parts. These changes expand the utility of the A2A SDK for developers. I have no feedback to provide.
- Add get_data_parts, get_raw_parts, get_url_parts extractors to complement the existing get_text_parts. - Add new_data_artifact_update_event, new_raw_artifact_update_event, new_url_artifact_update_event to complement the existing new_text_artifact_update_event. - Re-export all new and previously unexposed helpers (from a2aproject#1004) in a2a.helpers.__init__ so they are accessible via `from a2a.helpers import ...`. - Add tests for all new helpers (12 new test cases).
e870a4a to
1b1c8ca
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
get_data_parts,get_raw_parts,get_url_partsextractors to complement the existingget_text_parts, completing the Part extraction API for all content types.new_data_artifact_update_event,new_raw_artifact_update_event,new_url_artifact_update_eventto complement the existingnew_text_artifact_update_event, completing the streaming event helpers for all content types.new_data_part,new_raw_part,new_url_part,new_text_part,new_data_message,new_raw_message,new_url_message,new_data_artifact,new_raw_artifact,new_url_artifact) ina2a.helpers.__init__so they are accessible viafrom a2a.helpers import ....Changes
src/a2a/helpers/proto_helpers.py: Added 6 new functions (3 extractors + 3 artifact update events).src/a2a/helpers/__init__.py: Updated imports and__all__to expose all 16 new helpers.tests/helpers/test_proto_helpers.py: Added 12 new test cases covering all new functions.Testing
ruff,mypy,pyright,pytest(50 helper tests pass, 1675 total).