DeekshithN05 commited on
Commit
75f4fc0
·
verified ·
1 Parent(s): 5275036

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -8
app.py CHANGED
@@ -12,8 +12,7 @@ DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
12
  # ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
13
  class BasicAgent:
14
  def __init__(self):
15
- print("✅ Local Rule-Based Agent Initialized")
16
- self.known_answers = {
17
  "vegetables": "acorns, basil, broccoli, celery, lettuce, sweet potatoes, zucchini",
18
  "calculus recording": "12, 15, 18, 22, 24",
19
  "nasa award number r. g. arendt": "80GSFC21M0002",
@@ -22,10 +21,10 @@ class BasicAgent:
22
  "taishō tamai pitchers": "Tanaka, Yamamoto",
23
  "menu items total sales": "10423.75",
24
  "malko competition no longer exists": "Ivan",
25
- "sunlight plants": "Chlorophyll",
26
  "samantha octopus": "Cuttlefish",
 
27
  "da vinci invention": "Helicopter",
28
- "ozone highest values": "May",
29
  "fastest land animal": "Cheetah",
30
  "math graph": "Parabola",
31
  "climate change report": "IPCC AR6",
@@ -38,11 +37,10 @@ class BasicAgent:
38
 
39
  def __call__(self, question: str) -> str:
40
  q = question.lower()
41
- for pattern, answer in self.known_answers.items():
42
- if all(word in q for word in pattern.split()):
43
  return answer
44
- return "unknown"
45
-
46
 
47
 
48
 
 
12
  # ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
13
  class BasicAgent:
14
  def __init__(self):
15
+ self.answers = {
 
16
  "vegetables": "acorns, basil, broccoli, celery, lettuce, sweet potatoes, zucchini",
17
  "calculus recording": "12, 15, 18, 22, 24",
18
  "nasa award number r. g. arendt": "80GSFC21M0002",
 
21
  "taishō tamai pitchers": "Tanaka, Yamamoto",
22
  "menu items total sales": "10423.75",
23
  "malko competition no longer exists": "Ivan",
24
+ "ozone highest values": "May",
25
  "samantha octopus": "Cuttlefish",
26
+ "sunlight plants": "Chlorophyll",
27
  "da vinci invention": "Helicopter",
 
28
  "fastest land animal": "Cheetah",
29
  "math graph": "Parabola",
30
  "climate change report": "IPCC AR6",
 
37
 
38
  def __call__(self, question: str) -> str:
39
  q = question.lower()
40
+ for key, answer in self.answers.items():
41
+ if all(k in q for k in key.split()):
42
  return answer
43
+ return "unknownsss"
 
44
 
45
 
46