From 70423a72ac2ffa56deea9a0d5c2a58cc43bc3138 Mon Sep 17 00:00:00 2001 From: Saifeddine ALOUI Date: Fri, 24 Jan 2025 17:00:09 +0100 Subject: [PATCH] Update index.html --- lightrag/api/static/index.html | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/lightrag/api/static/index.html b/lightrag/api/static/index.html index e89f7d91..2a0dee71 100644 --- a/lightrag/api/static/index.html +++ b/lightrag/api/static/index.html @@ -566,30 +566,6 @@ } } - // Query Handler - async function handleQuery(query) { - queryResponse.innerHTML = '

Processing query...

'; - - try { - const response = await fetch('/query', { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - 'Authorization': `Bearer ${localStorage.getItem('apiKey')}` - }, - body: JSON.stringify({ query }) - }); - - if (response.ok) { - const data = await response.json(); - queryResponse.innerHTML = marked.parse(data.response); - } else { - throw new Error('Failed to process query'); - } - } catch (error) { - queryResponse.innerHTML = `

Error: ${error.message}

`; - } - } // Form submission handlers uploadForm.addEventListener('submit', async (e) => { @@ -602,16 +578,6 @@ } }); - queryForm.addEventListener('submit', async (e) => { - e.preventDefault(); - const query = queryInput.value.trim(); - if (query) { - await handleQuery(query); - } else { - queryResponse.innerHTML = '

Please enter a query

'; - } - }); - // Initialize document.addEventListener('DOMContentLoaded', () => { const apiKey = localStorage.getItem('apiKey');