Class: OpenAI::Images
- Inherits:
-
Object
- Object
- OpenAI::Images
- Defined in:
- lib/openai_ruby/images.rb
Instance Attribute Summary collapse
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
Instance Method Summary collapse
- #generate(params = {}) ⇒ Object
-
#initialize(connection) ⇒ Images
constructor
A new instance of Images.
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
#connection ⇒ Object (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 |