forked from phoenix/litellm-mirror
(testing - litellm.Router ) add unit test coverage for pattern matching / wildcard routing (#6250)
* add testing coverage for pattern match router * fix add_pattern * fix typo on router_cooldown_event_callback * add testing for pattern match router * fix add explanation for pattern match router
This commit is contained in:
parent
c390b07e29
commit
183bd5d873
3 changed files with 159 additions and 5 deletions
|
@ -32,10 +32,7 @@ class PatternMatchRouter:
|
|||
regex = self._pattern_to_regex(pattern)
|
||||
if regex not in self.patterns:
|
||||
self.patterns[regex] = []
|
||||
if isinstance(llm_deployment, list):
|
||||
self.patterns[regex].extend(llm_deployment)
|
||||
else:
|
||||
self.patterns[regex].append(llm_deployment)
|
||||
self.patterns[regex].append(llm_deployment)
|
||||
|
||||
def _pattern_to_regex(self, pattern: str) -> str:
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue