Skip to content

Commit

Permalink
forgot suggests
Browse files Browse the repository at this point in the history
  • Loading branch information
JBGruber committed Apr 6, 2023
1 parent af245e4 commit eed5300
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Suggests:
rmarkdown,
rstudioapi,
shiny,
shinycssloaders,
spelling,
testthat (>= 3.0.0),
withr
Expand Down
6 changes: 3 additions & 3 deletions R/tutorial_addin.r
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,9 @@ tutorialise_addin <- function() {

server <- function(input, output, session) {


# does not really render text but needed to show spinner
prcs <- shiny::eventReactive(input$done, "GPT is thinking")
output$spinner <- renderText({
output$spinner <- shiny::renderText({
prcs()
shiny::stopApp({
out <- make_request(input$prompt, input$code)
Expand All @@ -64,10 +63,11 @@ tutorialise_addin <- function() {

make_request <- function(prompt, code) {

parse_response(chat_api(prompt = prompt))
parse_response(chat_api(prompt = prompt))

}


rstudio_selection <- function() {
context <- rstudioapi::getActiveDocumentContext()
out <- context$selection[[1L]]$text
Expand Down

0 comments on commit eed5300

Please sign in to comment.