moderation_create_request {oaii}R Documentation

API moderations: create moderation

Description

Given a input text, outputs if the model classifies it as violating OpenAI's content policy. To get more details, visit https://platform.openai.com/docs/api-reference/moderations/create https://platform.openai.com/docs/guides/moderation

Usage

moderation_create_request(input, model = NULL, api_key = api_get_key())

Arguments

input

string, the input text to classify

model

string, two content moderations models are available: 'text-moderation-stable' and 'text-moderation-latest'. The default is 'text-moderation-latest' which will be automatically upgraded over time. This ensures you are always using our most accurate model. If you use 'text-moderation-stable', we will provide advanced notice before updating the model. Accuracy of 'text-moderation-stable' may be slightly lower than for 'text-moderation-latest'.

api_key

string, OpenAI API key (see https://platform.openai.com/account/api-keys)

Value

content of the httr response object or SimpleError (conditions) enhanced with two additional fields: 'status_code' (response$status_code) and 'message_long' (built on response content)


[Package oaii version 0.5.0 Index]