atlasbot: keep coolest answers opinionated

This commit is contained in:
Brad Stein 2026-01-27 18:58:59 -03:00
parent 8bd4d9fc7a
commit 4bab34eae1
2 changed files with 4 additions and 3 deletions

View File

@ -16,7 +16,7 @@ spec:
labels:
app: atlasbot
annotations:
checksum/atlasbot-configmap: manual-atlasbot-60
checksum/atlasbot-configmap: manual-atlasbot-61
vault.hashicorp.com/agent-inject: "true"
vault.hashicorp.com/role: "comms"
vault.hashicorp.com/agent-inject-secret-turn-secret: "kv/data/atlas/comms/turn-shared-secret"

View File

@ -1701,6 +1701,7 @@ def _select_insight(
prefer_keys.extend(["hardware", "availability"])
if any(word in q for word in ("coolest", "favorite", "favourite", "trivia", "fun")):
prefer_keys.extend(["hardware", "cpu", "ram"])
avoid_used = any(word in q for word in ("another", "else", "different", "other")) or "most interesting" in q
if any(word in q for word in ("another", "else", "different", "other")) and len(candidates) > 1:
for candidate in candidates:
if candidate[0] not in used:
@ -1709,13 +1710,13 @@ def _select_insight(
if prefer_keys:
for prefer in prefer_keys:
for key, text, conf in candidates:
if key == prefer and key not in used:
if key == prefer and (not avoid_used or key not in used):
return key, text, conf
for prefer in prefer_keys:
for key, text, conf in candidates:
if key == prefer:
return key, text, conf
if used:
if used and avoid_used:
for candidate in candidates:
if candidate[0] not in used:
return candidate