fix(base.py): change appdirs dependency to platformdirs

This commit is contained in:
Gladson 2023-11-03 02:08:36 -04:00 committed by GitHub
commit 307c526d6a
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 appdirs
import platformdirs
# Define the app name and author
app_name = "langflow"
app_author = "logspace"
# Get the cache directory for the application
cache_dir = appdirs.user_cache_dir(app_name, app_author)
cache_dir = platformdirs.user_cache_dir(app_name, app_author)
# Create a .langflow directory inside the cache directory
value = Path(cache_dir)