ak0601 commited on
Commit
f39b364
·
verified ·
1 Parent(s): b5bea7f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +39 -27
app.py CHANGED
@@ -2552,35 +2552,47 @@ async def generate_sequences_with_llm(job_description: str, campaign_id: Optiona
2552
  llm = ChatOpenAI(model="gpt-4o", temperature=0.7, openai_api_key=openai_api_key)
2553
  structured_llm = llm.with_structured_output(SequenceStructure)
2554
 
2555
- system_prompt = """You are an expert email sequence template generator for recruitment campaigns on behalf of 'Ali Taghikhani, CEO SRN'.
2556
-
2557
- Your task is to generate a 3-step email sequence template for a given job description.
2558
- Email Sequence Structure:
2559
- 1. INTRODUCTION (Day 1): Ask for consent and interest in the role, In the starting use the welcome message placeholder after the salutation, and in the end use closing message template along with the name and title of sender
2560
- 2. OUTREACH (Day 3): Provide detailed job information
2561
- 3. FOLLOW-UP (Day 5): Follow up on updates and next steps
2562
- Requirements:
2563
- - First sequence will only ask about the consent and interest in the role, no other information is needed.
2564
- - Second and third sequences are follow-ups (no subject line needed) in the 3rd sequence try providing some information about the role and the company.
2565
- - All emails should be HTML formatted with proper <br> tags
2566
- - Professional but friendly tone
2567
- - Include clear call-to-actions
2568
- - Focus on building consent and trust
2569
 
2570
  **CRITICAL FORMATTING RULES:**
2571
- 1. **PLACEHOLDER FORMAT IS ESSENTIAL:** You MUST use double curly braces for all placeholders.
2572
- - **CORRECT:** `{{first_name}}`
2573
- - **INCORRECT:** `{first_name}` or `[first_name]` or `<first_name>`
2574
- 2. **REQUIRED PLACEHOLDERS:** You MUST include `{{Welcome_Message}}` and `{{Closing_Message}}` in the first email. You should also use `{{first_name}}` in follow-ups.
2575
- 3. **FIRST EMAIL STRUCTURE:** The first email's body MUST begin with `{{Welcome_Message}}` and end with `{{Closing_Message}}`.
2576
- 4. **SIGNATURE:** End EVERY email body with `<br><br>Best regards,<br>Ali Taghikhani<br>CEO, SRN`.
2577
- 5. **EXAMPLE BODY:**
2578
- ```html
2579
- {{Welcome_Message}}<br><br>I saw your profile and was impressed. We have an opening for a Senior Engineer that seems like a great fit.<br><br>{{Closing_Message}}<br><br>Best regards,<br>Ali Taghikhani<br>CEO, SRN>
2580
- ```
2581
- Always try to start the message with the salutation except for the first email.
2582
- If lead context is provided, use it to make the templates more relevant.
2583
- Respond with ONLY a valid JSON object matching the required structure.
 
 
 
 
 
 
 
 
 
 
 
 
2584
  """
2585
 
2586
  prompt = ChatPromptTemplate.from_messages([
 
2552
  llm = ChatOpenAI(model="gpt-4o", temperature=0.7, openai_api_key=openai_api_key)
2553
  structured_llm = llm.with_structured_output(SequenceStructure)
2554
 
2555
+ system_prompt = """You are an expert email sequence template generator for recruitment campaigns on behalf of 'Ali Taghikhani, CEO SRN'. Your task is to generate a 3-step email sequence template for a given job description.
2556
+
2557
+ Email Sequence Structure:
2558
+ 1. INTRODUCTION (Day 1): Ask for consent and interest in the role, In the starting use the welcome message placeholder after the salutation, and in the end use closing message template along with the name and title of sender
2559
+ 2. OUTREACH (Day 3): Provide detailed job information
2560
+ 3. FOLLOW-UP (Day 5): Follow up on updates and next steps
2561
+
2562
+ Requirements:
2563
+ - First sequence will only ask about the consent and interest in the role, mentioning the company name, role title, and location type (onsite/hybrid/remote)
2564
+ - Second and third sequences are follow-ups (no subject line needed) providing more details about the role, company mission, and salary information (if available)
2565
+ - All emails should be HTML formatted with proper <br> tags
2566
+ - Professional but friendly tone
2567
+ - Each email must include a clear call-to-action: "If you're interested, send me your updated CV, salary expectations, and I'll get your application in front of the hiring manager ASAP."
2568
+ - Focus on building consent and trust
2569
 
2570
  **CRITICAL FORMATTING RULES:**
2571
+ 1. **PLACEHOLDER FORMAT IS ESSENTIAL:** You MUST use double curly braces for all placeholders.
2572
+ - **CORRECT:** `{{first_name}}`
2573
+ - **INCORRECT:** `{first_name}` or `[first_name]` or `<first_name>`
2574
+
2575
+ 2. **REQUIRED PLACEHOLDERS:** You MUST include `{{Welcome_Message}}` and `{{Closing_Message}}` in the first email. You should also use `{{first_name}}` in follow-ups.
2576
+
2577
+ 3. **FIRST EMAIL STRUCTURE:** The first email's body MUST begin with `{{Welcome_Message}}` and end with `{{Closing_Message}}`.
2578
+
2579
+ 4. **SIGNATURE:** End EVERY email body with `<br><br>Best regards`.
2580
+
2581
+ 5. **CONTENT REQUIREMENTS:** Each email must mention:
2582
+ - Company name
2583
+ - Role title
2584
+ - Work location (onsite/hybrid/remote)
2585
+ - Company mission (in emails 2 and 3)
2586
+ - Salary information (if available, in emails 2 and 3)
2587
+
2588
+ 6. **CALL-TO-ACTION:** Each email must end with the CTA (before the signature): "If you're interested, send me your updated CV, salary expectations, and I'll get your application in front of the hiring manager ASAP."
2589
+
2590
+ 7. **EXAMPLE BODY:**
2591
+ ```html
2592
+ {{Welcome_Message}}<br><br>I saw your profile and was impressed. We have an opening for a Senior Engineer at [Company Name] that seems like a great fit. This is a [remote/hybrid/onsite] position.<br><br>If you're interested, send me your updated CV, salary expectations, and I'll get your application in front of the hiring manager ASAP.<br><br>{{Closing_Message}}<br><br>Best regards,<br>Ali Taghikhani<br>CEO, SRN
2593
+ ```
2594
+
2595
+ Always try to start the message with the salutation except for the first email. If lead context is provided, use it to make the templates more relevant. Respond with ONLY a valid JSON object matching the required structure.
2596
  """
2597
 
2598
  prompt = ChatPromptTemplate.from_messages([