mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-20 00:11:50 +00:00
fix DualCache import error in CI and update docstrings for cache coordinator
This commit is contained in:
parent
3c2c61e1e4
commit
354ad40d15
2 changed files with 21 additions and 3 deletions
|
|
@ -6,6 +6,8 @@ Currently only supports admin.
|
|||
JWT token must have 'litellm_proxy_admin' in scope.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import fnmatch
|
||||
import hashlib
|
||||
import os
|
||||
|
|
|
|||
|
|
@ -20,11 +20,27 @@ T = TypeVar("T")
|
|||
|
||||
|
||||
class AsyncCacheProtocol(Protocol):
|
||||
"""Protocol for cache backends used by EventDrivenCacheCoordinator."""
|
||||
"""Protocol for cache backends used by EventDrivenCacheCoordinator.
|
||||
|
||||
async def async_get_cache(self, key: str, **kwargs: Any) -> Any: ...
|
||||
Matches ``DualCache`` / ``UserApiKeyCache`` call shapes (explicit optional params
|
||||
before ``**kwargs``), not only ``(key, **kwargs)``, so overloads validate.
|
||||
"""
|
||||
|
||||
async def async_set_cache(self, key: str, value: Any, **kwargs: Any) -> Any: ...
|
||||
async def async_get_cache(
|
||||
self,
|
||||
key: str,
|
||||
parent_otel_span: Any = None,
|
||||
local_only: bool = False,
|
||||
**kwargs: Any,
|
||||
) -> Any: ...
|
||||
|
||||
async def async_set_cache(
|
||||
self,
|
||||
key: str,
|
||||
value: Any,
|
||||
local_only: bool = False,
|
||||
**kwargs: Any,
|
||||
) -> Any: ...
|
||||
|
||||
|
||||
class EventDrivenCacheCoordinator:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue