OpenAI.moderations

You're seeing just the function moderations, go back to OpenAI module for more information.

Classifies if text violates OpenAI's Content Policy

Example request

OpenAI.moderations(input: "I want to kill everyone!")

Example response

{:ok, %{ id: "modr-6gEWXyuaU8dqiHpbAHIsdru0zuC88", model: "text-moderation-004", results: [ %{

 "categories" => %{
   "hate" => false,
   "hate/threatening" => false,
   "self-harm" => false,
   "sexual" => false,
   "sexual/minors" => false,
   "violence" => true,
   "violence/graphic" => false
 },
 "category_scores" => %{
   "hate" => 0.05119025334715844,
   "hate/threatening" => 0.00321022979915142,
   "self-harm" => 7.337320857914165e-5,
   "sexual" => 1.1111642379546538e-6,
   "sexual/minors" => 3.588798147546868e-10,
   "violence" => 0.9190407395362855,
   "violence/graphic" => 1.2791929293598514e-7
 },
 "flagged" => true

} ] }}

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