Skip to content

Commit 9fea45f

Browse files
committed
Revert "Update articles/openai-cookbook-llms-101.md"
This reverts commit 0699988.
1 parent 0699988 commit 9fea45f

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

articles/openai-cookbook-llms-101.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,12 @@ print(resp.output_text)
4646
import OpenAI from "openai";
4747
const client = new OpenAI();
4848

49-
const resp = await client.chat.completions.create({
49+
const resp = await client.responses.create({
5050
model: "gpt-4o",
51-
messages: [
52-
{ role: "system", content: "You are a concise technical explainer." },
53-
{ role: "user", content: "In one paragraph, explain what a token is in an LLM." }
54-
]
51+
instructions: "You are a concise technical explainer.",
52+
input: "In one paragraph, explain what a token is in an LLM."
5553
});
56-
console.log(resp.choices[0].message.content);
54+
console.log(resp.output_text);
5755
```
5856

5957
> **Tip.** Model names evolve; check your Models list before shipping. Prefer streaming for chat‑like UIs (see below).

0 commit comments

Comments
 (0)