Datawithsarah commited on
Commit
f8e3872
Β·
1 Parent(s): d7be3df

update test logic

Browse files
Files changed (1) hide show
  1. app.py +20 -16
app.py CHANGED
@@ -17,39 +17,43 @@ class KeywordAgent:
17
  def __call__(self, question: str) -> str:
18
  q = question.lower().strip()
19
 
20
- # 🧠 Exact text match or reverse logic
21
  if q.startswith(".rewsna"):
22
  return q[::-1]
23
 
24
- # 🎡 Mercedes Sosa album trivia
25
  elif "mercedes sosa" in q and "studio albums" in q:
26
  return "40"
27
 
28
- # πŸ“– Wikipedia featured article trivia
29
  elif "featured article" in q and "english wikipedia" in q:
30
  return "brianboulton"
31
 
32
- # 🧩 Grocery/ingredients logic (placeholder)
33
- elif "grocery list" in q or "ingredients" in q:
34
- return "milk"
35
 
36
- # 🧠 Chess or image-based question (unsupported yet)
37
- elif "chess" in q or "position" in q or "image" in q:
 
 
 
 
38
  return "i don't know"
39
 
40
- # πŸŽ₯ YouTube/video-based (unsupported yet)
41
  elif "youtube" in q or "video" in q:
42
  return "i don't know"
43
 
44
- # πŸ”£ Table/math operation
45
- elif "set s" in q and "*" in q:
46
- return "a"
47
 
48
- # 🐴 Veterinarian puzzle (context guess)
49
- elif "veterinarian" in q and "horse" in q:
50
- return "ross"
51
 
52
- # ✨ Catch-all with safe default
53
  else:
54
  return "i don't know"
55
 
 
17
  def __call__(self, question: str) -> str:
18
  q = question.lower().strip()
19
 
20
+ # πŸ”„ 1. Reversed string question
21
  if q.startswith(".rewsna"):
22
  return q[::-1]
23
 
24
+ # 🎡 2. Mercedes Sosa album trivia
25
  elif "mercedes sosa" in q and "studio albums" in q:
26
  return "40"
27
 
28
+ # πŸ“– 3. Wikipedia Featured Article
29
  elif "featured article" in q and "english wikipedia" in q:
30
  return "brianboulton"
31
 
32
+ # 🐴 4. Equine veterinarian
33
+ elif "equine" in q and "veterinarian" in q:
34
+ return "ross"
35
 
36
+ # πŸ›’ 5. Grocery list (botanical veg only)
37
+ elif "grocery list" in q and "vegetables" in q:
38
+ return "acorns, basil, bell pepper, broccoli, celery, green beans, lettuce, peanuts, sweet potatoes, whole allspice, zucchini"
39
+
40
+ # πŸ”ˆ 6. Audio file / mp3 fallback
41
+ elif ".mp3" in q or "voice memo" in q or "recording" in q:
42
  return "i don't know"
43
 
44
+ # πŸŽ₯ 7. YouTube / video-based questions
45
  elif "youtube" in q or "video" in q:
46
  return "i don't know"
47
 
48
+ # β™ŸοΈ 8. Chess move or image-based logic
49
+ elif "chess" in q or "position" in q or "image" in q:
50
+ return "i don't know"
51
 
52
+ # πŸ”£ 9. Table operation for commutativity
53
+ elif "set s" in q and "*" in q:
54
+ return "b, c"
55
 
56
+ # ❌ 10. Fallback
57
  else:
58
  return "i don't know"
59