Skip to content

Commit fa9da83

Browse files
strands a2a demo
1 parent e59c713 commit fa9da83

10 files changed

Lines changed: 3283 additions & 0 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.13

strands-a2a-demo/strands-a2a-client/README.md

Whitespace-only changes.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import asyncio
2+
3+
from strands.agent.a2a_agent import A2AAgent
4+
5+
async def main():
6+
agent = A2AAgent(endpoint="http://localhost:9000")
7+
agent_card = await agent.get_agent_card()
8+
9+
print("Invoking remote agent with agent card:")
10+
for key, value in agent_card:
11+
print(key, ":", value)
12+
print('-' * 20)
13+
14+
while True:
15+
prompt = input("User: ")
16+
if prompt.lower() == "exit":
17+
break
18+
19+
async for event in agent.stream_async(prompt):
20+
if "result" in event:
21+
print("AI: ", event["result"], end="", flush=True)
22+
23+
24+
if __name__ == "__main__":
25+
asyncio.run(main())
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[project]
2+
name = "strands-a2a-client"
3+
version = "0.1.0"
4+
description = "Add your description here"
5+
readme = "README.md"
6+
requires-python = ">=3.13"
7+
dependencies = [
8+
"strands-agents[a2a]==1.42.0",
9+
]

strands-a2a-demo/strands-a2a-client/uv.lock

Lines changed: 1273 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.13

strands-a2a-demo/strands-a2a-server/README.md

Whitespace-only changes.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
from dotenv import load_dotenv
2+
from strands import Agent
3+
from strands.multiagent.a2a import A2AServer
4+
from strands_tools import http_request
5+
6+
load_dotenv()
7+
8+
def main():
9+
agent = Agent(
10+
callback_handler=None,
11+
description="A sample strands agent",
12+
model="us.amazon.nova-micro-v1:0",
13+
name="my strands agent",
14+
tools=[http_request],
15+
)
16+
a2a_server = A2AServer(agent=agent)
17+
a2a_server.serve()
18+
19+
if __name__ == "__main__":
20+
main()
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[project]
2+
name = "strands-a2a-server"
3+
version = "0.1.0"
4+
description = "Add your description here"
5+
readme = "README.md"
6+
requires-python = ">=3.13"
7+
dependencies = [
8+
"python-dotenv==1.2.2",
9+
"strands-agents-tools==0.8.0",
10+
"strands-agents[a2a]==1.42.0",
11+
]

strands-a2a-demo/strands-a2a-server/uv.lock

Lines changed: 1943 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)