#' Set up the authentication with your API key
#'
#' @description
#' Access to GPT-3's functions requires an API key that you obtain from [https://openai.com/api/](https://openai.com/api/). `gpt3_authenticate()` looks for your API key in a file that you provide the path to and ensures you can connect to the models. `gpt3_endsession()` overwrites your API key _for this session_ (it is recommended that you run this when you are done). `check_apikey_form()` is a simple check if any information has been provided at all.
#' @param path The file path to the API key
#' @return A confirmation message
#' @details The easiest way to store you API key is in a `.txt` file with _only_ the API key in it (without quotation marks or other common string indicators). `gpt3_authenticate()` reads the single file you point it to and retrieves the content as authentication key for all requests.
#' @examples
#' # Starting a session:
#' gpt3_authenticate(path = './YOURPATH/access_key.txt')
# '
#' # After you are finished:
#' gpt3_endsession()
#' @export
gpt3_authenticate = function(path){
  apikey_ = readLines(path)
  api_key <<- apikey_
  print(paste0("Will use --> ", api_key, " for authentication."))
}

gpt3_endsession = function(){
  api_key = "---"
  print('-- session ended: you need to re-authenticate again next time.')
}

check_apikey_form = function(){

  if(exists(x = 'api_key') == F){
    warning("Use gpt3_authenticate() to set your API key")
  } else if(nchar(api_key) < 10){

    warning("Use gpt3_authenticate() to set your API key")

  }
}
