Compare commits

...
Author SHA1 Message Date
Muhsin Keloth 51b1b3b668 Improve AI reply prompt 2023-07-21 11:30:15 +08:00
2 changed files with 6 additions and 2 deletions
+3 -1
View File
@@ -148,7 +148,9 @@ class Integrations::Openai::ProcessorService < Integrations::OpenaiBaseService
model: GPT_MODEL,
messages: [
{ role: 'system',
content: 'Please suggest a reply to the following conversation between support agents and customer. Reply in the user\'s language.' }
content: 'Please suggest a reply to the following conversation between support agents and customer. ' \
'Don\'t expose that you are an AI model, respond "Couldn\'t generate the reply" in cases where you can\'t answer. ' \
'Reply in the user\'s language.' }
].concat(conversation_messages(in_array_format: true))
}.to_json
end
@@ -64,7 +64,9 @@ RSpec.describe Integrations::Openai::ProcessorService do
'model' => 'gpt-3.5-turbo',
'messages' => [
{ role: 'system',
content: 'Please suggest a reply to the following conversation between support agents and customer. Reply in the user\'s language.' },
content: 'Please suggest a reply to the following conversation between support agents and customer. ' \
'Don\'t expose that you are an AI model, respond "Couldn\'t generate the reply" in cases where you can\'t answer. ' \
'Reply in the user\'s language.' },
{ role: 'user', content: customer_message.content },
{ role: 'assistant', content: agent_message.content }
]