Merge branch 'dev' of personal:logspace-ai/langflow into dev

This commit is contained in:
anovazzi1 2023-08-01 18:55:30 -03:00
commit ba1fe2c815
2 changed files with 7 additions and 3 deletions

View file

@ -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",
),

View file

@ -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: