Skip to content

Commit 4ec4027

Browse files
author
Stainless Bot
committed
docs: bump models in example snippets to gpt-4o (#1184)
1 parent f555dd6 commit 4ec4027

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const client = new OpenAI({
3939
async function main() {
4040
const chatCompletion = await client.chat.completions.create({
4141
messages: [{ role: 'user', content: 'Say this is a test' }],
42-
model: 'gpt-3.5-turbo',
42+
model: 'gpt-4o',
4343
});
4444
}
4545

@@ -57,7 +57,7 @@ const client = new OpenAI();
5757

5858
async function main() {
5959
const stream = await client.chat.completions.create({
60-
model: 'gpt-4',
60+
model: 'gpt-4o',
6161
messages: [{ role: 'user', content: 'Say this is a test' }],
6262
stream: true,
6363
});
@@ -87,7 +87,7 @@ const client = new OpenAI({
8787
async function main() {
8888
const params: OpenAI.Chat.ChatCompletionCreateParams = {
8989
messages: [{ role: 'user', content: 'Say this is a test' }],
90-
model: 'gpt-3.5-turbo',
90+
model: 'gpt-4o',
9191
};
9292
const chatCompletion: OpenAI.Chat.ChatCompletion = await client.chat.completions.create(params);
9393
}
@@ -333,7 +333,7 @@ a subclass of `APIError` will be thrown:
333333
```ts
334334
async function main() {
335335
const job = await client.fineTuning.jobs
336-
.create({ model: 'gpt-3.5-turbo', training_file: 'file-abc123' })
336+
.create({ model: 'gpt-4o', training_file: 'file-abc123' })
337337
.catch(async (err) => {
338338
if (err instanceof OpenAI.APIError) {
339339
console.log(err.status); // 400
@@ -415,7 +415,7 @@ const client = new OpenAI({
415415
});
416416

417417
// Or, configure per-request:
418-
await client.chat.completions.create({ messages: [{ role: 'user', content: 'How can I get the name of the current day in Node.js?' }], model: 'gpt-3.5-turbo' }, {
418+
await client.chat.completions.create({ messages: [{ role: 'user', content: 'How can I get the name of the current day in JavaScript?' }], model: 'gpt-4o' }, {
419419
maxRetries: 5,
420420
});
421421
```
@@ -432,7 +432,7 @@ const client = new OpenAI({
432432
});
433433

434434
// Override per-request:
435-
await client.chat.completions.create({ messages: [{ role: 'user', content: 'How can I list all files in a directory using Python?' }], model: 'gpt-3.5-turbo' }, {
435+
await client.chat.completions.create({ messages: [{ role: 'user', content: 'How can I list all files in a directory using Python?' }], model: 'gpt-4o' }, {
436436
timeout: 5 * 1000,
437437
});
438438
```
@@ -485,13 +485,13 @@ You can also use the `.withResponse()` method to get the raw `Response` along wi
485485
const client = new OpenAI();
486486

487487
const response = await client.chat.completions
488-
.create({ messages: [{ role: 'user', content: 'Say this is a test' }], model: 'gpt-3.5-turbo' })
488+
.create({ messages: [{ role: 'user', content: 'Say this is a test' }], model: 'gpt-4o' })
489489
.asResponse();
490490
console.log(response.headers.get('X-My-Header'));
491491
console.log(response.statusText); // access the underlying Response object
492492

493493
const { data: chatCompletion, response: raw } = await client.chat.completions
494-
.create({ messages: [{ role: 'user', content: 'Say this is a test' }], model: 'gpt-3.5-turbo' })
494+
.create({ messages: [{ role: 'user', content: 'Say this is a test' }], model: 'gpt-4o' })
495495
.withResponse();
496496
console.log(raw.headers.get('X-My-Header'));
497497
console.log(chatCompletion);

0 commit comments

Comments
 (0)