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

Method _parse_model_name

rorf/controller.py:55–66  ·  view source on GitHub ↗

Parse the method and embedding model provider's name from the router name.

(self, router: str)

Source from the content-addressed store, hash-verified

53 )
54
55 def _parse_model_name(self, router: str):
56 """
57 Parse the method and embedding model provider's name from the router name.
58 """
59 method, embedding_provider = router.split("/")[1].split('-')[0:2]
60 if not method == "rorf":
61 raise RoutingError(f"Invalid method {method}. Method must be 'rorf'.")
62 if not embedding_provider in ["jina", "voyage", "openai"]:
63 raise RoutingError(
64 f"Invalid embedding provider {embedding_provider}. Embedding provider must be 'jina', 'voyage', or 'openai'."
65 )
66 return embedding_provider
67
68 def batch_calculate_win_rate(self, prompts: List[str]) -> List[float]:
69 """

Callers 1

__init__Method · 0.95

Calls 1

RoutingErrorClass · 0.85

Tested by

no test coverage detected