Spaces:
Runtime error
Runtime error
| <html> | |
| <head><title>Autonomous AI</title></head> | |
| <body> | |
| <h1>π Autonomous AI</h1> | |
| <input id="apiKey" placeholder="Enter API key" /> | |
| <input id="goal" placeholder="What should I do?" /> | |
| <button onclick="submit()">Submit</button> | |
| <pre id="output"></pre> | |
| <script> | |
| async function submit() { | |
| const key = document.getElementById("apiKey").value; | |
| const goal = document.getElementById("goal").value; | |
| const res = await fetch("/session_task", { | |
| method: "POST", | |
| headers: { "x-api-key": key, "Content-Type": "application/json" }, | |
| body: JSON.stringify({ goal }) | |
| }); | |
| const data = await res.json(); | |
| document.getElementById("output").textContent = JSON.stringify(data, null, 2); | |
| } | |
| </script> | |
| </body> | |
| </html> | |