mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-11 22:51:28 +00:00
refactor: clean up _invoke_callback_setup_proxy
- Remove redundant hasattr check (setup_proxy is defined on base class) - Remove inline import (CustomLogger already imported at module level) - Add note about call timing (before DB init) in docstring Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
1c3a3bebb7
commit
725c5648aa
1 changed files with 4 additions and 3 deletions
|
|
@ -762,11 +762,12 @@ def _invoke_callback_setup_proxy(app: FastAPI) -> None:
|
|||
|
||||
This gives callbacks an opportunity to interact with the FastAPI app
|
||||
during startup, e.g., to add middleware or mount additional routes.
|
||||
"""
|
||||
from litellm.integrations.custom_logger import CustomLogger
|
||||
|
||||
Note: Called after config load but before DB initialization, so callbacks
|
||||
should not depend on prisma_client being available.
|
||||
"""
|
||||
for callback in litellm.callbacks:
|
||||
if isinstance(callback, CustomLogger) and hasattr(callback, "setup_proxy"):
|
||||
if isinstance(callback, CustomLogger):
|
||||
try:
|
||||
callback.setup_proxy(app)
|
||||
except Exception as e:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue