from textwrap import dedent from crewai import Task class MultiTasks: def research_task(self, agent, job_posting_url): description = dedent( f"""Examine the provided job posting URL ({job_posting_url}) to extract essential skills, experiences, and qualifications required. Use available tools to collect and analyze the content, efficiently identifying and categorizing the requirements.""" ) expected_output = dedent( """A structured list of job requirements, including the necessary skills, qualifications, and experiences.""" ) job_research_task = Task( description=description, expected_output=expected_output, agent=agent, async_execution=True, ) return job_research_task def profile_manager_task(self, agent, github_url, candidate_name): description = dedent( """Analyze the GitHub profile ({github_url}) to extract the candidate's competencies. Use specialized tools to examine repositories, commits, projects, and contributions, identifying and categorizing their technical skills and relevant experiences.""" ) expected_output = dedent( """An updated resume that effectively highlights the candidate's relevant qualifications, characteristics, and experiences for the job.""" ) profile_manager_task = Task( description=description, expected_output=expected_output, agent=agent, output_file=f"custom_resume_{candidate_name}.md", async_execution=True, ) return profile_manager_task def resume_adaptation_task( self, candidate_name, agent, task_researcher, profile_manager_task ): description = dedent( """Using the profile and job requirements obtained in previous tasks, adapt the resume to highlight the most relevant areas. Use tools to adjust and enhance the content, ensuring it is the best possible resume without inventing any information. Update all sections, including the summary, work experience, skills, and education, to better reflect the candidate's abilities and align with the job requirements.""" ) expected_output = dedent( """An updated resume that effectively highlights the candidate's relevant qualifications, characteristics, and experiences for the job.""" ) resume_adaptation_task = Task( description=description, expected_output=expected_output, context=[task_researcher, profile_manager_task], output_file=f"custom_resume_{candidate_name}.md", agent=agent, ) return resume_adaptation_task def interview_preparation_task( self, agent, task_researcher, profile_manager_task, resume_task ): description = dedent( """Identify the key skills from the job posting and create a set of possible interview questions and discussion points based on the customized resume and job requirements. Use tools to generate relevant questions and topics. Ensure that these questions and discussion points help the candidate highlight the key aspects of the resume and how they match the job posting.""" ) expected_output = dedent( """A document containing key questions and discussion points that the candidate should prepare for the initial interview.""" ) interview_preparation_task = Task( description=description, expected_output=expected_output, context=[task_researcher, profile_manager_task, resume_task], agent=agent, ) return interview_preparation_task