File size: 743 Bytes
8ed47dd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
26
<!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>