Skip to content

Commit 0010288

Browse files
docs: bump models in example snippets to gpt-4o (#1861)
1 parent 3a5c381 commit 0010288

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

README.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ chat_completion = client.chat.completions.create(
3636
"content": "Say this is a test",
3737
}
3838
],
39-
model="gpt-3.5-turbo",
39+
model="gpt-4o",
4040
)
4141
```
4242

@@ -67,7 +67,7 @@ async def main() -> None:
6767
"content": "Say this is a test",
6868
}
6969
],
70-
model="gpt-3.5-turbo",
70+
model="gpt-4o",
7171
)
7272

7373

@@ -92,7 +92,7 @@ stream = client.chat.completions.create(
9292
"content": "Say this is a test",
9393
}
9494
],
95-
model="gpt-3.5-turbo",
95+
model="gpt-4o",
9696
stream=True,
9797
)
9898
for chat_completion in stream:
@@ -113,7 +113,7 @@ stream = await client.chat.completions.create(
113113
"content": "Say this is a test",
114114
}
115115
],
116-
model="gpt-3.5-turbo",
116+
model="gpt-4o",
117117
stream=True,
118118
)
119119
async for chat_completion in stream:
@@ -216,7 +216,7 @@ completion = client.chat.completions.create(
216216
"content": "Can you generate an example json object describing a fruit?",
217217
}
218218
],
219-
model="gpt-3.5-turbo-1106",
219+
model="gpt-4o",
220220
response_format={"type": "json_object"},
221221
)
222222
```
@@ -256,7 +256,7 @@ client = OpenAI()
256256

257257
try:
258258
client.fine_tuning.jobs.create(
259-
model="gpt-3.5-turbo",
259+
model="gpt-4o",
260260
training_file="file-abc123",
261261
)
262262
except openai.APIConnectionError as e:
@@ -305,10 +305,10 @@ client.with_options(max_retries=5).chat.completions.create(
305305
messages=[
306306
{
307307
"role": "user",
308-
"content": "How can I get the name of the current day in Node.js?",
308+
"content": "How can I get the name of the current day in JavaScript?",
309309
}
310310
],
311-
model="gpt-3.5-turbo",
311+
model="gpt-4o",
312312
)
313313
```
314314

@@ -339,7 +339,7 @@ client.with_options(timeout=5.0).chat.completions.create(
339339
"content": "How can I list all files in a directory using Python?",
340340
}
341341
],
342-
model="gpt-3.5-turbo",
342+
model="gpt-4o",
343343
)
344344
```
345345

@@ -384,7 +384,7 @@ response = client.chat.completions.with_raw_response.create(
384384
"role": "user",
385385
"content": "Say this is a test",
386386
}],
387-
model="gpt-3.5-turbo",
387+
model="gpt-4o",
388388
)
389389
print(response.headers.get('X-My-Header'))
390390

@@ -417,7 +417,7 @@ with client.chat.completions.with_streaming_response.create(
417417
"content": "Say this is a test",
418418
}
419419
],
420-
model="gpt-3.5-turbo",
420+
model="gpt-4o",
421421
) as response:
422422
print(response.headers.get("X-My-Header"))
423423

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)