One Logo Pool Ball
FoundationModels · IOS API REFERENCE

Transcript.Prompt

struct · iOS 26.0+ · SDK 27.1

struct Prompt

A prompt from the user to the model. Prompts typically contain content sourced directly from the user, though you may choose to augment prompts by interpolating content from end users into a template that you control.

Members (15)

get · iOS 26.0+

description

TypeScript
get description(): string
Swift declaration
var description: String { get }

A textual representation of this instance. Calling this property directly is discouraged. Instead, convert an instance of any type to a string by using the `String(describing:)` initializer. This initializer works with any type, and uses the custom `description` property for types that conform to `CustomStringConvertible`: struct Point: CustomStringConvertible { let x: Int, y: Int var description: String { return "(\(x), \(y))" } } let p = Point(x: 21, y: 30) let s = String(describing: p) print(s) // Prints "(21, 30)" The conversion of `p` to a string in the assignment to `s` uses the `Point` type's `description` property.

get · iOS 27.0+

contextOptions

TypeScript
get contextOptions(): ContextOptions
Swift declaration
var contextOptions: ContextOptions

Configuration of the prompt.

set · iOS 27.0+

contextOptions

TypeScript
set contextOptions(value: ContextOptions)
Swift declaration
var contextOptions: ContextOptions

Configuration of the prompt.

get · iOS 26.0+

responseFormat

TypeScript
get responseFormat(): (Transcript_ResponseFormat) | null
Swift declaration
var responseFormat: Transcript.ResponseFormat?

An optional response format that describes the desired output structure.

set · iOS 26.0+

responseFormat

TypeScript
set responseFormat(value: (Transcript_ResponseFormat) | null)
Swift declaration
var responseFormat: Transcript.ResponseFormat?

An optional response format that describes the desired output structure.

init · iOS 27.0+

init

TypeScript
static initIdMetadataSegmentsOptionsResponseFormatContextOptions(id: string, metadata: Record<string, SDKHandle>, segments: Array<Transcript_Segment>, options?: GenerationOptions, responseFormat?: (Transcript_ResponseFormat) | null, contextOptions?: ContextOptions): Transcript_Prompt
Swift declaration
init(id: String = UUID().uuidString, metadata: [String : any ConvertibleToGeneratedContent] = [:], segments: [Transcript.Segment], options: GenerationOptions = GenerationOptions(), responseFormat: Transcript.ResponseFormat? = nil, contextOptions: ContextOptions = ContextOptions())

Creates a prompt. - Parameters: - id: A ``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.

init · iOS 26.0+

init

TypeScript
static initIdSegmentsOptionsResponseFormat(id: string, segments: Array<Transcript_Segment>, options?: GenerationOptions, responseFormat?: (Transcript_ResponseFormat) | null): Transcript_Prompt
Swift declaration
init(id: String = UUID().uuidString, segments: [Transcript.Segment], options: GenerationOptions = GenerationOptions(), responseFormat: Transcript.ResponseFormat? = nil)

Creates a prompt. - Parameters: - id: A ``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.

get · iOS 26.0+

id

TypeScript
get id(): string
Swift declaration
var id: String

The identifier of the prompt.

set · iOS 26.0+

id

TypeScript
set id(value: string)
Swift declaration
var id: String

The identifier of the prompt.

get · iOS 26.0+

options

TypeScript
get options(): GenerationOptions
Swift declaration
var options: GenerationOptions

Generation options associated with the prompt.

set · iOS 26.0+

options

TypeScript
set options(value: GenerationOptions)
Swift declaration
var options: GenerationOptions

Generation options associated with the prompt.

get · iOS 27.0+

metadata

TypeScript
get metadata(): Record<string, GeneratedContent>
Swift declaration
var metadata: [String : GeneratedContent]

Metadata provided as part of this prompt.

set · iOS 27.0+

metadata

TypeScript
set metadata(value: Record<string, GeneratedContent>)
Swift declaration
var metadata: [String : GeneratedContent]

Metadata provided as part of this prompt.

get · iOS 26.0+

segments

TypeScript
get segments(): Array<Transcript_Segment>
Swift declaration
var segments: [Transcript.Segment]

Ordered prompt segments.

set · iOS 26.0+

segments

TypeScript
set segments(value: Array<Transcript_Segment>)
Swift declaration
var segments: [Transcript.Segment]

Ordered prompt segments.

Skipped declarations

No declarations were skipped in this snapshot.

All FoundationModels types →