Uh oh!
There was an error while loading. Please reload this page.
feat(pydantic): add ToonPydanticModel with schema_to_toon() and from_toon() - #46
Conversation
johannschopplich
commented
Nov 29, 2025
LGTM README-wise, the rest is up to the @toon-format/python-maintainers. :) |
Ansarafsar
commented
Nov 29, 2025
via email
Thank you @*johannschopplich :)* …On Sat, 29 Nov 2025 at 14:34, Johann Schopplich ***@***.***> wrote:
***@***.**** approved this pull request.
—
Reply to this email directly, view it on GitHub
<#46 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AT5UVZBLT4AHBJAGVYG3Y7337FOTDAVCNFSM6AAAAACNPXFJ2WVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTKMRQGYYDKOJQGA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Ansarafsar
commented
Dec 15, 2025
Hi @toon-format/python-maintainers just a small follow up request on merging the PR :) |
Franky1
commented
Mar 3, 2026
What is preventing this pull request from being merged? |
Ansarafsar
commented
Mar 4, 2026
Idk, the maintainers haven't been reviewed this yet. |
grizzlybearg
commented
Mar 4, 2026
Would it be possible to update the branch‑protection rules so that the minimum number of required reviewers is set to two? This would help prevent useful PRs from being blocked when only one maintainer is available to review, while still maintaining a solid review standard. It also aligns with common open‑source practices where two approvals strike a good balance between code quality and contributor velocity. |
johannschopplich
commented
Mar 4, 2026
The required approvals is actually set to two. Of course, for the core maintainers. The inherent issue is that the maintainers don't seem to have the resources to work on the repo anymore. I'm searching new devs at this very moment. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
alesanfra
left a comment
There was a problem hiding this comment.
Thanks for this contribution, please take a look to the comments on the naming conventions and the use of poetry as build system
…model_validate_toon() methods; update tests accordingly
refactor(pydantic): rename from_toon, add model_dump_toon, drop poetry config
|
alesanfra
commented
May 20, 2026
LGTM, @Ansarafsar can you please check why some tests are failing? |
…clarity and consistency
Ansarafsar
commented
May 20, 2026
Sorted out bro :) |
Uh oh!
There was an error while loading. Please reload this page.
Description
Adds first-class Pydantic integration via an optional [
pydantic] extra. Users can install withpip install "toon-python[pydantic]"and inherit fromToonPydanticModelto get.schema_to_toon()(ultra-compact schema for prompts) and.from_toon()(parse raw TOON output directly into a validated model). Saves 50–60% tokens on schemas and eliminates JSON parsing errors completely.Key methods:
schema_to_toon()- Convert Pydantic schema to compact TOON formatfrom_toon()- Parse LLM TOON output into validated model instancesType of Change
Related Issues
Part of #44 (Agent framework integration – Pydantic AI request)
Changes Made
src/toon_format/pydantic/withToonPydanticModelmixintests/test_pydantic.pywith 4 comprehensive tests[pydantic]extra inpyproject.tomlREADME.mdwith clear installation + usage examplesSPEC Compliance
(Uses existing
encode/decode– 100 % spec-compliant)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
Additional Context
This + the already-open LangChain PR completes the two most requested agent-framework integrations from discussion #44.
TOON is now the cheapest, most reliable format for structured LLM output in 2025 – works perfectly with Instructor, Outlines, Marvin, LangChain agents, etc.
Fully optional – core users completely unaffected.
Thank you for the quick review – let’s make TOON the default for AI engineering!