Data
Recipes
Generate training examples from your documents with a model endpoint and a recipe.
A recipe tells a model what kind of examples to write from your documents: factual questions, troubleshooting steps, JSON extraction and more. When you generate, each selected document is cut into passages and each passage is sent to a model endpoint with the recipe. The examples come back to Review as pending, each with exact quotes from its passage as evidence.
You only need recipes for documents. Imported question and answer pairs are already examples.
Before you start
- You are a member or an owner.
- The project has documents in Sources.
- Your organization has a model endpoint that speaks the OpenAI chat completions format, or a ready deployment.
- You are happy for that endpoint's provider to see your documents. See What is sent to the endpoint.
Starter recipes
| Starter recipe | What it writes |
|---|---|
| Factual Q&A | One specific question, answered only from the source |
| Troubleshooting | A realistic problem with diagnostic steps and a fix from the source |
| Multi-turn conversation | 2 to 4 user and assistant exchanges with natural follow-ups (needs at least two assistant turns) |
| Structured JSON | An extraction request answered with JSON that matches your schema |
| Clarification question | An ambiguous request, answered with a targeted clarifying question |
| Insufficient information | A question the source can't answer, answered by saying what is unknown |
The project's use case decides which starter the generation form offers first. You can generate with a starter directly, or save your own recipe from one.
Save a recipe
- Open Recipes under Data, and choose a starter under Starter recipes (or New recipe for Factual Q&A).
- Enter a Recipe name.
- Write the Generation instructions in your own words. Left empty, the starter's instructions are used.
- Choose the Training context. See below.
- For Structured JSON, enter the Response JSON schema. See Structured JSON.
- Optionally tick up to five Approved references. See Reference examples.
- Choose Save recipe.
To change a saved recipe, choose it, edit it and choose Save new revision. Jobs and versions keep the revision they used, and each example shows its recipe and revision in Review. Saved recipes cannot be deleted.
Training context
- Include source passage (recommended). The passage is put at the start of each example's first user message, followed by the question. The model learns to answer from text it is given. Choose this if your application will send relevant text along with each question.
- Closed book · omit source passage. Examples hold only the question and answer, so the model learns to answer from memory.
With the source passage, leave the passage in the example unchanged. Editing it makes the example fail its checks.
Reference examples
References show the endpoint the style you want: tone, length, format. Tick up to five approved examples under Approved references. They are copied into the recipe and sent with every passage, and the endpoint is told to copy their style, not their facts.
- References must be approved training examples of this project, 20,000 characters together, without images.
- A reference, and anything sharing its source or question, always stays in the training split of every version, so you are never tested on an example the generator was shown. See Split reservations.
Structured JSON
A Structured JSON recipe needs a Response JSON schema (draft 2020-12, inline; no $ref, pattern or format). The starter asks for one text field:
{
"type": "object",
"properties": {"answer": {"type": "string"}},
"required": ["answer"],
"additionalProperties": false
}Replace it with the fields you extract. In Review every answer must match the schema before it can be approved.
Generate examples
- In Sources, tick whole imports or single sources.
- Choose Generate examples.
- Choose the Recipe: a starter or a saved recipe.
- Choose the Generation endpoint.
- Optionally choose an Optional quality judge. It adds one model call per example to check factual support, completeness and contradictions. Rule checks only adds no call.
- Set Examples per passage (1 to 10, default 3).
- Choose Generate for N.
Follow the job in Activity.
How generation runs
- Each source is cut into 6,000-character passages, and one request goes to the endpoint per passage.
- New examples arrive in Review as pending, with their source's category. Exact duplicates are not added.
- Every assistant turn needs an exact quote from the passage. A generated example can't be approved until each turn has one. A quote shows where support should be, not that the answer is right, so read the answer too, or add a judge.
- A failed passage is retried a few times. Examples from earlier passages stay, and Retry in Activity continues from the failed passage.
What is sent to the endpoint
For each passage, the endpoint receives the passage (up to 6,000 characters), the project's Goal and Generation instructions, the recipe with its full reference examples, and fixed instructions to treat all of it as data and quote the passage exactly. With a judge, there is one more request per example; see What the judge receives.
Note
The endpoint's provider sees the full text of every selected passage and bills you for the requests. Choose a provider you trust with your content, or a model you run yourself.
Tips
- Start small. Generate from a few sources, read the results in Review, adjust the instructions or references, then generate for the rest.
- Use a capable generator. Each answer must be a JSON list of examples with exact quotes. If passages keep failing, switch to a more capable model.
- Mix recipes. A few Insufficient information examples alongside factual ones teach the model to say when the source doesn't cover a question.
Limits
| Limit | Value |
|---|---|
| Examples per passage | 1 to 10; 3 by default |
| Passage | 6,000 characters |
| Sources in one generation | 2,000, and 25 MB of text |
| Selection in one generation | 50 whole imports and 500 single sources |
| Endpoint answer time | 3 minutes per request |
| Reference examples | 5 per recipe, 20,000 characters together |
| Recipe name | 160 characters |
| Recipe instructions | 10,000 characters |
| Response JSON schema | 20,000 characters, 20 levels of nesting |
When something goes wrong
| Message | What to do |
|---|---|
| "Select sources or imports to generate from" | Tick imports or sources in Sources first. |
| "The selected documents have no text" | Choose other sources. |
| "Select at most 2,000 sources at a time…" or "…more than 25 MB of text…" | Select fewer sources and generate in rounds. |
| "A reference overlaps held-out validation/test data…" | Choose a reference that is in training. |
| "Use an inline schema without references or regex patterns" | Remove $ref, pattern and patternProperties. |
| "Format assertions are not supported…" | Remove format from the schema. |
| "Endpoint name returned HTTP code" | Use Check connection in Connections. |
| "Endpoint name did not answer in time" | Use a faster model or fewer examples per passage, then Retry. |
| "Error: an unexpected error stopped this…" | Usually the endpoint didn't answer with the JSON list asked for. Retry, lower Examples per passage, or use a more capable model. Details are hidden because they may contain your data. |