mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-08 03:08:45 +00:00
refactor: replace fresh getattr string access and a restating comment (#45017)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
2c67ae90bd
commit
7b439d9138
3 changed files with 4 additions and 4 deletions
|
|
@ -90,7 +90,7 @@ def _fold_message_cache_control(
|
|||
return base
|
||||
|
||||
|
||||
def _message_role_mapping(role: str) -> type[ChatMessage]: # returns the SAP message model class, not an instance
|
||||
def _message_role_mapping(role: str) -> type[ChatMessage]:
|
||||
return {
|
||||
"user": SAPUserMessage,
|
||||
"assistant": SAPAssistantMessage,
|
||||
|
|
|
|||
|
|
@ -4550,7 +4550,7 @@ async def _adaptive_router_flusher_loop():
|
|||
ar = tagged.strategy
|
||||
# Lazy state load: covers adaptive routers registered via
|
||||
# `/config/reload` after proxy boot.
|
||||
if not getattr(ar, "state_loaded", False):
|
||||
if not ar.state_loaded:
|
||||
try:
|
||||
await ar.load_state_from_db(prisma_client)
|
||||
finally:
|
||||
|
|
|
|||
|
|
@ -1393,10 +1393,10 @@ def _schedule_async_success_logging(
|
|||
)
|
||||
)
|
||||
|
||||
if not getattr(logging_obj, "defer_async_logging", False):
|
||||
if not logging_obj.defer_async_logging:
|
||||
_enqueue_async_logging()
|
||||
return
|
||||
if getattr(logging_obj, "enqueue_deferred_logging", None) is not None:
|
||||
if logging_obj.enqueue_deferred_logging is not None:
|
||||
return
|
||||
logging_obj.enqueue_deferred_logging = _enqueue_async_logging
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue