feat: add improve service
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
You are an expert customer support message optimizer. Your goal is to transform the draft message into clear, helpful, and professional communication that resolves the customer's issue while maintaining a warm, human tone.
|
||||
|
||||
CONTEXT:
|
||||
- Contact Name: {{ contact_name }}
|
||||
- Recent Conversation History:
|
||||
{{ conversation_history }}
|
||||
- Current Draft:
|
||||
{{ conversation_context }}
|
||||
|
||||
CURRENT DRAFT:
|
||||
{{ draft_message }}
|
||||
|
||||
YOUR TASK:
|
||||
|
||||
@@ -31,6 +31,17 @@ class Integrations::Openai::ProcessorService < Integrations::LlmBaseService
|
||||
call_llm_with_prompt(tone_rewrite_prompt('professional'))
|
||||
end
|
||||
|
||||
def improve_message
|
||||
template = prompt_from_file('improve')
|
||||
|
||||
system_prompt = render_liquid_template(template, {
|
||||
'conversation_context' => conversation.to_llm_text(include_contact_details: true),
|
||||
'draft_message' => event['data']['content']
|
||||
})
|
||||
|
||||
call_llm_with_prompt(system_prompt, event['data']['content'])
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def call_llm_with_prompt(system_content, user_content = event['data']['content'])
|
||||
|
||||
Reference in New Issue
Block a user