Skip to content

模型选择器#

¥Model Selector

模型选择器节点会在工作流执行期间,根据一组定义的条件动态选择一个已连接的语言模型。此功能可实现错误处理回退机制,或为特定任务选择最佳模型。

¥The Model Selector node dynamically selects one of the connected language models during workflow execution based on a set of defined conditions. This enables implementing fallback mechanisms for error handling or choosing the optimal model for specific tasks.

此页面涵盖模型选择器节点的节点参数,并包含指向相关资源的链接。

¥This page covers node parameters for the Model Selector node and includes links to related resources.

Parameter resolution in sub-nodes

Sub-nodes behave differently to other nodes when processing multiple items using an expression.

Most nodes, including root nodes, take any number of items as input, process these items, and output the results. You can use expressions to refer to input items, and the node resolves the expression for each item in turn. For example, given an input of five name values, the expression {{ $json.name }} resolves to each name in turn.

In sub-nodes, the expression always resolves to the first item. For example, given an input of five name values, the expression {{ $json.name }} always resolves to the first name.

节点参数#

¥Node parameters

输入数量#

¥Number of Inputs

指定可用于附加语言模型的输入连接数。

¥Specifies the number of input connections available for attaching language models.

规则#

¥Rules

每条规则定义了在特定条件匹配时要使用的模型。

¥Each rule defines the model to use when specific conditions match.

模型选择器节点会从第一个输入开始,按顺序评估规则,并在找到匹配项后立即停止评估。这意味着,如果多个规则匹配,n8n 将仅使用第一个匹配规则定义的模型。

¥The Model Selector node evaluates rules sequentially, starting from the first input, and stops evaluation as soon as it finds a match. This means that if multiple rules would match, n8n will only use the model defined by the first matching rule.

模板和示例#

¥Templates and examples

Template widget placeholder.

相关资源#

¥Related resources

View n8n's Advanced AI documentation.