One Logo Pool Ball
FoundationModels · IOS API REFERENCE

GenerationSchema

struct · iOS 26.0+ · SDK 27.1

struct GenerationSchema

A type that describes the properties of an object and any guides on their values. Generation schemas guide the output of a language model to deterministically ensure the output is in the desired format.

Members (3)

get · iOS 26.0+

debugDescription

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

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

get · iOS 27.0+

name

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

The name of this generation schema. Typically this will the name of a Swift type, but it can be an arbitrary string for schemas created dynamically.

init · iOS 26.0+

init

TypeScript
static init(root: DynamicGenerationSchema, dependencies: Array<DynamicGenerationSchema>): GenerationSchema
Swift declaration
init(root: DynamicGenerationSchema, dependencies: [DynamicGenerationSchema]) throws

Creates a schema by providing an array of dynamic schemas. - Parameters: - root: The root schema. - dependencies: An array of dynamic schemas. - Throws: If there are schemas with naming conflicts or references to undefined types.

Skipped declarations

4 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

GenerationSchema.init(type:description:properties:)

Passing a Swift type itself is not supported.

GenerationSchema.init(type:description:representNilExplicitlyInGeneratedContent:properties:)

Passing a Swift type itself is not supported.

GenerationSchema.init(type:description:anyOf:)

Passing a Swift type itself is not supported.

GenerationSchema.init(type:description:anyOf:)

Passing a Swift type itself is not supported.

All FoundationModels types →