R/genai.openai.chat.history.save.R

Defines functions genai.openai.chat.history.save

#' @noRd
genai.openai.chat.history.save = function(genai.openai.object,
                                          file.name) {
  write(jsonlite::toJSON(genai.openai.object$chat.history$messages, pretty = TRUE),
        paste0(file.name, ".json"))
}

Try the GenAI package in your browser

Any scripts or data that you put into this service are public.

GenAI documentation built on May 29, 2024, 11:58 a.m.