struct OpenAI::ModerationRequest

Overview

The moderations endpoint is a tool you can use to check whether content complies with OpenAI's usage policies. Developers can thus identify content that our usage policies prohibits and take action, for instance by filtering it.

Included Modules

Extended Modules

Defined in:

openai/api/moderation.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(pull : JSON::PullParser) #

[View source]
def self.new(input : String, model : OpenAI::ModerationModel = :stable) #

[View source]

Instance Method Detail

def input : String #

The input text to classify


[View source]
def model : ModerationModel #

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.


[View source]