Spaces:
Sleeping
Sleeping
[style] language adjustment
Browse files- src/agents.py +55 -62
- src/tasks.py +39 -52
src/agents.py
CHANGED
@@ -3,25 +3,28 @@ from textwrap import dedent
|
|
3 |
from crewai import Agent
|
4 |
from crewai_tools import ScrapeWebsiteTool, SerperDevTool
|
5 |
|
|
|
6 |
search_tool = SerperDevTool()
|
7 |
scrape_tool = ScrapeWebsiteTool()
|
8 |
|
9 |
|
10 |
-
#
|
11 |
class MultiAgents:
|
12 |
def researcher(self, scrape_tool, search_tool):
|
13 |
researcher_agent = Agent(
|
14 |
-
role="
|
15 |
-
goal=
|
16 |
-
|
|
|
|
|
17 |
backstory=dedent(
|
18 |
-
"""
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
),
|
26 |
verbose=True,
|
27 |
tools=[scrape_tool, search_tool],
|
@@ -32,25 +35,22 @@ class MultiAgents:
|
|
32 |
self, search_tool, scrape_tool, semantic_search_resume
|
33 |
):
|
34 |
profile_creator_agent = Agent(
|
35 |
-
role="
|
36 |
-
goal=
|
37 |
-
|
38 |
-
|
|
|
39 |
backstory=dedent(
|
40 |
-
"""
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
),
|
49 |
-
tools=[
|
50 |
-
scrape_tool,
|
51 |
-
search_tool,
|
52 |
-
semantic_search_resume,
|
53 |
-
],
|
54 |
verbose=True,
|
55 |
)
|
56 |
return profile_creator_agent
|
@@ -59,24 +59,20 @@ class MultiAgents:
|
|
59 |
self, search_tool, scrape_tool, semantic_search_resume
|
60 |
):
|
61 |
professional_consultant_agent = Agent(
|
62 |
-
role="
|
63 |
-
goal=
|
64 |
-
|
|
|
|
|
65 |
backstory=dedent(
|
66 |
-
"""
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
trabalho."
|
73 |
-
"""
|
74 |
),
|
75 |
-
tools=[
|
76 |
-
search_tool,
|
77 |
-
scrape_tool,
|
78 |
-
semantic_search_resume,
|
79 |
-
],
|
80 |
verbose=True,
|
81 |
)
|
82 |
return professional_consultant_agent
|
@@ -85,26 +81,23 @@ class MultiAgents:
|
|
85 |
self, search_tool, scrape_tool, semantic_search_resume
|
86 |
):
|
87 |
interview_preparer_agent = Agent(
|
88 |
-
role="
|
89 |
-
goal=
|
90 |
-
|
91 |
-
|
|
|
|
|
92 |
backstory=dedent(
|
93 |
-
"""
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
posição."""
|
102 |
),
|
103 |
-
tools=[
|
104 |
-
search_tool,
|
105 |
-
scrape_tool,
|
106 |
-
semantic_search_resume,
|
107 |
-
],
|
108 |
verbose=True,
|
109 |
)
|
110 |
return interview_preparer_agent
|
|
|
3 |
from crewai import Agent
|
4 |
from crewai_tools import ScrapeWebsiteTool, SerperDevTool
|
5 |
|
6 |
+
# Initialize the tools
|
7 |
search_tool = SerperDevTool()
|
8 |
scrape_tool = ScrapeWebsiteTool()
|
9 |
|
10 |
|
11 |
+
# Career consulting agents
|
12 |
class MultiAgents:
|
13 |
def researcher(self, scrape_tool, search_tool):
|
14 |
researcher_agent = Agent(
|
15 |
+
role="Job Searcher",
|
16 |
+
goal=dedent(
|
17 |
+
"""Perform job ad analyses to help candidates find the best
|
18 |
+
opportunities."""
|
19 |
+
),
|
20 |
backstory=dedent(
|
21 |
+
"""As a Job Researcher, you possess unparalleled skills in
|
22 |
+
navigating and extracting crucial information from job offers.
|
23 |
+
Your expertise allows you to identify the most sought-after
|
24 |
+
qualifications and skills by employers, providing a foundation
|
25 |
+
for effective application adjustments.
|
26 |
+
Your detailed analysis capability helps candidates understand
|
27 |
+
the available opportunities."""
|
28 |
),
|
29 |
verbose=True,
|
30 |
tools=[scrape_tool, search_tool],
|
|
|
35 |
self, search_tool, scrape_tool, semantic_search_resume
|
36 |
):
|
37 |
profile_creator_agent = Agent(
|
38 |
+
role="Profile Creator",
|
39 |
+
goal=dedent(
|
40 |
+
"""Perform detailed and reliable research on job candidates to
|
41 |
+
help them stand out in the job market."""
|
42 |
+
),
|
43 |
backstory=dedent(
|
44 |
+
"""As a Profile Creator, you possess exceptional skills that
|
45 |
+
allow you to examine and synthesize information from various
|
46 |
+
sources with precision.
|
47 |
+
You develop comprehensive and personalized personal profiles,
|
48 |
+
which are essential for optimizing resumes.
|
49 |
+
Your expertise enables candidates to highlight their most
|
50 |
+
relevant qualifications and skills, enhancing their chances of
|
51 |
+
success in the competitive job market."""
|
52 |
),
|
53 |
+
tools=[scrape_tool, search_tool, semantic_search_resume],
|
|
|
|
|
|
|
|
|
54 |
verbose=True,
|
55 |
)
|
56 |
return profile_creator_agent
|
|
|
59 |
self, search_tool, scrape_tool, semantic_search_resume
|
60 |
):
|
61 |
professional_consultant_agent = Agent(
|
62 |
+
role="Professional Resume Consultant",
|
63 |
+
goal=dedent(
|
64 |
+
"""Find the best strategies to make a resume stand out in the
|
65 |
+
job market."""
|
66 |
+
),
|
67 |
backstory=dedent(
|
68 |
+
"""With a strategic mind and meticulous attention to detail,
|
69 |
+
you excel in refining resumes to maximize the presentation of
|
70 |
+
relevant skills and experiences.
|
71 |
+
Your consultative approach ensures that resumes perfectly
|
72 |
+
resonate with job requirements, increasing the chances of
|
73 |
+
success in the competitive job market."""
|
|
|
|
|
74 |
),
|
75 |
+
tools=[search_tool, scrape_tool, semantic_search_resume],
|
|
|
|
|
|
|
|
|
76 |
verbose=True,
|
77 |
)
|
78 |
return professional_consultant_agent
|
|
|
81 |
self, search_tool, scrape_tool, semantic_search_resume
|
82 |
):
|
83 |
interview_preparer_agent = Agent(
|
84 |
+
role="Professional Interview Preparer",
|
85 |
+
goal=dedent(
|
86 |
+
"""Develop interview questions and discussion points
|
87 |
+
based on the resume and job requirements. Always
|
88 |
+
respond in Portuguese (Brazil)."""
|
89 |
+
),
|
90 |
backstory=dedent(
|
91 |
+
"""Your role is crucial in anticipating the dynamics of
|
92 |
+
interviews. With your exceptional skill in formulating key
|
93 |
+
questions and strategic discussion points,
|
94 |
+
you prepare candidates for success, ensuring they confidently
|
95 |
+
address all aspects of the job ad they are applying for.
|
96 |
+
Your expertise ensures that candidates are well-equipped to
|
97 |
+
highlight their qualifications and align perfectly with the
|
98 |
+
position's requirements."""
|
|
|
99 |
),
|
100 |
+
tools=[search_tool, scrape_tool, semantic_search_resume],
|
|
|
|
|
|
|
|
|
101 |
verbose=True,
|
102 |
)
|
103 |
return interview_preparer_agent
|
src/tasks.py
CHANGED
@@ -4,17 +4,17 @@ from crewai import Task
|
|
4 |
|
5 |
|
6 |
class MultiTasks:
|
|
|
7 |
def research_task(self, agent, job_posting_url):
|
8 |
description = dedent(
|
9 |
-
"""Examine
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
e categorizando os requisitos de forma eficiente."""
|
14 |
)
|
15 |
expected_output = dedent(
|
16 |
-
"""
|
17 |
-
|
18 |
)
|
19 |
job_research_task = Task(
|
20 |
description=description,
|
@@ -26,85 +26,72 @@ class MultiTasks:
|
|
26 |
|
27 |
def profile_manager_task(self, agent, github_url, candidate_name):
|
28 |
description = dedent(
|
29 |
-
"""
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
)
|
35 |
expected_output = dedent(
|
36 |
-
"""
|
37 |
-
|
38 |
-
|
39 |
)
|
40 |
profile_manager_task = Task(
|
41 |
description=description,
|
42 |
expected_output=expected_output,
|
43 |
agent=agent,
|
44 |
-
output_file=f"
|
45 |
async_execution=True,
|
46 |
)
|
47 |
return profile_manager_task
|
48 |
|
49 |
def resume_adaptation_task(
|
50 |
-
self,
|
51 |
-
candidate_name,
|
52 |
-
agent,
|
53 |
-
task_researcher,
|
54 |
-
profile_manager_task,
|
55 |
):
|
56 |
description = dedent(
|
57 |
-
"""
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
alinhar-se aos requisitos do anúncio de emprego."""
|
65 |
)
|
66 |
expected_output = dedent(
|
67 |
-
"""
|
68 |
-
|
69 |
-
|
70 |
)
|
71 |
resume_adaptation_task = Task(
|
72 |
description=description,
|
73 |
expected_output=expected_output,
|
74 |
context=[task_researcher, profile_manager_task],
|
75 |
-
output_file=f"
|
76 |
agent=agent,
|
77 |
)
|
78 |
return resume_adaptation_task
|
79 |
|
80 |
def interview_preparation_task(
|
81 |
-
self,
|
82 |
-
agent,
|
83 |
-
task_researcher,
|
84 |
-
profile_manager_task,
|
85 |
-
resume_task,
|
86 |
):
|
87 |
description = dedent(
|
88 |
-
"""
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
)
|
96 |
expected_output = dedent(
|
97 |
-
"""
|
98 |
-
|
99 |
)
|
100 |
interview_preparation_task = Task(
|
101 |
description=description,
|
102 |
expected_output=expected_output,
|
103 |
-
context=[
|
104 |
-
task_researcher,
|
105 |
-
profile_manager_task,
|
106 |
-
resume_task,
|
107 |
-
],
|
108 |
agent=agent,
|
109 |
)
|
110 |
return interview_preparation_task
|
|
|
4 |
|
5 |
|
6 |
class MultiTasks:
|
7 |
+
|
8 |
def research_task(self, agent, job_posting_url):
|
9 |
description = dedent(
|
10 |
+
f"""Examine the provided job posting URL ({job_posting_url})
|
11 |
+
to extract essential skills, experiences, and qualifications
|
12 |
+
required. Use available tools to collect and analyze the content,
|
13 |
+
efficiently identifying and categorizing the requirements."""
|
|
|
14 |
)
|
15 |
expected_output = dedent(
|
16 |
+
"""A structured list of job requirements, including the necessary
|
17 |
+
skills, qualifications, and experiences."""
|
18 |
)
|
19 |
job_research_task = Task(
|
20 |
description=description,
|
|
|
26 |
|
27 |
def profile_manager_task(self, agent, github_url, candidate_name):
|
28 |
description = dedent(
|
29 |
+
"""Analyze the GitHub profile ({github_url}) to extract the
|
30 |
+
candidate's competencies.
|
31 |
+
Use specialized tools to examine repositories, commits, projects,
|
32 |
+
and contributions, identifying and categorizing their technical
|
33 |
+
skills and relevant experiences."""
|
34 |
)
|
35 |
expected_output = dedent(
|
36 |
+
"""An updated resume that effectively highlights the candidate's
|
37 |
+
relevant qualifications, characteristics, and experiences for the
|
38 |
+
job."""
|
39 |
)
|
40 |
profile_manager_task = Task(
|
41 |
description=description,
|
42 |
expected_output=expected_output,
|
43 |
agent=agent,
|
44 |
+
output_file=f"custom_resume_{candidate_name}.md",
|
45 |
async_execution=True,
|
46 |
)
|
47 |
return profile_manager_task
|
48 |
|
49 |
def resume_adaptation_task(
|
50 |
+
self, candidate_name, agent, task_researcher, profile_manager_task
|
|
|
|
|
|
|
|
|
51 |
):
|
52 |
description = dedent(
|
53 |
+
"""Using the profile and job requirements obtained in previous
|
54 |
+
tasks, adapt the resume to highlight the most relevant areas.
|
55 |
+
Use tools to adjust and enhance the content, ensuring it is the
|
56 |
+
best possible resume without inventing any information. Update all
|
57 |
+
sections, including the summary, work experience, skills, and
|
58 |
+
education, to better reflect the candidate's abilities and align
|
59 |
+
with the job requirements."""
|
|
|
60 |
)
|
61 |
expected_output = dedent(
|
62 |
+
"""An updated resume that effectively highlights the candidate's
|
63 |
+
relevant qualifications, characteristics, and experiences for the
|
64 |
+
job."""
|
65 |
)
|
66 |
resume_adaptation_task = Task(
|
67 |
description=description,
|
68 |
expected_output=expected_output,
|
69 |
context=[task_researcher, profile_manager_task],
|
70 |
+
output_file=f"custom_resume_{candidate_name}.md",
|
71 |
agent=agent,
|
72 |
)
|
73 |
return resume_adaptation_task
|
74 |
|
75 |
def interview_preparation_task(
|
76 |
+
self, agent, task_researcher, profile_manager_task, resume_task
|
|
|
|
|
|
|
|
|
77 |
):
|
78 |
description = dedent(
|
79 |
+
"""Identify the key skills from the job posting and create a set
|
80 |
+
of possible interview questions and discussion points based on the
|
81 |
+
customized resume and job requirements. Use tools to generate
|
82 |
+
relevant questions and topics.
|
83 |
+
Ensure that these questions and discussion points help the
|
84 |
+
candidate highlight the key aspects of the resume and how they
|
85 |
+
match the job posting."""
|
86 |
)
|
87 |
expected_output = dedent(
|
88 |
+
"""A document containing key questions and discussion points
|
89 |
+
that the candidate should prepare for the initial interview."""
|
90 |
)
|
91 |
interview_preparation_task = Task(
|
92 |
description=description,
|
93 |
expected_output=expected_output,
|
94 |
+
context=[task_researcher, profile_manager_task, resume_task],
|
|
|
|
|
|
|
|
|
95 |
agent=agent,
|
96 |
)
|
97 |
return interview_preparation_task
|