File size: 1,445 Bytes
c484fda
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
35
36
37
38
39
40
41
42
43
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)."
        }