AV-AV commited on
Commit
819317a
·
verified ·
1 Parent(s): 7de85f1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -14
app.py CHANGED
@@ -36,43 +36,48 @@ def setup_crewai(resume_text, location):
36
  # Set up agents
37
  resume_feedback = Agent(
38
  role="Professional Resume Advisor",
39
- goal="Give feedback on resumes to make them stand out",
40
  verbose=True,
41
- backstory="Expert in resume optimization with keen eye for detail"
42
  )
43
 
44
  resume_advisor = Agent(
45
  role="Professional Resume Writer",
46
- goal="Rewrite resumes based on feedback",
47
  verbose=True,
48
- backstory="Skilled at enhancing resume content and structure"
49
  )
50
 
51
  job_researcher = Agent(
52
  role="Senior Recruitment Consultant",
53
- goal="Find relevant job openings",
54
  tools=[search_tool],
55
  verbose=True,
56
- backstory="Expert in job market analysis and opportunities"
 
57
  )
58
 
59
  # Define tasks
60
  feedback_task = Task(
61
- description=f"Analyze this resume and provide feedback: {resume_text}",
62
- expected_output="Bullet-point feedback with overall score/10",
 
 
63
  agent=resume_feedback
64
  )
65
 
66
  rewrite_task = Task(
67
- description="Improve the resume based on feedback",
68
- expected_output="Markdown formatted improved resume",
 
69
  agent=resume_advisor,
70
  context=[feedback_task]
71
  )
72
 
73
  research_task = Task(
74
- description=f"Find relevant jobs in {location}",
75
- expected_output="Markdown list of top 5 job opportunities with links",
 
76
  agent=job_researcher
77
  )
78
 
@@ -95,8 +100,8 @@ def process_resume(file, location):
95
  result = setup_crewai(resume_text, location)
96
 
97
  # Parse results
98
- feedback = resume_feedback_task.output.raw.strip("```markdown").strip("```").strip()
99
- improved_resume = resume_advisor_task.output.raw.strip("```markdown").strip("```").strip()
100
  jobs = research_task.output.raw.strip("```markdown").strip("```").strip()
101
 
102
  return feedback, improved_resume, jobs
 
36
  # Set up agents
37
  resume_feedback = Agent(
38
  role="Professional Resume Advisor",
39
+ goal="Give feedback on the resume to make it stand out in the job market.",
40
  verbose=True,
41
+ backstory="With a strategic mind and an eye for detail, you excel at providing feedback on resumes to highlight the most relevant skills and experiences."
42
  )
43
 
44
  resume_advisor = Agent(
45
  role="Professional Resume Writer",
46
+ goal="Based on the feedback recieved from Resume Advisor, make changes to the resume to make it stand out in the job market.",
47
  verbose=True,
48
+ backstory= "With a strategic mind and an eye for detail, you excel at refining resumes based on the feedback to highlight the most relevant skills and experiences."
49
  )
50
 
51
  job_researcher = Agent(
52
  role="Senior Recruitment Consultant",
53
+ goal="Find the 5 most relevant, recently posted jobs based on the improved resume recieved from resume advisor and the location preference",
54
  tools=[search_tool],
55
  verbose=True,
56
+ backstory="""As a senior recruitment consultant your prowess in finding the most relevant jobs based on the resume and location preference is unmatched.
57
+ You can scan the resume efficiently, identify the most suitable job roles and search for the best suited recently posted open job positions at the preffered location."""
58
  )
59
 
60
  # Define tasks
61
  feedback_task = Task(
62
+ description= """Give feedback on the resume to make it stand out for recruiters.
63
+ Review every section, inlcuding the summary, work experience, skills, and education. Suggest to add relevant sections if they are missing.
64
+ Also give an overall score to the resume out of 10. This is the resume: {resume_text}""",
65
+ expected_output="The overall score of the resume followed by the feedback in bullet points.",
66
  agent=resume_feedback
67
  )
68
 
69
  rewrite_task = Task(
70
+ description= """Rewrite the resume based on the feedback to make it stand out for recruiters. You can adjust and enhance the resume but don't make up facts.
71
+ Review and update every section, including the summary, work experience, skills, and education to better reflect the candidates abilities. This is the resume: {resume_text}""",
72
+ expected_output="Resume in markdown format that effectively highlights the candidate's qualifications and experiences",
73
  agent=resume_advisor,
74
  context=[feedback_task]
75
  )
76
 
77
  research_task = Task(
78
+ description="""Find the 5 most relevant recent job postings based on the resume recieved from resume advisor and location preference. This is the preferred location: {location} .
79
+ Use the tools to gather relevant content and shortlist the 5 most relevant, recent, job openings""",
80
+ expected_output="A bullet point list of the 5 job openings, with the appropriate links and detailed description about each job, in markdown format",
81
  agent=job_researcher
82
  )
83
 
 
100
  result = setup_crewai(resume_text, location)
101
 
102
  # Parse results
103
+ feedback = feedback_task.output.raw.strip("```markdown").strip("```").strip()
104
+ improved_resume = rewrite_task.output.raw.strip("```markdown").strip("```").strip()
105
  jobs = research_task.output.raw.strip("```markdown").strip("```").strip()
106
 
107
  return feedback, improved_resume, jobs