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

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

Creates a prompt.

## Declaration

```swift
init(id: String = UUID().uuidString, segments: [Transcript.Segment], options: GenerationOptions = GenerationOptions(), responseFormat: Transcript.ResponseFormat? = nil)
```

## Parameters

- `id`: A doc://com.apple.foundationmodels/documentation/FoundationModels/Generable type to use as the response format.
- `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.

## See Also

### Creating a prompt

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