mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-10 03:28:53 +00:00
* refactor: expose core private symbols with compatibility aliases Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * types: narrow core migration diagnostics Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix: preserve runtime behavior in core symbol migration Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix: preserve core private usage migration behavior Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix: preserve private value rebinding compatibility Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix: restore optional imports and cover public helpers Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * test: exempt router property from call coverage Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * test: align recursive detector ignore names Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --------- Co-authored-by: mateo <mateo@berri.ai> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
33 lines
982 B
Python
33 lines
982 B
Python
from typing import Dict, Literal, Type, Union
|
|
|
|
from litellm_enterprise.proxy.hooks.managed_files import PROXY_LiteLLMManagedFiles
|
|
from litellm_enterprise.proxy.hooks.managed_vector_stores import (
|
|
PROXY_LiteLLMManagedVectorStores,
|
|
)
|
|
|
|
from litellm.integrations.custom_logger import CustomLogger
|
|
|
|
ENTERPRISE_PROXY_HOOKS: Dict[str, Type[CustomLogger]] = {
|
|
"managed_files": PROXY_LiteLLMManagedFiles,
|
|
"managed_vector_stores": PROXY_LiteLLMManagedVectorStores,
|
|
}
|
|
|
|
|
|
def get_enterprise_proxy_hook(
|
|
hook_name: Union[
|
|
Literal[
|
|
"managed_files",
|
|
"managed_vector_stores",
|
|
"max_parallel_requests",
|
|
],
|
|
str,
|
|
],
|
|
):
|
|
"""
|
|
Factory method to get a enterprise hook instance by name
|
|
"""
|
|
if hook_name not in ENTERPRISE_PROXY_HOOKS:
|
|
raise ValueError(
|
|
f"Unknown hook: {hook_name}. Available hooks: {list(ENTERPRISE_PROXY_HOOKS.keys())}"
|
|
)
|
|
return ENTERPRISE_PROXY_HOOKS[hook_name]
|