diff --git a/NAMESPACE b/NAMESPACE index bbb565a..f686a2c 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -21,6 +21,7 @@ importFrom(httr,content) importFrom(httr,http_status) importFrom(jsonlite,fromJSON) importFrom(jsonlite,toJSON) +importFrom(jsonlite,write_json) importFrom(openai,create_chat_completion) importFrom(readr,read_csv) importFrom(readxl,read_excel) @@ -34,6 +35,7 @@ importFrom(shiny,br) importFrom(shiny,column) importFrom(shiny,conditionalPanel) importFrom(shiny,downloadButton) +importFrom(shiny,downloadHandler) importFrom(shiny,fileInput) importFrom(shiny,fluidPage) importFrom(shiny,fluidRow) @@ -45,8 +47,11 @@ importFrom(shiny,mainPanel) importFrom(shiny,numericInput) importFrom(shiny,observe) importFrom(shiny,observeEvent) +importFrom(shiny,outputOptions) importFrom(shiny,p) importFrom(shiny,paneViewer) +importFrom(shiny,reactive) +importFrom(shiny,reactiveVal) importFrom(shiny,renderUI) importFrom(shiny,req) importFrom(shiny,runGadget) diff --git a/R/batchLLM_shiny.R b/R/batchLLM_shiny.R index 2db8f0b..1f2474c 100644 --- a/R/batchLLM_shiny.R +++ b/R/batchLLM_shiny.R @@ -1,14 +1,22 @@ #' @title Interact with batchLLM via a Shiny Gadget #' +#' @description This function provides a Shiny-based user interface to interact with +#' the `batchLLM` package. It allows users to configure and execute batch processing +#' through an interactive dashboard. +#' #' @export -#' @importFrom shiny fluidPage fluidRow column titlePanel tabPanel tabsetPanel conditionalPanel HTML sidebarLayout sidebarPanel -#' @importFrom shiny textInput numericInput downloadButton updateTextInput tags tagList br hr h1 p span img uiOutput textAreaInput -#' @importFrom shiny sliderInput actionButton icon mainPanel observe req -#' @importFrom shiny selectInput updateSelectInput renderUI observeEvent -#' @importFrom shiny runGadget paneViewer fileInput showNotification +#' +#' @importFrom shiny fluidPage fluidRow column titlePanel tabPanel tabsetPanel +#' @importFrom shiny conditionalPanel HTML sidebarLayout sidebarPanel mainPanel +#' @importFrom shiny textInput numericInput downloadButton updateTextInput +#' @importFrom shiny tags tagList br hr h1 p span img uiOutput textAreaInput +#' @importFrom shiny sliderInput actionButton icon observe req +#' @importFrom shiny downloadHandler outputOptions selectInput updateSelectInput +#' @importFrom shiny renderUI observeEvent runGadget paneViewer fileInput +#' @importFrom shiny showNotification reactive reactiveVal #' @importFrom shinydashboard dashboardPage dashboardHeader dashboardSidebar -#' @importFrom shinydashboard sidebarMenu menuItem dashboardBody tabItems -#' @importFrom shinydashboard tabItem box +#' @importFrom shinydashboard sidebarMenu menuItem dashboardBody tabItems tabItem +#' @importFrom shinydashboard box #' @importFrom shinyWidgets pickerInput updatePickerInput radioGroupButtons #' @importFrom DT dataTableOutput renderDataTable datatable #' @importFrom shinyjs useShinyjs toggle hidden show hide @@ -19,9 +27,10 @@ #' @importFrom readxl read_excel #' @importFrom tools file_ext file_path_sans_ext #' @importFrom stats setNames +#' @importFrom jsonlite write_json +#' @import batchLLM batchLLM_shiny <- function() { - library(batchLLM) - + df_objects <- "beliefs" create_exportable_datatable <- function(data, filename_prefix) { @@ -256,8 +265,8 @@ batchLLM_shiny <- function() { ) server <- function(input, output, session) { - if (exists("beliefs")) { - session$userData$beliefs <- beliefs + if (!exists("beliefs")) { + session$userData$beliefs <- batchLLM::beliefs } all_objects <- reactiveVal(c()) diff --git a/man/batchLLM_shiny.Rd b/man/batchLLM_shiny.Rd index 3fbc6c1..6c2e2b1 100644 --- a/man/batchLLM_shiny.Rd +++ b/man/batchLLM_shiny.Rd @@ -7,5 +7,7 @@ batchLLM_shiny() } \description{ -Interact with batchLLM via a Shiny Gadget +This function provides a Shiny-based user interface to interact with +the \code{batchLLM} package. It allows users to configure and execute batch processing +through an interactive dashboard. }