Saltar para o conteúdo principal
Versão: Próximo

OpenAIModerationsAPI

The OpenAIModerationsAPI is responsible for classifying if text and/or image inputs are potentially harmful.

https://platform.openai.com/docs/api-reference/moderations

Funções

create()

create(input : Variant; model : Text; parameters : OpenAIParameters) : OpenAIModerationResult

ParâmetroTipoDescrição
entradaDiferente deInsira (ou entradas) para classificar. Can be a single text or a collection of OpenAIMessage.
modelTextThe content moderation model you would like to use.
parâmetrosOpenAIParametersAdditional parameters for the request.
ResultadoOpenAIModerationResultThe result of the moderation, indicating potential harm.

Classifies whether the input is potentially harmful.

https://platform.openai.com/docs/api-reference/moderations/create

Exemplos

Moderate a text

var $result:=$client.moderation.create("Some text to classify"; "omni-moderation-latest"; $parameters)

Moderate a text and an image

var $messages:=[{type: "text"; text: "...text to classify goes here..."}; \
{type: "image_url"; image_url: {url: "https://example.com/image.png"}}]
var $result:=$client.moderation.create($messages; "omni-moderation-latest"; $parameters)