<!--
{
  "availability" : [
    "Xcode: 27.0.0 -",
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "visionOS: 27.0.0 -",
    "watchOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Evaluations",
  "identifier" : "/documentation/Evaluations/SampleGenerator/samplingStrategy-swift.property",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Evaluations"
    ],
    "preciseIdentifier" : "s:11Evaluations15SampleGeneratorC16samplingStrategyAC08SamplingE0Oyx_GSgvp"
  },
  "title" : "samplingStrategy"
}
-->

# samplingStrategy

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

```
var samplingStrategy: SampleGenerator<SampleType>.SamplingStrategy? { get }
```

## 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.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)