fix: disable stream for helloworld example, since it do not support by vincent-pli · Pull Request #53 · a2aproject/a2a-python · GitHub
Skip to content

fix: disable stream for helloworld example, since it do not support - #53

Merged
holtskinner merged 2 commits into
a2aproject:mainfrom
vincent-pli:disable-stream-helloworld
May 20, 2025
Merged

holtskinner merged 2 commits into
a2aproject:mainfrom
vincent-pli:disable-stream-helloworld

Conversation

@vincent-pli

Copy link
Copy Markdown
Contributor

Description

Thank you for opening a Pull Request!
Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

Fixes #<issue_number_goes_here> 🦕
The helloworld example do not act as stream enable, so I get exception

object async_generator can't be used in 'await' expression

when I try to invoke client.send_message_streaming

Signed-off-by: vincent-pli <justdoit.pli@gmail.com>
@vincent-pli
vincent-pli requested a review from a team as a code owner May 20, 2025 02:37
@holtskinner
holtskinner merged commit 436c931 into a2aproject:main May 20, 2025
@kthota-g

Copy link
Copy Markdown
Contributor

@vincent-pli

Copy link
Copy Markdown
Contributor Author

@kthota-g
I have not dig too much into the root cause, but when the streaming is enabled in the card in hello world example, I get the error when I try to await client.send_message_streaming(request), see the draft code below (not finished yet)
https://github.com/vincent-pli/a2a-agent-mcpserver-generator/blob/a526e7a60d9fb62a2e93810486a9080979c5a932/src/a2a_agent_mcpserver_generator/server_generator.py#L132

@kthota-g

Copy link
Copy Markdown
Contributor

@vincent-pli send_message_streaming returns an AsyncGenerator, which is not awaitable.

Here is an example for how you can process the response - https://github.com/google/a2a-python/blob/53a58611b32bc3ae01adba432463d1d5cab95f09/examples/helloworld/test_client.py#L33

@vincent-pli

Copy link
Copy Markdown
Contributor Author

You are right, my mistake, thanks a lot

@Linux2010

Copy link
Copy Markdown
Contributor

martimfasantos pushed a commit to martimfasantos/a2a-python that referenced this pull request May 23, 2025
…oject#53)

Signed-off-by: vincent-pli <justdoit.pli@gmail.com>
Co-authored-by: Holt Skinner <13262395+holtskinner@users.noreply.github.com>
martimfasantos pushed a commit to martimfasantos/a2a-python that referenced this pull request May 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants