Class: Openai::Client::Moderations

Inherits:
Object
  • Object
show all
Defined in:
lib/openai/client/moderations.rb

Constant Summary collapse

PATH =
'moderations'

Instance Method Summary collapse

Instance Method Details

#create(body) ⇒ Hash

Public: Makes an API call to create a moderation.

Parameters:

  • body (Hash)

    request body

Returns:

  • (Hash)

    a moderation



14
15
16
17
18
# File 'lib/openai/client/moderations.rb', line 14

def create(body)
  Http.new.post(PATH, body).body
rescue Faraday::Error
  nil
end