-
Notifications
You must be signed in to change notification settings - Fork 325
Description
Checks
- I have updated to the lastest minor and patch version of Strands
- I have checked the documentation and this is not expected behavior
- I have searched ./issues and there are no duplicates of my issue
Strands Version
1.0.0
Python Version
3.13
Operating System
macOS 15.5
Installation Method
pip
Steps to Reproduce
Have an invoke command for the A2A Server like so:
import asyncio
import json
import httpx
from uuid import uuid4
from a2a.client import A2ACardResolver, A2AClient
from a2a.types import MessageSendParams, SendStreamingMessageRequest, SendMessageRequest
async def ask_agent(port: str):
async with httpx.AsyncClient(timeout=httpx.Timeout(timeout=None)) as httpx_client:
# Connect to the agent
resolver = A2ACardResolver(httpx_client=httpx_client, base_url="http://localhost/:" + port)
agent_card = await resolver.get_agent_card()
print("Agent:", agent_card.name)
client = A2AClient(httpx_client=httpx_client, agent_card=agent_card)
message = input("Enter your message: ")
# Send the message
request = SendMessageRequest(
id=str(uuid4()),
params=MessageSendParams(
message={
"role": "user",
"parts": [{"kind":"data", "data": {"text": "User's favorite villain is the Joker"}}, {"kind": "text", "text": message}],
"messageId": uuid4().hex,
}
),
)
response = await client.send_message(request)
print("Response:", response.model_dump(mode="json", exclude_none=True))
# Example usage
async def main():
port = input("Enter the port of your agent: ")
await ask_agent(port)
if __name__ == "__main__":
asyncio.run(main())
Create an A2A Server like so:
import logging
import sys
from strands import Agent
from strands.multiagent.a2a import A2AServer
from strands.models.bedrock import BedrockModel
logging.basicConfig(
level=logging.ERROR,
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
handlers=[logging.StreamHandler(sys.stdout)],
force=True,
)
# Log that we're starting
logging.info("Starting A2A server with root logger")
strands_agent = Agent(
name= "Hello World Agent",
model= BedrockModel(
region_name="us-west-2",
model_id="us.anthropic.claude-3-7-sonnet-20250219-v1:0",
streaming=True,
),
description="Just a hello world agent",
)
# uncomment to enable streaming
# strands_a2a_agent = A2AServer(agent=strands_agent, streaming=True)
# sync enabled
strands_a2a_agent = A2AServer(agent=strands_agent)
strands_a2a_agent.serve()
When invoking the Bedrock Converse API it doesn't seem to actually pass along the DataPart type (even though data part is just an arbitrary object of string keys and values of any type).
Expected Behavior
I would expect A2A Servers to pass along DataParts to the Converse API https://a2a-protocol.org/latest/specification/#653-datapart-object as defined in the specification.
Actual Behavior
DataParts are not forwarded when invoking the LLM.
Additional Context
As noted in this issue here a2aproject/A2A#602 we are trying to use DataParts to pass context from previous messages in the session (previous messages between the agent and the user) to bring context which as noted in the comments in this issue folks seem to either do this via a DataPart or by using metadata.
Possible Solution
No response
Related Issues
No response