🔀 chore(utils.py): rename cache variable to CACHE for consistency with other settings
🔀 chore(utils.py): rename `LANGFLOW_LANGCHAIN_CACHE` environment variable to `CACHE` for clarity and consistency
This commit is contained in:
parent
3495375f50
commit
956ba45e9b
1 changed files with 1 additions and 2 deletions
|
|
@ -74,13 +74,12 @@ def setup_llm_caching():
|
|||
logger.warning(f"Could not setup LLM caching. Error: {exc}")
|
||||
|
||||
|
||||
# TODO Rename this here and in `setup_llm_caching`
|
||||
def set_langchain_cache(settings):
|
||||
import langchain
|
||||
from langflow.interface.importing.utils import import_class
|
||||
|
||||
cache_type = os.getenv("LANGFLOW_LANGCHAIN_CACHE")
|
||||
cache_class = import_class(f"langchain.cache.{cache_type or settings.cache}")
|
||||
cache_class = import_class(f"langchain.cache.{cache_type or settings.CACHE}")
|
||||
|
||||
logger.debug(f"Setting up LLM caching with {cache_class.__name__}")
|
||||
langchain.llm_cache = cache_class()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue