Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Accept valid bare JSON in structured response recipes

クローズ
#971 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@lipikaramaswamy がすでに取り組んでいます。

2026年9月30日 から。

  • #972 @lipikaramaswamy による — オープン

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python

調査の方向性

Start with packages/data-designer-engine/src/data_designer/engine/models/recipes/response_recipes.py and trace LLMResponseParser through packages/data-designer-engine/src/data_designer/engine/models/parsers/postprocessors.py, especially merge_text_blocks and deserialize_json_code. Run the reproduction in the issue for both recipes. Done means valid bare JSON is accepted and schema-validated as a fallback, while fenced JSON and invalid or prose-embedded responses retain their existing behavior.

索引モデルが issue の本文から書いたものです。

説明

bug
Priority Level

Medium (Annoying but has workaround)

Describe the bug

While using Data Designer 0.9.1 for structured-output columns in NeMo Anonymizer, we encountered model responses containing valid bare JSON that were rejected because they were not wrapped in a Markdown json code fence. Wrapping the same response in a fence made it parse successfully.

This is reproducible with both PydanticResponseRecipe and StructuredResponseRecipe, without making any model calls. A formatting-only difference can therefore cause a valid structured response to fail parsing.

Steps/Code to reproduce bug

With data-designer==0.9.1 installed:

from pydantic import BaseModel

from data_designer.engine.models.recipes.response_recipes import (
    PydanticResponseRecipe,
    StructuredResponseRecipe,
)


class Result(BaseModel):
    answer: int


raw = '{"answer": 42}'
recipes = (
    PydanticResponseRecipe(data_type=Result),
    StructuredResponseRecipe(json_schema=Result.model_json_schema()),
)

for recipe in recipes:
    for label, response in (
        ("bare", raw),
        ("fenced", f"```json\n{raw}\n```"),
    ):
        try:
            print(type(recipe).__name__, label, "OK", recipe.parse(response))
        except Exception as exc:
            print(type(recipe).__name__, label, type(exc).__name__, str(exc))

Actual output:

PydanticResponseRecipe bare ParserException No parsable JSON structure within ```json markdown fence.
PydanticResponseRecipe fenced OK answer=42
StructuredResponseRecipe bare ParserException No parsable JSON structure within ```json markdown fence.
StructuredResponseRecipe fenced OK {'answer': 42}
Expected behavior

Both recipes should accept a response consisting entirely of valid bare JSON as a fallback when fenced JSON parsing finds no usable JSON block. The parsed value must still pass the recipe's existing schema validation.

Existing fenced JSON behavior should continue to work. This request does not require extracting JSON embedded in arbitrary prose or accepting schema-invalid responses.

Agent Diagnostic / Prior Investigation
  • An agent ran the reproduction above against data-designer-engine==0.9.1 and confirmed the output for both recipes.
  • Inspected the tagged v0.9.3 source and the local main checkout at d2470a43dcaf8c5d3babbc0fd2f8631139d40509; both recipes retain the fenced-block parsing path.
  • In packages/data-designer-engine/src/data_designer/engine/models/recipes/response_recipes.py, both recipes use LLMResponseParser with merge_text_blocks and deserialize_json_code, then select a StructuredDataBlock before schema validation.
  • In packages/data-designer-engine/src/data_designer/engine/models/parsers/postprocessors.py, deserialize_json_code processes only CodeBlock objects whose language is json. Bare JSON remains a text block, leaving no structured block for the recipe to validate.
  • Searched the current documentation and GitHub issues/PRs for bare JSON and code-fence parsing; no matching issue or documented bare-JSON fallback was found.
Additional context

We will implement the fallback and contribute a PR with regression tests for both recipes.

Checklist
  • I reproduced this issue or provided a minimal example
  • I searched the docs/issues myself, or had my agent do so
  • If I used an agent, I included its diagnostics above
主要言語
Python
スター
2.3k
フォーク
219
平均マージ
1日 21時間
マージ済み PR(30日)
38

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

NVIDIA-NeMo/DataDesigner のほかの issue

NVIDIA-NeMo/DataDesigner の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。