fix async_pre_routing_hook

This commit is contained in:
Ishaan Jaff 2025-07-24 14:37:56 -07:00
parent d5c7afd834
commit 1e0b70141b

View file

@ -6650,18 +6650,19 @@ class Router:
Used for the litellm auto-router to modify the request before the routing decision is made.
"""
custom_logger_callbacks: List[CustomLogger] = litellm.logging_callback_manager.get_custom_loggers_for_type(
callback_type=CustomLogger,
)
for callback in custom_logger_callbacks:
await callback.async_pre_routing_hook(
#########################################################
# Check if any auto-router should be used
#########################################################
if model in self.auto_routers:
await self.auto_routers[model].async_pre_routing_hook(
model=model,
request_kwargs=request_kwargs,
messages=messages,
input=input,
specific_deployment=specific_deployment,
)