Update docs/my-website/docs/providers/openai.md

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
This commit is contained in:
Cesar Garcia 2026-03-11 14:13:56 -03:00 committed by GitHub
parent 9e7a6a73ed
commit 274bf42493
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -675,17 +675,18 @@ To use built-in tools like `web_search_preview` with `mode: chat` models, add th
# This will FAIL - gpt-4o has mode: chat, uses Chat Completions API
response = litellm.completion(
model="gpt-4o",
messages=[{"role": "user", "content": "What is the weather in Paris today?"}],
tools=[{"type": "web_search_preview"}], # Not supported in Chat Completions
...
# ... other kwargs
)
# This will WORK - prefix forces Responses API
response = litellm.completion(
model="openai/responses/gpt-4o",
messages=[{"role": "user", "content": "What is the weather in Paris today?"}],
tools=[{"type": "web_search_preview"}], # Supported in Responses API
...
# ... other kwargs
)
```
### Examples