docs: Fix the code error at "Creating the agent function" (#922)
This commit is contained in:
parent
6699f75e6c
commit
72c167e7de
1 changed files with 4 additions and 6 deletions
|
|
@ -129,12 +129,10 @@ We start by pushing the `userInput` to the messages array. This time, we set the
|
|||
|
||||
```js
|
||||
async function agent(userInput) {
|
||||
messages.push([
|
||||
{
|
||||
role: "user",
|
||||
content: userInput,
|
||||
},
|
||||
]);
|
||||
messages.push({
|
||||
role: "user",
|
||||
content: userInput,
|
||||
});
|
||||
const response = await openai.chat.completions.create({
|
||||
model: "gpt-4",
|
||||
messages: messages,
|
||||
|
|
|
|||
Loading…
Reference in a new issue