Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -48,58 +48,90 @@ if uploaded_file:
|
|
48 |
|
49 |
# Define LLM Prompt Templates
|
50 |
email_template = PromptTemplate.from_template("""
|
51 |
-
You are an AI assistant
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
|
53 |
### Input:
|
54 |
-
- Recipient: {recipient_name}
|
55 |
-
- Position: {position_name}
|
56 |
-
- Research Interests: {research_interests}
|
57 |
-
-
|
58 |
-
- Resume
|
59 |
|
60 |
### Output:
|
61 |
-
|
62 |
""")
|
63 |
|
|
|
64 |
cover_letter_template = PromptTemplate.from_template("""
|
65 |
-
You are an AI assistant generating
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
|
67 |
### Input:
|
68 |
- Job Title: {job_title}
|
69 |
-
- Company
|
70 |
-
-
|
71 |
-
- Resume
|
72 |
|
73 |
### Output:
|
74 |
-
|
75 |
""")
|
76 |
|
|
|
77 |
research_statement_template = PromptTemplate.from_template("""
|
78 |
-
You are an AI assistant
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
|
80 |
### Input:
|
81 |
- Research Interests: {research_interests}
|
82 |
-
- Academic Background: {resume_text}
|
83 |
-
- Future Research
|
84 |
|
85 |
### Output:
|
86 |
-
|
87 |
""")
|
88 |
|
89 |
sop_template = PromptTemplate.from_template("""
|
90 |
-
You are an AI assistant
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
|
92 |
### Input:
|
93 |
- Program Name: {program_name}
|
94 |
-
- University: {university}
|
95 |
-
- Research Interests: {research_interests}
|
96 |
-
- Career
|
97 |
- Resume Details: {resume_text}
|
98 |
|
99 |
### Output:
|
100 |
-
|
101 |
""")
|
102 |
|
|
|
103 |
# Create LangChain Chains
|
104 |
email_chain = LLMChain(llm=llm, prompt=email_template)
|
105 |
cover_letter_chain = LLMChain(llm=llm, prompt=cover_letter_template)
|
|
|
48 |
|
49 |
# Define LLM Prompt Templates
|
50 |
email_template = PromptTemplate.from_template("""
|
51 |
+
You are an AI assistant skilled in crafting personalized and engaging cold emails for research positions.
|
52 |
+
|
53 |
+
### Instructions:
|
54 |
+
- Address the recipient warmly and professionally.
|
55 |
+
- Introduce yourself succinctly, highlighting relevant background.
|
56 |
+
- Clearly express your interest in the specific position and align it with your research interests.
|
57 |
+
- Articulate why you are particularly drawn to this professor's work or lab.
|
58 |
+
- Mention pertinent details from your resume that strengthen your candidacy.
|
59 |
+
- Conclude with a polite call to action and gratitude.
|
60 |
|
61 |
### Input:
|
62 |
+
- Recipient Name: {recipient_name}
|
63 |
+
- Position Title: {position_name}
|
64 |
+
- Your Research Interests: {research_interests}
|
65 |
+
- Reason for Choosing This Professor/Lab: {reason}
|
66 |
+
- Key Resume Highlights: {resume_text}
|
67 |
|
68 |
### Output:
|
69 |
+
Compose a well-structured, concise cold email with a polite and engaging tone that reflects genuine interest and professionalism.
|
70 |
""")
|
71 |
|
72 |
+
|
73 |
cover_letter_template = PromptTemplate.from_template("""
|
74 |
+
You are an AI assistant proficient in generating personalized and compelling cover letters for job applications.
|
75 |
+
|
76 |
+
### Instructions:
|
77 |
+
- Begin with a formal salutation.
|
78 |
+
- State the position you are applying for and how you discovered it.
|
79 |
+
- Highlight your key skills and experiences that make you a strong fit for the role.
|
80 |
+
- Connect your professional background to the company's mission and values.
|
81 |
+
- Include specific achievements from your resume that demonstrate your qualifications.
|
82 |
+
- End with a courteous closing and express enthusiasm for the opportunity.
|
83 |
|
84 |
### Input:
|
85 |
- Job Title: {job_title}
|
86 |
+
- Company Name: {company}
|
87 |
+
- Relevant Skills and Experiences: {key_skills}
|
88 |
+
- Resume Highlights: {resume_text}
|
89 |
|
90 |
### Output:
|
91 |
+
Draft a polished and formal cover letter that showcases your suitability for the position and aligns with the company's ethos.
|
92 |
""")
|
93 |
|
94 |
+
|
95 |
research_statement_template = PromptTemplate.from_template("""
|
96 |
+
You are an AI assistant adept at composing insightful and persuasive research statements for Ph.D. applications.
|
97 |
+
|
98 |
+
### Instructions:
|
99 |
+
- Open with a summary of your research interests and their significance.
|
100 |
+
- Detail your academic background and any research projects that have prepared you for this field.
|
101 |
+
- Discuss your future research goals and how they align with the program's strengths.
|
102 |
+
- Emphasize your passion and commitment to advancing knowledge in this area.
|
103 |
|
104 |
### Input:
|
105 |
- Research Interests: {research_interests}
|
106 |
+
- Academic Background and Experience: {resume_text}
|
107 |
+
- Future Research Objectives: {goals}
|
108 |
|
109 |
### Output:
|
110 |
+
Generate a compelling research statement with a strong academic tone that reflects your expertise and aspirations.
|
111 |
""")
|
112 |
|
113 |
sop_template = PromptTemplate.from_template("""
|
114 |
+
You are an AI assistant experienced in crafting detailed and engaging Statements of Purpose for graduate program applications.
|
115 |
+
|
116 |
+
### Instructions:
|
117 |
+
- Introduce yourself and your academic interests.
|
118 |
+
- Explain why you are interested in the chosen program and university.
|
119 |
+
- Describe your relevant experiences and how they have prepared you for this program.
|
120 |
+
- Outline your career goals and how this program will help you achieve them.
|
121 |
+
- Highlight aspects of your resume that support your application.
|
122 |
|
123 |
### Input:
|
124 |
- Program Name: {program_name}
|
125 |
+
- University Name: {university}
|
126 |
+
- Your Research Interests: {research_interests}
|
127 |
+
- Career Objectives: {career_goals}
|
128 |
- Resume Details: {resume_text}
|
129 |
|
130 |
### Output:
|
131 |
+
Compose a structured and professional Statement of Purpose that conveys your qualifications, motivations, and fit for the program.
|
132 |
""")
|
133 |
|
134 |
+
|
135 |
# Create LangChain Chains
|
136 |
email_chain = LLMChain(llm=llm, prompt=email_template)
|
137 |
cover_letter_chain = LLMChain(llm=llm, prompt=cover_letter_template)
|