You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update the dataset generation configuration documentation to detail the new `output_schema` setting under `generation` and the `custom` format option under `output`.
- Add schema table entries for `generation.output_schema` and `output.format`
- Include a section explaining custom structured output with code examples
- List current limitations regarding field validation, CLI flags, and provider support
Signed-off-by: Luke Hinds <lukehinds@gmail.com>
By default, DeepFabric generates samples in a conversation format (`basic` or `cot`, made up of messages). Setting `output_schema` bypasses the conversation format entirely: DeepFabric generates directly into your JSON Schema via constrained decoding, and each output record matches that schema instead of the OpenAI messages format.
154
+
155
+
```yaml title="Example: Custom schema output"
156
+
generation:
157
+
system_prompt: "Extract structured product information from the topic."
158
+
instructions: "Populate every field with realistic, specific values."
format: custom # documents intent; the switch is driven by output_schema
170
+
num_samples: 100
171
+
batch_size: 5
172
+
save_as: "products.jsonl"
173
+
```
174
+
175
+
Set `output.format: custom` alongside it to document the intent in your config — see the `output` section below for how `format` is used.
176
+
177
+
!!! warning "Limitations"
178
+
- **No field-level validation.** DeepFabric confirms the model's response is valid JSON but does not check it against `required`, types, `enum`, or nested `properties` in your schema. Malformed or incomplete-but-valid JSON will pass through into the dataset.
179
+
- **No example demonstrations.** Unlike the standard conversation prompts, the custom-schema prompt does not support `generation.example_data`; example demonstrations have no effect in this mode.
180
+
- **Constrained decoding depends on the provider.** OpenAI, OpenRouter, Ollama, and local providers enforce the schema via [Outlines](https://github.com/dottxt-ai/outlines); Gemini and Anthropic use their native structured-output APIs. Enforcement quality varies by provider and model.
181
+
- **No CLI override.** `output_schema` can only be set via YAML config or the Python API (`DataSetGenerator(output_schema={...}, ...)`); there is no `--output-schema` flag.
182
+
- **Retries follow the same validation-error heuristics** as normal generation (`sample_retries`). If a schema-related error isn't recognized as a validation error, it fails immediately instead of retrying.
183
+
150
184
#### generation.conversation
151
185
152
186
| Field | Type | Options | Description |
@@ -199,6 +233,7 @@ Controls final dataset.
199
233
| `num_samples` | int \| string | required | Total samples: integer, `"auto"`, or percentage like `"50%"` |
200
234
| `batch_size` | int | 1 | Parallel generation concurrency (number of simultaneous LLM calls) |
0 commit comments