Repository navigation
Parse genkit structured output with ChatTemplateEngine.parseRendered - #1574
Merged
Merged
Conversation
The public parse takes only a format and flags, so it cannot see how a render left the prompt's thought: after the stock Seed-OSS template it returns reasoning Plan for Plan</seed:think>Sunny., where llama.cpp and the engine return content. parseRendered takes the render result and parses through the engine's own parseRenderedOutput with its thought marks. parse is unchanged.
Structured output now parses as llamadart's engine parses its final message, from the render result, so a Seed-OSS reply after the stock template matches llama-server. parseRendered is new in llamadart 0.17.0, so the package floor and the workflow lower-bound pins move to 0.17.0.
13 tasks done
This was referenced Oct 29, 2026
# Conflicts: # lib/src/core/template/chat_template_engine.dart
Contributor
|
Chat app preview removed for |
This was referenced Oct 29, 2026
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.
Summary
genkit_llamadartstructured output parses withChatTemplateEngine.parseRendered(template, generatedText, ...)instead ofChatTemplateEngine.parse(template.format, ..., thinkingForcedOpen, parser), so it matches llamadart's engine and llama.cpp 620d2225: after the stock Seed-OSS template,Plan</seed:think>{...}is content (and fails JSON validation) instead of reasoningPlanplus the JSON. The old call also never passed the template-closed thought mark, whichparseRenderedreads from the render.parseRenderedis new in llamadart 0.17.0, so the package floor moves tollamadart: ^0.17.0and the lower-bound/publish workflow pins to[email protected](genkit_llamadart_floor_pin_test.dartenforces they match). README, migration guide, tool-schema guide, changelog (## Unreleased) and the website Genkit page follow; the website keeps the published 3.5.0 / 0.16.1 pairing and notes the next release targets 0.17.How it ships: blocked until llamadart 0.17.0 is on pub.dev. The adapter's published-dependency lane and the lower-bound lane resolve hosted llamadart, so they fail before then by design. After the core 0.17.0 publish: retarget to
main(once #1573 merges), rerun CI, audit, merge; then a separate two-file genkit release prep (release/genkit_llamadart-vX.Y.Z) perwebsite/docs/maintainers/genkit-package.md. It can fold into the planned genkit 0.17 move (#1211 part 2) if that lands first.Production-readiness scope
Completeness checklist
PR type guidance
parse, which cannot see how the render left the thought. Regression testparses_structured_output_from_its_render_test.dart(FakeRuntime with realChatTemplateEngine.renderresults): fails at the old call (the stock Seed-OSS stray end tag was accepted as reasoning), passes now.Test Plan
dart run tool/prepare_workspace.dartdart format --output=none --set-exit-if-changed .dart analyzeN/A at root for the adapter; packagedart analyze --fatal-infospasses against checkout coredart test -p vm -j 1 --exclude-tags local-onlyN/A: no root change beyond Add ChatTemplateEngine.parseRendered to parse a reply as the engine does #1573;test/unit/tooling/genkit_llamadart_floor_pin_test.dartpassesdart test -p chrome --exclude-tags local-onlyN/A locally; CI runs the adapter browser lanepackages/genkit_llamadartwith a checkout-corepubspec_overrides.yaml(as CI's second phase):dart pub get, format,dart analyze --fatal-infos,python3 .github/check_docs.py,dart test -x real-model(+467). Published-core and lower-bound lanes: blocked on the 0.17.0 publish.Matrix Evidence
structured-output-adversarialhigh-risk-exact-head-independent-qa/opt/UnitySrc/personal/llama/llamadart-evidence/pr-1574/evidence-1574-035a566.jsonrelease-metadata-verificationlitert-lm-json-schemaReview Notes
High-risk regression review