Spaces:
Configuration error
Configuration error
| import random | |
| class SmartCareerAgent: | |
| def __init__(self): | |
| self.career_map = { | |
| "ai": ["AI Engineer", "ML Engineer", "Deep Learning Engineer"], | |
| "web": ["Frontend Developer", "Backend Developer", "Full Stack Developer"], | |
| "data": ["Data Analyst", "Data Scientist", "Data Engineer"], | |
| "design": ["UI/UX Designer", "Product Designer"] | |
| } | |
| self.tips = [ | |
| "Build real-world projects", | |
| "Create a strong GitHub portfolio", | |
| "Participate in hackathons", | |
| "Learn problem-solving (DSA)", | |
| "Follow industry trends" | |
| ] | |
| def detect_intent(self, query): | |
| query = query.lower() | |
| for key in self.career_map: | |
| if key in query: | |
| return key | |
| return "unknown" | |
| def respond(self, query): | |
| intent = self.detect_intent(query) | |
| if intent != "unknown": | |
| return { | |
| "intent": intent, | |
| "careers": self.career_map[intent], | |
| "tip": random.choice(self.tips), | |
| "message": f"Based on your interest in {intent}, these careers fit you." | |
| } | |
| return { | |
| "intent": "unknown", | |
| "careers": [], | |
| "tip": random.choice(self.tips), | |
| "message": "Please tell me your interest (AI, Web, Data, Design)." | |
| } |