refactor: Update langflow custom components to use specific input classes
The code changes update the langflow custom components to use specific input classes, such as IntInput and TextInput, instead of the generic field types. This refactor improves the clarity and type safety of the code.
This commit is contained in:
parent
df04a329cc
commit
98e3f4bdaa
2 changed files with 8 additions and 6 deletions
|
|
@ -1,11 +1,12 @@
|
|||
from langflow.custom import Component
|
||||
from langflow.template.field.base import Input, Output
|
||||
from langflow.inputs.inputs import IntInput, TextInput
|
||||
from langflow.template.field.base import Output
|
||||
|
||||
|
||||
class MultipleOutputsComponent(Component):
|
||||
inputs = [
|
||||
Input(display_name="Input", name="input", field_type=str),
|
||||
Input(display_name="Number", name="number", field_type=int),
|
||||
TextInput(display_name="Input", name="input"),
|
||||
IntInput(display_name="Number", name="number"),
|
||||
]
|
||||
outputs = [
|
||||
Output(display_name="Certain Output", name="certain_output", method="certain_output"),
|
||||
|
|
|
|||
|
|
@ -1,13 +1,14 @@
|
|||
from random import randint
|
||||
|
||||
from langflow.custom import Component
|
||||
from langflow.template.field.base import Input, Output
|
||||
from langflow.inputs.inputs import IntInput, TextInput
|
||||
from langflow.template.field.base import Output
|
||||
|
||||
|
||||
class MultipleOutputsComponent(Component):
|
||||
inputs = [
|
||||
Input(display_name="Input", name="input", field_type=str),
|
||||
Input(display_name="Number", name="number", field_type=int),
|
||||
TextInput(display_name="Input", name="input"),
|
||||
IntInput(display_name="Number", name="number"),
|
||||
]
|
||||
outputs = [
|
||||
Output(display_name="Certain Output", name="certain_output", method="certain_output"),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue