-
Notifications
You must be signed in to change notification settings - Fork 41
feat(langchain): add ToonSerializer and ToonOutputParser #45
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
base: main
Are you sure you want to change the base?
feat(langchain): add ToonSerializer and ToonOutputParser #45
Conversation
|
PR ready for review!
This is the #1 requested feature for RAG/agent developers who want cheaper prompts. Happy to add benchmarks, more tests, or a docs page if needed — just let me know! Thanks for the quick review |
Co-authored-by: Johann Schopplich <[email protected]>
Added LangChain integration details and usage examples.
johannschopplich
left a comment
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.
Thanks for the updates LGTM (README-wise). As for the code and usefulness, @toon-format/python-maintainers shall decide. :)
|
Thanks for the approval Johann :)
…On Fri, 28 Nov 2025, 12:09 pm Johann Schopplich, ***@***.***> wrote:
***@***.**** approved this pull request.
Thanks for the updates LGTM (README-wise). As for the code and usefulness,
@toon-format/python-maintainers
<https://github.com/orgs/toon-format/teams/python-maintainers> shall
decide. :)
—
Reply to this email directly, view it on GitHub
<#45 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AT5UVZF7F3C6SRIGYBLDAVT367U2TAVCNFSM6AAAAACNMWFKA6VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTKMJXGY2DAOBXGM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Description
Adds an optional LangChain integration as an extra dependency. Users can install with
pip install "toon-python[langchain]"and usefrom toon_format.langchain import ToonSerializerto convert Documents to compact TOON format, saving 30-60% tokens in RAG and agent prompts.Type of Change
Related Issues
Closes # (no issue yet, this is the first LangChain request)
Changes Made
src/toon_format/langchain/withToonSerializerandToonOutputParsertests/test_langchain.pywith 2 tests[langchain]extra inpyproject.tomlSPEC Compliance
Testing
Test Output
Code Quality
ruff check src/toon_format tests- no issuesruff format src/toon_format tests- code formattedmypy src/toon_format- no critical errorspytest tests/ -vChecklist
Performance Impact
Breaking Changes
Screenshots / Examples
Output:
Additional Context
This is a fully optional integration. Core users are unaffected. After the next release, LangChain developers can save significant tokens in prompts with just one line of code.
Checklist for Reviewers