Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/helloworld/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "helloworld"
version = "0.1.0"
description = "HelloWorld agent example that only returns Messages"
readme = "README.md"
requires-python = ">=3.13"
requires-python = ">=3.12"
dependencies = [
"a2a-sdk",
"click>=8.1.8",
Expand Down
23 changes: 14 additions & 9 deletions examples/helloworld/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ async def main() -> None:
logger.error(f"Critical error fetching public agent card: {e}", exc_info=True)
raise RuntimeError("Failed to fetch the public agent card. Cannot continue.") from e


client = A2AClient(
httpx_client=httpx_client, agent_card=final_agent_card_to_use
)
Expand All @@ -80,14 +80,19 @@ async def main() -> None:

response = await client.send_message(request)
print(response.model_dump(mode='json', exclude_none=True))

streaming_request = SendStreamingMessageRequest(
params=MessageSendParams(**send_message_payload)
)

stream_response = client.send_message_streaming(streaming_request)
async for chunk in stream_response:
print(chunk.model_dump(mode='json', exclude_none=True))
# The HelloWorld agent doesn't support streaming requests. Validate
# this throws an error.
try:
streaming_request = SendStreamingMessageRequest(
params=MessageSendParams(**send_message_payload)
)

stream_response = client.send_message_streaming(streaming_request)
print("Got an unexpected response:")
async for chunk in stream_response:
print(chunk.model_dump(mode='json', exclude_none=True))
except Exception:
pass


if __name__ == '__main__':
Expand Down
2 changes: 1 addition & 1 deletion examples/langgraph/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "langgraph-example"
version = "0.1.0"
description = "Currency conversion agent example"
readme = "README.md"
requires-python = ">=3.13"
requires-python = ">=3.12"
dependencies = [
"a2a-sdk",
"click>=8.1.8",
Expand Down
Loading