testhtml / index.html
timbosssds's picture
Update index.html
087be0c verified
Raw History Blame Contribute Delete
793 Bytes
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>LLM Text App</title>
</head>
<body>
<h1>Text Input</h1>
<textarea id="user_input" rows="5"></textarea>
<br>
<button onclick="sendRequest()">Send to LLM</button>
<p id="output"></p>
<script>
async function sendRequest() {
const userInput = document.getElementById("user_input").value;
const response = await fetch('/predict', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ input: userInput })
});
const data = await response.json();
document.getElementById("output").innerHTML = data.output;
}
</script>
</body>
</html>