Skip to main content
Assemble Message Block Screenshot

Overview

The Assemble Message Block is designed to assemble a single chat message from multiple parts. It is similar to a Prompt Block, but it works with multimodal models, allowing you to include both text and images in the message. This block is particularly useful when working with multimodal LLMs such as GPT-4 Vision that can process both text and images simultaneously. The Assemble Message Block outputs a chat message in the same format as a Prompt Block.

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 block.

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

  1. Create an Assemble Message Block and set the Type to ‘user’.
  2. Create a Text Block and set the value to “Here is an image:”. Connect the output of the Text Block to the first input of the Assemble Message Block.
  3. Create an Image Block and browse for your image. Connect the output of the Image Block to the second input of the Assemble Message Block.
  4. Run the flow. The Message output of the Assemble Message Block 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 Block Example 1

Error Handling

The Assemble Message Block 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 blocks. Q: Can I use the Assemble Message Block 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 Block supports function/tool calls with assistant-type messages.

See Also