diff --git a/src/backend/langflow/__main__.py b/src/backend/langflow/__main__.py index b20a2a902..58789908a 100644 --- a/src/backend/langflow/__main__.py +++ b/src/backend/langflow/__main__.py @@ -127,7 +127,7 @@ def serve( timeout: int = typer.Option(300, help="Worker timeout in seconds."), port: int = typer.Option(7860, help="Port to listen on.", envvar="LANGFLOW_PORT"), components_path: Optional[Path] = typer.Option( - Path(__file__).parent, + Path(__file__).parent / "components", help="Path to the directory containing custom components.", envvar="LANGFLOW_COMPONENTS_PATH", ), diff --git a/src/backend/langflow/settings.py b/src/backend/langflow/settings.py index e9c62d6f7..08400a811 100644 --- a/src/backend/langflow/settings.py +++ b/src/backend/langflow/settings.py @@ -47,16 +47,20 @@ class Settings(BaseSettings): if not values.get("components_path"): values["components_path"] = [BASE_COMPONENTS_PATH] + logger.debug("No components_path provided, using default components path") elif BASE_COMPONENTS_PATH not in values["components_path"]: values["components_path"].append(BASE_COMPONENTS_PATH) + logger.debug("Adding default components path to components_path") - if os.getenv("LANGFLOW_COMPONENT_PATH"): - langflow_component_path = Path(os.getenv("LANGFLOW_COMPONENT_PATH")) + if os.getenv("LANGFLOW_COMPONENTS_PATH"): + logger.debug("Adding LANGFLOW_COMPONENTS_PATH to components_path") + langflow_component_path = Path(os.getenv("LANGFLOW_COMPONENTS_PATH")) if ( langflow_component_path.exists() and langflow_component_path not in values["components_path"] ): values["components_path"].append(langflow_component_path) + logger.debug(f"Adding {langflow_component_path} to components_path") return values class Config: