Skip to main content

Assemble Message Node

Assemble Message Node Screenshot

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

TitleData TypeDescriptionDefault ValueNotes
Part Nstring/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/ADynamic number of input ports based on how many inputs are already connected to the node.

Example 1: Assemble a user message with text and an image

  1. Create an Assemble Message Node and set the Type to 'user'.
  2. 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.
  3. 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.
  4. 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.

Assemble Message Node Example 1

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.

See Also