fix: Improve reply prompt (#7588)
Co-authored-by: Sojan Jose <sojan@chatwoot.com>
This commit is contained in:
@@ -18,10 +18,6 @@ module Enterprise::Integrations::OpenaiProcessorService
|
||||
|
||||
private
|
||||
|
||||
def prompt_from_file(file_name)
|
||||
Rails.root.join('enterprise/lib/enterprise/integrations/openai_prompts', "#{file_name}.txt").read
|
||||
end
|
||||
|
||||
def labels_with_messages
|
||||
conversation = find_conversation
|
||||
|
||||
@@ -47,7 +43,7 @@ module Enterprise::Integrations::OpenaiProcessorService
|
||||
model: self.class::GPT_MODEL,
|
||||
messages: [
|
||||
{ role: 'system',
|
||||
content: prompt_from_file('summary') },
|
||||
content: prompt_from_file('summary', enterprise: true) },
|
||||
{ role: 'user', content: conversation_messages }
|
||||
]
|
||||
}.to_json
|
||||
@@ -62,7 +58,7 @@ module Enterprise::Integrations::OpenaiProcessorService
|
||||
messages: [
|
||||
{
|
||||
role: 'system',
|
||||
content: prompt_from_file('label_suggestion')
|
||||
content: prompt_from_file('label_suggestion', enterprise: true)
|
||||
},
|
||||
{ role: 'user', content: content }
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user