mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-07 08:26:10 +00:00
fix(complexity_router): skip empty string content in async_pre_routing_hook
This commit is contained in:
parent
4755c8f5b8
commit
25391a8c10
1 changed files with 3 additions and 3 deletions
|
|
@ -15,12 +15,12 @@ from litellm._logging import verbose_router_logger
|
|||
from litellm.integrations.custom_logger import CustomLogger
|
||||
|
||||
from .config import (
|
||||
ComplexityRouterConfig,
|
||||
ComplexityTier,
|
||||
DEFAULT_CODE_KEYWORDS,
|
||||
DEFAULT_REASONING_KEYWORDS,
|
||||
DEFAULT_SIMPLE_KEYWORDS,
|
||||
DEFAULT_TECHNICAL_KEYWORDS,
|
||||
ComplexityRouterConfig,
|
||||
ComplexityTier,
|
||||
)
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
|
@ -366,7 +366,7 @@ class ComplexityRouter(CustomLogger):
|
|||
for msg in reversed(messages):
|
||||
role = msg.get("role", "")
|
||||
content = msg.get("content", "")
|
||||
if isinstance(content, str):
|
||||
if isinstance(content, str) and content:
|
||||
if role == "user" and user_message is None:
|
||||
user_message = content
|
||||
elif role == "system" and system_prompt is None:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue