🔧 chore(__main__.py): update components_path default value to include "components" directory for better organization

🔧 chore(custom.py): update description of YourComponent to be more descriptive and accurate
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-08-01 18:24:19 -03:00
commit a09e57b9ef
2 changed files with 4 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

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