Skip to content

Commit adafe08

Browse files
author
Stainless Bot
committed
docs: bump models in example snippets to gpt-4o (#1861)
1 parent 362cf74 commit adafe08

File tree

2 files changed

+21
-16
lines changed

2 files changed

+21
-16
lines changed

README.md

+17-12
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ chat_completion = client.chat.completions.create(
4141
"content": "Say this is a test",
4242
}
4343
],
44-
model="gpt-3.5-turbo",
44+
model="gpt-4o",
4545
)
4646
```
4747

@@ -164,7 +164,7 @@ async def main() -> None:
164164
"content": "Say this is a test",
165165
}
166166
],
167-
model="gpt-3.5-turbo",
167+
model="gpt-4o",
168168
)
169169

170170

@@ -183,8 +183,13 @@ from openai import OpenAI
183183
client = OpenAI()
184184

185185
stream = client.chat.completions.create(
186-
model="gpt-4",
187-
messages=[{"role": "user", "content": "Say this is a test"}],
186+
messages=[
187+
{
188+
"role": "user",
189+
"content": "Say this is a test",
190+
}
191+
],
192+
model="gpt-4o",
188193
stream=True,
189194
)
190195
for chunk in stream:
@@ -231,7 +236,7 @@ openai.base_url = "https://..."
231236
openai.default_headers = {"x-foo": "true"}
232237

233238
completion = openai.chat.completions.create(
234-
model="gpt-4",
239+
model="gpt-4o",
235240
messages=[
236241
{
237242
"role": "user",
@@ -349,7 +354,7 @@ completion = client.chat.completions.create(
349354
"content": "Can you generate an example json object describing a fruit?",
350355
}
351356
],
352-
model="gpt-3.5-turbo-1106",
357+
model="gpt-4o",
353358
response_format={"type": "json_object"},
354359
)
355360
```
@@ -389,7 +394,7 @@ client = OpenAI()
389394

390395
try:
391396
client.fine_tuning.jobs.create(
392-
model="gpt-3.5-turbo",
397+
model="gpt-4o",
393398
training_file="file-abc123",
394399
)
395400
except openai.APIConnectionError as e:
@@ -456,10 +461,10 @@ client.with_options(max_retries=5).chat.completions.create(
456461
messages=[
457462
{
458463
"role": "user",
459-
"content": "How can I get the name of the current day in Node.js?",
464+
"content": "How can I get the name of the current day in JavaScript?",
460465
}
461466
],
462-
model="gpt-3.5-turbo",
467+
model="gpt-4o",
463468
)
464469
```
465470

@@ -490,7 +495,7 @@ client.with_options(timeout=5.0).chat.completions.create(
490495
"content": "How can I list all files in a directory using Python?",
491496
}
492497
],
493-
model="gpt-3.5-turbo",
498+
model="gpt-4o",
494499
)
495500
```
496501

@@ -535,7 +540,7 @@ response = client.chat.completions.with_raw_response.create(
535540
"role": "user",
536541
"content": "Say this is a test",
537542
}],
538-
model="gpt-3.5-turbo",
543+
model="gpt-4o",
539544
)
540545
print(response.headers.get('X-My-Header'))
541546

@@ -568,7 +573,7 @@ with client.chat.completions.with_streaming_response.create(
568573
"content": "Say this is a test",
569574
}
570575
],
571-
model="gpt-3.5-turbo",
576+
model="gpt-4o",
572577
) as response:
573578
print(response.headers.get("X-My-Header"))
574579

tests/test_client.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,7 @@ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> No
727727
"content": "Say this is a test",
728728
}
729729
],
730-
model="gpt-3.5-turbo",
730+
model="gpt-4o",
731731
),
732732
),
733733
cast_to=httpx.Response,
@@ -753,7 +753,7 @@ def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> Non
753753
"content": "Say this is a test",
754754
}
755755
],
756-
model="gpt-3.5-turbo",
756+
model="gpt-4o",
757757
),
758758
),
759759
cast_to=httpx.Response,
@@ -1594,7 +1594,7 @@ async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter)
15941594
"content": "Say this is a test",
15951595
}
15961596
],
1597-
model="gpt-3.5-turbo",
1597+
model="gpt-4o",
15981598
),
15991599
),
16001600
cast_to=httpx.Response,
@@ -1620,7 +1620,7 @@ async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter)
16201620
"content": "Say this is a test",
16211621
}
16221622
],
1623-
model="gpt-3.5-turbo",
1623+
model="gpt-4o",
16241624
),
16251625
),
16261626
cast_to=httpx.Response,

0 commit comments

Comments
 (0)