feat: add time-of-day recommendation context
CI / test (push) Successful in 6m13s

This commit is contained in:
strsv committed 2026-11-06 21:35:10 +03:00
1 parent facacfb751
commit 2dbe457836
12 files changed
+75 -11

No files matched your search

+4
View File
@@ -1117,6 +1117,9 @@ class Handler(BaseHTTPRequestHandler):
session = body.get("session")
if session not in {"short", "evening", "weekend"}:
session = None
time_of_day = body.get("time_of_day")
if time_of_day not in {"morning", "day", "evening", "night"}:
time_of_day = None
mood, results = reco.recommend(
con, mood,
allowed_statuses=allowed,
@@ -1126,6 +1129,7 @@ class Handler(BaseHTTPRequestHandler):
limit=min(100, int(body.get("limit", 36))),
feedback_key=key,
session=session,
time_of_day=time_of_day,
)
ids = [g["appid"] for g in results]
details = details_map(con, ids)