Skip to content

Commit 72c167e

Browse files
authored
docs: Fix the code error at "Creating the agent function" (#922)
1 parent 6699f75 commit 72c167e

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

examples/How_to_build_an_agent_with_the_node_sdk.mdx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,10 @@ We start by pushing the `userInput` to the messages array. This time, we set the
129129

130130
```js
131131
async function agent(userInput) {
132-
messages.push([
133-
{
134-
role: "user",
135-
content: userInput,
136-
},
137-
]);
132+
messages.push({
133+
role: "user",
134+
content: userInput,
135+
});
138136
const response = await openai.chat.completions.create({
139137
model: "gpt-4",
140138
messages: messages,

0 commit comments

Comments
 (0)