-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathagent.py
More file actions
34 lines (27 loc) · 852 Bytes
/
agent.py
File metadata and controls
34 lines (27 loc) · 852 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# agent.py
from career_db import CAREER_DB
from scoring import calculate_score
def career_agent(user_profile):
results = {}
for career, data in CAREER_DB.items():
score = calculate_score(
user_profile["skills"],
user_profile["preferences"],
data
)
results[career] = score
# Sort by score
ranked = sorted(results.items(), key=lambda x: x[1], reverse=True)
best_career = ranked[0][0]
career_data = CAREER_DB[best_career]
# Skill gap analysis
missing_skills = [
skill for skill in career_data["required_skills"]
if skill not in user_profile["skills"]
]
return {
"recommended_career": best_career,
"score": ranked[0][1],
"missing_skills": missing_skills,
"prep_focus": career_data["prep_focus"]
}