---
title: samplingStrategy
framework: evaluations
role: symbol
role_heading: Instance Property
path: evaluations/samplegenerator/samplingstrategy-swift.property
---

# samplingStrategy

The strategy for selecting existing samples as examples in the prompt.

## Declaration

```swift
var samplingStrategy: SampleGenerator<SampleType>.SamplingStrategy?
```

## Discussion

Discussion When nil, the generator shows no examples and doesn’t retry on repetition. When set, the strategy also controls retry behavior when the model repeats itself.

## See Also

### Configuring generation

- [validator](evaluations/samplegenerator/validator.md)
- [SampleGenerator.SamplingStrategy](evaluations/samplegenerator/samplingstrategy-swift.enum.md)
