Thanos51 commited on
Commit
5615b89
·
verified ·
1 Parent(s): 162b239

Update hire_recommendation.py

Browse files
Files changed (1) hide show
  1. hire_recommendation.py +31 -31
hire_recommendation.py CHANGED
@@ -1,32 +1,32 @@
1
- from crewai import Agent, Task, Crew
2
- from langchain_groq import ChatGroq
3
- from dotenv import load_dotenv
4
- import os
5
- import logging
6
-
7
- load_dotenv()
8
- logging.basicConfig(filename="Logs/app.log", level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s")
9
-
10
- llm = ChatGroq(
11
- api_key=os.getenv("GROQ_API_KEY"),
12
- model="llama3-70b-8192",
13
- temperature=0.5,
14
- max_tokens=1000
15
- )
16
-
17
- hire_recommendation_agent = Agent(
18
- role="Hire Recommendation Agent",
19
- goal="Analyze transcripts for fair hiring decisions",
20
- backstory="An expert in candidate evaluation",
21
- llm=llm,
22
- verbose=True,
23
- allow_delegation=False
24
- )
25
-
26
- def create_hire_recommendation_task(transcript):
27
- prompt = f"Analyze this transcript: '{transcript}'. Provide strengths, weaknesses, and a Hire/No-Hire decision. Ensure fairness by avoiding bias based on gender, age, or ethnicity. Flag any biased language or assumptions."
28
- return Task(
29
- description=prompt,
30
- agent=hire_recommendation_agent,
31
- expected_output="Analysis with strengths, weaknesses, Hire/No-Hire, and bias flags."
32
  )
 
1
+ from crewai import Agent, Task, Crew
2
+ from langchain_groq import ChatGroq
3
+ from dotenv import load_dotenv
4
+ import os
5
+ import logging
6
+
7
+ load_dotenv()
8
+ logging.basicConfig(filename="app.log", level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s")
9
+
10
+ llm = ChatGroq(
11
+ api_key=os.getenv("GROQ_API_KEY"),
12
+ model="llama3-70b-8192",
13
+ temperature=0.5,
14
+ max_tokens=1000
15
+ )
16
+
17
+ hire_recommendation_agent = Agent(
18
+ role="Hire Recommendation Agent",
19
+ goal="Analyze transcripts for fair hiring decisions",
20
+ backstory="An expert in candidate evaluation",
21
+ llm=llm,
22
+ verbose=True,
23
+ allow_delegation=False
24
+ )
25
+
26
+ def create_hire_recommendation_task(transcript):
27
+ prompt = f"Analyze this transcript: '{transcript}'. Provide strengths, weaknesses, and a Hire/No-Hire decision. Ensure fairness by avoiding bias based on gender, age, or ethnicity. Flag any biased language or assumptions."
28
+ return Task(
29
+ description=prompt,
30
+ agent=hire_recommendation_agent,
31
+ expected_output="Analysis with strengths, weaknesses, Hire/No-Hire, and bias flags."
32
  )