Skip to main content

Input and output components in Langflow

Input and output components define where data enters and exits your flow.

Both components accept user input and return a Message object, but serve different purposes.

The Text Input component accepts a text string input and returns a Message object containing only the input text. The output does not appear in the Playground.

The Chat Input component accepts multiple input types including text, files, and metadata, and returns a Message object containing the text along with sender information, session ID, and file attachments.

The Chat Input component provides an interactive chat interface in the Playground.

Chat Input

This component collects user input as Text strings from the chat and wraps it in a Message object that includes the input text, sender information, session ID, file attachments, and styling properties.

It can optionally store the message in a chat history.

Inputs

NameDisplay NameInfo
input_valueTextThe Message to be passed as input.
should_store_messageStore MessagesStore the message in the history.
senderSender TypeThe type of sender.
sender_nameSender NameThe name of the sender.
session_idSession IDThe session ID of the chat. If empty, the current session ID parameter is used.
filesFilesThe files to be sent with the message.
background_colorBackground ColorThe background color of the icon.
chat_iconIconThe icon of the message.
text_colorText ColorThe text color of the name.

Outputs

NameDisplay NameInfo
messageMessageThe resulting chat message object with all specified properties.

Message method

The ChatInput class provides an asynchronous method to create and store a Message object based on the input parameters. The Message object is created in the message_response method of the ChatInput class using the Message.create() factory method.


_12
message = await Message.create(
_12
text=self.input_value,
_12
sender=self.sender,
_12
sender_name=self.sender_name,
_12
session_id=self.session_id,
_12
files=self.files,
_12
properties={
_12
"background_color": background_color,
_12
"text_color": text_color,
_12
"icon": icon,
_12
},
_12
)

Text Input

The Text Input component accepts a text string input and returns a Message object containing only the input text.

The output does not appear in the Playground.

Inputs

NameDisplay NameInfo
input_valueTextThe text/content to be passed as output.

Outputs

NameDisplay NameInfo
textTextThe resulting text message.

Chat Output

The Chat Output component creates a Message object that includes the input text, sender information, session ID, and styling properties.

The component accepts the following input types.

Inputs

NameDisplay NameInfo
input_valueTextThe message to be passed as output.
should_store_messageStore MessagesThe flag to store the message in the history.
senderSender TypeThe type of sender.
sender_nameSender NameThe name of the sender.
session_idSession IDThe session ID of the chat. If empty, the current session ID parameter is used.
data_templateData TemplateThe template to convert Data to Text. If the option is left empty, it is dynamically set to the Data's text key.
background_colorBackground ColorThe background color of the icon.
chat_iconIconThe icon of the message.
text_colorText ColorThe text color of the name.
clean_dataBasic Clean DataWhen enabled, DataFrame inputs are cleaned when converted to text. Cleaning removes empty rows, empty lines in cells, and multiple newlines.

Outputs

NameDisplay NameInfo
messageMessageThe resulting chat message object with all specified properties.

Text Output

The Text Output takes a single input of text and returns a Message object containing that text.

The output does not appear in the Playground.

Inputs

NameDisplay NameInfo
input_valueTextThe text to be passed as output.

Outputs

NameDisplay NameInfo
textTextThe resulting text message.
Search