Class: Openai::Client::Completions

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

Constant Summary collapse

PATH =
'completions'

Instance Method Summary collapse

Instance Method Details

#create(body) ⇒ Hash

Public: Makes an API call to create a completion.

Parameters:

  • body (Hash)

    request body

Returns:

  • (Hash)

    a hash with a completion



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

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