Validate the router and threshold.
(
self, router: Optional[str], threshold: Optional[float]
)
| 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 | """ |