Skip to content

fix(langchain): improve output parsing in xml agent #3975

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

Merged
merged 4 commits into from
Apr 28, 2025

Conversation

jmlon
Copy link
Contributor

@jmlon jmlon commented Jan 10, 2024

Fixed problem with handling of closing XML tags.
Fixed posible nulls returned by the match function.

@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Jan 10, 2024
Copy link

vercel bot commented Jan 10, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
langchainjs-docs ✅ Ready (Inspect) Visit Preview Apr 28, 2025 11:12am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
langchainjs-api-refs ⬜️ Ignored (Inspect) Visit Preview Apr 28, 2025 11:12am

@VishulaKnow
Copy link

VishulaKnow commented Apr 8, 2024

Hello. Could you please let me know if there are any plans to complete this pull request soon? I'm currently encountering the issue where closing tags end up in the result as well. It would be greatly appreciated if this fix could be included in the update. If you're short on time, would it be possible for me to create a pull request myself? For instance, I could take the implementation from the Python version: https://api.python.langchain.com/en/latest/_modules/langchain/agents/output_parsers/xml.html#XMLAgentOutputParser

@jacoblee93 jacoblee93 self-assigned this Apr 9, 2024
@jacoblee93
Copy link
Collaborator

Hey @VishulaKnow, will take it over!

@benjamincburns
Copy link
Collaborator

Sorry it took so long to get this merged, and thanks for the contribution @jmlon!

@benjamincburns benjamincburns changed the title Update output_parser.ts fix(langchain): improve output parsing in xml agent Apr 28, 2025
@benjamincburns benjamincburns merged commit a52cdbc into langchain-ai:main Apr 28, 2025
29 of 30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto:bug Related to a bug, vulnerability, unexpected error with an existing feature size:S This PR changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants