Spaces:
Running
Running
Download src/backend/base/langflow/components/custom_component/custom_component.py from opendigital/agent-flow: direct link, hf CLI and curl.
- Browser
- Download file 895 Bytes
-
https://huggingface.co/spaces/opendigital/agent-flow/resolve/main/src/backend/base/langflow/components/custom_component/custom_component.py
- Command line
-
hf download hf://spaces/opendigital/agent-flow/src/backend/base/langflow/components/custom_component/custom_component.py
-
curl -L -o custom_component.py https://huggingface.co/spaces/opendigital/agent-flow/resolve/main/src/backend/base/langflow/components/custom_component/custom_component.py
895 Bytes
| # 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 | |