Skip to content

feat(helpers): add non-text Part extractors and artifact update events#1017

Open
martimfasantos wants to merge 1 commit intoa2aproject:mainfrom
martimfasantos:feat/expose-proto-helpers-init
Open

feat(helpers): add non-text Part extractors and artifact update events#1017
martimfasantos wants to merge 1 commit intoa2aproject:mainfrom
martimfasantos:feat/expose-proto-helpers-init

Conversation

@martimfasantos
Copy link
Copy Markdown
Contributor

@martimfasantos martimfasantos commented Apr 24, 2026

Summary

  • Adds get_data_parts, get_raw_parts, get_url_parts extractors to complement the existing get_text_parts, completing the Part extraction API for all content types.
  • Adds new_data_artifact_update_event, new_raw_artifact_update_event, new_url_artifact_update_event to complement the existing new_text_artifact_update_event, completing the streaming event helpers for all content types.
  • Re-exports all new helpers and the previously unexposed helpers from feat(helpers): add non-text Part, Message, and Artifact helpers #1004 (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) in a2a.helpers.__init__ so they are accessible via from 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

  • All mandatory checks pass: ruff, mypy, pyright, pytest (50 helper tests pass, 1675 total).

@martimfasantos martimfasantos requested a review from a team as a code owner April 24, 2026 16:56
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 24, 2026

🧪 Code Coverage (vs main)

⬇️ Download Full Report

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

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a 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 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).
@martimfasantos martimfasantos force-pushed the feat/expose-proto-helpers-init branch from e870a4a to 1b1c8ca Compare April 26, 2026 00:03
@martimfasantos martimfasantos changed the title chore(helpers): expose new proto_helpers in __init__.py feat(helpers): add non-text Part extractors and artifact update events Apr 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant