mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-07 08:26:10 +00:00
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:
parent
9e7a6a73ed
commit
274bf42493
1 changed files with 4 additions and 3 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue