Improve validation in structured generation columns
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
从 LLMStructuredColumnConfig 和附带的 test_serialization_pydantic_core_schema notebook 开始,然后检查 JSON Schema 和 gsonschema 当前如何验证结构化输出。将其与 #171 中描述的行为进行比较,尤其是写入 Parquet 的 Decimal 值。完成的标准是提出一种具体的、可序列化的方法,在不只依赖生成的 JSON schema 的情况下保留相关的 Pydantic 验证行为。
由索引模型根据 Issue 内容生成。
描述
Is your feature request related to a problem? Please describe.
We would like to store a Pydantic model inside the LLMStructuredColumnConfig, since it allows us to better validate the output. However, column configs need to be serializable. Because of that, we end up converting that to a JSON schema, and using gsonschema to do the validation.
Unfortunately, validating using the JSON schema is not as good as using the Pydantic model. Recently, for instance, we had an issue where models would generate either "price": "12.34" (converted to string) or "price": 12.34 (converted to float), both of which passed validation (price being a Decimal), and later would have issues writing to Parquet. See #171 for more details.
Describe the solution you'd like
It would be nice to be able to serialize the Pydantic model keeping features such as complex types, validators etc. One possibility would be creating our own serialization.
Describe alternatives you've considered
Alternative solutions include adding more info to the prompt, depending on the type; and standardizing types later, before writing to Parquet.
Additional context
See notebook attached (by @nabinchha) for one possibility on how to ser/de Pydantic models.
- 主要语言
- Python
- 星标
- 2.4k
- 派生
- 241
- 平均合并
- 21 小时 51 分钟
- 30 天内合并 PR
- 90
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
NVIDIA-NeMo/DataDesigner 的其他 Issue
-
Allow huggingface-hub 2.x (widen cap from <2 to <3)可能已有人在做 @davanstrien 于 3 天前认领。 未关闭enhancement triaged
难度 2/5 1-3 小时 新手友好度 72/100
NVIDIA-NeMo/DataDesigner#1110 · 1 条评论 ·
维护者通常 1 天内回复
-
Local seed path containing a single quote breaks the DuckDB query可能重新可做 关联的 PR 已关闭且未合并。 未关闭bug triaged
难度 2/5 1-3 小时 新手友好度 67/100
NVIDIA-NeMo/DataDesigner#1102 · 3 条评论 ·
维护者通常 1 天内回复
-
enforce \from future import annotations` via ruff FA102 rule`可能已有人在做 @chethanuk 于 52 天前认领。 未关闭task
难度 2/5 1-3 小时 新手友好度 82/100
NVIDIA-NeMo/DataDesigner#760 ·
维护者通常 1 天内回复
-
enhancement
难度 5/5 一周以上 新手友好度 18/100
NVIDIA-NeMo/DataDesigner#1125 ·
维护者通常 1 天内回复
-
Anthropic provider drops thinking blocks when replaying MCP tool-call turns可能已有人在做 @andreatnvidia 于 3 天前认领。 未关闭bug triaged
难度 4/5 3-5 天 新手友好度 68/100
NVIDIA-NeMo/DataDesigner#1118 · 2 条评论 ·
维护者通常 1 天内回复
查看 NVIDIA-NeMo/DataDesigner 的全部 Issue
相似的 Issue
-
question
难度 2/5 1-3 小时 新手友好度 62/100
conda-forge/vc-feedstock#132 ·
-
难度 2/5 1-3 小时 新手友好度 72/100
limitlessprojects/Go-Hybrid#3342 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
UKGovernmentBEIS/inspect_ai#6268 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
LSSTDESC/rail_sompz#42 ·
-
难度 2/5 1-3 小时 新手友好度 66/100
pytest-dev/pytest-forked#113 ·