Class: OpenAI::Images

Inherits:
Object
  • Object
show all
Defined in:
lib/openai_ruby/images.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(connection) ⇒ Images

Returns a new instance of Images.



5
6
7
# File 'lib/openai_ruby/images.rb', line 5

def initialize(connection)
  @connection = connection
end

Instance Attribute Details

#connectionObject (readonly)

Returns the value of attribute connection.



3
4
5
# File 'lib/openai_ruby/images.rb', line 3

def connection
  @connection
end

Instance Method Details

#generate(params = {}) ⇒ Object



9
10
11
# File 'lib/openai_ruby/images.rb', line 9

def generate(params = {})
  connection.post("/v1/images/generations", params.to_json)
end