Skip to content

结构化输出解析器节点#

¥Structured Output Parser node

使用结构化输出解析器节点根据 JSON Schema 返回字段。

¥Use the Structured Output Parser node to return fields based on a JSON Schema.

本页提供结构化输出解析器节点的参数以及更多资源的链接。

¥On this page, you'll find the node parameters for the Structured Output Parser node, and links to more 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

  • 架构类型:定义输出结构和验证。你可以通过两种方式提供模式:

¥Schema Type: Define the output structure and validation. You have two options to provide the schema:

  1. Generate from JSON Example: Input an example JSON object to automatically generate the schema. The node uses the object property types and names. It ignores the actual values. n8n treats every field as mandatory when generating schemas from JSON examples.
  2. Define using JSON Schema: Manually input the JSON schema. Read the JSON Schema guides and examples for help creating a valid JSON schema. Please note that we don't support references (using $ref) in JSON schemas.

模板和示例#

¥Templates and examples

Template widget placeholder.

相关资源#

¥Related resources

有关服务的更多信息,请参阅 LangChain 的输出解析器文档

¥Refer to LangChain's output parser documentation for more information about the service.

View n8n's Advanced AI documentation.

常见问题#

¥Common issues

有关常见问题或建议的解决方案,请参阅 常见问题

¥For common questions or issues and suggested solutions, refer to Common issues.