david-thrower commited on
Commit
61568f9
·
1 Parent(s): d28db27

Added a cover letter prompt step.

Browse files
Files changed (1) hide show
  1. app.py +39 -6
app.py CHANGED
@@ -279,8 +279,8 @@ def process_job_description(company_name, company_url, job_description, resume):
279
  system_prompt_summary = "Create a concise 150-200 word summary of this job description. Remove company bragging bragging about the company, and other fluff not relevant to the position and what is desired from the candidate. FOCUS ON ASPECTS THAT POINT THE USER IN WHAT THE EMPLOYER WANTS FROM A CANDIDATE IN TERMS OF SKILLS, ACCOMPLISHMENTS, AND SUCH"
280
  clean_job_description = smol_lm_jd_process(job_description, system_prompt_summary)
281
 
282
- system_prompt_get_job_title = "Extract only the job title from the following job description. Respond with nothing but the job title—no labels, no comments, no summaries, no locations, or extra text. If the title is unusually long or nonstandard, replace it with the most common, concise, and widely recognized job title for the role in plain text with only letters and numbers, remove any special characters nor punctuation no '\n' and no tabs, because any of these cause problems with downstream automated steps. Your answer must be 7 words or fewer. Acceptable examples may look like: 'Systems Analyst', 'marketing director', 'patient advocate III', ..."
283
- extracted_job_title = smol_lm_jd_process(job_description, system_prompt_get_job_title, max_new_tokens=150)[:50].lower().replace("job","").replace("title","").replace("\n","")
284
 
285
  role = Role(company_name, company_url, job_description, clean_job_description, extracted_job_title)
286
 
@@ -288,9 +288,9 @@ def process_job_description(company_name, company_url, job_description, resume):
288
  searches = {
289
  "company_values": f"{role.company_name} company values",
290
  "corporate_culture": f"{role.company_name} corporate culture",
291
- "leadership_team": f"{role.company_name} leadership team members relevant to {role.job_title} role",
292
- "recent_news": f"{role.company_name} recent news relevant to {role.job_title} role",
293
- "competitive_advantages": f"{role.company_name} competitive advantages in {role.job_title} market"
294
  }
295
  search_client = DDGS(timeout=35)
296
  search_results = {}
@@ -399,7 +399,40 @@ with demo:
399
  )
400
 
401
  gr.Markdown("## Resume Prompt")
402
- gr.Markdown("Copy the following prompt into a suitable SOTA AI assistant like LLama 4 maveric on poe.com, Deepseek R1-1776 on poe.com, Qwen/Qwen3-235B-A22B on huggingface chat, or chatGPT. Save the result as a Word document, then export it to PDF. Submit the PDF.")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
403
 
404
  if __name__ == "__main__":
405
  demo.launch()
 
279
  system_prompt_summary = "Create a concise 150-200 word summary of this job description. Remove company bragging bragging about the company, and other fluff not relevant to the position and what is desired from the candidate. FOCUS ON ASPECTS THAT POINT THE USER IN WHAT THE EMPLOYER WANTS FROM A CANDIDATE IN TERMS OF SKILLS, ACCOMPLISHMENTS, AND SUCH"
280
  clean_job_description = smol_lm_jd_process(job_description, system_prompt_summary)
281
 
282
+ system_prompt_get_job_title = "Extract only the job title from the following job description. Respond with nothing but the job title—no labels, no comments, no summaries, no locations, or extra text. If the title is unusually long or nonstandard, replace it with the most common, concise, and widely recognized job title for the role in plain text with only letters and numbers, remove any special characters nor punctuation no '\n' and no tabs, because any of these cause problems with downstream automated steps. Your answer must be 7 words or fewer. Acceptable examples may look like: 'Systems Analyst', 'marketing director', 'patient advocate III', ...\n\nThis is an excerpt of the job description:\n"
283
+ extracted_job_title = smol_lm_jd_process(job_description[:350], system_prompt_get_job_title, max_new_tokens=150)[:50].lower().replace("job","").replace("title","").replace("\n","")
284
 
285
  role = Role(company_name, company_url, job_description, clean_job_description, extracted_job_title)
286
 
 
288
  searches = {
289
  "company_values": f"{role.company_name} company values",
290
  "corporate_culture": f"{role.company_name} corporate culture",
291
+ "leadership_team": f"{role.company_name} leadership team members relevant to the role {role.job_title} role",
292
+ "recent_news": f"{role.company_name} recent news relevant to the role {role.job_title} role",
293
+ "competitive_advantages": f"{role.company_name} competitive advantages relevant to the role {role.job_title}"
294
  }
295
  search_client = DDGS(timeout=35)
296
  search_results = {}
 
399
  )
400
 
401
  gr.Markdown("## Resume Prompt")
402
+ customized_resume = gr.TextArea(label="Paste In Final Resume")
403
+ gr.Button("Submit Customized Resume").click(
404
+ lambda job_and_company_info, customized_resume: f"""
405
+
406
+ # Write a 3-paragraph cover letter with:
407
+ 1. Personalized greeting (use {job_and_company_info['Company Research']['Leadership Team Summary']} if available)
408
+ 2. Opening paragraph: Role you're applying for and excitement
409
+ 3. Body: Match a few of the top qualifications to job requirements
410
+ 4. Consider this company research and company metadata as you are writing this:
411
+
412
+ Company Name: {job_and_company_info['Company Name']}
413
+ Company URL: {job_and_company_info['Company URL']}
414
+ Job Title: {job_and_company_info['job_title']}
415
+ Role Requirements: {job_and_company_info['Role Requirements']}
416
+ Clean Job Description: {job_and_company_info['Clean Job Description']}
417
+ Company Research:
418
+ Company Values: {job_and_company_info['Company Research']['Company Values Summary']}
419
+ Corporate Culture: {job_and_company_info['Company Research']['Corporate Culture Summary']}
420
+ Leadership Team and Possible Key Opinion Leaders: {job_and_company_info['Company Research']['Leadership Team Summary']}
421
+ Recent Company News: {job_and_company_info['Company Research']['Recent News Summary']}
422
+ Company Competitive Advantages: {job_and_company_info['Company Research']['Competitive Advantages Summary']}
423
+
424
+ 5. Closing: Express reasonable enthusiasm and request discussion. Don't overdo it and make the enthusiasm not sound feigned or disingenuous.
425
+
426
+ ## This is the resume for this job to consider in writing this:
427
+
428
+ {customized_resume}
429
+
430
+ """,
431
+ inputs=[job_and_company_info_output, customized_resume],
432
+ outputs=gr.TextArea(label="Cover Letter Prompt")
433
+ )
434
+
435
+ gr.Markdown("Copy the following prompt into a suitable SOTA AI assistant like LLama 4 maveric on poe.com, Deepseek R1-1776 on poe.com, Qwen/Qwen3-235B-A22B on huggingface chat, or chatGPT. Save the result as a Word document, then export it to PDF. You now have a resume and cover letter ready to submit.")
436
 
437
  if __name__ == "__main__":
438
  demo.launch()