Improve quick answers and song requests at every speech level

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-26 15:55:05 +09:00
co-authored by Claude Opus 5.5
parent e3fcfd30ab
commit b4362701b9
10 changed files with 383 additions and 63 deletions
+2 -1
View File
@@ -15,7 +15,7 @@ ON_CHARGE = re.compile(r"\b(on|per|with) (a |one |the )?(full |single )?charge\b
r"\bgo (back )?(to )?(re)?charg|한 ?번 충전(?:으로|하면)|완충(?:으로|하면|되면)|충전하면 ?(?:얼마나|몇)|"
r"충전하러", re.I) # how long it lasts (10 hours), when it goes to charge: the LLM
LASTS = re.compile(r"\b(last|life|lifetime|capacity|volt|amp|ah|kind|type|made|hours?)\b|얼마나 ?가|몇 ?시간|오래 ?가|"
r"지속|용량|종류|볼트", re.I) # how long it lasts, what it is: the reference notes
r"지속|용량|종류|볼트|수명|뭐\s*들어|무슨\s*배터리|어떤\s*배터리|\bwhat (?:kind of |type of )?battery\b|사용 ?시간|쓸 ?수 ?있는 ?시간|런타임|\bruntime\b|\bhow long\b", re.I) # how long it lasts, what it is: the reference notes
LEVEL = re.compile(
r"\bbattery\b.*\b(level|percent(age)?|left|status|charged|full|low|now|remaining|state|at|much|look)\b|"
r"\b(level|percent(age)?|how much)\b.*\bbattery\b|^\W*(and |so |what about |how about )?(your |the )?battery\W*$|"
@@ -28,6 +28,7 @@ CHARGING = re.compile(
def asked(text):
""""now" (level / charging now), "how long" (charging time), or None."""
text = re.sub(r"\S+—\s*", "", text or "") # a stutter: "몇 시— 시간"
if ON_CHARGE.search(text):
return None
if HOW_LONG_CHARGE.search(text):