datascientist22
commited on
Commit
β’
8631f90
1
Parent(s):
ac89ed8
Update app.py
Browse files
app.py
CHANGED
@@ -160,5 +160,48 @@ if "api_key" in st.session_state:
|
|
160 |
st.subheader("π Generated Resume")
|
161 |
st.text_area("Your Resume", resume_output.content, height=400)
|
162 |
st.button("π Copy Resume to Clipboard")
|
163 |
-
|
164 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
160 |
st.subheader("π Generated Resume")
|
161 |
st.text_area("Your Resume", resume_output.content, height=400)
|
162 |
st.button("π Copy Resume to Clipboard")
|
163 |
+
|
164 |
+
# Cover Letter Section
|
165 |
+
st.subheader("π© Generate Cover Letter")
|
166 |
+
|
167 |
+
with st.form("cover_letter_form"):
|
168 |
+
job_title = st.text_input("Job Title", placeholder="Enter the position you're applying for...")
|
169 |
+
company_name = st.text_input("Company Name", placeholder="Enter the company name...")
|
170 |
+
company_address = st.text_input("Company Address", placeholder="Enter the company's address...")
|
171 |
+
cover_letter_style = st.selectbox("Choose Cover Letter Style", ("Professional", "Casual", "Creative"))
|
172 |
+
|
173 |
+
submit_cover_letter = st.form_submit_button("π Generate Cover Letter")
|
174 |
+
|
175 |
+
if submit_cover_letter and job_title and company_name and company_address:
|
176 |
+
# Create a prompt to generate the cover letter
|
177 |
+
cover_letter_prompt = f"""
|
178 |
+
Write a {cover_letter_style.lower()} cover letter for a job application.
|
179 |
+
|
180 |
+
Name: {st.session_state['name']}
|
181 |
+
Contact: {st.session_state['contact']}
|
182 |
+
Job Title: {job_title}
|
183 |
+
Company Name: {company_name}
|
184 |
+
Company Address: {company_address}
|
185 |
+
|
186 |
+
Skills: {skills_content}
|
187 |
+
Experience: {experience_content}
|
188 |
+
Education: {education_content}
|
189 |
+
Projects: {projects_content}
|
190 |
+
|
191 |
+
Make sure to follow a formal structure:
|
192 |
+
1. Applicant's contact details.
|
193 |
+
2. Date.
|
194 |
+
3. Employer's details.
|
195 |
+
4. Introduction.
|
196 |
+
5. Relevant skills and experiences.
|
197 |
+
6. Enthusiasm for the role.
|
198 |
+
7. Closing with a call to action.
|
199 |
+
"""
|
200 |
+
|
201 |
+
# Generate the cover letter
|
202 |
+
cover_letter_output = chat_model.invoke(input=cover_letter_prompt)
|
203 |
+
|
204 |
+
# Display the generated cover letter
|
205 |
+
st.subheader("π Generated Cover Letter")
|
206 |
+
st.text_area("Your Cover Letter", cover_letter_output.content, height=300)
|
207 |
+
st.button("π Copy Cover Letter to Clipboard")
|