Spaces:
Runtime error
Runtime error
Create static/index.html
Browse files- 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>
|