-
Notifications
You must be signed in to change notification settings - Fork 2
/
example.html
25 lines (25 loc) · 782 Bytes
/
example.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>FreeGPT.js Web Example</title>
</head>
<body>
<script src="src/freegpt.js"></script>
<script>
(async () => {
let confirmed = false;
while (!confirmed) {
const result = await gpt.ask(prompt("Ask a question with GPT: "));
confirmed = confirm(
"Click OK to open the GitHub page now. Cancel to re-ask.\n\n" +
result
);
}
window.open("https://github.com/ashishagarwal2023/freegptjs", "_blank");
})();
</script>
Reload page to re-ask if you closed or missed prompt.
</body>
</html>