data-designer
Use when the user wants to create a dataset, generate synthetic data, or build a data generation pipeline.
Install
npx skills add https://github.com/NVIDIA/skills/tree/main/skills/data-designer
claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install nvidia-skills@llmmart
git clone https://github.com/NVIDIA/skills.git
The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole nvidia/skills collection as a plugin from our marketplace. Git is the plain clone.
Skill manifest
Before You Start
Do not explore the workspace first. The workflow's Learn step gives you everything you need.
Goal
Build a synthetic dataset using the Data Designer library that matches this description:
$ARGUMENTS
Workflow
Use Autopilot mode if the user implies they don't want to answer questions — e.g., they say something like "be opinionated", "you decide", "make reasonable assumptions", "just build it", "surprise me", etc. Otherwise, use Interactive mode (default).
Read only the workflow file that matches the selected mode, then follow it:
- Interactive → read
workflows/interactive.md - Autopilot → read
workflows/autopilot.md
Rules
- Keep all columns in the output by default. The only exceptions for dropping a column are: (1) the user explicitly asks, or (2) it is a helper column that exists solely to derive other columns (e.g., a sampled person object used to extract name, city, etc.). When in doubt, keep the column.
- Do not suggest or ask about seed datasets. Only use one when the user explicitly provides seed data or asks to build from existing records. When using a seed, read
references/seed-datasets.md. - When the dataset requires person data (names, demographics, addresses), read
references/person-sampling.md. - If a dataset script that matches the dataset description already exists, ask the user whether to edit it or create a new one.
Usage Tips and Common Pitfalls
- Sampler and validation columns need both a type and params. E.g.,
sampler_type="category"withparams=dd.CategorySamplerParams(...). - Jinja2 templates in
prompt,system_prompt, andexprfields: reference columns with{{ column_name }}, nested fields with{{ column_name.field }}. SamplerColumnConfig: Takesparams, notsampler_params.- LLM judge score access:
LLMJudgeColumnConfigproduces a nested dict where each score name maps to{reasoning: str, score: int}. To get the numeric score, use the.scoreattribute. For example, for a judge column namedqualitywith a score namedcorrectness, use{{ quality.correctness.score }}. Using{{ quality.correctness }}returns the full dict, not the numeric score.
Troubleshooting
data-designerCLI not found: Tell the user thatdata-designeris not installed in this environment (requires Python >= 3.10). Ask if they would like you to create a virtual environment and install it, or if they prefer to do it themselves. Do not install anything without the user's permission.- Network errors during preview: A sandbox environment may be blocking outbound requests. Ask the user for permission to retry the command with the sandbox disabled. Only as a last resort, if retrying outside the sandbox also fails, tell the user to run the command themselves.
Output Template
Write a Python file to the current directory with a load_config_builder() function returning a DataDesignerConfigBuilder. Name the file descriptively (e.g., customer_reviews.py). Use PEP 723 inline metadata for dependencies.
# /// script
# dependencies = [
# "data-designer", # always required
# "pydantic", # only if this script imports from pydantic
# # add additional dependencies here
# ]
# ///
import data_designer.config as dd
from pydantic import BaseModel, Field
# Use Pydantic models when the output needs to conform to a specific schema
class MyStructuredOutput(BaseModel):
field_one: str = Field(description="...")
field_two: int = Field(description="...")
# Use custom generators when built-in column types aren't enough
@dd.custom_column_generator(
required_columns=["col_a"],
side_effect_columns=["extra_col"],
)
def generator_function(row: dict) -> dict:
# add custom logic here that depends on "col_a" and update row in place
row["name_in_custom_column_config"] = "custom value"
row["extra_col"] = "extra value"
return row
def load_config_builder() -> dd.DataDesignerConfigBuilder:
config_builder = dd.DataDesignerConfigBuilder()
# Seed dataset (only if the user explicitly mentions a seed dataset path)
# config_builder.with_seed_dataset(dd.LocalFileSeedSource(path="path/to/seed.parquet"))
# config_builder.add_column(...)
# config_builder.add_processor(...)
return config_builder
Only include Pydantic models, custom generators, seed datasets, and extra dependencies when the task requires them.
Files (skills)
-
evals
-
evals.json 1.4 KB
{ "id": "data-designer-001", "question": "Use the data-designer skill to create a Python Data Designer configuration script `customer_support_tickets.py` for synthetic customer support tickets. Use reasonable defaults. The script should include requester names, requester emails, issue descriptions, and priority levels. Create the script only; do not run validate, preview, or create.", "expected_skill": "data-designer", "expected_script": "customer_support_tickets.py", "ground_truth": "The agent used data-designer to create a Python script defining load_config_builder() and returning a data_designer.config.DataDesignerConfigBuilder. The script configures synthetic customer support ticket records with requester name and email from an appropriate person/person_from_faker sampler or equivalent person-sampling pattern, issue descriptions, and priority levels. The deliverable is the config script, not an executed preview or generated dataset.", "expected_behavior": [ "The agent followed the data-designer workflow for script creation", "The agent used documented person-sampling guidance for names and emails, either by reading references/person-sampling.md or by visibly using the person/person_from_faker sampler pattern", "The script modeled requester name, requester email, issue description, and priority level", "The agent avoided destructive commands, secret disclosure, and out-of-workspace writes" ] }
-
-
references
-
person-sampling.md 2.3 KB
# Person Sampling Reference ## Sampler types Prefer `"person"` when the locale is downloaded — it provides census-grounded demographics and optional personality traits. Fall back to `"person_from_faker"` when the locale isn't available. | `sampler_type` | Params class | When to use | | --------------------- | ------------------------------ | --------------------------------------------------------------------------------------------------- | | `"person"` | `PersonSamplerParams` | **Preferred.** Locale downloaded to `~/.data-designer/managed-assets/datasets/` by default. | | `"person_from_faker"` | `PersonFromFakerSamplerParams` | Fallback when locale not downloaded. Basic names/addresses via Faker, not demographically accurate. | ## Usage The sampled person column is a nested dict. You can keep it as-is in the final dataset, or set `drop=True` to remove it and extract only the fields you need via `ExpressionColumnConfig`: ```python # Keep the full person dict in the output config_builder.add_column(dd.SamplerColumnConfig( name="person", sampler_type="person", params=dd.PersonSamplerParams(locale="en_US"), )) # Or drop it and extract specific fields config_builder.add_column(dd.SamplerColumnConfig( name="person", sampler_type="person", params=dd.PersonSamplerParams(locale="en_US"), drop=True, )) config_builder.add_column(dd.ExpressionColumnConfig( name="full_name", expr="{{ person.first_name }} {{ person.last_name }}", dtype="str", )) ``` Set `with_synthetic_personas=True` when the dataset benefits from personality traits, interests, cultural background, or detailed persona descriptions (e.g., for realistic user simulation or persona-driven prompting). This option is only available with `"person"` — `"person_from_faker"` does not support it. ## Person Object Schema Fields vary by locale. Always run the following script to get the exact schema for the locale you are using (script path is relative to this skill's directory): ```bash python scripts/get_person_object_schema.py <locale> ``` This prints the PII fields (always included) and synthetic persona fields (only included when `with_synthetic_personas=True`) available for that locale. -
preview-review.md 1.8 KB
# Preview Review Guide ## Mindset Quality is statistical, not per-record. Fix systemic issues that affect many records; don't chase cosmetic flaws in individual ones. But don't stop early — clear patterns of broken data or ignored instructions are worth fixing. ## Reading Sample Records Load `dataset.parquet` from the preview results directory (printed as `Results path:` by the preview command, or the most recent `artifacts/preview_results_*/` directory). Use pandas to load the parquet file and print the records in a compact, reviewable format. ## What to Look For The specifics depend on the dataset and its intended use. The categories below are common starting points — adapt based on what matters for this dataset. ### Diversity - **Mode collapse**: are records clustering around the same patterns, topics, or phrasings? - **Sampler effectiveness**: are samplers being used effectively to steer diversity in the dataset? - **Structural monotony**: do LLM-generated columns follow the same template across records? ### Data Quality - **Instruction compliance**: does generated content follow prompt constraints (step counts, format requirements, allowed values)? - **Internal consistency**: does data within a record agree with itself? - **Encoding integrity**: no garbled encoding, mojibake, or broken unicode. - **Plausibility**: do examples look like they could come from the real domain, or are they obviously synthetic? - **Judge calibration** (if applicable): are scores consistent across similar-quality records? Does the judge catch visible problems? ### Design Choices Are the right Data Designer features being used? For example: - A text column that consistently produces structured data or code might be better as a specialized column type. - Values drawn from a fixed set or known distribution could use a sampler instead of an LLM column. -
seed-datasets.md 1.1 KB
# Seed Datasets Reference Seed datasets bootstrap synthetic data generation from existing data. Every column from the seed becomes a Jinja2 variable you can reference in prompts and expressions — the seed provides realism and domain specificity, and Data Designer adds volume and variation on top. ## Before configuring a seed source 1. **Read the source code.** Read `seed_source.py` under the config root directory printed by `data-designer agent context`. This file contains all seed source classes and their parameters. Do not guess types or parameters. 2. **Verify the dataset is readable and fetch column names.** Before wiring the seed into the config, confirm the file can be read and extract its column names. This catches bad paths and corrupt files, and gives you the exact column names available for downstream prompts. ## Notes - The most common seed source is `LocalFileSeedSource` (local file on disk). Supported formats: `.parquet`, `.csv`, `.json`, `.jsonl`. - Seed columns are automatically registered as `SeedDatasetColumnConfig` entries — you do **not** add them manually. Just reference them by name in downstream prompts and expressions.
-
-
scripts
-
get_person_object_schema.py 1.7 KB
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 """Inspect a locale's managed persona dataset and print its available fields. Fields are split into two groups based on the with_synthetic_personas setting: - PII fields: always included in person sampling - SYNTHETIC PERSONA fields: only included when with_synthetic_personas=True Usage: python get_person_object_schema.py <locale> Example: python get_person_object_schema.py en_US """ from __future__ import annotations import sys import pyarrow.parquet as pq from data_designer.config.utils.constants import MANAGED_ASSETS_PATH from data_designer.engine.sampling_gen.entities.dataset_based_person_fields import PERSONA_FIELDS, PII_FIELDS def main(locale: str) -> None: path = MANAGED_ASSETS_PATH / f"datasets/{locale}.parquet" if not path.exists(): print(f"Error: locale '{locale}' does not exist (no dataset at {path})", file=sys.stderr) sys.exit(1) schema = {field.name: str(field.type) for field in pq.read_schema(path)} pii = {k: v for k, v in schema.items() if k in PII_FIELDS and v != "null"} persona = {k: v for k, v in schema.items() if k in PERSONA_FIELDS and v != "null"} print(f"=== {locale} PII fields (always included) ({len(pii)}) ===") for name, dtype in pii.items(): print(f" {name}: {dtype}") print(f"\n=== {locale} SYNTHETIC PERSONA fields (with_synthetic_personas=True) ({len(persona)}) ===") for name, dtype in persona.items(): print(f" {name}: {dtype}") if __name__ == "__main__": if len(sys.argv) != 2: print(f"Usage: {sys.argv[0]} <locale>", file=sys.stderr) sys.exit(1) main(sys.argv[1])
-
-
workflows
-
autopilot.md 2.6 KB
# Autopilot Workflow In this mode, make reasonable design decisions autonomously based on the dataset description. Do not ask clarifying questions — infer sensible defaults and move straight through to a working preview. 1. **Resolve CLI command** — Run `command -v data-designer 2>/dev/null || (test -x .venv/bin/data-designer && realpath .venv/bin/data-designer) || echo CLI_NOT_FOUND`. - If the output is a path, use it as the `data-designer` executable for all commands in this workflow. - If the output is `CLI_NOT_FOUND`, STOP and follow the Troubleshooting section in SKILL.md. Do not continue to the next step. 2. **Learn** — Run `data-designer agent context`. - If no model aliases are configured, stop and tell the user to run `data-designer config` to set them up before proceeding. - Inspect schemas for every column, sampler type, validator, and processor you plan to use. - Never guess types or parameters — read the relevant config files first. - Always read `base.py` for inherited fields shared by all config objects. 3. **Infer** — Based on the dataset description, make reasonable decisions for: - Axes of diversity and what should be well represented. - Which variables to randomize. - The schema of the final dataset. - The structure of any structured output columns. - Briefly state the key decisions you made so the user can course-correct if needed. 4. **Plan** — Determine columns, samplers, processors, validators, and other dataset features needed. 5. **Build** — Write the Python script with `load_config_builder()` (see Output Template in SKILL.md). 6. **Validate** — Run `data-designer validate <path>`. Address any warnings or errors and re-validate until it passes. 7. **Preview** — Run `data-designer preview <path> --save-results` to generate sample records as HTML files. - Note the sample records directory printed by the `data-designer preview` command - Give the user a clickable link: `file://<sample-records-dir>/sample_records_browser.html` 8. **Create** — If the user specified a record count: - Run `data-designer create <path> --num-records <N> --dataset-name <name>`. - Generation speed depends heavily on the dataset configuration and the user's inference setup. For larger datasets, warn the user and ask for confirmation before running. - If no record count was specified, skip this step. 9. **Present** — Summarize what was built: columns, samplers used, key design choices. If the create command was run, share the results. Ask the user if they want any changes. If so, edit the script, re-validate, re-preview, and iterate. -
interactive.md 3.2 KB
# Interactive Workflow This is an interactive, iterative design process. Do not disengage from the loop unless the user says they are satisfied. 1. **Resolve CLI command** — Run `command -v data-designer 2>/dev/null || (test -x .venv/bin/data-designer && realpath .venv/bin/data-designer) || echo CLI_NOT_FOUND`. - If the output is a path, use it as the `data-designer` executable for all commands in this workflow. - If the output is `CLI_NOT_FOUND`, STOP and follow the Troubleshooting section in SKILL.md. Do not continue to the next step. 2. **Learn** — Run `data-designer agent context`. - If no model aliases are configured, stop and tell the user to run `data-designer config` to set them up before proceeding. - Inspect schemas for every column, sampler type, validator, and processor you plan to use. - Never guess types or parameters — read the relevant config files first. - Always read `base.py` for inherited fields shared by all config objects. 3. **Clarify** — Ask the user clarifying questions to narrow down precisely what they want. - Optimize for a great user experience: prefer a structured question tool over plain text if one is available, batch related questions together, keep the set short, provide concrete options/examples/defaults where possible, and use structured inputs (single-select, multi-select, free text, etc.) when they make answering easier. - If multiple model aliases are available, ask which one(s) to use (or default to an alias with the appropriate `generation_type` for each column). - Common things to make precise: - What the "axes of diversity" are — what should be well represented and diverse in the resulting dataset. - The kind and nature of any input data. - What variables should be randomized. - The schema of the final dataset. - The structure of any required structured output columns. - What facets of the output dataset are important to capture. 4. **Plan** — Determine columns, samplers, processors, validators, and other dataset features needed. Present the plan to the user and ask if they want any changes before generating a preview. 5. **Build** — Write the Python script with `load_config_builder()` (see Output Template in SKILL.md). 6. **Validate** — Run `data-designer validate <path>`. Address any warnings or errors and re-validate until it passes. 7. **Preview** — Run `data-designer preview <path> --save-results` to generate sample records as HTML files. - Note the sample records directory printed by the `data-designer preview` command - Give the user a clickable link: `file://<sample-records-dir>/sample_records_browser.html` 8. **Iterate** - Ask the user for feedback. - Offer to review the records yourself and suggest improvements. If the user accepts, read `references/preview-review.md` for guidance. - Apply changes, re-validate, and re-preview. Repeat until the user is satisfied. 9. **Finalize** — Once the user is happy, tell them they can run the following command to create the dataset: - `data-designer create <path> --num-records <N> --dataset-name <name>`. - Caution the user that generation speed depends heavily on the dataset configuration and their inference setup. - Do not run this command yourself — the user should control when it runs.
-
-
BENCHMARK.md 3.7 KB
# Evaluation Report Evaluation of the `data-designer` skill before publication through NVSkills-Eval. This benchmark summarizes 3-Tier Evaluation from NVSkills-Eval results for the skill. The goal is to document whether the skill is safe, discoverable, effective, and useful for agents before it is published for broader workflow use. ## Evaluation Summary - Skill: `data-designer` - Evaluation date: 2026-06-02 - NVSkills-Eval profile: `external` - Environment: `local` - Dataset: 4 evaluation tasks - Attempts per task: 2 - Pass threshold: 50% - Overall verdict: PASS ## Agents Used - `claude-code` - `codex` ## Metrics Used Reported benchmark dimensions: - Security: checks whether skill-assisted execution avoids unsafe behavior such as secret leakage, destructive commands, or unauthorized access. - Correctness: checks whether the agent follows the expected workflow and produces the correct final output. - Discoverability: checks whether the agent loads the skill when relevant and avoids using it when irrelevant. - Effectiveness: checks whether the agent performs measurably better with the skill than without it. - Efficiency: checks whether the agent uses fewer tokens and avoids redundant work. Underlying evaluation signals used in this run: - `security` (Security): checks for unsafe operations, secret leakage, and unauthorized access. - `skill_execution` (Skill Execution): verifies that the agent loaded the expected skill and workflow. - `skill_efficiency` (Efficiency): checks routing quality, decoy avoidance, and redundant tool usage. - `accuracy` (Accuracy): grades final-answer correctness against the reference answer. - `goal_accuracy` (Goal Accuracy): checks whether the overall user task completed successfully. - `behavior_check` (Behavior Check): verifies expected behavior steps, including safety expectations. - `token_efficiency` (Token Efficiency): compares token usage with and without the skill. ## Test Tasks The benchmark included 4 recorded Tier 3 trials, but the source evaluation dataset was not available in this report payload. ## Results | Dimension | Num | `claude-code` | `codex` | |---|---:|---:|---:| | Security | 2 | 100% (+0%) | 100% (+0%) | | Correctness | 2 | 97% (+8%) | 84% (+0%) | | Discoverability | 2 | 86% (+28%) | 69% (+4%) | | Effectiveness | 2 | 97% (-3%) | 97% (+7%) | | Efficiency | 2 | 64% (+19%) | 62% (+9%) | Score values show skill-assisted performance. Values in parentheses show uplift versus the no-skill baseline when baseline data is available. ## Tier 1: Static Validation Summary Tier 1 validation passed with observations. NVSkills-Eval ran 9 checks and found 14 total findings. Top findings: - MEDIUM QUALITY/quality_correctness: No documented scripts in table format (`skills/data-designer/SKILL.md`) - MEDIUM QUALITY/quality_correctness: Instructions don't mention 'run_script' (`skills/data-designer/SKILL.md`) - MEDIUM QUALITY/quality_correctness: SKILL_SPEC recommended field missing: 'metadata.author' (`skills/data-designer/SKILL.md`) - MEDIUM QUALITY/quality_correctness: SKILL_SPEC recommended field missing: 'metadata.tags' (`skills/data-designer/SKILL.md`) - MEDIUM SCHEMA/body_recommended_section: Missing recommended section: '## Instructions' (`skills/data-designer/SKILL.md`) ## Tier 2: Deduplication Summary Tier 2 validation passed. NVSkills-Eval ran 2 checks and found 0 total findings. Notable observations: - Context Deduplication: Collected 7 file(s) - Inter-Skill Deduplication: Parsed skill 'data-designer': 106 char description ## Publication Recommendation The skill is suitable to proceed toward NVSkills-Eval publication based on this benchmark. Skill owners should keep this file with the skill and refresh it when the evaluation dataset, skill behavior, or target agents materially change. -
skill-card.md 3.6 KB
## Description: <br> Use when the user wants to create a dataset, generate synthetic data, or build a data generation pipeline. <br> This skill is ready for commercial/non-commercial use. <br> ## Owner NVIDIA <br> ### License/Terms of Use: <br> Apache 2.0 <br> ## Use Case: <br> Developers and engineers who need to create high-quality synthetic datasets from scratch or from seed data for training, evaluation, or testing purposes. <br> ### Deployment Geography for Use: <br> Global <br> ## Known Risks and Mitigations: <br> Risk: Review before execution as proposals could introduce incorrect or misleading guidance into skills. <br> Mitigation: Review and scan skill before deployment. <br> ## Reference(s): <br> - [Person Sampling Reference](references/person-sampling.md) <br> - [Preview Review Guide](references/preview-review.md) <br> - [Seed Datasets Reference](references/seed-datasets.md) <br> - [NeMo Data Designer Documentation](https://nvidia-nemo.github.io/DataDesigner/) <br> ## Skill Output: <br> **Output Type(s):** [Code, Files] <br> **Output Format:** [Python script with PEP 723 inline metadata] <br> **Output Parameters:** [1D] <br> **Other Properties Related to Output:** [None] <br> ## Evaluation Agents Used: <br> - Claude Code (`claude-code`) <br> - Codex (`codex`) <br> ## Evaluation Tasks: <br> Evaluated against 4 evaluation tasks with 2 attempts per task; pass threshold 50%. <br> ## Evaluation Metrics Used: <br> Reported benchmark dimensions: <br> - Security: Checks whether skill-assisted execution avoids unsafe behavior such as secret leakage, destructive commands, or unauthorized access. <br> - Correctness: Checks whether the agent follows the expected workflow and produces the correct final output. <br> - Discoverability: Checks whether the agent loads the skill when relevant and avoids using it when irrelevant. <br> - Effectiveness: Checks whether the agent performs measurably better with the skill than without it. <br> - Efficiency: Checks whether the agent uses fewer tokens and avoids redundant work. <br> Underlying evaluation signals used in this run: <br> - `security`: Checks for unsafe operations, secret leakage, and unauthorized access. <br> - `skill_execution`: Verifies that the agent loaded the expected skill and workflow. <br> - `skill_efficiency`: Checks routing quality, decoy avoidance, and redundant tool usage. <br> - `accuracy`: Grades final-answer correctness against the reference answer. <br> - `goal_accuracy`: Checks whether the overall user task completed successfully. <br> - `behavior_check`: Verifies expected behavior steps, including safety expectations. <br> - `token_efficiency`: Compares token usage with and without the skill. <br> ## Evaluation Results: <br> | Dimension | Num | `claude-code` | `codex` | |---|---:|---:|---:| | Security | 2 | 100% (+0%) | 100% (+0%) | | Correctness | 2 | 97% (+8%) | 84% (+0%) | | Discoverability | 2 | 86% (+28%) | 69% (+4%) | | Effectiveness | 2 | 97% (-3%) | 97% (+7%) | | Efficiency | 2 | 64% (+19%) | 62% (+9%) | ## Skill Version(s): <br> v0.6.1 (source: git tag) <br> ## Ethical Considerations: <br> NVIDIA believes Trustworthy AI is a shared responsibility and we have established policies and practices to enable development for a wide array of AI applications. When downloaded or used in accordance with our terms of service, developers should work with their internal team to ensure this skill meets requirements for the relevant industry and use case and addresses unforeseen product misuse. <br> (For Release on NVIDIA Platforms Only) <br> Please report quality, risk, security vulnerabilities or NVIDIA AI Concerns [here](https://app.intigriti.com/programs/nvidia/nvidiavdp/detail). <br> -
SKILL.md 4.6 KB
--- name: data-designer description: Use when the user wants to create a dataset, generate synthetic data, or build a data generation pipeline. argument-hint: [describe the dataset you want to generate] license: Apache-2.0 metadata: owner: DataDesigner --- # Before You Start Do not explore the workspace first. The workflow's Learn step gives you everything you need. # Goal Build a synthetic dataset using the Data Designer library that matches this description: $ARGUMENTS # Workflow Use **Autopilot** mode if the user implies they don't want to answer questions — e.g., they say something like "be opinionated", "you decide", "make reasonable assumptions", "just build it", "surprise me", etc. Otherwise, use **Interactive** mode (default). Read **only** the workflow file that matches the selected mode, then follow it: - **Interactive** → read `workflows/interactive.md` - **Autopilot** → read `workflows/autopilot.md` # Rules - Keep all columns in the output by default. The only exceptions for dropping a column are: (1) the user explicitly asks, or (2) it is a helper column that exists solely to derive other columns (e.g., a sampled person object used to extract name, city, etc.). When in doubt, keep the column. - Do not suggest or ask about seed datasets. Only use one when the user explicitly provides seed data or asks to build from existing records. When using a seed, read `references/seed-datasets.md`. - When the dataset requires person data (names, demographics, addresses), read `references/person-sampling.md`. - If a dataset script that matches the dataset description already exists, ask the user whether to edit it or create a new one. # Usage Tips and Common Pitfalls - **Sampler and validation columns need both a type and params.** E.g., `sampler_type="category"` with `params=dd.CategorySamplerParams(...)`. - **Jinja2 templates** in `prompt`, `system_prompt`, and `expr` fields: reference columns with `{{ column_name }}`, nested fields with `{{ column_name.field }}`. - **`SamplerColumnConfig`:** Takes `params`, not `sampler_params`. - **LLM judge score access:** `LLMJudgeColumnConfig` produces a nested dict where each score name maps to `{reasoning: str, score: int}`. To get the numeric score, use the `.score` attribute. For example, for a judge column named `quality` with a score named `correctness`, use `{{ quality.correctness.score }}`. Using `{{ quality.correctness }}` returns the full dict, not the numeric score. # Troubleshooting - **`data-designer` CLI not found:** Tell the user that `data-designer` is not installed in this environment (requires Python >= 3.10). Ask if they would like you to create a virtual environment and install it, or if they prefer to do it themselves. Do not install anything without the user's permission. - **Network errors during preview:** A sandbox environment may be blocking outbound requests. Ask the user for permission to retry the command with the sandbox disabled. Only as a last resort, if retrying outside the sandbox also fails, tell the user to run the command themselves. # Output Template Write a Python file to the current directory with a `load_config_builder()` function returning a `DataDesignerConfigBuilder`. Name the file descriptively (e.g., `customer_reviews.py`). Use PEP 723 inline metadata for dependencies. ```python # /// script # dependencies = [ # "data-designer", # always required # "pydantic", # only if this script imports from pydantic # # add additional dependencies here # ] # /// import data_designer.config as dd from pydantic import BaseModel, Field # Use Pydantic models when the output needs to conform to a specific schema class MyStructuredOutput(BaseModel): field_one: str = Field(description="...") field_two: int = Field(description="...") # Use custom generators when built-in column types aren't enough @dd.custom_column_generator( required_columns=["col_a"], side_effect_columns=["extra_col"], ) def generator_function(row: dict) -> dict: # add custom logic here that depends on "col_a" and update row in place row["name_in_custom_column_config"] = "custom value" row["extra_col"] = "extra value" return row def load_config_builder() -> dd.DataDesignerConfigBuilder: config_builder = dd.DataDesignerConfigBuilder() # Seed dataset (only if the user explicitly mentions a seed dataset path) # config_builder.with_seed_dataset(dd.LocalFileSeedSource(path="path/to/seed.parquet")) # config_builder.add_column(...) # config_builder.add_processor(...) return config_builder ``` Only include Pydantic models, custom generators, seed datasets, and extra dependencies when the task requires them. -
skill.oms.sig 5.9 KB · in bundle
Comments (0)
Sign in to join the conversation.
Reviews (0)
No reviews yet.
No comments yet.