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 ab02f60 commit 0367453
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion R/fct_get_url.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ get_url <- function(prompt, size){
openai::create_image(prompt = prompt,
n = 1,
size = size,
openai_api_key = Sys.getenv('OPENAI_API_KEY')
openai_api_key = Sys.getenv("OPENAI_API_KEY")
)[["data"]][1,]
}
4 changes: 2 additions & 2 deletions R/mod_create_image.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ mod_create_image_server <- function(id){
output$openaiResponse <- renderImage({
url <- get_url(input$createimage, input$imagesizes)
filename <- paste("inst/app/www",get_filename(url), sep = "/")
download.file(url,filename, mode = 'wb')
download.file(url,filename, mode = "wb")
img_dimension <- as.numeric(sapply(strsplit(input$imagesizes, "x"), getElement, 1))
list(src = filename, contentType = 'image/png',width = img_dimension, height = img_dimension,
list(src = filename, contentType = "image/png",width = img_dimension, height = img_dimension,
alt = input$createimage)
}, deleteFile = FALSE) |>
bindEvent(input$buttonCreateImage)
Expand Down
2 changes: 1 addition & 1 deletion dev/02_dev.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
## Dependencies ----
## Amend DESCRIPTION with dependencies read from package code parsing
## install.package('attachment') # if needed. # The s is missing on package/s
install.packages('attachment')
install.packages("attachment")
attachment::att_amend_desc()
## Add one line by package you want to add as dependency"
usethis::use_package("shinydashboard", min_version = TRUE)
Expand Down
2 changes: 1 addition & 1 deletion tests/spelling.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
if (requireNamespace('spelling', quietly = TRUE))
if (requireNamespace("spelling", quietly = TRUE))
spelling::spell_check_test(vignettes = TRUE, error = FALSE,
skip_on_cran = TRUE)

0 comments on commit 0367453

Please sign in to comment.