Skip to content

Commit 45552e3

Browse files
committed
test(types): options.messages for prompt()
1 parent 8c786c7 commit 45552e3

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

index.test-d.ts

+24-3
Original file line numberDiff line numberDiff line change
@@ -307,12 +307,33 @@ export async function promptWithToolsTest() {
307307
function: {
308308
name: "",
309309
description: "",
310-
parameters: {
311-
312-
},
310+
parameters: {},
313311
strict: true,
314312
}
315313
}
316314
]
317315
})
316+
}
317+
318+
export async function promptWithMessageAndMessages() {
319+
await prompt("What about Spain?", {
320+
model: "gpt-4",
321+
token: 'secret',
322+
messages: [
323+
{ role: "user", content: "What is the capital of France?" },
324+
{ role: "assistant", content: "The capital of France is Paris." },
325+
],
326+
});
327+
}
328+
329+
export async function promptWithoutMessageButMessages() {
330+
await prompt({
331+
model: "gpt-4",
332+
token: 'secret',
333+
messages: [
334+
{ role: "user", content: "What is the capital of France?" },
335+
{ role: "assistant", content: "The capital of France is Paris." },
336+
{ role: "user", content: "What about Spain?" },
337+
],
338+
});
318339
}

0 commit comments

Comments
 (0)