Refactor TextInput and add TextOutput component

This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-02-25 12:33:29 -03:00
commit 042ea07977
2 changed files with 19 additions and 3 deletions

View file

@ -9,9 +9,6 @@ class TextInput(CustomComponent):
description = "Used to pass text input to the next component."
field_config = {
"code": {
"show": False,
},
"value": {"display_name": "Value"},
}

View file

@ -0,0 +1,19 @@
from typing import Optional
from langflow import CustomComponent
from langflow.field_typing import Text
class TextOutput(CustomComponent):
display_name = "Text Output"
description = "Used to pass text output to the next component."
field_config = {
"value": {"display_name": "Value"},
}
def build(self, value: Optional[str] = "") -> Text:
self.status = value
if not value:
value = ""
return value