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

Method capture

uncommon_route/feedback.py:84–102  ·  view source on GitHub ↗

Buffer compact features for a routed request (no raw prompts stored).

(
        self,
        request_id: str,
        features: dict[str, float],
        tier: str,
        *,
        model: str = "",
        mode: str = "auto",
    )

Source from the content-addressed store, hash-verified

82 # ─── Public API ───
83
84 def capture(
85 self,
86 request_id: str,
87 features: dict[str, float],
88 tier: str,
89 *,
90 model: str = "",
91 mode: str = "auto",
92 ) -> None:
93 """Buffer compact features for a routed request (no raw prompts stored)."""
94 compact = {k: v for k, v in features.items() if not k.startswith("ngram_")}
95 self._buffer[request_id] = RequestContext(
96 features=compact,
97 tier=_normalize_tier(tier),
98 timestamp=self._now(),
99 model=model,
100 mode=mode,
101 )
102 self._save_buffer()
103
104 def rebind_request(
105 self,

Calls 3

_save_bufferMethod · 0.95
RequestContextClass · 0.85
_normalize_tierFunction · 0.85