[kimi] Make perception_cache confidence threshold configurable (#1259) #1265

Closed
kimi wants to merge 1 commits from kimi/issue-1259 into main
2 changed files with 7 additions and 1 deletions

View File

@@ -455,6 +455,10 @@ class Settings(BaseSettings):
# Background meditation interval in seconds (0 = disabled).
scripture_meditation_interval: int = 0
# ── Perception Cache ───────────────────────────────────────────────
# Minimum confidence threshold for template matching in perception cache.
perception_confidence_threshold: float = 0.85
def _compute_repo_root(self) -> str:
"""Auto-detect repo root if not set."""
if self.repo_root:

View File

@@ -8,6 +8,8 @@ from typing import Any
import cv2
import numpy as np
from config import settings
@dataclass
class Template:
@@ -43,7 +45,7 @@ class PerceptionCache:
best_match_confidence = max_val
best_match_name = template.name
if best_match_confidence > 0.85: # TODO: Make this configurable per template
if best_match_confidence > settings.perception_confidence_threshold:
return CacheResult(
confidence=best_match_confidence, state={"template_name": best_match_name}
)