Classifies if text violates OpenAI's Content Policy
请求体:
input
string or array
Required
The input text to classify
model
string
Optional
Defaults to text-moderation-latest
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.
const{Configuration,OpenAIApi}=require("openai");constconfiguration=newConfiguration({apiKey:process.env.OPENAI_API_KEY,});constopenai=newOpenAIApi(configuration);constresponse=awaitopenai.createModeration({input:"I want to kill them.",});