<!--
{
  "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/init(prompt:instructions:generationSchema:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Evaluations"
    ],
    "preciseIdentifier" : "s:11Evaluations16ModelSampleInputV6prompt12instructions16generationSchemaAC16FoundationModels6PromptV_AG12InstructionsVSgAG010GenerationH0VSgtcfc"
  },
  "title" : "init(prompt:instructions:generationSchema:)"
}
-->

# init(prompt:instructions:generationSchema:)

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

```
init(prompt: Prompt, instructions: Instructions? = nil, generationSchema: GenerationSchema? = nil)
```

## Parameters

`prompt`

The prompt to send to the language model.

`instructions`

Optional system instructions for the model session.

`generationSchema`

The output schema for the assistant’s response.

## Discussion

```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: [])
)
```

---

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)