From a11e41de60f59ab1bccebbdcb8861e6358a697f2 Mon Sep 17 00:00:00 2001 From: andy010629 Date: Thu, 15 May 2025 13:28:15 +0800 Subject: [PATCH] fix: enable streaming mode in examples/helloworld to fix the test_client streaming error --- examples/helloworld/__main__.py | 4 +++- examples/helloworld/test_client.py | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/helloworld/__main__.py b/examples/helloworld/__main__.py index ac6cca7d..abf8fbdf 100644 --- a/examples/helloworld/__main__.py +++ b/examples/helloworld/__main__.py @@ -27,7 +27,9 @@ version='1.0.0', defaultInputModes=['text'], defaultOutputModes=['text'], - capabilities=AgentCapabilities(), + capabilities=AgentCapabilities( + streaming=True, # enable streaming mode + ), skills=[skill], authentication=AgentAuthentication(schemes=['public']), ) diff --git a/examples/helloworld/test_client.py b/examples/helloworld/test_client.py index 0ade8d2a..2de745aa 100644 --- a/examples/helloworld/test_client.py +++ b/examples/helloworld/test_client.py @@ -34,6 +34,7 @@ async def main() -> None: params=MessageSendParams(**send_message_payload) ) + # if you want to stream the response, please make sure to set streaming=True in the agent card (__main__.py) stream_response = client.send_message_streaming(streaming_request) async for chunk in stream_response: print(chunk.model_dump(mode='json', exclude_none=True))