-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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): Refactor Output Parsers and Improve Error Handling #11148
Merged
OlegIvaniv
merged 8 commits into
master
from
ai-362-output-parser-errors-appear-on-chain-and-not-on-sub-node
Oct 22, 2024
Merged
feat(Structured Output Parser Node): Refactor Output Parsers and Improve Error Handling #11148
OlegIvaniv
merged 8 commits into
master
from
ai-362-output-parser-errors-appear-on-chain-and-not-on-sub-node
Oct 22, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…n-and-not-on-sub-node
…n-and-not-on-sub-node
n8n-assistant
bot
added
n8n team
Authored by the n8n team
ui
Enhancement in /editor-ui or /design-system
labels
Oct 7, 2024
OlegIvaniv
changed the title
refactor(Structured Output Parser Node): Refactor Output Parsers and Improve Error Handling
feat(Structured Output Parser Node): Refactor Output Parsers and Improve Error Handling
Oct 8, 2024
burivuhster
reviewed
Oct 10, 2024
...angchain/nodes/output_parser/OutputParserAutofixing/test/OutputParserAutofixing.node.test.ts
Outdated
Show resolved
Hide resolved
burivuhster
requested changes
Oct 10, 2024
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.
Awesome job! And kudos for writing tests.
I have only one comment about auto-fixing parser test case, could you please check?
burivuhster
previously approved these changes
Oct 22, 2024
n8n Run #7478
Run Properties:
|
Project |
n8n
|
Branch Review |
ai-362-output-parser-errors-appear-on-chain-and-not-on-sub-node
|
Run status |
Passed #7478
|
Run duration | 04m 17s |
Commit |
0d6d5d190f: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 OlegIvaniv 🗃️ e2e/*
|
Committer | Oleg Ivaniv |
View all properties for this run ↗︎ |
Test results | |
---|---|
Failures |
0
|
Flaky |
2
|
Pending |
0
|
Skipped |
0
|
Passing |
458
|
View all changes introduced in this branch ↗︎ |
✅ All Cypress E2E specs passed |
burivuhster
approved these changes
Oct 22, 2024
✅ All Cypress E2E specs passed |
OlegIvaniv
deleted the
ai-362-output-parser-errors-appear-on-chain-and-not-on-sub-node
branch
October 22, 2024 08:47
Merged
Got released with |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR refactors our output parser implementation, extracting them into individual classes and improving error handling, particularly for structured output parsers. These changes should improve our ability to provide user-friendly error messages while maintaining the functionality of the auto-fixing parser.
N8nStructuredOutputParser
now includes acontext
property to handle execution context and supports custom error mapping.N8nOutputFixingParser
integrates with the structured parser to attempt fixing invalid outputs.N8nItemListOutputParser
retains its functionality but is now part of the new parser structure.getOptionalOutputParsers
utility to work with the new parser types.Changes
Extracted output parsers into separate classes:
N8nStructuredOutputParser
N8nOutputFixingParser
N8nItemListOutputParser
Implemented error mapping in
N8nStructuredOutputParser
to allow for both user-friendly error messages and proper error handling in the auto-fixing parser.Removed proxy wrapping from
logWrapper
and instead manually populate input/output data from each parser class.Updated relevant nodes and utility functions to use the new parser classes.
Adjusted test files to reflect the new structure and functionality and added tests for
N8nOutputFixingParser
andN8nItemListOutputParser
nodes.Related Linear tickets, Github issues, and Community forum posts
Review / Merge checklist
release/backport
(if the PR is an urgent fix that needs to be backported)