Leonydis137 commited on
Commit
8ed47dd
·
verified ·
1 Parent(s): 9d9413b

Create static/index.html

Browse files
Files changed (1) hide show
  1. static/index.html +25 -0
static/index.html ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head><title>Autonomous AI</title></head>
4
+ <body>
5
+ <h1>🔐 Autonomous AI</h1>
6
+ <input id="apiKey" placeholder="Enter API key" />
7
+ <input id="goal" placeholder="What should I do?" />
8
+ <button onclick="submit()">Submit</button>
9
+ <pre id="output"></pre>
10
+
11
+ <script>
12
+ async function submit() {
13
+ const key = document.getElementById("apiKey").value;
14
+ const goal = document.getElementById("goal").value;
15
+ const res = await fetch("/session_task", {
16
+ method: "POST",
17
+ headers: { "x-api-key": key, "Content-Type": "application/json" },
18
+ body: JSON.stringify({ goal })
19
+ });
20
+ const data = await res.json();
21
+ document.getElementById("output").textContent = JSON.stringify(data, null, 2);
22
+ }
23
+ </script>
24
+ </body>
25
+ </html>