Spaces:
Sleeping
Sleeping
Add Show Prolog Queries" button
Browse files- src/App.js +9 -2
src/App.js
CHANGED
|
@@ -727,8 +727,15 @@ function App() {
|
|
| 727 |
try {
|
| 728 |
const debugResult = await sendChat(userMsg.text, strictMode, historyForBackend, token, sessionId);
|
| 729 |
if (debugResult.prolog_query_info) {
|
| 730 |
-
|
| 731 |
-
setMessages(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 732 |
}
|
| 733 |
} catch (debugErr) {
|
| 734 |
// Silently fail - debug info is optional
|
|
|
|
| 727 |
try {
|
| 728 |
const debugResult = await sendChat(userMsg.text, strictMode, historyForBackend, token, sessionId);
|
| 729 |
if (debugResult.prolog_query_info) {
|
| 730 |
+
// Update the assistant message with debug info and force re-render
|
| 731 |
+
setMessages(prevMessages => {
|
| 732 |
+
const updated = [...prevMessages];
|
| 733 |
+
const lastMsg = updated[updated.length - 1];
|
| 734 |
+
if (lastMsg && lastMsg.role === 'assistant') {
|
| 735 |
+
lastMsg.debug = debugResult.prolog_query_info;
|
| 736 |
+
}
|
| 737 |
+
return updated;
|
| 738 |
+
});
|
| 739 |
}
|
| 740 |
} catch (debugErr) {
|
| 741 |
// Silently fail - debug info is optional
|