I haven’t found it in documentation, but I am having issues on tying together the output of multiple sub-agents. Example: I have a manager agent that have 2 handoffs: generate_a and generate_b, each having multiple tools connected. generate_b can have dependencies on generate_a. When I have a task: generate output b containing output a first handoff goes to generate_a, after which the execution stops. Then I have to prompt again to generate_b. Is there a way to “loop” handoffs? I cannot go hardcoded way as in the " Financial Research Agent Example" in documentation, as I need main agent to decide what sub-agents to invoke and in what order. Basically the issue is execution stops after one handoff, and there’s seemingly no way to have multiple of them in the flow like: Main to A, A to Main, Main to B, B to Main → final output
Have you tried / considered the Agent as a Tool pattern? openai-agents-python/examples/agent_patterns/agents_as_tools.py at main · openai/openai-agents-python · GitHub
Yes. For now I am using this. Basically the set up for me now is the Main agent that uses agents as tools, which in turn use other agents as tools. But as I increase complexity of my solution this may have more deeper levels, so I was wondering if I can use handoffs instead.