R/verify_mime_type.R

Defines functions verify_mime_type

verify_mime_type <- function(result) {

    if (httr::http_type(result) != "application/json") {
        paste(
            "OpenAI API probably has been changed. If you see this, please",
            "rise an issue at: https://github.com/irudnyts/openai/issues"
        ) %>%
            stop()
    }

}

Try the openai package in your browser

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

openai documentation built on March 31, 2023, 11:56 p.m.