added logging of RAG chunks for debugging

This commit is contained in:
2026-02-03 11:44:11 +01:00
parent 205e348be0
commit 62dc69374a
3 changed files with 55 additions and 17 deletions
+9
View File
@@ -186,6 +186,15 @@
});
const data = await res.json();
setLoading(false);
if (data.retrieved && data.retrieved.length > 0) {
console.groupCollapsed('[RAG] Retrieved ' + data.retrieved.length + ' chunk(s)');
data.retrieved.forEach(function(chunk, i) {
console.group('Chunk ' + (i + 1) + ' | ' + (chunk.source || '') + (chunk.page != null ? ' p.' + chunk.page : ''));
console.log(chunk.content);
console.groupEnd();
});
console.groupEnd();
}
if (data.error) {
appendMessage('assistant', data.error, true);
} else {