From c9724d0fb4f39f74e79b4abf8d8926151b54d22b Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Wed, 4 Oct 2023 15:32:48 -0300 Subject: [PATCH] added custom component template --- src/frontend/tests/custom_component_full.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/frontend/tests/custom_component_full.ts diff --git a/src/frontend/tests/custom_component_full.ts b/src/frontend/tests/custom_component_full.ts new file mode 100644 index 000000000..443c3fd85 --- /dev/null +++ b/src/frontend/tests/custom_component_full.ts @@ -0,0 +1,20 @@ +export const custom = `from langflow import CustomComponent + +from langchain.llms.base import BaseLLM +from langchain.chains import LLMChain +from langchain.prompts import PromptTemplate +from langchain.schema import Document +from langchain.field_typing import NestedDict + +import requests + +class YourComponent(CustomComponent): + display_name: str = "Custom Component" + description: str = "Create any custom component you want!" + + def build_config(self): + return { "file": { "file_type": ["json"], } } + + def build(self, url: str,file:str,integer:int,nested:NestedDict,flt:float,boolean:bool,lisst:list[str],dictionary:dict, llm: BaseLLM, prompt: PromptTemplate) -> Document: + + return "test"`;