Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
rossarmstrong committed Feb 2, 2023
1 parent 86506c1 commit 2110c94
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions R/fct_set_apikey.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
#'
#' @noRd
set_apikey <- function(apikey) {
api_string <- paste("OPENAI_API_KEY=",apikey, sep = "")
api_string <- paste("OPENAI_API_KEY=", apikey, sep = "")
fileConn<-file(".Renviron")
writeLines(api_string, fileConn)
close(fileConn)
# These 4 lines are required to update the environment variable input in settings tab
# Otherwise it will be stuck using the one that was in the .renviron file at startup
path <- gsub("/", "\\\\", golem::get_golem_wd())
filename <- "\\.Renviron"
full_path <- paste(path,filename, sep = "")
full_path <- paste(path, filename, sep = "")
readRenviron(full_path)
}
4 changes: 2 additions & 2 deletions R/mod_create_image.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ mod_create_image_ui <- function(id) {

## START - MY CODE
textAreaInput(ns("createimage"), label = "Enter the description to draw", rows = 3),
selectInput(ns("imagesizes"), "Size of Images", choices = c("256x256", "512x512" , "1024x1024")),
selectInput(ns("imagesizes"), "Size of Images", choices = c("256x256", "512x512", "1024x1024")),
actionButton(ns("buttonCreateImage"), label = "Create Image", icon = icon("pencil")),
br(),br(),br(),
br(), br(), br(),
imageOutput(ns("openaiResponse"))
## END - MY CODE

Expand Down
2 changes: 1 addition & 1 deletion R/mod_input_apikey.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ mod_input_apikey_ui <- function(id) {
## START - MY CODE
passwordInput(ns("apikey"), label = "Enter your OpenAI API Key"),
actionButton(ns("buttonSaveApiKey"), label = "Save", icon = icon("upload")),
br(),br(),
br(), br(),
textOutput(ns("messageApiKeySaved"))
## END - MY CODE

Expand Down

0 comments on commit 2110c94

Please sign in to comment.