fixed documentation for base request function
diff --git a/R/authenticate.R b/R/authenticate.R
index c6a3a69..d0fbb80 100644
--- a/R/authenticate.R
+++ b/R/authenticate.R
@@ -1,24 +1,24 @@
#' 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()` accepts your API key and ensures that 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.
+#' 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.
+#' @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(apikey = 'REPLACE_THIS_WITH_YOUR_KEY')
+#' gpt3_authenticate(path = './YOURPATH/access_key.txt')
# '
#' # After you are finished:
-#' gpt3.endsession()
+#' gpt3_endsession()
#' @export
-gpt3.authenticate = function(path){
+gpt3_authenticate = function(path){
apikey_ = readLines(path)
api_key <<- apikey_
print(paste0("Will use --> ", api_key, " for authentication."))
}
-gpt3.endsession = function(){
+gpt3_endsession = function(){
api_key = "---"
print('-- session ended: you need to re-authenticate again next time.')
}
@@ -26,10 +26,10 @@
check_apikey_form = function(){
if(exists(x = 'api_key') == F){
- warning("Use gpt3.authenticate() to set your API key")
+ warning("Use gpt3_authenticate() to set your API key")
} else if(nchar(api_key) < 10){
- warning("Use gpt3.authenticate() to set your API key")
+ warning("Use gpt3_authenticate() to set your API key")
}
}