#' Makes a single chat completion request to the ChatGPT API
#'
#' @description
#' `chatgpt_single()` sends a single [chat completion request](https://platform.openai.com/docs/guides/chat) to the Open AI GPT API. Doing so, makes this equivalent to the sending single completion requests with `gpt3_single_completion()`. You can see the notes on chat vs completion requests here: [https://platform.openai.com/docs/guides/chat/chat-vs-completions](https://platform.openai.com/docs/guides/chat/chat-vs-completions). This function allows you to specify the role and content for your API call.
#' @details For a general guide on the completion requests, see [https://platform.openai.com/docs/api-reference/chat](https://platform.openai.com/docs/api-reference/chat). This function provides you with an R wrapper to send requests with the full range of request parameters as detailed on [https://beta.openai.com/docs/api-reference/completions](https://beta.openai.com/docs/api-reference/completions) and reproduced below.
#'
#' Parameters not included/supported:
#'   - `logit_bias`: [https://platform.openai.com/docs/api-reference/chat/create#chat/create-logit_bias](https://platform.openai.com/docs/api-reference/chat/create#chat/create-logit_bias)
#'   - `stream`: [https://platform.openai.com/docs/api-reference/chat/create#chat/create-stream](https://platform.openai.com/docs/api-reference/chat/create#chat/create-stream)
#'
#'
#' @param prompt_role character (default: 'user') that contains the role for the prompt message in the ChatGPT message format. Must be one of 'system', 'assistant', 'user' (default), see [https://platform.openai.com/docs/guides/chat](https://platform.openai.com/docs/guides/chat)
#' @param prompt_content character that contains the content for the prompt message in the ChatGPT message format, see [https://platform.openai.com/docs/guides/chat](https://platform.openai.com/docs/guides/chat). This is the key instruction that ChatGPT receives.
#' @param model a character vector that indicates the [ChatGPT model](https://platform.openai.com/docs/api-reference/chat/create#chat/create-model) to use; one of "gpt-3.5-turbo" (default), "gpt-3.5-turbo-0301"
#' @param output_type character determining the output provided: "complete" (default), "text" or "meta"
#' @param max_tokens numeric (default: 100) indicating the maximum number of tokens that the completion request should return (from the official API documentation: _The maximum number of tokens allowed for the generated answer. By default, the number of tokens the model can return will be (4096 - prompt tokens)._)
#' @param temperature numeric (default: 1.0) specifying the sampling strategy of the possible completions (from the official API documentation: _What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both._)
#' @param top_p numeric (default: 1) specifying sampling strategy as an alternative to the temperature sampling (from the official API documentation: _An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both._)
#' @param n numeric (default: 1) specifying the number of completions per request (from the official API documentation: _How many chat completion choices to generate for each input message. **Note: Because this parameter generates many completions, it can quickly consume your token quota.** Use carefully and ensure that you have reasonable settings for max_tokens and stop._)
#' @param stop character or character vector (default: NULL) that specifies after which character value when the completion should end (from the official API documentation: _Up to 4 sequences where the API will stop generating further tokens._)
#' @param presence_penalty numeric (default: 0) between -2.00  and +2.00 to determine the penalisation of repetitiveness if a token already exists (from the official API documentation: _Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics._). See also: [https://beta.openai.com/docs/api-reference/parameter-details](https://beta.openai.com/docs/api-reference/parameter-details)
#' @param frequency_penalty numeric (default: 0) between -2.00  and +2.00 to determine the penalisation of repetitiveness based on the frequency of a token in the text already (from the official API documentation: _Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim._). See also: [https://beta.openai.com/docs/api-reference/parameter-details](https://beta.openai.com/docs/api-reference/parameter-details)
#'
#' @return A list with two data tables (if `output_type` is the default "complete"): [[1]] contains the data table with the columns `n` (= the mo. of `n` responses requested), `prompt_role` (= the role that was set for the prompt), `prompt_content` (= the content that was set for the prompt), `chatgpt_role` (= the role that ChatGPT assumed in the chat completion) and `chatgpt_content` (= the content that ChatGPT provided with its assumed role in the chat completion). [[2]] contains the meta information of the request, including the request id, the parameters of the request and the token usage of the prompt (`tok_usage_prompt`), the completion (`tok_usage_completion`) and the total usage (`tok_usage_total`).
#'
#' If `output_type` is "text", only the data table in slot [[1]] is returned.
#'
#' If `output_type` is "meta", only the data table in slot [[2]] is returned.
#' @examples
#' # First authenticate with your API key via `gpt3_authenticate('pathtokey')`
#'
#' # Once authenticated:
#'
#' ## Simple request with defaults:
#' chatgpt_single(prompt_content = 'You are a teacher: explain to me what science is')
#'
#' ## Instruct ChatGPT to write ten research ideas of max. 150 tokens with some controls:
#' chatgpt_single(prompt_role = 'user', prompt_content = 'Write a research idea about using text data to understand human behaviour:'
#'    , temperature = 0.8
#'    , n = 10
#'    , max_tokens = 150)
#'
#' ## For fully reproducible results, we need `temperature = 0`, e.g.:
#' chatgpt_single(prompt_content = 'Finish this sentence:/n There is no easier way to learn R than'
#'     , temperature = 0.0
#'     , max_tokens = 50)
#'
#' @export
chatgpt_single = function(prompt_role = 'user'
                          , prompt_content
                          , model = 'gpt-3.5-turbo'
                          , output_type = 'complete'
                          , max_tokens = 100
                          , temperature = 1.0
                          , top_p = 1
                          , n = 1
                          , stop = NULL
                          , presence_penalty = 0
                          , frequency_penalty = 0
                          ){

  #check for request issues with `n` and `best_of`

  if(temperature == 0 & n > 1){
    n = 1
    message('You are running the deterministic model, so `n` was set to 1 to avoid unnecessary token quota usage.')
  }

  messages = c = data.frame(role = prompt_role
                            , content = prompt_content)

  parameter_list = list(messages = messages
                        , model = model
                        , max_tokens = max_tokens
                        , temperature = temperature
                        , top_p = top_p
                        , n = n
                        , stop = stop
                        , presence_penalty = presence_penalty
                        , frequency_penalty = frequency_penalty
                        )

  request_base = httr::POST(url = url.chat_completions
                            , body = parameter_list
                            , httr::add_headers(Authorization = paste("Bearer", api_key))
                            , encode = "json")

  request_content = httr::content(request_base)

  if(request_base$status_code != 200){
    warning(paste0("Request completed with error. Code: ", request_base$status_code
                   , ", message: ", request_content$error$message))
  }

  if(n == 1){
    core_output = data.table::data.table('n' = 1
                                         , 'prompt_role' = prompt_role
                                         , 'prompt_content' = prompt_content
                                         , 'chatgpt_role' = request_content$choices[[1]]$message$role
                                         , 'chatgpt_content' = request_content$choices[[1]]$message$content)
  } else if(n > 1){

    core_output = data.table::data.table('n' = 1:n
                                         , 'prompt_role' = rep(prompt_role, n)
                                         , 'prompt_content' = rep(prompt_content, n)
                                         , 'chatgpt_role' = rep("", n)
                                         , 'chatgpt_content' = rep("", n))

    for(i in 1:n){
      core_output$chatgpt_role[i] = request_content$choices[[i]]$message$role
      core_output$chatgpt_content[i] = request_content$choices[[i]]$message$content
    }

  }


  meta_output = data.table::data.table('request_id' = request_content$id
                                       , 'object' = request_content$object
                                       , 'model' = request_content$model
                                       , 'param_prompt_role' = prompt_role
                                       , 'param_prompt_content' = prompt_content
                                       , 'param_model' = model
                                       , 'param_max_tokens' = max_tokens
                                       , 'param_temperature' = temperature
                                       , 'param_top_p' = top_p
                                       , 'param_n' = n
                                       , 'param_stop' = stop
                                       , 'param_presence_penalty' = presence_penalty
                                       , 'param_frequency_penalty' = frequency_penalty
                                       , 'tok_usage_prompt' = request_content$usage$prompt_tokens
                                       , 'tok_usage_completion' = request_content$usage$completion_tokens
                                       , 'tok_usage_total' = request_content$usage$total_tokens)


  if(output_type == 'complete'){
    output = list(core_output
                  , meta_output)
  } else if(output_type == 'meta'){
    output = meta_output
  } else if(output_type == 'text'){
    output = core_output
  }

  return(output)

}
