Autonomous-AI / static /index.html
Leonydis137's picture
Create static/index.html
8ed47dd verified
raw
history blame
743 Bytes
<!DOCTYPE html>
<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>