-
Notifications
You must be signed in to change notification settings - Fork 2.1k
feat: #864 support streaming nested tool events in Agent.as_tool #1057
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
5a0ce3a
to
dcfaf3f
Compare
@rm-openai i’ve resolved the merge conflict in |
looking forward to this new feature |
Action isn't published yet, so gotta do this
31af63e
to
243462e
Compare
When I test on my project, in the above codes in agent.py, the parent_queue will be None and the sub_run event will not be streaming, I manually init it as:
It is right? |
hey @yxh-y the queue is only attached when the outer‑most run itself is started in streaming mode. In other words, Runner.run_streamed(…) sets If you invoke the outer agent with the non‑streaming So, rather than injecting your own
this ensures that tl;dr, if you start the outer run with run_streamed, the queue is set up automatically (no manual queue needed), and you’ll see the child events immediately. |
Hey @rm-openai, just a quick ping on this PR. It’s playing nice with BTW, totally get that it might end up redundant with future changes (esp. with how quickly tracing and realtime features are evolving), but I haven’t seen anything merged yet that overlaps, so figured it was worth a quick nudge in case it’s still helpful to review. Happy to tweak, rebase, or rework as needed. |
thanks for all your hard work. can we expect this new feature in next release? 😊 |
@vrtnis Thanks for this PR, I encounter the same need to stream inner/sub tool calls, and was wondering if this PR will also emit tools that are created in the following way:
OR
|
hey @SeeYangZhi this pr #1057 does not affect the If you bypass that As such, if you would like to keep your
then repeat this for Please note that instead of the above snippet probably easier alternatives could be to expose each sub‑agent directly, like so,
and then drop your custom parent_tool and let the caller agent orchestrate. |
I see, thanks for the explanation!
This may be tough, but we will think about it! We want a more deterministic tool, setting the main agent to call a tool that goes through a certain "workflow". |
You bring up an interesting point around tool determinism and you should still be able to keep that deterministic workflow feel while getting streaming too. e.g., |
stream_inner_events
flag to allow sub-agent tool call visibilityRunner.run_streamed
for streaming inner agentsResolves #864