@@ -41,7 +41,7 @@ chat_completion = client.chat.completions.create(
41
41
" content" : " Say this is a test" ,
42
42
}
43
43
],
44
- model = " gpt-3.5-turbo " ,
44
+ model = " gpt-4o " ,
45
45
)
46
46
```
47
47
@@ -164,7 +164,7 @@ async def main() -> None:
164
164
" content" : " Say this is a test" ,
165
165
}
166
166
],
167
- model = " gpt-3.5-turbo " ,
167
+ model = " gpt-4o " ,
168
168
)
169
169
170
170
@@ -183,8 +183,13 @@ from openai import OpenAI
183
183
client = OpenAI()
184
184
185
185
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" ,
188
193
stream = True ,
189
194
)
190
195
for chunk in stream:
@@ -231,7 +236,7 @@ openai.base_url = "https://..."
231
236
openai.default_headers = {" x-foo" : " true" }
232
237
233
238
completion = openai.chat.completions.create(
234
- model = " gpt-4 " ,
239
+ model = " gpt-4o " ,
235
240
messages = [
236
241
{
237
242
" role" : " user" ,
@@ -349,7 +354,7 @@ completion = client.chat.completions.create(
349
354
" content" : " Can you generate an example json object describing a fruit?" ,
350
355
}
351
356
],
352
- model = " gpt-3.5-turbo-1106 " ,
357
+ model = " gpt-4o " ,
353
358
response_format = {" type" : " json_object" },
354
359
)
355
360
```
@@ -389,7 +394,7 @@ client = OpenAI()
389
394
390
395
try :
391
396
client.fine_tuning.jobs.create(
392
- model = " gpt-3.5-turbo " ,
397
+ model = " gpt-4o " ,
393
398
training_file = " file-abc123" ,
394
399
)
395
400
except openai.APIConnectionError as e:
@@ -456,10 +461,10 @@ client.with_options(max_retries=5).chat.completions.create(
456
461
messages = [
457
462
{
458
463
" 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 ?" ,
460
465
}
461
466
],
462
- model = " gpt-3.5-turbo " ,
467
+ model = " gpt-4o " ,
463
468
)
464
469
```
465
470
@@ -490,7 +495,7 @@ client.with_options(timeout=5.0).chat.completions.create(
490
495
" content" : " How can I list all files in a directory using Python?" ,
491
496
}
492
497
],
493
- model = " gpt-3.5-turbo " ,
498
+ model = " gpt-4o " ,
494
499
)
495
500
```
496
501
@@ -535,7 +540,7 @@ response = client.chat.completions.with_raw_response.create(
535
540
" role" : " user" ,
536
541
" content" : " Say this is a test" ,
537
542
}],
538
- model = " gpt-3.5-turbo " ,
543
+ model = " gpt-4o " ,
539
544
)
540
545
print (response.headers.get(' X-My-Header' ))
541
546
@@ -568,7 +573,7 @@ with client.chat.completions.with_streaming_response.create(
568
573
" content" : " Say this is a test" ,
569
574
}
570
575
],
571
- model = " gpt-3.5-turbo " ,
576
+ model = " gpt-4o " ,
572
577
) as response:
573
578
print (response.headers.get(" X-My-Header" ))
574
579
0 commit comments