langflow/src/frontend/tests/custom_component_full.ts
Gabriel Luiz Freitas Almeida 83c915916d
Add PythonREPLToolComponent to tools/__init__.py and create PythonREPLTool.py (#1639)
* re-add --fix

* Add PythonREPLToolComponent to tools/__init__.py and create PythonREPLTool.py

* Refactor PythonREPLToolComponent to use build_status_from_tool in PythonREPLTool.py

* Refactor model_specs imports in ChatLiteLLMSpecs.py

* Refactor imports in various files

* Refactor model_specs imports and class names in AnthropicLLMSpecs.py and AnthropicSpecs.py
2024-04-08 16:51:03 -03:00

20 lines
750 B
TypeScript

export const custom = `from langflow.custom import CustomComponent
from langflow.field_typing import BaseLanguageModel
from langchain.chains import LLMChain
from langchain.prompts import PromptTemplate
from langchain_core.documents import Document
from langflow.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: BaseLanguageModel, prompt: PromptTemplate) -> Document:
return "test"`;