From f4271ba4d92476f0a29ee95e74944558b97aeea2 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Tue, 1 Aug 2023 18:09:01 -0300 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=94=A7=20chore(settings.py):=20add=20?= =?UTF-8?q?debug=20logs=20to=20track=20the=20behavior=20of=20components=5F?= =?UTF-8?q?path=20configuration=20=E2=9C=A8=20feat(settings.py):=20add=20s?= =?UTF-8?q?upport=20for=20LANGFLOW=5FCOMPONENTS=5FPATH=20environment=20var?= =?UTF-8?q?iable=20to=20add=20custom=20components=20path=20to=20components?= =?UTF-8?q?=5Fpath?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/backend/langflow/settings.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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: From 9f97ecba25d7764b8680ef639dc431158f2f296d Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Tue, 1 Aug 2023 18:12:02 -0300 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=90=9B=20fix(=5F=5Fmain=5F=5F.py):=20?= =?UTF-8?q?fix=20default=20value=20of=20components=5Fpath=20option=20to=20?= =?UTF-8?q?point=20to=20the=20correct=20directory=20=E2=9C=A8=20feat(=5F?= =?UTF-8?q?=5Fmain=5F=5F.py):=20add=20support=20for=20LANGFLOW=5FCOMPONENT?= =?UTF-8?q?S=5FPATH=20environment=20variable=20to=20specify=20the=20direct?= =?UTF-8?q?ory=20containing=20custom=20components?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/backend/langflow/__main__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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", ),