Text Generation
Transformers
English
Russian
legal
CyberFuture-3 / html_main.html
SkillForge45's picture
Create html_main.html
4bc48f4 verified
<!DOCTYPE html>
<html>
<head>
<title>CyberFuture-3</title>
</head>
<body>
<div id="chat"></div>
<input type="text" id="input" placeholder="Type your question...">
<button onclick="sendMessage()">Send</button>
<button onclick="startVoice()">Voice</button>
<script>
async function sendMessage() {
const input = document.getElementById('input').value;
const response = await fetch('http://localhost:8000/chat/', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
body: `prompt=${encodeURIComponent(input)}&use_web=true`
});
const data = await response.json();
document.getElementById('chat').innerHTML += `<p>You: ${input}</p>`;
document.getElementById('chat').innerHTML += `<p>Bot: ${data.response}</p>`;
}
async function startVoice() {
// You would need to add proper voice recording implementation
alert("Voice recording would be implemented here");
}
</script>
</body>
</html>