lib/openaipoet/runner.rb
# Use the generated values and input to compose the 
# poem and return this to the user.
Use the generated values and input to compose the
poem and return this to the user.
Use the generated values and input to compose the poem and return this to the user .
def compose_poem(input, parsed_response, poem, poet)
      id = parsed_response["id"]
      created = parsed_response["created"]
      result = parsed_response["choices"].map { |c| c["text"].lstrip }.first
      poem_lines = [input.seed+"\n"]
      generated_lines = result.split("\n")
      content = poem_lines + generated_lines
      GeneratedPoem.new(
        id: id,
        created: created,
        title: input.title,
        content: content.flatten,
        inspiration: poem.title,
        mimic: poet.full_name
      )
    end
def compose_poem ( input , parsed_response , poem , poet ) id = parsed_response [ "id" ] created = parsed_response [ "created" ] result = parsed_response [ "choices" ] . map { | c | c [ "text" ] . lstrip } . first poem_lines = [ input . seed + "\n" ] generated_lines = result . split ( "\n" ) content = poem_lines + generated_lines GeneratedPoem . new ( id : id , created : created , title : input . title , content : content . flatten , inspiration : poem . title , mimic : poet . full_name ) end
Use the generated values and input to compose the
poem and return this to the user.
Use the generated values and input to compose the poem and return this to the user .
input
<not_specific>
parsed_response
<not_specific>
poem
<not_specific>
poet
<not_specific>