mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-05 08:07:05 +00:00
fix
This commit is contained in:
parent
27bc5c1fca
commit
62b4fe79b2
2 changed files with 9 additions and 1 deletions
|
|
@ -362,6 +362,8 @@ class LiteLLMRoutes(enum.Enum):
|
|||
"/v1/ocr",
|
||||
|
||||
# containers API
|
||||
"/containers",
|
||||
"/v1/containers",
|
||||
"/containers/*",
|
||||
"/v1/containers/*",
|
||||
]
|
||||
|
|
|
|||
|
|
@ -308,7 +308,7 @@ class RouteChecks:
|
|||
return True
|
||||
|
||||
# fuzzy match routes like "/v1/threads/thread_49EIN5QF32s4mH20M7GFKdlZ"
|
||||
# Check for routes with placeholders
|
||||
# Check for routes with placeholders or wildcard patterns
|
||||
for openai_route in LiteLLMRoutes.openai_routes.value:
|
||||
# Replace placeholders with regex pattern
|
||||
# placeholders are written as "/threads/{thread_id}"
|
||||
|
|
@ -317,6 +317,12 @@ class RouteChecks:
|
|||
route=route, pattern=openai_route
|
||||
):
|
||||
return True
|
||||
# Check for wildcard patterns like "/containers/*"
|
||||
if RouteChecks._is_wildcard_pattern(pattern=openai_route):
|
||||
if RouteChecks._route_matches_wildcard_pattern(
|
||||
route=route, pattern=openai_route
|
||||
):
|
||||
return True
|
||||
|
||||
# Check for Google routes with placeholders like "/v1beta/models/{model_name}:generateContent"
|
||||
for google_route in LiteLLMRoutes.google_routes.value:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue