Delete templates/index.html
Browse files12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Enterprise Agent Console</title> <style> body { font-family: 'Courier New', monospace; background: #0a0a0a; color: #00ff41; padding: 20px; } #console { border: 1px solid #333; height: 500px; overflow-y: auto; padding: 15px; background: #000; margin-bottom: 20px; border-radius: 4px; } .thought { color: #888; font-style: italic; background: #111; padding: 10px; border-left: 2px solid #444; margin: 10px 0; display: block; } .answer { color: #fff; font-weight: bold; display: block; margin-top: 10px; } input { width: 80%; padding: 12px; background: #1a1a1a; color: #fff; border: 1px solid #333; border-radius: 4px; } button { padding: 12px 24px; background: #007acc; border: none; color: white; cursor: pointer; border-radius: 4px; } </style></head><body> <h2>ReAct Agentic Trace</h2> <div id="console"></div> <input type="text" id="user-input" placeholder="Enter business objective..."> <button onclick="send()">Execute</button>
<script> async function send() { const input = document.getElementById('user-input'); const consoleBox = document.getElementById('console'); const text = input.value; if (!text) return;
consoleBox.innerHTML += `<div>> USER: ${text}</div>`; input.value = '';
const resDiv = document.createElement('div'); consoleBox.appendChild(resDiv);
const response = await fetch('/chat', { method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify({ message: text }) });
const reader = response.body.getReader(); const decoder = new TextDecoder(); let fullText = "";
while (true) { const { done, value } = await reader.read(); if (done) break; fullText += decoder.decode(value); // Real-time parsing of the ReAct loop [35, 36] let html = fullText .replace(/<thought>([\s\S]*?)<\/thought>/g, '<span class="thought">THOUGHT: $1</span>') .replace(/<\/thought>([\s\S]*)/g, '</span><span class="answer">FINAL ANSWER: $1</span>'); resDiv.innerHTML = html; consoleBox.scrollTop = consoleBox.scrollHeight; } } </script></body></html>templates/index.htmlDeleted-61