Open
Description
Please read this first
- Have you read the docs?Agents SDK docs: yes :)
- Have you searched for related issues? Others may have had similar requests: also yes :)
Question
I'm building an agent that's often running multiple tool calls sequentially, and sometimes tool A
will 'unlock' tools B
, C
, and D
. But I so far haven't found a way to 'inject' those during an automated run_llm_again
loop. And I'm really dreading writing all the logic required to manually handle the run loop.
I've attempted using the Hooks
to dynamically add new tools, I've been trying to work with various different Agent
s as tools, where the tools of those Agent
s are added dynamically through the hooks. The only thing that's semi worked for me is to use the handoff
feature, but then I can't give control back to the 'main' agent.
My agent's flow will normally be like:
- User asks for information from Gmail
- Agent
Runner
starts - Agent detects that there's no Gmail connection set up
- Agent will call the "initiate gmail connection" tool
- Response from the tool 'unlocks' all Gmail actions
- Agent calls the 'get latest emails' tool
- Agent streams the response
- Agent
Runner
exits
But this is a workflow that I can't currently figure out. Is there a way?