ben-aaron188 | 3818e7c | 2022-09-08 17:49:01 +0200 | [diff] [blame] | 1 | % Generated by roxygen2: do not edit by hand |
| 2 | % Please edit documentation in R/authenticate.R |
| 3 | \name{gpt3.authenticate} |
| 4 | \alias{gpt3.authenticate} |
| 5 | \title{Set up the authentication with your API key} |
| 6 | \usage{ |
ben-aaron188 | 42a91d2 | 2022-09-08 20:38:22 +0200 | [diff] [blame^] | 7 | gpt3.authenticate(path) |
ben-aaron188 | 3818e7c | 2022-09-08 17:49:01 +0200 | [diff] [blame] | 8 | } |
| 9 | \arguments{ |
ben-aaron188 | 42a91d2 | 2022-09-08 20:38:22 +0200 | [diff] [blame^] | 10 | \item{path}{The file path to the API key} |
ben-aaron188 | 3818e7c | 2022-09-08 17:49:01 +0200 | [diff] [blame] | 11 | } |
| 12 | \value{ |
| 13 | A confirmation message |
| 14 | } |
| 15 | \description{ |
| 16 | Access to GPT-3's functions requires an API key that you obtain from \url{https://openai.com/api/}. \code{gpt3.authenticate()} accepts your API key and ensures that you can connect to the models. \code{gpt3.endsession()} overwrites your API key \emph{for this session} (it is recommended that you run this when you are done). \code{check_apikey_form()} is a simple check if any information has been provided at all. |
| 17 | } |
ben-aaron188 | 42a91d2 | 2022-09-08 20:38:22 +0200 | [diff] [blame^] | 18 | \details{ |
| 19 | The easiest way to store you API key is in a \code{.txt} file with \emph{only} the API key in it (without quotation marks or other common string indicators). \code{gpt3.authenticate()} reads the single file you point it to and retrieves the content as authentication key for all requests. |
| 20 | } |
ben-aaron188 | 3818e7c | 2022-09-08 17:49:01 +0200 | [diff] [blame] | 21 | \examples{ |
| 22 | # Starting a session: |
| 23 | gpt3.authenticate(apikey = 'REPLACE_THIS_WITH_YOUR_KEY') |
| 24 | # After you are finished: |
| 25 | gpt3.endsession() |
| 26 | } |