diff --git a/src/assets/js/main.js b/src/assets/js/main.js index 46fe5cd..534d735 100644 --- a/src/assets/js/main.js +++ b/src/assets/js/main.js @@ -21,7 +21,6 @@ async function sendGen() { } async function readResponse(response) { - console.log(response); const reader = response.body.getReader(); const decoder = new TextDecoder('utf-8'); @@ -32,18 +31,12 @@ async function readResponse(response) { function read() { // Recursive function to read the stream reader.read().then(( chunk ) => { - console.log(`Done: ${JSON.stringify(chunk.done)}`); - console.log(`Value: ${new TextDecoder().decode(chunk.value)}`); if (chunk.value) { const text = decoder.decode(chunk.value); - console.log(`Text: ${text}`); finishedResponse += text; - console.log(`(un)finishedResponse: ${finishedResponse}`); } if (chunk.done) { - console.log(`Finished: ${finishedResponse}`); const lines = finishedResponse.split('\n'); - console.log(lines); for (let i = 0; i < lines.length; i++) { const line = lines[i]; if (line.length > 0) { @@ -57,7 +50,7 @@ async function readResponse(response) { cleanResponse.push(JSONline.response); } } - console.log(cleanResponse.join('')); + outputArea.innerHTML = cleanResponse; return; } read();