Class: Openai::Images::Create
- Inherits:
-
Resource::Api
- Object
- Resource::Api
- Openai::Images::Create
- Defined in:
- lib/openai/images/create.rb
Instance Attribute Summary
Attributes inherited from Resource::Api
#connection, #data, #path, #response
Instance Method Summary collapse
-
#initialize ⇒ Create
constructor
A new instance of Create.
- #request ⇒ Object
Constructor Details
#initialize ⇒ Create
6 7 8 9 |
# File 'lib/openai/images/create.rb', line 6 def initialize @path = "/v1/images/generations" super() end |
Instance Method Details
#request ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/openai/images/create.rb', line 11 def request(**) @response = @connection.post( path: @path, body: ::Openai::Request::Images::Create.new(**).to_json ) @data = ::Openai::Mapper::Images::List.from_json(@response.body) end |