openai-agents-python/examples
Rohan Mehta a0254b0b74
RFC: automatically use litellm if possible (#534)
## Summary
This replaces the default model provider with a `MultiProvider`, which
has the logic:
- if the model name starts with `openai/` or doesn't contain "/", use
OpenAI
- if the model name starts with `litellm/`, use LiteLLM to use the
appropriate model provider.

It's also extensible, so users can create their own mappings. I also
imagine that if we natively supported Anthropic/Gemini etc, we can add
it to MultiProvider to make it work.

The goal is that it should be really easy to use any model provider.
Today if you pass `model="gpt-4.1"`, it works great. But
`model="claude-sonnet-3.7"` doesn't. If we can make it that easy, it's a
win for devx.

I'm not entirely sure if this is a good idea - is it too magical? Is the
API too reliant on litellm? Comments welcome.

## Test plan

For now, the example. Will add unit tests if we agree its worth mergin.

---------

Co-authored-by: Steven Heidel <steven@heidel.ca>
2025-04-21 15:03:06 -04:00
..
agent_patterns Example for streaming guardrails (#505) 2025-04-14 12:40:41 -04:00
basic Enable non-strict output types (#539) 2025-04-21 11:58:36 -04:00
customer_service Initial commit 2025-03-11 09:42:28 -07:00
financial_research_agent Fix: Correct the trace path in examples (#395) 2025-04-01 11:51:52 -04:00
handoffs fix: use first_agent instead of second_agent for a task to generate random number 2025-03-13 18:26:49 -07:00
mcp Fix: Correct the trace path in examples (#395) 2025-04-01 11:51:52 -04:00
model_providers RFC: automatically use litellm if possible (#534) 2025-04-21 15:03:06 -04:00
research_bot examples(research_bot): Add space to INSTRUCTIONS (#439) 2025-04-08 14:01:09 -04:00
tools Update computer-use example to support simultaneous key presses (#452) 2025-04-08 11:47:15 -04:00
voice fix(examples): make sure audio playback finishes 2025-03-25 12:11:33 -07:00
__init__.py Initial commit 2025-03-11 09:42:28 -07:00