Skip to content

Commit

Permalink
Close #4. chat_append() now waits for flush before sending message st…
Browse files Browse the repository at this point in the history
…ream
  • Loading branch information
cpsievert committed Oct 10, 2024
1 parent d58fd39 commit a8d8b23
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion R/chat.R
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,10 @@ chat_append <- function(id, response, session = getDefaultReactiveDomain()) {
# Already a generator (sync or async)
stream <- response
}
chat_append_stream(id, stream, session = session)
do_stream <- function() {
chat_append_stream(id, stream, session = session)
}
session$onFlushed(do_stream)
}

#' Low-level function to append a message to a chat control
Expand Down

0 comments on commit a8d8b23

Please sign in to comment.