Add support for combining a list of texts in CombineTextComponent
This commit is contained in:
parent
acb1fa9997
commit
dc0feddb54
1 changed files with 5 additions and 2 deletions
|
|
@ -5,6 +5,7 @@ from langflow.field_typing import Text
|
||||||
class CombineTextComponent(CustomComponent):
|
class CombineTextComponent(CustomComponent):
|
||||||
display_name = "Combine Text"
|
display_name = "Combine Text"
|
||||||
description = "Concatenate multiple text sources into a single text chunk using a specified delimiter."
|
description = "Concatenate multiple text sources into a single text chunk using a specified delimiter."
|
||||||
|
icon = "merge"
|
||||||
|
|
||||||
def build_config(self):
|
def build_config(self):
|
||||||
return {
|
return {
|
||||||
|
|
@ -18,5 +19,7 @@ class CombineTextComponent(CustomComponent):
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
def build(self, texts: str, delimiter: str = " ") -> Text:
|
def build(self, texts: list[str], delimiter: str = " ") -> Text:
|
||||||
return delimiter.join(texts)
|
combined = delimiter.join(texts)
|
||||||
|
self.status = combined
|
||||||
|
return combined
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue