From afe852935e8a1b5622d98ba009db68c2ecab7c90 Mon Sep 17 00:00:00 2001 From: ntohidi Date: Wed, 9 Jul 2025 16:59:17 +0200 Subject: [PATCH] fix: show /llm API response in playground. ref #1288 --- deploy/docker/static/playground/index.html | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/deploy/docker/static/playground/index.html b/deploy/docker/static/playground/index.html index 7af96f1f..e01fc857 100644 --- a/deploy/docker/static/playground/index.html +++ b/deploy/docker/static/playground/index.html @@ -671,6 +671,16 @@ method: 'GET', headers: { 'Accept': 'application/json' } }); + responseData = await response.json(); + const time = Math.round(performance.now() - startTime); + if (!response.ok) { + updateStatus('error', time); + throw new Error(responseData.error || 'Request failed'); + } + updateStatus('success', time); + document.querySelector('#response-content code').textContent = JSON.stringify(responseData, null, 2); + document.querySelector('#response-content code').className = 'json hljs'; + forceHighlightElement(document.querySelector('#response-content code')); } else if (endpoint === 'crawl_stream') { // Stream processing response = await fetch(api, {