added custom component template
This commit is contained in:
parent
71bc3c4a65
commit
c9724d0fb4
1 changed files with 20 additions and 0 deletions
20
src/frontend/tests/custom_component_full.ts
Normal file
20
src/frontend/tests/custom_component_full.ts
Normal file
|
|
@ -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"`;
|
||||
Loading…
Add table
Add a link
Reference in a new issue