---
title: SampleProtocol
framework: evaluations
role: symbol
role_heading: Protocol
path: evaluations/sampleprotocol
---

# SampleProtocol

A type that defines evaluation samples.

## Declaration

```swift
protocol SampleProtocol : Decodable, Encodable, Sendable
```

## Overview

Overview struct MySample: SampleProtocol {     var input: String     var expected: String? } Conform to this protocol to define input samples for your evaluation datasets. Each sample has an input that’s displayed in the DataFrame “Input” column, and an optional expected value for comparison. For language model evaluations, use ModelSampleProtocol which extends this protocol with language-model-specific properties: prompt, instructions, and expectations. let samples = [     ModelSample(prompt: "Classify: I love this!", expected: "positive"), ]

## Topics

### Associated Types

- [ExpectedValue](evaluations/sampleprotocol/expectedvalue.md)
- [Input](evaluations/sampleprotocol/input-swift.associatedtype.md)

### Instance Properties

- [expected](evaluations/sampleprotocol/expected.md)
- [input](evaluations/sampleprotocol/input-swift.property.md)

## Relationships

### Inherits From

- [Decodable](swift/decodable.md)
- [Encodable](swift/encodable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

### Inherited By

- [ModelSampleProtocol](evaluations/modelsampleprotocol.md)

### Conforming Types

- [ModelSample](evaluations/modelsample.md)

## See Also

### Protocols

- [ModelSampleProtocol](evaluations/modelsampleprotocol.md)
