|
|
from langchain_groq import ChatGroq |
|
|
from crewai import Agent |
|
|
|
|
|
def create_llm(api_key): |
|
|
""" |
|
|
Dynamically create an LLM instance using the provided API key. |
|
|
""" |
|
|
if not api_key: |
|
|
raise ValueError("API key is required to initialize the LLM.") |
|
|
|
|
|
return ChatGroq( |
|
|
model="groq/llama-3.1-8b-instant", |
|
|
verbose=True, |
|
|
temperature=0.5, |
|
|
api_key=api_key, |
|
|
) |
|
|
|
|
|
|
|
|
def create_resume_analyst(api_key): |
|
|
llm = create_llm(api_key) |
|
|
return Agent( |
|
|
role="Resume Analyst", |
|
|
goal="Analyze resumes and provide detailed feedback", |
|
|
verbose=True, |
|
|
memory=True, |
|
|
backstory=( |
|
|
""" |
|
|
You're an experienced HR professional specialized in resume screening |
|
|
and providing constructive feedback to candidates. Your insights help |
|
|
candidates showcase their strengths effectively and improve their chances. |
|
|
""" |
|
|
), |
|
|
llm=llm, |
|
|
allow_delegation=False, |
|
|
) |
|
|
|
|
|
|
|
|
def create_feedback_specialist(api_key): |
|
|
llm = create_llm(api_key) |
|
|
return Agent( |
|
|
role="Feedback Specialist", |
|
|
goal="Provide actionable improvement suggestions for resumes", |
|
|
verbose=True, |
|
|
memory=True, |
|
|
backstory=( |
|
|
""" |
|
|
You're an expert in career development and resume optimization, |
|
|
focusing on providing specific, actionable feedback to enhance |
|
|
presentation and content alignment with industry standards. |
|
|
""" |
|
|
), |
|
|
llm=llm, |
|
|
allow_delegation=False, |
|
|
) |
|
|
|
|
|
|
|
|
def create_hr_problem_analyst(api_key): |
|
|
llm = create_llm(api_key) |
|
|
return Agent( |
|
|
role="HR Problem Analyst", |
|
|
goal="Analyze HR challenges and provide practical solutions", |
|
|
verbose=True, |
|
|
memory=True, |
|
|
backstory=( |
|
|
""" |
|
|
As an experienced HR consultant, you specialize in tackling |
|
|
workplace challenges with a problem-solving mindset. Your solutions |
|
|
are rooted in HR best practices and tailored to organizational needs. |
|
|
""" |
|
|
), |
|
|
llm=llm, |
|
|
allow_delegation=False, |
|
|
) |
|
|
|
|
|
|
|
|
def create_solution_architect(api_key): |
|
|
llm = create_llm(api_key) |
|
|
return Agent( |
|
|
role="Solution Architect", |
|
|
goal="Provide detailed, implementable solutions for HR challenges", |
|
|
verbose=True, |
|
|
memory=True, |
|
|
backstory=( |
|
|
""" |
|
|
You're an HR solution expert who transforms challenges into opportunities. |
|
|
With a practical approach, you deliver actionable recommendations that drive |
|
|
organizational success while considering best practices and industry standards. |
|
|
""" |
|
|
), |
|
|
llm=llm, |
|
|
allow_delegation=False, |
|
|
) |
|
|
|