Class: CodeFromDescriptionGenerator

Inherits:
Sublayer::Generators::Base show all
Defined in:
lib/sublayer/cli/commands/generators/example_generator.rb

Instance Attribute Summary

Attributes inherited from Sublayer::Generators::Base

#results

Instance Method Summary collapse

Methods inherited from Sublayer::Generators::Base

llm_output_adapter

Constructor Details

#initialize(description:, technologies:) ⇒ CodeFromDescriptionGenerator

Returns a new instance of CodeFromDescriptionGenerator.



6
7
8
9
# File 'lib/sublayer/cli/commands/generators/example_generator.rb', line 6

def initialize(description:, technologies:)
  @description = description
  @technologies = technologies
end

Instance Method Details

#generateObject



11
12
13
# File 'lib/sublayer/cli/commands/generators/example_generator.rb', line 11

def generate
  super
end

#promptObject



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/sublayer/cli/commands/generators/example_generator.rb', line 15

def prompt
  <<-PROMPT
      You are an expert programmer in #{@technologies.join(", ")}.

      You are tasked with writing code using the following technologies: #{@technologies.join(", ")}.

      The description of the task is #{@description}

      Take a deep breath and think step by step before you start coding.
  PROMPT
end