mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #762] [CLOSED] serve: extract JSON from prose and code fences #2816
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#2816
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/762
Author: @cipgysmo
Created: 10/4/2026
Status: ❌ Closed
Base:
main← Head:fix/structured-json-extraction📝 Commits (1)
2cee7b2serve: extract JSON from prose and code fences📊 Changes
1 file changed (+38 additions, -1 deletions)
View changed files
📝
serve/structured.py(+38 -1)📄 Description
In tool-heavy runs, the model often returns valid JSON after a short explanation or inside a Markdown code fence.
validated_json()previously passed the whole assistant message tojson.loads(), so those otherwise-correct structured responses failed.This adds a small
_extract_json()helper that:{...}object,This was one of the highest-value fixes in our local dual-GPU tool-eval runs: it made structured output tolerant of normal model prose without changing the benchmark or forcing extra JSON-only prompts.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.