[FEAT]: Introduce TOON Encoding for Token Optimization in AI Assistant #456
Closed
Vatsal-Verma wants to merge 5 commits intoaccordproject:mainfrom
Closed
[FEAT]: Introduce TOON Encoding for Token Optimization in AI Assistant #456Vatsal-Verma wants to merge 5 commits intoaccordproject:mainfrom
Vatsal-Verma wants to merge 5 commits intoaccordproject:mainfrom
Conversation
Signed-off-by: Vatsal-Verma <lastav1234@gmail.com>
✅ Deploy Preview for ap-template-playground ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Signed-off-by: Vatsal-Verma <lastav1234@gmail.com>
Contributor
Author
5 tasks
|
This PR is stale because it has been open 15 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
|
This PR is stale because it has been open 15 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
This file contains hidden or 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
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.


Problem
The AI Assistant in Template Playground currently injects raw JSON agreement data into prompts when assisting users with TemplateMark, Concerto models, or explanations.
For medium-to-large agreements, this leads to:
Key Features:
how this works
1 → User Input
TemplateMark, Concerto, and JSON data from the Playground editors
2 → TOON Encoding
JSON agreement data is encoded into TOON for token optimization
3 → API Request
TOON-encoded context is sent to the AI via a standard JSON API call
4 → AI Processing
The model uses TOON only as internal context
5 → AI Response
Normal JSON response with generated code or suggestions
6 → User Output
Results shown in standard editor formats (no TOON exposure)
Sample format
JSON
TOON Format:
Reference
https://github.com/toon-format/toon
Result
handling pr #446