One Logo Pool Ball
Speech · IOS API REFERENCE

SFCustomLanguageModelData.TemplateInsertableBuilder

struct · iOS 17.0+ · SDK 27.1

@resultBuilder struct TemplateInsertableBuilder

A custom parameter attribute that constructs custom language model data from closures. Phrase counts can be generated manually by providing an exact phrase and weight (e.g. "Play the Albin counter gambit") or from templates (e.g. "Move my \<piece> to \<square>"). Templates themselves can be constructed manually, or using the result builder DSL. This type supports the latter.

Members (4)

static · iOS 17.0+

buildArray

TypeScript
static buildArray(components: Array<Implements<TemplateInsertable> | SDKHandle>): SDKHandle
Swift declaration
static func buildArray(_ components: [any TemplateInsertable]) -> any TemplateInsertable

Enables support for `for..in` loops.

static · iOS 17.0+

buildEither

TypeScript
static buildEitherFirst(first: Implements<TemplateInsertable> | SDKHandle): SDKHandle
Swift declaration
static func buildEither(first: any TemplateInsertable) -> any TemplateInsertable

Enables support for `if-else` and `switch` constructs.

static · iOS 17.0+

buildEither

TypeScript
static buildEitherSecond(second: Implements<TemplateInsertable> | SDKHandle): SDKHandle
Swift declaration
static func buildEither(second: any TemplateInsertable) -> any TemplateInsertable

Enables support for `if-else` and `switch` constructs.

static · iOS 17.0+

buildOptional

TypeScript
static buildOptional(component?: (Implements<TemplateInsertable> | SDKHandle) | null): SDKHandle
Swift declaration
static func buildOptional(_ component: (any TemplateInsertable)?) -> any TemplateInsertable

Enables support for `if` statements that do not have an `else` clause.

Skipped declarations

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

SFCustomLanguageModelData.TemplateInsertableBuilder.buildBlock(_:)

A variable number of Swift arguments is not supported.

All Speech types →