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

Class TierVote

uncommon_route/signals/base.py:9–25  ·  view source on GitHub ↗

A signal's prediction: tier_id (0-3) or None to abstain.

Source from the content-addressed store, hash-verified

7
8@dataclass(frozen=True, slots=True)
9class TierVote:
10 """A signal's prediction: tier_id (0-3) or None to abstain."""
11 tier_id: int | None
12 confidence: float
13
14 def __post_init__(self):
15 if self.tier_id is not None:
16 if not isinstance(self.tier_id, int):
17 raise TypeError(f"tier_id must be int or None, got {type(self.tier_id).__name__}")
18 if not (0 <= self.tier_id <= 3):
19 raise ValueError(f"tier_id must be 0-3 or None, got {self.tier_id}")
20 if not (0.0 <= self.confidence <= 1.0):
21 raise ValueError(f"confidence must be 0.0-1.0, got {self.confidence}")
22
23 @property
24 def abstained(self) -> bool:
25 return self.tier_id is None

Calls

no outgoing calls