Merge branch 'dev' of personal:logspace-ai/langflow into dev
This commit is contained in:
commit
ba1fe2c815
2 changed files with 7 additions and 3 deletions
|
|
@ -127,7 +127,7 @@ def serve(
|
||||||
timeout: int = typer.Option(300, help="Worker timeout in seconds."),
|
timeout: int = typer.Option(300, help="Worker timeout in seconds."),
|
||||||
port: int = typer.Option(7860, help="Port to listen on.", envvar="LANGFLOW_PORT"),
|
port: int = typer.Option(7860, help="Port to listen on.", envvar="LANGFLOW_PORT"),
|
||||||
components_path: Optional[Path] = typer.Option(
|
components_path: Optional[Path] = typer.Option(
|
||||||
Path(__file__).parent,
|
Path(__file__).parent / "components",
|
||||||
help="Path to the directory containing custom components.",
|
help="Path to the directory containing custom components.",
|
||||||
envvar="LANGFLOW_COMPONENTS_PATH",
|
envvar="LANGFLOW_COMPONENTS_PATH",
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -47,16 +47,20 @@ class Settings(BaseSettings):
|
||||||
|
|
||||||
if not values.get("components_path"):
|
if not values.get("components_path"):
|
||||||
values["components_path"] = [BASE_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"]:
|
elif BASE_COMPONENTS_PATH not in values["components_path"]:
|
||||||
values["components_path"].append(BASE_COMPONENTS_PATH)
|
values["components_path"].append(BASE_COMPONENTS_PATH)
|
||||||
|
logger.debug("Adding default components path to components_path")
|
||||||
|
|
||||||
if os.getenv("LANGFLOW_COMPONENT_PATH"):
|
if os.getenv("LANGFLOW_COMPONENTS_PATH"):
|
||||||
langflow_component_path = Path(os.getenv("LANGFLOW_COMPONENT_PATH"))
|
logger.debug("Adding LANGFLOW_COMPONENTS_PATH to components_path")
|
||||||
|
langflow_component_path = Path(os.getenv("LANGFLOW_COMPONENTS_PATH"))
|
||||||
if (
|
if (
|
||||||
langflow_component_path.exists()
|
langflow_component_path.exists()
|
||||||
and langflow_component_path not in values["components_path"]
|
and langflow_component_path not in values["components_path"]
|
||||||
):
|
):
|
||||||
values["components_path"].append(langflow_component_path)
|
values["components_path"].append(langflow_component_path)
|
||||||
|
logger.debug(f"Adding {langflow_component_path} to components_path")
|
||||||
return values
|
return values
|
||||||
|
|
||||||
class Config:
|
class Config:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue