Accept valid bare JSON in structured response recipes
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 78/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- python
- Lĩnh vực
- backend-api-design
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.1and 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 useLLMResponseParserwithmerge_text_blocksanddeserialize_json_code, then select aStructuredDataBlockbefore schema validation. - In
packages/data-designer-engine/src/data_designer/engine/models/parsers/postprocessors.py,deserialize_json_codeprocesses onlyCodeBlockobjects whose language isjson. 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
- Ngôn ngữ chính
- Python
- Star
- 2.4k
- Fork
- 241
- Merge trung bình
- 1 ngày 19 phút
- Pull request đã merge (30 ngày)
- 84
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của NVIDIA-NeMo/DataDesigner
-
Local seed path containing a single quote breaks the DuckDB queryCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
NVIDIA-NeMo/DataDesigner#1102 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Code validation repeats the first result for subsequent target columnsCó thể đã có người làm @edjson đã nhận hôm nay. Đang mởbug triaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
NVIDIA-NeMo/DataDesigner#1092 · 2 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enforce \from future import annotations` via ruff FA102 rule`Có thể đã có người làm @chethanuk đã nhận 48 ngày trước. Đang mởtask
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
NVIDIA-NeMo/DataDesigner#760 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Complete Slurm proxy health integration, draining, telemetry, and overload validationCó thể đã có người làm @nabinchha đã nhận hôm nay. Đang mởtask
NVIDIA-NeMo/DataDesigner#1103 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
task
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 38/100
NVIDIA-NeMo/DataDesigner#1094 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của NVIDIA-NeMo/DataDesigner
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
microsoft/agent-lightning#661 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
area/profiles comp/cli P3 type/feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
NousResearch/hermes-agent#146372 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] OpenAI-compatible embedding model alias breaks embedder constructionCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[oblt-aw][autodoc] Document obs-aw-automerge contract and fix automerge doc inconsistenciesCó thể đã có người làm @github-actions đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
GeoSeries scale and skew tests fail with pytest 9.2.0Có thể đã có người làm @jiayuasu đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày