-
Notifications
You must be signed in to change notification settings - Fork 33.8k
feat(Structured Output Parser Node): Add auto-fix support to Strucutred Output Parser #15915
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(Structured Output Parser Node): Add auto-fix support to Strucutred Output Parser #15915
Conversation
…output parser nodes
@@ -163,7 +173,7 @@ function onCommunityNodeTooltipClick(event: MouseEvent) { | |||
:is-trigger="isTrigger" | |||
:is-official="isOfficial" | |||
:data-test-id="dataTestId" | |||
:tag="nodeType.tag" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nodeType.tag
was typed string | undefined
but this component expects an object, so I don't think this would've worked before - but it also looks like no nodes used this mechanism. I did fix the typing issue on the computed value now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice 👍
Codecov ReportAttention: Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cubic found 11 issues across 6 files. Review them in cubic.dev
React with 👍 or 👎 to teach cubic. Tag @cubic-dev-ai
to give specific feedback.
...8n/nodes-langchain/nodes/output_parser/OutputParserStructured/OutputParserStructured.node.ts
Show resolved
Hide resolved
...8n/nodes-langchain/nodes/output_parser/OutputParserStructured/OutputParserStructured.node.ts
Show resolved
Hide resolved
...8n/nodes-langchain/nodes/output_parser/OutputParserStructured/OutputParserStructured.node.ts
Show resolved
Hide resolved
@@ -0,0 +1,16 @@ | |||
export const NAIVE_FIX_PROMPT = `Instructions: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate implementation of NAIVE_FIX_PROMPT that already exists in other files. Consider importing from a shared location instead of duplicating.
export const NAIVE_FIX_PROMPT = `Instructions: | |
export { NAIVE_FIX_PROMPT } from '../../../utils/output_parsers/prompt'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Intentionally took a copy of it to make this independent of the old auto-fixing node.
...angchain/nodes/output_parser/OutputParserStructured/test/OutputParserStructured.node.test.ts
Show resolved
Hide resolved
...angchain/nodes/output_parser/OutputParserStructured/test/OutputParserStructured.node.test.ts
Show resolved
Hide resolved
packages/frontend/editor-ui/src/components/Node/NodeCreator/ItemTypes/NodeItem.vue
Show resolved
Hide resolved
packages/frontend/editor-ui/src/components/Node/NodeCreator/ItemTypes/NodeItem.vue
Show resolved
Hide resolved
packages/frontend/editor-ui/src/components/Node/NodeCreator/ItemTypes/NodeItem.vue
Show resolved
Hide resolved
packages/frontend/editor-ui/src/components/Node/NodeCreator/ItemTypes/NodeItem.vue
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work 👏
inputs: [], | ||
inputs: `={{ | ||
((parameters) => { | ||
if (parameters?.autoFix) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, I think we really need to work on the inputs being loaded dynamically in the NDV.
@@ -163,7 +173,7 @@ function onCommunityNodeTooltipClick(event: MouseEvent) { | |||
:is-trigger="isTrigger" | |||
:is-official="isOfficial" | |||
:data-test-id="dataTestId" | |||
:tag="nodeType.tag" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice 👍
Workflow Test Results 📊 🔴 2 Failed,
|
Workflow ID | Workflow Name | Reason |
---|---|---|
237 | BasicLLMChain:AzureChat | Workflow contains 1 deleted data. |
258 | Agent:auto-fix:openai | Workflow contains 2 deleted data. |
⚠️ Warnings (4)
Workflow ID | Workflow Name | Reason |
---|---|---|
35 | Slack:User:getPresence info:UserProfile:get update... | Workflow contains new data that previously did not exist. |
53 | ConvertKit:CustomField:create getAll update delete... | Workflow contains new data that previously did not exist. |
257 | Agent:auto-fix:anthropic | Workflow contains new data that previously did not exist. |
48 | Asana:Project:getAll get:Task:create update move g... | Workflow contains new data that previously did not exist. |
✅ All Cypress E2E specs passed |
Got released with |
Summary
This PR merges
Auto-fixing Output Parser
auto-fix functionality toStructured Output Parser
node. User can now turn on Auto-Fix on these nodes, and optionally provide a custom prompt instructions for fixing the output like on the auto-fixing node. If Auto-Fix mode is enabled a Model input has to be connected to the node.autofix.mp4
With this change
Auto-fixing Output Parser
is should be considered deprecated, as theStructured Output Parser
now offers the same functionality. The old node is still kept available for now, with a 'Deprecated' tag on it and we may remove it in the future.This is the first time we're displaying such 'Deprecated' tag - to display it, make node's description contain string "deprecated". In future we may want to add a way to add tags node definitions.
Related Linear tickets, Github issues, and Community forum posts
https://linear.app/n8n/issue/ADO-3549/merge-auto-fixing-and-structured-output-nodes
Review / Merge checklist
release/backport
(if the PR is an urgent fix that needs to be backported)