atlasbot: fix insight scoring
This commit is contained in:
parent
a10050e4c7
commit
2d90005076
@ -16,7 +16,7 @@ spec:
|
||||
labels:
|
||||
app: atlasbot
|
||||
annotations:
|
||||
checksum/atlasbot-configmap: manual-atlasbot-82
|
||||
checksum/atlasbot-configmap: manual-atlasbot-83
|
||||
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"
|
||||
|
||||
@ -2724,6 +2724,14 @@ def _insight_score(
|
||||
return base
|
||||
|
||||
|
||||
def _score_insight(insight: dict[str, Any], preference: str) -> float:
|
||||
relevance = _normalize_fraction(insight.get("relevance"), default=0.6)
|
||||
novelty = _normalize_fraction(insight.get("novelty"), default=0.5)
|
||||
if preference == "novelty":
|
||||
return novelty * 0.6 + relevance * 0.4
|
||||
return relevance * 0.6 + novelty * 0.4
|
||||
|
||||
|
||||
def _select_diverse_insights(
|
||||
candidates: list[dict[str, Any]],
|
||||
*,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user