added logging of RAG chunks for debugging
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user