Assemble Message Node
Overview
The Assemble Message Node is designed to assemble a single chat message from multiple parts. It is similar to a Prompt Node, but it works with multimodal models, allowing you to include both text and images in the message. This node is particularly useful when working with multimodal LLMs such as GPT-4 Vision that can process both text and images simultaneously.
The Assemble Message Node can be used in conjunction with the Image Node or URL Reference Node to include images in a message.
The Assemble Message Node outputs a chat message in the same format as a Prompt Node.
- Inputs
- Outputs
- Editor Settings
Inputs
Title | Data Type | Description | Default Value | Notes |
---|---|---|---|---|
Part N | string /string[] /image /image[] | A part of the message to assemble. Arrays connected to inputs will be flattened, so connecting a single image[] connection will put multiple images into the message. | N/A | Dynamic number of input ports based on how many inputs are already connected to the node. |
Outputs
Title | Data Type | Description | Notes |
---|---|---|---|
Message | chat-message | The assembled chat message. The message will be in the same format as a message from a Prompt Node. | The output will be a chat message containing the assembled data. The type of the message will be the specified type. |
Editor Settings
Setting | Description | Default Value | Use Input Toggle | Input Data Type |
---|---|---|---|---|
Type | The type of message to assemble. The value should be either 'system', 'user', 'assistant', or 'function'. | 'user' | Yes | string |
Example 1: Assemble a user message with text and an image
- Create an Assemble Message Node and set the Type to 'user'.
- Create a Text Node and set the value to "Here is an image:". Connect the output of the Text Node to the first input of the Assemble Message Node.
- Create an Image Node and browse for your image. Connect the output of the Image Node to the second input of the Assemble Message Node.
- Run the graph. The
Message
output of the Assemble Message Node should contain a user message with the text "Here is an image of a cat:" and the text(Image)
indicating that an image is included in the message.
Error Handling
The Assemble Message Node will error if the Type
input is enabled and is set to an invalid value.
FAQ
Q: Can I include multiple images in a message?
A: Yes, you can include multiple images in a message by connecting multiple input nodes.
Q: Can I use the Assemble Message Node with a function tool call?
A: Yes, you can set the Type to 'function' to assemble a function response tool call message. Note that function tool call messages require a Tool Call ID, which can be provided via the Tool Call ID
input or setting. The output of the tool call is the assembled message content.
Q: Can I include a function call with an assistant
-type message?
A: At this time, only the Prompt Node supports function/tool calls with assistant
-type messages.