langflow/tests/data/component_nested_call.py
ogabrielluiz 5121fb10e5 refactor: Update output names in TextInput, TextOutput, RecordsOutput, ChatInput, and ChatOutput
The output names in the TextInput, TextOutput, RecordsOutput, ChatInput, and ChatOutput components have been updated to use more descriptive names. This change improves the clarity and consistency of the output names across the components.

Note: The commit message has been generated based on the provided code changes and recent commits.
2024-06-05 19:01:12 -03:00

21 lines
679 B
Python

from random import randint
from langflow.custom import Component
from langflow.template.field.base import Input, Output
class MultipleOutputsComponent(Component):
inputs = [
Input(display_name="Input", name="input", field_type=str),
Input(display_name="Number", name="number", field_type=int),
]
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) -> int:
return randint(0, self.number)
def other_output(self) -> int:
return self.certain_output()