Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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
|
| 40 |
verbose=True,
|
| 41 |
-
backstory="
|
| 42 |
)
|
| 43 |
|
| 44 |
resume_advisor = Agent(
|
| 45 |
role="Professional Resume Writer",
|
| 46 |
-
goal="
|
| 47 |
verbose=True,
|
| 48 |
-
backstory="
|
| 49 |
)
|
| 50 |
|
| 51 |
job_researcher = Agent(
|
| 52 |
role="Senior Recruitment Consultant",
|
| 53 |
-
goal="Find relevant
|
| 54 |
tools=[search_tool],
|
| 55 |
verbose=True,
|
| 56 |
-
backstory="
|
|
|
|
| 57 |
)
|
| 58 |
|
| 59 |
# Define tasks
|
| 60 |
feedback_task = Task(
|
| 61 |
-
description=
|
| 62 |
-
|
|
|
|
|
|
|
| 63 |
agent=resume_feedback
|
| 64 |
)
|
| 65 |
|
| 66 |
rewrite_task = Task(
|
| 67 |
-
description="
|
| 68 |
-
|
|
|
|
| 69 |
agent=resume_advisor,
|
| 70 |
context=[feedback_task]
|
| 71 |
)
|
| 72 |
|
| 73 |
research_task = Task(
|
| 74 |
-
description=
|
| 75 |
-
|
|
|
|
| 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 =
|
| 99 |
-
improved_resume =
|
| 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
|