Skip to content

Pathological streaming slowdown with promises 1.3.1 #16

Closed
@jcheng5

Description

@jcheng5

With yesterday's {promises} 1.3.1 release, long streaming answers from elmer in shinychat have ground to an absolute halt. Using the example from the README:

app source
library(shiny)
library(shinychat)

ui <- bslib::page_fluid(
  chat_ui("chat")
)

server <- function(input, output, session) {
  chat <- elmer::chat_openai(system_prompt = "You're a trickster who answers in riddles")
  
  observeEvent(input$chat_user_input, {
    stream <- chat$stream_async(input$chat_user_input)
    chat_append("chat", stream)
  })
}

shinyApp(ui, server)
shinychat-1.mov

The slowness can be addressed by setting options(shiny.deepstacktrace=FALSE), but then you get a stack overflow:

shinychat-2.mov

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions