Running ‘spelling.R’ [0s/1s]
  Running ‘testthat.R’ [3s/40s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > # This file is part of the standard setup for testthat.
  > # It is recommended that you do not modify it.
  > #
  > # Where should you do additional test configuration?
  > # Learn more about the roles of various files in:
  > # * https://r-pkgs.org/tests.html
  > # * https://testthat.r-lib.org/reference/test_package.html#special-files
  > 
  > library(testthat)
  > library(gptstudio)
  > 
  > test_check("gptstudio")
  Loading required package: shiny
  i Sending query to ChatGPT...
  ! OpenAI API request failed [401].Error message: 
  ! OpenAI API request failed [401].Error message: 
  Asking GPT for help...
  $choices
                             text
  1 here are edits openai returns
  
  Inserting text from GPT...
  here are edits openai returns
  Asking GPT for help...
  $choices
                             text
  1 here are edits openai returns
  
  Appending text from GPT...
  here is some selected text and here are edits openai returns
  Inserting text from GPT...
  Inserting text from GPT...
  Inserting text from GPT...
  Appending text from GPT...
  i Inserting response from ChatGPT...
  i Inserting response from ChatGPT...
  i Inserting response from ChatGPT...
  i Inserting response from ChatGPT...
  Result: list(list(role = "system", content = "You are a helpful chat bot that answers questions for an R\nprogrammer working in the RStudio IDE. TThey consider themselves\nto be a beginner R programmer. Provide answers with their skill\nlevel in mind."), list(role = "user", content = "What is the meaning of life?")) and list(role = "system", content = "Life's meaning is 42.", choices = list(message.content = "The meaning of life is 42."))
  [ FAIL 4 | WARN 0 | SKIP 9 | PASS 26 ]
  
  ══ Skipped tests ═══════════════════════════════════════════════════════════════
  • On CRAN (9)
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-gpt_api_calls.R:4:3'): OpenAI create completion fails with bad key ──
  `openai_create_completion(...)` threw an unexpected error.
  Message: lexical error: invalid char in json text.
                                         <html>  <head><title>503 Servic
                       (right here) ------^
  
  Class:   simpleError/error/condition
  ── Error ('test-gpt_api_calls.R:12:3'): OpenAI create edit fails with bad key ──
  `openai_create_edit(...)` threw an unexpected error.
  Message: lexical error: invalid char in json text.
                                         <html>  <head><title>503 Servic
                       (right here) ------^
  
  Class:   simpleError/error/condition
  ── Error ('test-gpt_api_calls.R:20:3'): OpenAI create edit fails with bad key ──
  `openai_create_edit(...)` threw an unexpected error.
  Message: lexical error: invalid char in json text.
                                         <html>  <head><title>503 Servic
                       (right here) ------^
  
  Class:   simpleError/error/condition
  ── Error ('test-gpt_api_calls.R:31:3'): OpenAI create chat completion fails with bad key ──
  `openai_create_chat_completion(...)` threw an unexpected error.
  Message: lexical error: invalid char in json text.
                                         <html>  <head><title>503 Servic
                       (right here) ------^
  
  Class:   simpleError/error/condition
  
  [ FAIL 4 | WARN 0 | SKIP 9 | PASS 26 ]
  Error: Test failures
  Execution halted