Update build_config method in TextComponent subclasses

This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-03-29 16:27:33 -03:00
commit 7ebbc9abac
3 changed files with 21 additions and 1 deletions

View file

@ -12,7 +12,7 @@ class TextComponent(CustomComponent):
def build_config(self):
return {
"input_value": {"display_name": "Value", "input_types": ["Record"]},
"input_value": {"display_name": "Value", "input_types": ["Record"], "info": "Text or Record to be passed."},
"record_template": {"display_name": "Record Template", "multiline": True},
}

View file

@ -8,6 +8,16 @@ class TextInput(TextComponent):
display_name = "Text Input"
description = "Capture Text or Record and send text inputs."
def build_config(self):
return {
"input_value": {
"display_name": "Value",
"input_types": ["Record"],
"info": "Text or Record to be passed as input.",
},
"record_template": {"display_name": "Record Template", "multiline": True},
}
def build(
self,
input_value: Optional[str] = "",

View file

@ -8,5 +8,15 @@ class TextOutput(TextComponent):
display_name = "Text Output"
description = "Used to send a text output."
def build_config(self):
return {
"input_value": {
"display_name": "Value",
"input_types": ["Record"],
"info": "Text or Record to be passed as output.",
},
"record_template": {"display_name": "Record Template", "multiline": True},
}
def build(self, input_value: Optional[Text] = "", record_template: str = "{text}") -> Text:
return super().build(input_value=input_value, record_template=record_template)