Skip to main content

Inputs and Outputs

warning

This page may contain outdated information. It will be updated as soon as possible.

Inputs and Outputs are a category of components that are used to define where data comes in and out of your flow. They also dynamically change the Playground and can be renamed to facilitate building and maintaining your flows.

Inputs

Inputs are components used to define where data enters your flow. They can receive data from the user, a database, or any other source that can be converted to Text or Data.

The difference between Chat Input and other Input components is the output format, the number of configurable fields, and the way they are displayed in the Playground.

Chat Input components can output Text or Data. When you want to pass the sender name or sender to the next component, use the Data output. To pass only the message, use the Text output, useful when saving the message to a database or memory system like Zep.

You can find out more about Chat Input and other Inputs here.

Chat Input

This component collects user input from the chat.

Docusaurus themed imageDocusaurus themed image

Parameters

  • Sender Type: Specifies the sender type. Defaults to User. Options are Machine and User.
  • Sender Name: Specifies the name of the sender. Defaults to User.
  • Message: Specifies the message text. It is a multiline text input.
  • Session ID: Specifies the session ID of the chat history. If provided, the message will be saved in the Message History.
Note

If As Data is true and the Message is a Data, the data of the Data will be updated with the Sender, Sender Name, and Session ID.

One significant capability of the Chat Input component is its ability to transform the Playground into a chat window. This feature is particularly valuable for scenarios requiring user input to initiate or influence the flow.

Docusaurus themed imageDocusaurus themed image

Text Input

The Text Input component adds an Input field on the Playground. This enables you to define parameters while running and testing your flow.

Docusaurus themed imageDocusaurus themed image

Parameters

  • Value: Specifies the text input value. This is where the user inputs text data that will be passed to the next component in the sequence. If no value is provided, it defaults to an empty string.
  • Data Template: Specifies how a Data should be converted into Text.

The Data Template field is used to specify how a Data should be converted into Text. This is particularly useful when you want to extract specific information from a Data and pass it as text to the next component in the sequence.

For example, if you have a Data with the following structure:


_10
{
_10
"name": "John Doe",
_10
"age": 30,
_10
"email": "johndoe@email.com"
_10
}

A template with Name: {name}, Age: {age} will convert the Data into a text string of Name: John Doe, Age: 30.

If you pass more than one Data, the text will be concatenated with a new line separator.

Outputs

Outputs are components that are used to define where data comes out of your flow. They can be used to send data to the user, to the Playground, or to define how the data will be displayed in the Playground.

The Chat Output works similarly to the Chat Input but does not have a field that allows for written input. It is used as an Output definition and can be used to send data to the user.

You can find out more about it and the other Outputs here.

Chat Output

This component sends a message to the chat.

Parameters

  • Sender Type: Specifies the sender type. Default is "Machine". Options are "Machine" and "User".

  • Sender Name: Specifies the sender's name. Default is "AI".

  • Session ID: Specifies the session ID of the chat history. If provided, messages are saved in the Message History.

  • Message: Specifies the text of the message.

Note

If As Data is true and the Message is a Data, the data in the Data is updated with the Sender, Sender Name, and Session ID.

Text Output

This component displays text data to the user. It is useful when you want to show text without sending it to the chat.

Parameters

  • Value: Specifies the text data to be displayed. Defaults to an empty string.

The TextOutput component provides a simple way to display text data. It allows textual data to be visible in the chat window during your interaction flow.

Prompts

A prompt is the input provided to a language model, consisting of multiple components and can be parameterized using prompt templates. A prompt template offers a reproducible method for generating prompts, enabling easy customization through input variables.

Prompt

This component creates a prompt template with dynamic variables. This is useful for structuring prompts and passing dynamic data to a language model.

Docusaurus themed imageDocusaurus themed image

Parameters

  • Template: The template for the prompt. This field allows you to create other fields dynamically by using curly brackets {}. For example, if you have a template like Hello {name}, how are you?, a new field called name will be created. Prompt variables can be created with any name inside curly brackets, e.g. {variable_name}.

PromptTemplate

The PromptTemplate component enables users to create prompts and define variables that control how the model is instructed. Users can input a set of variables which the template uses to generate the prompt when a conversation starts.

After defining a variable in the prompt template, it acts as its own component input. See Prompt Customization for more details.

  • template: The template used to format an individual request.

Hi, how can I help you?