chore: add diskcache as extra dependency

This commit is contained in:
Antonio Loison 2024-05-10 11:19:14 +02:00
parent 7ee07cd961
commit c1ba4ec078
3 changed files with 4 additions and 4 deletions

View file

@ -15,7 +15,6 @@ from openai._models import BaseModel as OpenAIObject
from litellm._logging import verbose_logger from litellm._logging import verbose_logger
from litellm.types.services import ServiceLoggerPayload, ServiceTypes from litellm.types.services import ServiceLoggerPayload, ServiceTypes
import traceback import traceback
import diskcache as dc
def print_verbose(print_statement): def print_verbose(print_statement):
@ -1919,6 +1918,7 @@ class Cache:
class DiskCache(BaseCache): class DiskCache(BaseCache):
def __init__(self, cache_dir: str = ".litellm_cache"): def __init__(self, cache_dir: str = ".litellm_cache"):
import diskcache as dc
# if users don't provider one, use the default litellm cache # if users don't provider one, use the default litellm cache
self.disk_cache = dc.Cache(cache_dir) self.disk_cache = dc.Cache(cache_dir)

4
poetry.lock generated
View file

@ -2679,11 +2679,11 @@ docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.link
testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-ignore-flaky", "pytest-mypy", "pytest-ruff (>=0.2.1)"] testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-ignore-flaky", "pytest-mypy", "pytest-ruff (>=0.2.1)"]
[extras] [extras]
extra-cache = ["diskcache"] disk-caching = ["diskcache"]
extra-proxy = ["azure-identity", "azure-keyvault-secrets", "google-cloud-kms", "prisma", "resend"] extra-proxy = ["azure-identity", "azure-keyvault-secrets", "google-cloud-kms", "prisma", "resend"]
proxy = ["PyJWT", "apscheduler", "backoff", "cryptography", "fastapi", "fastapi-sso", "gunicorn", "orjson", "python-multipart", "pyyaml", "rq", "uvicorn"] proxy = ["PyJWT", "apscheduler", "backoff", "cryptography", "fastapi", "fastapi-sso", "gunicorn", "orjson", "python-multipart", "pyyaml", "rq", "uvicorn"]
[metadata] [metadata]
lock-version = "2.0" lock-version = "2.0"
python-versions = ">=3.8.1,<4.0, !=3.9.7" python-versions = ">=3.8.1,<4.0, !=3.9.7"
content-hash = "a21a41c1f683d7cb9a07fa76ee396b7da95cebf8c82d44de92e318916436a506" content-hash = "aa6283846b24f5703626c2de10459254166551f469c34e75b229adafb6985eba"

View file

@ -66,7 +66,7 @@ extra_proxy = [
"resend" "resend"
] ]
extra_cache = [ disk_caching = [
"diskcache" "diskcache"
] ]