mirror of
https://github.com/tiennm99/litellm.git
synced 2026-08-05 12:23:28 +00:00
fix
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user