Closed
Description
Please read this first
- Have you read the docs?Agents SDK docs
YES, seems max_turn is only available to be set at Runner. but with the implementation of agents as tools, I don't get access to the Runner of the tool agents. - Have you searched for related issues? Others may have had similar requests
YES couldn't find any
Question
Describe your question. Provide details if available.
How to set max_turn when agents are being used as tools.
I have serveral agents as tool use case. and the main agent can set Runner.run(max_turn), but I couldn't figure out where so inject max_turn limits for agents created as tools.
exactly like this example here: https://github.com/openai/openai-agents-python/blob/main/examples/agent_patterns/agents_as_tools.py
if it is not already implemented, I would suggest having a parameters for Agent, so that each agent can have a different max_turn limits, while Runner.run max_turn can override it.
thanks!