Update theme/templates/index.html
Browse files- theme/templates/index.html +20 -12
theme/templates/index.html
CHANGED
|
@@ -4,23 +4,31 @@
|
|
| 4 |
<title>PyRunner AI Space</title>
|
| 5 |
<link rel="stylesheet" href="/static/style.css">
|
| 6 |
</head>
|
|
|
|
| 7 |
<body>
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
-
<
|
| 10 |
-
<
|
| 11 |
|
| 12 |
-
<
|
| 13 |
|
| 14 |
-
<
|
| 15 |
-
|
|
|
|
| 16 |
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
</div>
|
| 23 |
-
</div>
|
| 24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
</body>
|
| 26 |
</html>
|
|
|
|
| 4 |
<title>PyRunner AI Space</title>
|
| 5 |
<link rel="stylesheet" href="/static/style.css">
|
| 6 |
</head>
|
| 7 |
+
|
| 8 |
<body>
|
| 9 |
+
<h1>PyRunner Agent OS</h1>
|
| 10 |
+
|
| 11 |
+
<p>Backend is running successfully.</p>
|
| 12 |
|
| 13 |
+
<input id="prompt" placeholder="Enter prompt..." />
|
| 14 |
+
<button onclick="send()">Send</button>
|
| 15 |
|
| 16 |
+
<pre id="out"></pre>
|
| 17 |
|
| 18 |
+
<script>
|
| 19 |
+
async function send() {
|
| 20 |
+
const prompt = document.getElementById("prompt").value;
|
| 21 |
|
| 22 |
+
const res = await fetch("/api/agent", {
|
| 23 |
+
method: "POST",
|
| 24 |
+
headers: {"Content-Type": "application/json"},
|
| 25 |
+
body: JSON.stringify({prompt})
|
| 26 |
+
});
|
|
|
|
|
|
|
| 27 |
|
| 28 |
+
const data = await res.json();
|
| 29 |
+
document.getElementById("out").innerText =
|
| 30 |
+
JSON.stringify(data, null, 2);
|
| 31 |
+
}
|
| 32 |
+
</script>
|
| 33 |
</body>
|
| 34 |
</html>
|