|
3 | 3 | <head>
|
4 | 4 | <meta charset="UTF-8">
|
5 | 5 | <meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
| - <meta name="debug" content="{{ debug }}"> |
7 | 6 | <title>Ask Defang</title>
|
8 | 7 | <script src="https://cdnjs.cloudflare.com/ajax/libs/marked/4.0.2/marked.min.js"></script>
|
9 | 8 | <link rel="icon" href="{{ url_for('static', filename='images/favicon.ico') }}" type="image/x-icon">
|
@@ -273,12 +272,7 @@ <h2>Ask Defang</h2>
|
273 | 272 | loadingSpinner.style.display = 'inline-block';
|
274 | 273 | sendButton.disabled = true;
|
275 | 274 |
|
276 |
| - const debug = document.querySelector('meta[name=debug]').content; |
277 |
| - if (debug == '1') { |
278 |
| - askDebug(query) |
279 |
| - } else { |
280 |
| - ask(query, responseContainer) |
281 |
| - } |
| 275 | + ask(query, responseContainer) |
282 | 276 | }
|
283 | 277 |
|
284 | 278 | function ask(query, responseContainer) {
|
@@ -324,36 +318,6 @@ <h2>Ask Defang</h2>
|
324 | 318 | chatBox.scrollTop = chatBox.scrollHeight;
|
325 | 319 | });
|
326 | 320 | }
|
327 |
| - |
328 |
| - function askDebug(query) { |
329 |
| - // fetch context for debugging |
330 |
| - rateLimitingFetch('/ask/debug', { |
331 |
| - method: 'POST', |
332 |
| - headers: { |
333 |
| - 'Content-Type': 'application/json', |
334 |
| - 'X-CSRFToken': '{{ csrf_token() }}' |
335 |
| - }, |
336 |
| - body: JSON.stringify({ query: query}), |
337 |
| - }) |
338 |
| - .then(response => response.json()) |
339 |
| - .then(data => { |
340 |
| - if (data.error) { |
341 |
| - chatBox.innerHTML += `<p><strong>Debug Context:</strong> Error: ${data.error}</p>`; |
342 |
| - } else { |
343 |
| - chatBox.innerHTML += `<p><strong>Debug Context:</strong> ${data.context}</p>`; |
344 |
| - } |
345 |
| - chatBox.scrollTop = chatBox.scrollHeight; |
346 |
| - loadingSpinner.style.display = 'none'; |
347 |
| - sendButton.disabled = false; |
348 |
| - }) |
349 |
| - .catch(error => { |
350 |
| - console.error('Error:', error); |
351 |
| - loadingSpinner.style.display = 'none'; |
352 |
| - sendButton.disabled = false; |
353 |
| - chatBox.innerHTML += '<p><strong>Debug Context:</strong> Error: Failed to get context</p>'; |
354 |
| - chatBox.scrollTop = chatBox.scrollHeight; |
355 |
| - }); |
356 |
| - } |
357 | 321 | </script>
|
358 | 322 | </body>
|
359 | 323 | </html>
|
0 commit comments