You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+27Lines changed: 27 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -321,6 +321,33 @@ const { message } = await prompt("What is the capital of France?", {
321
321
console.log(message.content);
322
322
```
323
323
324
+
In order to pass a history of messages, pass them as `options.messages`:
325
+
326
+
```js
327
+
const { message } =awaitprompt("What about Spain?", {
328
+
model:"gpt-4",
329
+
token:process.env.TOKEN,
330
+
messages: [
331
+
{ role:"user", content:"What is the capital of France?" },
332
+
{ role:"assistant", content:"The capital of France is Paris." },
333
+
],
334
+
});
335
+
```
336
+
337
+
Alternatively, skip the `message` argument and pass all messages as `options.messages`:
338
+
339
+
```js
340
+
const { message } =awaitprompt({
341
+
model:"gpt-4",
342
+
token:process.env.TOKEN,
343
+
messages: [
344
+
{ role:"user", content:"What is the capital of France?" },
345
+
{ role:"assistant", content:"The capital of France is Paris." },
346
+
{ role:"user", content:"What about Spain?" },
347
+
],
348
+
});
349
+
```
350
+
324
351
⚠️ Not all of the arguments below are implemented yet. See [#5](https://github.com/copilot-extensions/preview-sdk.js/issues/5) sub issues for progress.
0 commit comments