File size: 793 Bytes
032019d
 
 
 
 
 
 
 
 
 
 
 
 
 
087be0c
032019d
087be0c
032019d
 
 
087be0c
 
 
032019d
 
 
 
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
27
28
<!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>