Module: AskChatgpt::DefaultBehavior

Included in:
Executor
Defined in:
lib/ask_chatgpt/default_behavior.rb

Constant Summary collapse

DEFAULT_PROMPTS =
[:improve, :refactor, :question, :random_tip,
:with_code, :find_bug, :code_review, :rspec_test, :unit_test, :explain]

Instance Method Summary collapse

Instance Method Details

#add_prompt(prompt) ⇒ Object



30
31
32
33
# File 'lib/ask_chatgpt/default_behavior.rb', line 30

def add_prompt(prompt)
  scope << prompt
  self
end

#with_model(*models) ⇒ Object Also known as: with_models



6
7
8
9
10
11
12
# File 'lib/ask_chatgpt/default_behavior.rb', line 6

def with_model(*models)
  self.tap do
    models.each do |model|
      add_prompt AskChatGPT::Prompts::Model.new(model)
    end
  end
end