mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-12 03:48:56 +00:00
fix(sdk): resolve litellm.proxy lazily on attribute access (#45845)
The layer cleanup stopped import litellm from loading any proxy module, so litellm.proxy was no longer bound and litellm.proxy._types.X raised AttributeError. The module __getattr__ now imports litellm.proxy on first access, which keeps import litellm free of proxy._types and fixes the docs and code-quality checks on main
This commit is contained in:
parent
cf1284f3d5
commit
691ca03266
1 changed files with 5 additions and 0 deletions
|
|
@ -2386,6 +2386,11 @@ def __getattr__(name: str) -> Any:
|
|||
handler_func: Final = registry[name]
|
||||
return handler_func(name)
|
||||
|
||||
if name == "proxy":
|
||||
import importlib
|
||||
|
||||
return importlib.import_module("litellm.proxy")
|
||||
|
||||
if name == "harness" or name in _AGENT_EXPORTS:
|
||||
import importlib
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue