Skip to content

How to set max_turn for agents set as tools. #497

Description

@yongkangzhao

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionQuestion about using the SDK

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions