create_moderation: Create moderation
Description
Classifies if text violates OpenAI's Content Policy. See this page for
details.
Usage
create_moderation(
input,
model = c("text-moderation-stable", "text-moderation-latest"),
openai_api_key = Sys.getenv("OPENAI_API_KEY"),
openai_organization = NULL
)
Value
Returns a list, elements of which contain information about the
model.
Arguments
- input
required; an arbitrary length character vector.
- model
required; a length one character vector. One among
"text-moderation-stable"
and "text-moderation-latest"
.
- openai_api_key
required; defaults to Sys.getenv("OPENAI_API_KEY")
(i.e., the value is retrieved from the .Renviron
file); a length one
character vector. Specifies OpenAI API key.
- openai_organization
optional; defaults to NULL
; a length one
character vector. Specifies OpenAI organization.
Examples
Run this codeif (FALSE) {
create_moderation("I want to kill them all.")
}
Run the code above in your browser using DataLab