mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-06 02:48:13 +00:00
feat: lazy load DatadogLLMObsInitParams to reduce import time
- Added DatadogLLMObsInitParams to TYPES_NAMES in _lazy_imports_registry.py - Added import map entry for DatadogLLMObsInitParams in _TYPES_IMPORT_MAP - Moved DatadogLLMObsInitParams import from module level to TYPE_CHECKING block in __init__.py - Follows existing lazy import patterns for type classes - Automatically tested by existing test_types_lazy_imports() function
This commit is contained in:
parent
d8d10f5e25
commit
85944a1fef
2 changed files with 5 additions and 1 deletions
|
|
@ -26,7 +26,6 @@ from typing import (
|
|||
overload,
|
||||
Type,
|
||||
)
|
||||
from litellm.types.integrations.datadog_llm_obs import DatadogLLMObsInitParams
|
||||
from litellm.types.integrations.datadog import DatadogInitParams
|
||||
from litellm._logging import (
|
||||
set_verbose,
|
||||
|
|
@ -1533,6 +1532,9 @@ if TYPE_CHECKING:
|
|||
# Custom logger class (lazy-loaded)
|
||||
from litellm.integrations.custom_logger import CustomLogger
|
||||
|
||||
# Datadog LLM observability params (lazy-loaded)
|
||||
from litellm.types.integrations.datadog_llm_obs import DatadogLLMObsInitParams
|
||||
|
||||
# Logging callback manager class and instance (lazy-loaded)
|
||||
from litellm.litellm_core_utils.logging_callback_manager import LoggingCallbackManager
|
||||
logging_callback_manager: LoggingCallbackManager
|
||||
|
|
|
|||
|
|
@ -282,6 +282,7 @@ TYPES_NAMES = (
|
|||
"PriorityReservationSettings",
|
||||
"CustomLogger",
|
||||
"LoggingCallbackManager",
|
||||
"DatadogLLMObsInitParams",
|
||||
# Note: LlmProviders is NOT lazy-loaded because it's imported during import time
|
||||
# in multiple places including openai.py (via main import)
|
||||
# Note: KeyManagementSettings is NOT lazy-loaded because _key_management_settings
|
||||
|
|
@ -393,6 +394,7 @@ _TYPES_IMPORT_MAP = {
|
|||
"PriorityReservationSettings": ("litellm.types.utils", "PriorityReservationSettings"),
|
||||
"CustomLogger": ("litellm.integrations.custom_logger", "CustomLogger"),
|
||||
"LoggingCallbackManager": ("litellm.litellm_core_utils.logging_callback_manager", "LoggingCallbackManager"),
|
||||
"DatadogLLMObsInitParams": ("litellm.types.integrations.datadog_llm_obs", "DatadogLLMObsInitParams"),
|
||||
}
|
||||
|
||||
_LLM_PROVIDER_LOGIC_IMPORT_MAP = {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue