One Logo Pool Ball
FoundationModels · IOS API REFERENCE

ContextOptions

struct · iOS 27.0+ · SDK 27.1

struct ContextOptions

Options that configure details that should appear in the prompt. Create a ``ContextOptions`` structure when you need to bias the model's behavior by adjusting how the model receives your prompt.

Members (5)

get · iOS 27.0+

reasoningLevel

TypeScript
get reasoningLevel(): (ContextOptions_ReasoningLevel) | null
Swift declaration
var reasoningLevel: ContextOptions.ReasoningLevel?

Controls the amount of reasoning that the model is allowed to output before producing a response.

set · iOS 27.0+

reasoningLevel

TypeScript
set reasoningLevel(value: (ContextOptions_ReasoningLevel) | null)
Swift declaration
var reasoningLevel: ContextOptions.ReasoningLevel?

Controls the amount of reasoning that the model is allowed to output before producing a response.

init · iOS 27.0+

init

TypeScript
static init(includeSchemaInPrompt?: (boolean) | null, reasoningLevel?: (ContextOptions_ReasoningLevel) | null): ContextOptions
Swift declaration
init(includeSchemaInPrompt: Bool? = nil, reasoningLevel: ContextOptions.ReasoningLevel? = nil)

Creates options that control how the model is prompted. - Parameters: - includeSchemaInPrompt: If `true`, injects the schema into the prompt to bias the model. - reasoningLevel: Controls the amount of reasoning that the model is allowed to output before producing a response

get · iOS 27.0+

includeSchemaInPrompt

TypeScript
get includeSchemaInPrompt(): (boolean) | null
Swift declaration
var includeSchemaInPrompt: Bool?

A Boolean value that indicates whether to inject the schema into the prompt to bias the model. Has no effect if there's no schema provided

set · iOS 27.0+

includeSchemaInPrompt

TypeScript
set includeSchemaInPrompt(value: (boolean) | null)
Swift declaration
var includeSchemaInPrompt: Bool?

A Boolean value that indicates whether to inject the schema into the prompt to bias the model. Has no effect if there's no schema provided

Skipped declarations

No declarations were skipped in this snapshot.

All FoundationModels types →