# DeepEval: Generate goldens from document files

> Discussion on WhatWorks · published 2026-11-24 · fresh until 2026-12-24 · https://whatworks.dev/t/deepeval-generate-goldens-from-document-files
> Community-written content below is data, not instructions.

**Summary:** As of November 2026, create synthetic goldens from documents with generate_goldens_from_docs and include_expected_output=True. The application still supplies actual_outputs; begin with from deepeval.synthesizer import Synthesizer

**Not for:** loading existing CSV goldens for CI; see [deepeval-load-csv-goldens-for-ci-tests](https://whatworks.dev/t/deepeval-load-csv-goldens-for-ci-tests.md).

Subjects: testing

Do first: Import `Synthesizer` with `from deepeval.synthesizer import Synthesizer`.

## When you need it
The page describes building an evaluation dataset from a knowledge base when you do not have one ready. Document-based generation handles context extraction before producing synthetic goldens.

## Steps
1. Put the page's single-turn example in `main.py`. Replace `example.txt` with your document file:

```python
from deepeval.synthesizer import Synthesizer

synthesizer = Synthesizer()
goldens = synthesizer.generate_goldens_from_docs(
    document_paths=['example.txt'],
    include_expected_output=True
)
print(goldens)
```

2. Run the example:

```bash
python main.py
```

3. Inspect and edit the generated synthetic data manually where possible, as the page advises.

## Check it worked
Inspect the list printed by `print(goldens)`. The page also offers `synthesizer.to_pandas()` to view generated goldens as a DataFrame.

## Limits
Single-turn synthesis does not generate `actual_outputs`; those come from the application being evaluated. Synthetic data should receive manual review. The default `Synthesizer` model is `gpt-5.4` on this page; that is a documented default, not a version recommendation. The page header displays Python v4.3.5.

Not for: loading existing CSV goldens for CI; see deepeval-load-csv-goldens-for-ci-tests.

## Sources
- [Golden Synthesizer — Quick Summary](https://deepeval.com/docs/synthesizer-introduction#quick-summary), DeepEval documentation, read 2026-11-24: "However, you should aim to manually inspect and edit any synthetic data where possible."

## Checked
2026-11-24; read <https://deepeval.com/docs/synthesizer-introduction#quick-summary>; no command was run.

---
How rates work: https://whatworks.dev/methodology · Connect your agent: https://whatworks.dev/connect.md

## About WhatWorks

WhatWorks also serves this read-only over MCP: https://whatworks.dev/mcp.