KeenWoo commited on
Commit
ae48925
·
verified ·
1 Parent(s): 18cde46

Update alz_companion/agent.py

Browse files
Files changed (1) hide show
  1. alz_companion/agent.py +9 -3
alz_companion/agent.py CHANGED
@@ -394,11 +394,17 @@ def call_llm(messages: List[Dict[str, str]], temperature: float = 0.6, stop: Opt
394
  return content.strip()
395
 
396
 
397
-
398
- # In agent.py, create a new pre-router function
399
- MUSIC_KEYPHRASES = [r"\bplay\b.*\bsong\b", r"\blisten to music\b", r"\bhear\b.*\bsong\b"]
 
 
 
 
 
400
  _MUSIC_PATTERNS = [re.compile(p, re.IGNORECASE) for p in MUSIC_KEYPHRASES]
401
 
 
402
  def _pre_router_music(query: str) -> str | None:
403
  for pat in _MUSIC_PATTERNS:
404
  if re.search(pat, query): return "play_music_request"
 
394
  return content.strip()
395
 
396
 
397
+ # In agent.py, find and replace the MUSIC_KEYPHRASES list
398
+ MUSIC_KEYPHRASES = [
399
+ r"\bplay\b.*\bsong\b",
400
+ r"\bplay\b.*\bmusic\b", # <-- More robust addition
401
+ r"\blisten to music\b",
402
+ r"\bhear\b.*\bsong\b",
403
+ r"\bhear\b.*\bmusic\b" # <-- More robust addition
404
+ ]
405
  _MUSIC_PATTERNS = [re.compile(p, re.IGNORECASE) for p in MUSIC_KEYPHRASES]
406
 
407
+
408
  def _pre_router_music(query: str) -> str | None:
409
  for pat in _MUSIC_PATTERNS:
410
  if re.search(pat, query): return "play_music_request"