🐛 fix(utils.py): fix import order to avoid import errors
The import order was changed to avoid import errors. The import of langchain was moved to the top of the file to avoid circular import errors.
This commit is contained in:
parent
31ee134ee7
commit
a3efa8fe5d
1 changed files with 4 additions and 3 deletions
|
|
@ -63,11 +63,12 @@ def extract_input_variables_from_prompt(prompt: str) -> list[str]:
|
|||
|
||||
def setup_llm_caching():
|
||||
"""Setup LLM caching."""
|
||||
import langchain
|
||||
from langflow.settings import settings
|
||||
from langflow.interface.importing.utils import import_class
|
||||
|
||||
try:
|
||||
import langchain
|
||||
from langflow.settings import settings
|
||||
from langflow.interface.importing.utils import import_class
|
||||
|
||||
cache_class = import_class(f"langchain.cache.{settings.cache}")
|
||||
|
||||
logger.debug(f"Setting up LLM caching with {cache_class.__name__}")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue