AI Protocol Parser: add ParserConfig for the wuffs JSON parser#46300
Draft
tyxia wants to merge 15 commits into
Draft
AI Protocol Parser: add ParserConfig for the wuffs JSON parser#46300tyxia wants to merge 15 commits into
tyxia wants to merge 15 commits into
Conversation
Member
Author
|
/retest |
Signed-off-by: tyxia <tyxia@google.com>
Signed-off-by: tyxia <tyxia@google.com>
Signed-off-by: tyxia <tyxia@google.com>
Signed-off-by: tyxia <tyxia@google.com>
Signed-off-by: tyxia <tyxia@google.com>
Member
Author
|
/retest |
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.
Introduces ParserConfig to bound the parsing and capture and control streaming JSON field
extraction on top of WuffsJsonCursor.
The use of ParserConfig are shown in the test handler, agentic(MCP/A2A) and LLM(openAI/Gemini) handler will be implemented in the next PRs.
Capture limitation, (TODO define good defaults)
rejected — dropped entirely
values. A value that would overflow the total is dropped without consuming
budget, so later smaller values still fit.
Two capture modes
Spec-based extraction (
extract_fields) — the operator declares exactlywhich fields to extract as pattern paths ("model", "params._meta.traceparent",
"messages[].role", "tools[].function.name").
Capture-all mode (
capture_all_scalars) — captures every scalar value(strings, numbers, booleans, nulls) at every depth to maxDepth
Clean-up and Clarification