generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 605
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Problem Statement
The A2A converters (convert_input_to_message and convert_response_to_agent_result) currently only support TextPart content. This limits A2AAgent to text-only interactions, even though both Strands and A2A support richer content types.
When users try to send images, documents, or other content types through A2AAgent, the content is silently dropped or causes errors.
Proposed Solution
Extend the converters in src/strands/multiagent/a2a/converters.py to handle additional content types:
Input conversion (Strands → A2A)
| Strands ContentBlock | A2A Part | Priority |
|---|---|---|
text |
TextPart |
✅ Done |
image |
FilePart (with MIME type) |
High |
document |
FilePart (with MIME type) |
High |
video |
FilePart (with MIME type) |
Medium |
toolUse / toolResult |
DataPart (JSON) |
Low |
Output conversion (A2A → Strands)
| A2A Part | Strands ContentBlock | Priority |
|---|---|---|
TextPart |
text |
✅ Done |
FilePart (image/*) |
image |
High |
FilePart (application/pdf, etc.) |
document |
High |
FilePart (video/*) |
video |
Medium |
DataPart / JsonPart |
Custom handling | Medium |
Implementation notes
- A2A
FilePartcan contain either a URI or inline base64 data - Strands
ImageContentusessource.bytesfor inline data orsource.urlfor URLs - MIME type mapping needed between formats
Use Case
- Multi-modal agents: Users want to send images to remote A2A agents for analysis (e.g., image classification, document OCR)
- Document processing: Send PDFs or documents to specialized A2A agents
- Rich responses: Receive images, charts, or generated files from A2A agents
Example:
from strands.agent import A2AAgent
agent = A2AAgent(endpoint="https://image-analyzer.example.com")
# Currently fails - image content is dropped
result = agent([
{"role": "user", "content": [
{"text": "What's in this image?"},
{"image": {"source": {"bytes": image_bytes, "mediaType": "image/png"}}}
]}
])Alternatives Solutions
- Manual conversion: Users convert content themselves before calling A2AAgent - adds friction and duplicates logic
- Separate methods: Add
send_image(),send_document()methods - fragments the API - Passthrough mode: Allow raw A2A messages - loses type safety and Strands integration
Additional Context
- A2A Part types: https://agent2agent.info/docs/concepts/part/
- Strands ContentBlock:
src/strands/types/content.py - Current converter:
src/strands/multiagent/a2a/converters.py
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request