---
title: run()
framework: evaluations
role: symbol
role_heading: Instance Method
path: evaluations/samplegenerator/run()
---

# run()

Runs the generator and returns a stream of newly synthesized samples.

## Declaration

```swift
nonisolated func run() -> some AsyncSequence<SampleType, any Error>

```

## Return Value

Return Value An async throwing stream of individual samples.

## Discussion

Discussion Each element in the returned stream is a newly generated sample. After iteration completes, access samples to retrieve the full dataset (initial + generated), or invalidSamples to see samples the validator rejected.
