mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-10 03:28:53 +00:00
Apply suggestion from @greptile-apps[bot]
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
This commit is contained in:
parent
b4f2918730
commit
afb45595f3
1 changed files with 4 additions and 0 deletions
|
|
@ -772,6 +772,10 @@ async def proxy_startup_event(app: FastAPI): # noqa: PLR0915
|
|||
if not _hook_spec:
|
||||
continue
|
||||
try:
|
||||
if ":" not in _hook_spec:
|
||||
raise ValueError(
|
||||
f"Invalid hook spec '{_hook_spec}': expected format is 'module.path:function_name'"
|
||||
)
|
||||
_module_path, _func_name = _hook_spec.rsplit(":", 1)
|
||||
_module = importlib.import_module(_module_path)
|
||||
_hook_fn = getattr(_module, _func_name)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue