Class: PullRequestAi::OpenAi::Interpreter

Inherits:
Object
  • Object
show all
Defined in:
lib/pull_request_ai/openAi/interpreter.rb

Instance Method Summary collapse

Instance Method Details

#chat_message(feature_type, summary, current_changes) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/pull_request_ai/openAi/interpreter.rb', line 6

def chat_message(feature_type, summary, current_changes)
  result = ''.dup
  unless summary.nil? || summary.strip.empty?
    result << "Given the following summary for the changes made:\n"
    result << "\"#{summary}\""
    result << "\n\n"
  end
  result << "Write a #{feature_type} pull request description based on the following changes:\n"
  result << current_changes
  result.freeze
end