Update app.py
Browse files
app.py
CHANGED
@@ -31,11 +31,19 @@ def generate_and_correct_email(bio, company_name, role):
|
|
31 |
"Content-Type": "application/json",
|
32 |
}
|
33 |
|
34 |
-
# Updated prompt to
|
35 |
prompt = f"""
|
36 |
-
Write a professional email applying for
|
37 |
-
|
38 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
"""
|
40 |
|
41 |
# Construct the data payload for the API request
|
@@ -87,6 +95,10 @@ def create_email(name, dob, city, company_name, role, email, phone, linkedin_pro
|
|
87 |
# Step 3: Add the user's email, phone number, and LinkedIn profile to the signature
|
88 |
signature = f"\n\nBest regards,\n{name}\nEmail: {email}\nPhone: {phone}\nLinkedIn: {linkedin_profile_url if linkedin_profile_url else 'Not provided'}"
|
89 |
|
|
|
|
|
|
|
|
|
90 |
# Return the final polished email with the signature
|
91 |
return generated_email + signature
|
92 |
|
|
|
31 |
"Content-Type": "application/json",
|
32 |
}
|
33 |
|
34 |
+
# Updated prompt to focus on mapping skills to job requirements and suitability
|
35 |
prompt = f"""
|
36 |
+
Write a professional email applying for the {role} position at {company_name}.
|
37 |
+
Use this bio: {bio}.
|
38 |
+
|
39 |
+
The email should focus on how the candidate's skills and experience align with the job requirements,
|
40 |
+
highlighting why they are a great fit for the role.
|
41 |
+
Avoid overly bragging about accomplishments and focus more on how the candidate can meet the company's needs.
|
42 |
+
Structure the email as follows:
|
43 |
+
- Introduction
|
44 |
+
- Skills and experience directly related to the job requirements
|
45 |
+
- Why the candidate is the most suitable person for the role
|
46 |
+
- Conclusion
|
47 |
"""
|
48 |
|
49 |
# Construct the data payload for the API request
|
|
|
95 |
# Step 3: Add the user's email, phone number, and LinkedIn profile to the signature
|
96 |
signature = f"\n\nBest regards,\n{name}\nEmail: {email}\nPhone: {phone}\nLinkedIn: {linkedin_profile_url if linkedin_profile_url else 'Not provided'}"
|
97 |
|
98 |
+
# Ensure the body doesn't include any redundant 'Best regards' and just append our signature
|
99 |
+
if "Best regards" in generated_email:
|
100 |
+
generated_email = generated_email.split("Best regards")[0].strip()
|
101 |
+
|
102 |
# Return the final polished email with the signature
|
103 |
return generated_email + signature
|
104 |
|