MCPcopy Create free account
hub / github.com/CommonstackAI/UncommonRoute / record_feedback

Method record_feedback

uncommon_route/stats.py:296–319  ·  view source on GitHub ↗
(
        self,
        request_id: str,
        *,
        signal: str,
        ok: bool,
        action: str,
        from_tier: str = "",
        to_tier: str = "",
        reason: str = "",
    )

Source from the content-addressed store, hash-verified

294 self._save()
295
296 def record_feedback(
297 self,
298 request_id: str,
299 *,
300 signal: str,
301 ok: bool,
302 action: str,
303 from_tier: str = "",
304 to_tier: str = "",
305 reason: str = "",
306 ) -> bool:
307 for record in reversed(self._records):
308 if record.request_id != request_id:
309 continue
310 record.feedback_signal = signal
311 record.feedback_ok = ok
312 record.feedback_action = action
313 record.feedback_from_tier = _normalize_tier_label(from_tier) if from_tier else ""
314 record.feedback_to_tier = _normalize_tier_label(to_tier) if to_tier else ""
315 record.feedback_reason = reason
316 record.feedback_submitted_at = self._now()
317 self._save()
318 return True
319 return False
320
321 def history(self, limit: int | None = None) -> list[RouteRecord]:
322 records = list(reversed(self._records))

Callers 3

submitMethod · 0.45
handle_feedbackFunction · 0.45
_handle_chat_coreFunction · 0.45

Calls 2

_saveMethod · 0.95
_normalize_tier_labelFunction · 0.70

Tested by

no test coverage detected