feat: Improve reply suggestions using help center articles (#9026)
This commit is contained in:
@@ -8,9 +8,9 @@ class ChatGpt
|
||||
@messages = [system_message(context_sections)]
|
||||
end
|
||||
|
||||
def generate_response(input, previous_messages = [])
|
||||
def generate_response(input, previous_messages = [], role = 'user')
|
||||
@messages += previous_messages
|
||||
@messages << { 'role': 'user', 'content': input } if input.present?
|
||||
@messages << { 'role': role, 'content': input } if input.present?
|
||||
|
||||
response = request_gpt
|
||||
JSON.parse(response['choices'][0]['message']['content'].strip)
|
||||
|
||||
Reference in New Issue
Block a user