Spaces:
Running
Running
| # from langflow.field_typing import Data | |
| from langflow.custom import Component | |
| from langflow.io import MessageTextInput, Output | |
| from langflow.schema import Data | |
| class CustomComponent(Component): | |
| display_name = "Custom Component" | |
| description = "Use as a template to create your own component." | |
| documentation: str = "http://docs.langflow.org/components/custom" | |
| icon = "code" | |
| name = "CustomComponent" | |
| inputs = [ | |
| MessageTextInput( | |
| name="input_value", | |
| display_name="Input Value", | |
| info="This is a custom component Input", | |
| value="Hello, World!", | |
| tool_mode=True, | |
| ), | |
| ] | |
| outputs = [ | |
| Output(display_name="Output", name="output", method="build_output"), | |
| ] | |
| def build_output(self) -> Data: | |
| data = Data(value=self.input_value) | |
| self.status = data | |
| return data | |