---
title: "init(id:metadata:segments:options:responseFormat:contextOptions:)"
framework: foundationmodels
role: symbol
role_heading: Initializer
path: "foundationmodels/transcript/prompt/init(id:metadata:segments:options:responseformat:contextoptions:)"
---

# init(id:metadata:segments:options:responseFormat:contextOptions:)

Creates a prompt.

## Declaration

```swift
init(id: String = UUID().uuidString, metadata: [String : any Codable & Sendable & Equatable] = [:], segments: [Transcript.Segment], options: GenerationOptions = GenerationOptions(), responseFormat: Transcript.ResponseFormat? = nil, contextOptions: ContextOptions = ContextOptions())
```

## Parameters

- `id`: A doc://com.apple.foundationmodels/documentation/FoundationModels/Generable type to use as the response format.
- `metadata`: Metadata provided as part of this prompt.
- `segments`: An array of segments that make up the prompt.
- `options`: Options that control how tokens are sampled from the distribution the model produces.
- `responseFormat`: A response format that describes the output structure.
- `contextOptions`: Settings that configure how the model is prompted

## See Also

### Creating a prompt

- [init(id:segments:options:responseFormat:)](foundationmodels/transcript/prompt/init(id:segments:options:responseformat:).md)
