Create Chat
Synopsis
This operator creates a new chat history containing past LLM interactions.
Description
The operator can either use a Prompt Record object from a past LLM interaction to construct the chat history from it, or it can use a specially formatted data table to construct a chat object out of it.
Input
Record
A prompt record which was returned by some other operator interacting with an LLM. All the submitted requests and the LLM response will be used as-is, no replacements will take place. Note: Make sure to set the chat_origin parameter to chat_origin.RECORD to use this port.
Data
A data table which contains at least the two columns specified in the operator parameters that contain both the message type (e.g. system, user, ai), as well as the actual message content of past interactions. All messages will be used as-is, no replacements will take place. Note: Make sure to set the chat_origin parameter to chat_origin.DATA_TABLE to use this port.
Output
Chat
The newly created chat object for use by e.g. Prompt or AI Agent operators.
Parameters
Chat Origin
This parameter allows you to select from which input port to create the chat history. It has the following options:
- RECORD: This option uses the Record input port. This is the default option.
- DATA_TABLE: This option uses the data input port. The data table needs to have the columns specified by the
col_message_typeandcol_message_contentparameters.
Type column
This parameter is available if and only if the chat_origin is set to Data table. It specifies the column in the data that holds the chat message type (one of system, user, ai).
Content column
This parameter is available if and only if the chat_origin is set to Data table. It specifies the column in the data that holds the chat message content string.
Discard system prompt
If selected, a potentially existing system prompt will be discarded and not be part of the chat history output.
Chat size limit
The maximum chat size that will be created by this operator. If the input contains more messages, the oldest ones will be discarded.