跳至主要内容

组装消息节点

Assemble Message Node Screenshot

概述

组装消息节点(Assemble Message Node)旨在将多个部分组合成一条聊天消息。它类似于提示节点(Prompt Node),但适用于多模态模型,允许您在消息中同时包含文本和图像。当使用能同时处理文本和图像的多模态LLM(如GPT-4 Vision)时,该节点特别有用。

Assemble Message节点可以与Image NodeURL Reference Node配合使用,在消息中包含图片。

Assemble Message节点输出的聊天消息格式与Prompt Node相同。

输入项

标题数据类型描述默认值备注
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.

示例1:组装包含文本和图片的用户消息

  1. 创建一个Assemble Message节点并将类型设置为'user'。
  2. 创建一个文本节点并将其值设为"这里是一张图片:"。将文本节点的输出连接到组装消息节点的第一个输入。
  3. 创建一个Image Node并浏览选择您的图像。将Image Node的输出连接到Assemble Message Node的第二个输入端口。
  4. 运行图形。Assemble Message节点的Message输出应包含一条用户消息,文本为"这是一张猫的图片:"以及(Image)文本,表示消息中包含一张图片。

Assemble Message Node Example 1

错误处理

如果启用了Type输入并将其设置为无效值,Assemble Message Node将会报错。

常见问题

问:我可以在一条消息中包含多张图片吗?

A: 是的,您可以通过连接多个输入节点在一条消息中包含多张图片。

问:我可以在函数工具调用中使用Assemble Message Node吗?

A: 是的,您可以将类型(Type)设置为'function'来组装一个函数响应工具调用消息。请注意,函数工具调用消息需要一个工具调用ID(Tool Call ID),可以通过Tool Call ID输入或设置提供。工具调用的输出是组装好的消息内容。

问:我可以在assistant类型的消息中包含函数调用吗?

A: 目前只有Prompt Node支持通过assistant类型的消息进行函数/工具调用。

另请参阅