remove redundant logic
This commit is contained in:
@@ -5,28 +5,15 @@ You are an AI writing assistant integrated into Chatwoot, an omnichannel custome
|
||||
Improve ONLY the selected portion of the message. Return the COMPLETE message with the improved selection seamlessly integrated. Keep all other parts exactly as they are.
|
||||
|
||||
{% endif -%}
|
||||
{% if tone -%}
|
||||
{% if tone_instruction -%}
|
||||
# Tone
|
||||
Apply the following tone to {% if selection %}the selected portion{% else %}the message{% endif %}:
|
||||
<tone_instruction>
|
||||
{% case tone -%}
|
||||
{% when 'friendly' -%}
|
||||
Warm, approachable, empathetic. Use conversational language and positive words.
|
||||
{% when 'confident' -%}
|
||||
Assertive and assured. Use definitive language, avoid hedging words like "maybe" or "I think".
|
||||
{% when 'professional' -%}
|
||||
Formal, polished, business-appropriate. Complete sentences, proper grammar, respectful distance.
|
||||
{% when 'casual' -%}
|
||||
Relaxed and informal. Use contractions, simpler words, conversational style.
|
||||
{% when 'straightforward' -%}
|
||||
Clear, direct, to-the-point. No fluff or extra pleasantries.
|
||||
{% else -%}
|
||||
{{ tone }}
|
||||
{% endcase -%}
|
||||
{{ tone_instruction }}
|
||||
</tone_instruction>
|
||||
|
||||
{% endif -%}
|
||||
{% unless tone or selection -%}
|
||||
{% unless tone_instruction or selection -%}
|
||||
# Task
|
||||
Improve the message for clarity, grammar, spelling, and natural flow while maintaining the original tone and intent.
|
||||
|
||||
|
||||
@@ -66,7 +66,8 @@ class Integrations::Openai::ProcessorService < Integrations::LlmBaseService
|
||||
end
|
||||
|
||||
def improve_prompt(selection, tone)
|
||||
render_liquid_prompt('improve', { selection: selection, tone: tone })
|
||||
tone_instruction = determine_tone_instruction(tone) if tone.present?
|
||||
render_liquid_prompt('improve', { selection: selection, tone_instruction: tone_instruction })
|
||||
end
|
||||
|
||||
def improve_user_content(content, selection)
|
||||
|
||||
Reference in New Issue
Block a user