mirror of
https://github.com/james-m-jordan/openai-cookbook.git
synced 2025-05-09 19:32:38 +00:00
docs: Fix the code error at "Creating the agent function" (#922)
This commit is contained in:
parent
6699f75e6c
commit
72c167e7de
@ -129,12 +129,10 @@ We start by pushing the `userInput` to the messages array. This time, we set the
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
async function agent(userInput) {
|
async function agent(userInput) {
|
||||||
messages.push([
|
messages.push({
|
||||||
{
|
role: "user",
|
||||||
role: "user",
|
content: userInput,
|
||||||
content: userInput,
|
});
|
||||||
},
|
|
||||||
]);
|
|
||||||
const response = await openai.chat.completions.create({
|
const response = await openai.chat.completions.create({
|
||||||
model: "gpt-4",
|
model: "gpt-4",
|
||||||
messages: messages,
|
messages: messages,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user