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.
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.
Parameters
Inputs
Name
Display Name
Info
input_value
Text
The Message to be passed as input.
should_store_message
Store Messages
Store the message in the history.
sender
Sender Type
The type of sender.
sender_name
Sender Name
The name of the sender.
session_id
Session ID
The unique identifier for the chat session. If empty, the current session ID parameter is used.
files
Files
The files to be sent with the message.
background_color
Background Color
The background color of the icon.
chat_icon
Icon
The icon of the message.
text_color
Text Color
The text color of the name.
Outputs
Name
Display Name
Info
message
Message
The resulting chat message object with all specified properties.
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.
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 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.
To use the Chat Input and Chat Output components in a flow, connect them to components that accept or send the Message type.
For this example, connect a Chat Input component to an OpenAI model component’s Input port, and then connect the OpenAI model component’s Message port to the Chat Output component.
In the OpenAI model component, in the OpenAI API Key field, add your OpenAI API key.
The flow looks like this:
To send a message to your flow, open the Playground and then enter a message. The OpenAI model component responds. Optionally, in the OpenAI model component, enter a System Message to control the model’s response.
In the LLM Controls UI, click your flow name, and then click Logs. The Logs pane opens. Here, you can inspect your component logs.
Your first message was sent by the Chat Input component to the OpenAI model component. Click Outputs to view the sent message:
Your second message was sent by the OpenAI model component to the Chat Output component. This is the raw text output of the model’s response. The Chat Output component accepts this text as input and presents it as a formatted message. Click Outputs to view the sent message:
tipOptionally, to view the outputs of each component in the flow, click Inspect output.
The Chat Input component is often the entry point for passing messages to the LLM Controls API. To send the same example messages programmatically to your LLM Controls server, do the following:
To get your LLM Controls endpoint, click Publish, and then click API access.
Copy the command from the cURL tab, and then paste it into your terminal. It looks similar to this:
Modify input_value so it contains the question, What's the recommended way to install Docker on Mac M1?.Note the output_type and input_type parameters that are passed with the message. The chat type provides additional configuration options, and the messages appear in the Playground. The text type returns only text strings and does not appear in the Playground.
Add a custom session_id to the message’s data object. The custom session_id value starts a new chat session between your client and the LLM Controls server, and can be useful in keeping conversations and AI context separate.
Send the POST request. Your request is answered.
Navigate to the Playground. A new chat session called docker-question-on-m1 has appeared, using your unique session_id.
To modify additional parameters with Tweaks for your Chat Input and Chat Output components, click Publish, and then click API access.
Click Tweaks to modify parameters in the component’s data object. For example, disabling storing messages from the Chat Input component adds a Tweak to your command:
To confirm your command is using the tweak, navigate to the Logs pane and view the request from the Chat Input component. The value for should_store_message is false.