From 5b9bed07b5d04b489a95e14933f38ad8c95df738 Mon Sep 17 00:00:00 2001 From: gustavoschaedler Date: Tue, 1 Aug 2023 23:17:23 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A5=20chore(custom.py):=20remove=20cus?= =?UTF-8?q?tom=20component=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The custom component file `custom.py` has been removed from the project as it is no longer needed. --- .../components/custom_components/custom.py | 22 ------------------- 1 file changed, 22 deletions(-) delete mode 100644 src/backend/langflow/components/custom_components/custom.py diff --git a/src/backend/langflow/components/custom_components/custom.py b/src/backend/langflow/components/custom_components/custom.py deleted file mode 100644 index cec2c7acd..000000000 --- a/src/backend/langflow/components/custom_components/custom.py +++ /dev/null @@ -1,22 +0,0 @@ -from langflow import CustomComponent - -from langchain.llms.base import BaseLLM -from langchain.chains import LLMChain -from langchain import PromptTemplate -from langchain.schema import Document - -import requests - - -class YourComponent(CustomComponent): - display_name: str = "Custom Component" - description: str = "Create any custom component you want!" - - def build_config(self): - return {"url": {"multiline": True, "required": True}} - - def build(self, url: str, llm: BaseLLM, prompt: PromptTemplate) -> Document: - response = requests.get(url) - chain = LLMChain(llm=llm, prompt=prompt) - result = chain.run(response.text[:300]) - return Document(page_content=str(result))