From a09e57b9ef800b17cde806d4fcb9fb8b8f09dccb Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Tue, 1 Aug 2023 18:24:19 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20chore(=5F=5Fmain=5F=5F.py):=20up?= =?UTF-8?q?date=20components=5Fpath=20default=20value=20to=20include=20"co?= =?UTF-8?q?mponents"=20directory=20for=20better=20organization=20?= =?UTF-8?q?=F0=9F=94=A7=20chore(custom.py):=20update=20description=20of=20?= =?UTF-8?q?YourComponent=20to=20be=20more=20descriptive=20and=20accurate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/backend/langflow/__main__.py | 2 +- src/backend/langflow/components/custom_components/custom.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) 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/components/custom_components/custom.py b/src/backend/langflow/components/custom_components/custom.py index 3ebc5bda8..cec2c7acd 100644 --- a/src/backend/langflow/components/custom_components/custom.py +++ b/src/backend/langflow/components/custom_components/custom.py @@ -7,12 +7,13 @@ from langchain.schema import Document import requests + class YourComponent(CustomComponent): display_name: str = "Custom Component" - description: str = "My description" + description: str = "Create any custom component you want!" def build_config(self): - return { "url": { "multiline": True, "required": True } } + return {"url": {"multiline": True, "required": True}} def build(self, url: str, llm: BaseLLM, prompt: PromptTemplate) -> Document: response = requests.get(url)