Teotonix commited on
Commit
0a38422
·
verified ·
1 Parent(s): b1baa38

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +13 -0
index.html CHANGED
@@ -31,5 +31,18 @@
31
  <div class="container">
32
  <iframe src="https://teotonix-maindai.hf.space/?__theme=dark"></iframe>
33
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  </body>
35
  </html>
 
31
  <div class="container">
32
  <iframe src="https://teotonix-maindai.hf.space/?__theme=dark"></iframe>
33
  </div>
34
+ async function send(){
35
+ const msg = document.getElementById("msg").value;
36
+
37
+ const res = await fetch("http://127.0.0.1:8000/chat", {
38
+ method:"POST",
39
+ headers:{ "Content-Type":"application/json" },
40
+ body: JSON.stringify({ message: msg })
41
+ });
42
+
43
+ const data = await res.json();
44
+ document.getElementById("chat").innerText = data.reply;
45
+ }
46
+
47
  </body>
48
  </html>