Class: RunApi::Midjourney::Resources::ShortenPrompt

Inherits:
Object
  • Object
show all
Includes:
Core::ResourceHelpers
Defined in:
lib/runapi/midjourney/resources/shorten_prompt.rb

Overview

Derives concise suggestions from a prompt.

Constant Summary collapse

ENDPOINT =
"/api/v1/midjourney/shorten_prompt"
RESPONSE_CLASS =
Types::ShortenPromptResponse

Instance Method Summary collapse

Constructor Details

#initialize(http) ⇒ ShortenPrompt

Returns a new instance of ShortenPrompt.



13
# File 'lib/runapi/midjourney/resources/shorten_prompt.rb', line 13

def initialize(http) = (@http = http)

Instance Method Details

#run(options: nil, **params) ⇒ Object



15
16
17
18
19
# File 'lib/runapi/midjourney/resources/shorten_prompt.rb', line 15

def run(options: nil, **params)
  params = compact_params(params)
  validate_contract!(CONTRACT["shorten-prompt"], params)
  request(:post, ENDPOINT, body: params, options: options)
end