Spaces:
Running
Running
Download src/backend/tests/data/component_multiple_outputs.py from opendigital/agent-flow: direct link, hf CLI and curl.
- Browser
- Download file 742 Bytes
-
https://huggingface.co/spaces/opendigital/agent-flow/resolve/main/src/backend/tests/data/component_multiple_outputs.py
- Command line
-
hf download hf://spaces/opendigital/agent-flow/src/backend/tests/data/component_multiple_outputs.py
-
curl -L -o component_multiple_outputs.py https://huggingface.co/spaces/opendigital/agent-flow/resolve/main/src/backend/tests/data/component_multiple_outputs.py
742 Bytes
| from langflow.custom import Component | |
| from langflow.inputs.inputs import IntInput, MessageTextInput | |
| from langflow.template.field.base import Output | |
| class MultipleOutputsComponent(Component): | |
| inputs = [ | |
| MessageTextInput(display_name="Input", name="input"), | |
| IntInput(display_name="Number", name="number"), | |
| ] | |
| outputs = [ | |
| Output(display_name="Certain Output", name="certain_output", method="certain_output"), | |
| Output(display_name="Other Output", name="other_output", method="other_output"), | |
| ] | |
| def certain_output(self) -> str: | |
| return f"This is my string input: {self.input}" | |
| def other_output(self) -> int: | |
| return f"This is my int input multiplied by 2: {self.number * 2}" | |