mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-05-13 17:22:37 +02:00
add debug logging in chat
This commit is contained in:
parent
23681d8b4d
commit
58199aab35
1 changed files with 4 additions and 0 deletions
|
|
@ -213,9 +213,11 @@ export function Chat({
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log(`chat.tsx: got streamid: ${streamId}`);
|
||||||
eventSource = new EventSource(`/api/stream-response/${streamId}`);
|
eventSource = new EventSource(`/api/stream-response/${streamId}`);
|
||||||
|
|
||||||
eventSource.addEventListener("message", (event) => {
|
eventSource.addEventListener("message", (event) => {
|
||||||
|
console.log(`chat.tsx: got message: ${event.data}`);
|
||||||
if (ignore) {
|
if (ignore) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -233,6 +235,7 @@ export function Chat({
|
||||||
});
|
});
|
||||||
|
|
||||||
eventSource.addEventListener('done', (event) => {
|
eventSource.addEventListener('done', (event) => {
|
||||||
|
console.log(`chat.tsx: got done event: ${event.data}`);
|
||||||
if (eventSource) {
|
if (eventSource) {
|
||||||
eventSource.close();
|
eventSource.close();
|
||||||
}
|
}
|
||||||
|
|
@ -250,6 +253,7 @@ export function Chat({
|
||||||
});
|
});
|
||||||
|
|
||||||
eventSource.addEventListener('stream_error', (event) => {
|
eventSource.addEventListener('stream_error', (event) => {
|
||||||
|
console.log(`chat.tsx: got stream_error event: ${event.data}`);
|
||||||
if (eventSource) {
|
if (eventSource) {
|
||||||
eventSource.close();
|
eventSource.close();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue