Skip to content

结构化输出解析器节点#

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

本页将介绍结构化输出解析器节点的参数配置,并提供更多相关资源链接。

/// 注意 | 子节点中的参数解析 子节点在使用表达式处理多个项目时的行为与其他节点不同。

大多数节点(包括根节点)会接收任意数量的输入项,处理这些项目,然后输出结果。您可以使用表达式来引用输入项,节点会依次为每个项目解析表达式。例如,给定五个 name 值作为输入,表达式 {{ $json.name }} 会依次解析为每个名称。

而在子节点中,表达式总是解析为第一个项目。例如,给定五个 name 值作为输入,表达式 {{ $json.name }} 总是解析为第一个名称。 ///

节点参数#

  • Schema 类型: 定义输出结构和验证规则。提供 schema 有两种方式:
  1. 从 JSON 示例生成:输入一个 JSON 对象示例来自动生成 schema。节点会使用对象属性的类型和名称,但会忽略实际值。
  2. 手动定义:手动输入 JSON schema。请参阅 JSON Schema 指南和示例来了解如何创建有效的 JSON schema。请注意,我们不支持 JSON schema 中的引用(使用 $ref)。

模板与示例#

Browse 结构化输出解析器 integration templates, or search all templates

相关资源#

更多关于该服务的信息,请参考 LangChain 的输出解析器文档

查看 n8n 的高级 AI 文档。

常见问题#

关于常见问题或错误及其解决方案,请参阅常见问题

AI glossary#

  • completion: Completions are the responses generated by a model like GPT.
  • hallucinations: Hallucination in AI is when an LLM (large language model) mistakenly perceives patterns or objects that don't exist.
  • vector database: A vector database stores mathematical representations of information. Use with embeddings and retrievers to create a database that your AI can access when answering questions.
  • vector store: A vector store, or vector database, stores mathematical representations of information. Use with embeddings and retrievers to create a database that your AI can access when answering questions.