Skip to content

docs(agent-tools): add example for custom model provider propagation (#663)#2545

Closed
furkankoykiran wants to merge 1 commit intoopenai:mainfrom
furkankoykiran:fix/issue-663-custom-provider-example
Closed

docs(agent-tools): add example for custom model provider propagation (#663)#2545
furkankoykiran wants to merge 1 commit intoopenai:mainfrom
furkankoykiran:fix/issue-663-custom-provider-example

Conversation

@furkankoykiran
Copy link

What this PR does / why we need it

This PR adds an example demonstrating the behavior fixed in #2463 where a custom ModelProvider specified via RunConfig is correctly inherited when using an agent as a tool.

Since the core engineering fix to Agent.as_tool() was already merged in #2463, this documentation addition serves to close out the remaining gap from #663 by giving users a runnable example of this requested pattern.

Changes

  • Adds examples/agent_patterns/agents_as_tools_custom_provider.py which shows how a custom ModelProvider is passed to the orchestrator agent and properly inherited by nested agent-tools.
  • Updates examples/agent_patterns/README.md to reference the new example.

Fixes #663

@seratch
Copy link
Member

seratch commented Feb 26, 2026

Thanks for sending this patch! However, we already have a similar example at https://github.com/openai/openai-agents-python/blob/main/examples/model_providers/custom_example_provider.py, so we won't have this one.

@seratch seratch closed this Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Custom model provider ignored when using agents as tools

2 participants