Sets a legacy process-wide callback for non-interactive sessions. This
fallback cannot isolate concurrent Agents or Shiny sessions. New code should
bind a handler to a tool instance with tools_interactive().
Arguments
- callback
A function that takes
questionsin Deputy's structured question format. Each question hasquestion,header,options(list withlabelanddescription), andmultiSelect. Should return a named list mapping question text to selected label(s). For multi-select, join labels with ", ". Set to NULL to clear the callback.
Examples
if (FALSE) { # \dontrun{
# Legacy fallback for a single-Agent script:
set_ask_user_callback(function(questions) {
# Display questions in modal and collect answers
answers <- list()
for (q in questions) {
# Collect one answer for each question.
answers[[q$question]] <- selected_label
}
answers
})
} # }