fix(base.py): change import to from platformdirs

This commit is contained in:
Gladson 2023-11-03 02:36:05 -04:00 committed by GitHub
commit 819c283fe3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -55,14 +55,14 @@ class Settings(BaseSettings):
@validator("CONFIG_DIR", pre=True, allow_reuse=True)
def set_langflow_dir(cls, value):
if not value:
import platformdirs
from platformdirs import user_cache_dir
# Define the app name and author
app_name = "langflow"
app_author = "logspace"
# Get the cache directory for the application
cache_dir = platformdirs.user_cache_dir(app_name, app_author)
cache_dir = user_cache_dir(app_name, app_author)
# Create a .langflow directory inside the cache directory
value = Path(cache_dir)