跳转到内容
Agentic Workflowdocs
v0.8.2免费安装

节点 / builtin / ai / aidependencies / outputparser

Auto-fixing Output Parser

Wraps another output parser and retries with a model when the output fails to parse

AI 扩展程序网页应用

此内容尚不支持你的语言。

Wrap another output parser so a model repairs replies that fail to parse, instead of the run failing.

Auto-fixing Output Parser is not a step on its own: it has no output port and never runs by itself. You plug it into the Output Parser slot of an AI node, in place of the parser you would normally use.

It needs two nodes of its own: a base parser (for example Structured Output Parser) on Base Parser, and a chat model on Model. The base parser still decides the format. When a reply does not parse, this node sends the broken reply, the error and the format instructions to its model, asks for a corrected version, and parses that. It tries to fix a reply once; if the corrected reply also fails, the run fails.

  • The model usually returns good JSON but sometimes adds a stray sentence or a missing quote.
  • You use a small or on-device model that is less reliable with formats.
  • A failed run is costly, for example in a scheduled workflow nobody watches.

If the model gets the format wrong most of the time, choose a stronger model on the AI node instead: each fix is an extra model call.

This node has no settings.

Everything is set on the two connected nodes: the format on the base parser, the fixing model on the model node.

This node has no output port. It plugs into a slot on another node instead of passing items along.

The node it is plugged into returns the same data as with the base parser alone, for example an object in response.

SlotAcceptsConnections
Model (必填)chat modelOne node.
Base Parser (必填)output parserOne node.
  1. Get Selected Text reads a highlighted job post, with Output field name text.
  2. Basic LLM Chain with Prompt Extract the job details from: {{ $input.text }}, and an Ollama model on its Model slot.
  3. Auto-fixing Output Parser connected to the Output Parser slot of Basic LLM Chain.
  4. On Auto-fixing Output Parser, connect a Structured Output Parser to Base Parser with JSON Output Example { "title": "Designer", "company": "Acme", "remote": true }, and an OpenAI model to Model.

The local model does the work; OpenAI is only called when its reply needs repair.

  • “Dependency model is required” or “Dependency parser is required”. Connect a chat model to Model and a parser to Base Parser. Both are required.
  • “Model not found”. The model node on Model is not set up: open it and choose a model and its credential.
  • “Base output parser not found”. The node on Base Parser gave no parser. Reconnect a Structured Output Parser or Item List Output Parser and check its settings.
  • “Failed to parse” even with this node. The fixing model’s answer also failed. Simplify the base parser’s format, or connect a stronger model to Model.
编辑此页

最近更新:

Was this page useful?
向 Aria 询问“Auto-fixing Output Parser”