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
const { message } =awaitprompt("What is the capital of France?", {
48
+
model:"gpt-4",
49
+
token:process.env.TOKEN,
50
+
});
51
+
52
+
console.log(message.content);
53
+
} catch (error) {
54
+
console.error(error);
55
+
}
56
+
```
57
+
41
58
## API
42
59
43
60
### Verification
@@ -285,6 +302,86 @@ if (userConfirmation) {
285
302
}
286
303
```
287
304
305
+
## Prompt (Custom Chat completion calls)
306
+
307
+
#### `prompt(message, options)`
308
+
309
+
Send a prompt to the chat UI and receive a response from the user. The `message` argument must be a string and may include markdown.
310
+
311
+
The `options` argument is optional. It can contain a `token` to authenticate the request to GitHub's API, or a custom `request.fetch` instance to use for the request.
// configuration related to the request transport layer
373
+
request: {
374
+
// for mocking, proxying, client certificates, etc.
375
+
fetch: myCustomFetch,
376
+
// hook into request life cycle for complex authentication strategies, retries, throttling, etc
377
+
// compare options.request.hook from https://github.com/octokit/request.js
378
+
hook: myCustomHook,
379
+
// Use an `AbortController` instance to cancel a request
380
+
signal:myAbortController.signal,
381
+
},
382
+
});
383
+
```
384
+
288
385
## Dreamcode
289
386
290
387
While implementing the lower-level functionality, we also dream big: what would our dream SDK for Coplitot extensions look like? Please have a look and share your thoughts and ideas:
0 commit comments