<!--
{
  "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/ModelSampleInput",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Evaluations"
    ],
    "preciseIdentifier" : "s:11Evaluations16ModelSampleInputV"
  },
  "title" : "ModelSampleInput"
}
-->

# ModelSampleInput

The data a language model receives for evaluation.

```
struct ModelSampleInput
```

## Overview

```swift
@Generable
struct WeatherAnswer {
    let condition: String
}

let input = ModelSampleInput(
    prompt: Prompt("What's the weather like in Cupertino?"),
    instructions: Instructions("Respond with the weather condition only."),
    generationSchema: GenerationSchema(type: WeatherAnswer.self, properties: [])
)
```

synthesizes text representations for display, logging, and synthetic data.

## Topics

### Initializers

[`init(prompt: Prompt, instructions: Instructions?, generationSchema: GenerationSchema?)`](/documentation/Evaluations/ModelSampleInput/init(prompt:instructions:generationSchema:))

Creates a model sample input with the given prompt, instructions, and schema.

### Instance Properties

[`var description: String`](/documentation/Evaluations/ModelSampleInput/description)

A text representation of this input, equivalent to `promptDescription`.

[`var generationSchema: GenerationSchema?`](/documentation/Evaluations/ModelSampleInput/generationSchema)

The output schema for the assistant’s response.

[`var instructions: Instructions?`](/documentation/Evaluations/ModelSampleInput/instructions)

The optional FoundationModels instructions for this input.

[`var instructionsDescription: String?`](/documentation/Evaluations/ModelSampleInput/instructionsDescription)

A text representation of the instructions, synthesized from instruction segments.

[`var prompt: Prompt`](/documentation/Evaluations/ModelSampleInput/prompt)

The FoundationModels prompt for this input.

[`var promptDescription: String`](/documentation/Evaluations/ModelSampleInput/promptDescription)

A text representation of the prompt, synthesized from prompt segments.

## Relationships

### Conforms To

[`Decodable`](/documentation/Swift/Decodable)

[`Encodable`](/documentation/Swift/Encodable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Sendable`](/documentation/Swift/Sendable)

[`Copyable`](/documentation/Swift/Copyable)

[`Escapable`](/documentation/Swift/Escapable)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

---

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)