ExOpenAI.Moderations (ex_openai.ex v0.2.0) View Source

Link to this section Summary

Link to this section Types

Link to this type

create_moderation_opts()

View Source

Specs

create_moderation_opts() :: {:model, String.t()}

Link to this section Functions

Link to this function

create_moderation(input, opts \\ [])

View Source

Specs

create_moderation(any(), [{:model, String.t()}]) ::
  {:ok, ExOpenAI.Components.CreateModerationResponse.t()} | {:error, any()}

Endpoint /moderations

Classifies if text violates OpenAI's Content Policy


Required Arguments:

  • input: The input text to classify

Optional Arguments:

  • model: 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.

Example: "text-moderation-stable"