MCPcopy Create free account
hub / github.com/Not-Diamond/RoRF / _validate_router_threshold

Method _validate_router_threshold

rorf/controller.py:42–53  ·  view source on GitHub ↗

Validate the router and threshold.

(
        self, router: Optional[str], threshold: Optional[float]
    )

Source from the content-addressed store, hash-verified

40 self.threshold = threshold
41
42 def _validate_router_threshold(
43 self, router: Optional[str], threshold: Optional[float]
44 ):
45 """
46 Validate the router and threshold.
47 """
48 if router is None or threshold is None:
49 raise RoutingError("Router or threshold unspecified.")
50 if not 0 <= threshold <= 1:
51 raise RoutingError(
52 f"Invalid threshold {threshold}. Threshold must be a float between 0.0 and 1.0."
53 )
54
55 def _parse_model_name(self, router: str):
56 """

Callers 1

__init__Method · 0.95

Calls 1

RoutingErrorClass · 0.85

Tested by

no test coverage detected