Commit Diff


commit - 8d2a532b2c861b3e326e1855adb1cb2a8a9dcec4
commit + bbb301914b711755897a6000f8f68aea62bb8a2e
blob - a6929f9db205d5b1d1339e82fb1f8fd7e7489a8b
blob + e6c9ee3b06423ff23974eeb7819fe41f4a89d705
--- rag_backend.py
+++ rag_backend.py
@@ -126,7 +126,7 @@ class RagBackend:
 if __name__ == "__main__":
     logging.basicConfig(
         level=logging.INFO,
-        format='%(asctime)s %(name)s %(message)s'
+        format='%(asctime)s %(levelname)s %(message)s'
     )
 
     parser = argparse.ArgumentParser()
blob - 49748affccd22cfa540322215a430a4fd1ad2f6d
blob + fc8369a5e6dd63413cfa96ed393d27f6ba8dda21
--- rag_indexer.py
+++ rag_indexer.py
@@ -8,7 +8,7 @@ from rag_backend import RagBackend
 if __name__ == "__main__":
     logging.basicConfig(
         level=logging.INFO,
-        format='%(asctime)s %(name)s %(message)s'
+        format='%(asctime)s %(levelname)s %(message)s'
     )
 
     parser = argparse.ArgumentParser()
blob - af114799cf2fb32ccad650221606b6a761d48f64
blob + 084a7fa2fb50bb73d3c1cc670e39ce79417e01c4
--- rag_interface.py
+++ rag_interface.py
@@ -9,7 +9,7 @@ rag = RagBackend()
 
 logging.basicConfig(
     level=logging.INFO,
-    format='%(asctime)s %(name)s %(message)s'
+    format='%(asctime)s %(levelname)s %(message)s'
 )
 
 
blob - 9aa19b8971ac34dacc009c9b1ac133747ce7d5e0
blob + 8a95ebf26866fb6afc2dc76c1f1a36e26976fe26
--- templates/page.html
+++ templates/page.html
@@ -77,9 +77,13 @@
         #input {
             flex: 1;
             padding: 10px;
+            font-size: 1em;
+            border-radius: 18px;
             border: 1px solid #ccc;
-            border-radius: 18px;
-            font-size: 1em;
+            resize: none;
+            min-height: 0;
+            line-height: 1.2;
+            box-sizing: border-box;
         }
         #send {
             margin-left: 10px;
@@ -145,7 +149,7 @@
         <div id="header">🤖 GM Bot</div>
         <div id="chat"></div>
         <div id="input-area">
-            <input type="text" id="input" autocomplete="off" placeholder="Type your message..." />
+            <textarea id="input" rows="1" placeholder="Type your message..."></textarea>
             <button id="send">Send</button>
             <span id="spinner">
                     <span class="lds-ring"><div></div><div></div><div></div><div></div></span>
@@ -170,7 +174,7 @@
         if (sender === 'bot') {
             bubble.innerHTML = marked.parse(text);
         } else {
-            bubble.textContent = text;
+            bubble.innerHTML = marked.parse(text);
         }
         msgDiv.appendChild(bubble);
         chat.appendChild(msgDiv);
@@ -216,6 +220,7 @@
         if (!text) return;
         appendMessage('user', text);
         input.value = "";
+        input.style.height = "auto"; // Reset height to original
         setBusy(true);
         // Prepare the prompt: prepend previous Q&A
         let context_prompt = "";
@@ -234,9 +239,20 @@
         }
     };
 
-    input.addEventListener("keyup", function(event) {
-        if (event.key === "Enter" && !send.disabled) send.click();
+    // input.addEventListener("keyup", function(event) {
+    //     if (event.key === "Enter" && !send.disabled) send.click();
+    // });
+    input.addEventListener("keydown", function(event) {
+        if (event.key === "Enter" && (event.metaKey || event.ctrlKey)) {
+            if(send.disabled) return;
+            event.preventDefault();
+            send.click();
+        }
     });
+    input.addEventListener('input', function() {
+        this.style.height = 'auto'; // Reset height
+        this.style.height = (this.scrollHeight) + 'px'; // Set to scroll height
+    });
 </script>
 </body>
 </html>