🔧 chore(constants.py): update default custom component code to improve readability and remove unnecessary imports
✨ feat(constants.py): update display name and description of the custom component to improve clarity and user experience 🔧 chore(custom_components.py): update display name of the custom component to improve clarity and user experience
This commit is contained in:
parent
6450ec0e7b
commit
11854ccdb3
2 changed files with 4 additions and 5 deletions
|
|
@ -34,8 +34,7 @@ CUSTOM_COMPONENT_SUPPORTED_TYPES = {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
DEFAULT_CUSTOM_COMPONENT_CODE = """
|
DEFAULT_CUSTOM_COMPONENT_CODE = """from langflow import CustomComponent
|
||||||
from langflow import CustomComponent
|
|
||||||
|
|
||||||
from langchain.llms.base import BaseLLM
|
from langchain.llms.base import BaseLLM
|
||||||
from langchain.chains import LLMChain
|
from langchain.chains import LLMChain
|
||||||
|
|
@ -45,8 +44,8 @@ from langchain.schema import Document
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
class YourComponent(CustomComponent):
|
class YourComponent(CustomComponent):
|
||||||
display_name: str = "Your Component"
|
display_name: str = "Custom Component"
|
||||||
description: str = "Your description"
|
description: str = "Create any custom component you want!"
|
||||||
|
|
||||||
def build_config(self):
|
def build_config(self):
|
||||||
return { "url": { "multiline": True, "required": True } }
|
return { "url": { "multiline": True, "required": True } }
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ from langflow.interface.custom.constants import DEFAULT_CUSTOM_COMPONENT_CODE
|
||||||
|
|
||||||
class CustomComponentFrontendNode(FrontendNode):
|
class CustomComponentFrontendNode(FrontendNode):
|
||||||
name: str = "CustomComponent"
|
name: str = "CustomComponent"
|
||||||
display_name: str = "Your Component"
|
display_name: str = "Custom Component"
|
||||||
beta: bool = True
|
beta: bool = True
|
||||||
template: Template = Template(
|
template: Template = Template(
|
||||||
type_name="CustomComponent",
|
type_name="CustomComponent",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue