Spaces:
Sleeping
Sleeping
stream debug info
Browse files- src/App.js +1 -0
- src/api.js +2 -0
src/App.js
CHANGED
|
@@ -718,6 +718,7 @@ function App() {
|
|
| 718 |
},
|
| 719 |
(debugData) => {
|
| 720 |
// Debug info received at end of stream - instant!
|
|
|
|
| 721 |
assistantMsg.debug = debugData;
|
| 722 |
assistantMsg.loadingDebug = false;
|
| 723 |
setMessages([...newMessages]);
|
|
|
|
| 718 |
},
|
| 719 |
(debugData) => {
|
| 720 |
// Debug info received at end of stream - instant!
|
| 721 |
+
console.log("Debug callback triggered with:", debugData);
|
| 722 |
assistantMsg.debug = debugData;
|
| 723 |
assistantMsg.loadingDebug = false;
|
| 724 |
setMessages([...newMessages]);
|
src/api.js
CHANGED
|
@@ -124,7 +124,9 @@ export async function streamChat(message, strictMode, history, token, onToken, s
|
|
| 124 |
debugRegex.lastIndex = 0; // Reset regex
|
| 125 |
while ((match = debugRegex.exec(buffer)) !== null) {
|
| 126 |
try {
|
|
|
|
| 127 |
const debugData = JSON.parse(match[1]);
|
|
|
|
| 128 |
if (onDebug) {
|
| 129 |
onDebug(debugData);
|
| 130 |
}
|
|
|
|
| 124 |
debugRegex.lastIndex = 0; // Reset regex
|
| 125 |
while ((match = debugRegex.exec(buffer)) !== null) {
|
| 126 |
try {
|
| 127 |
+
console.log("Debug marker found:", match[1].substring(0, 100));
|
| 128 |
const debugData = JSON.parse(match[1]);
|
| 129 |
+
console.log("Debug data parsed:", debugData);
|
| 130 |
if (onDebug) {
|
| 131 |
onDebug(debugData);
|
| 132 |
}
|