One Logo Pool Ball
FoundationModels · IOS API REFERENCE

LanguageModelSession.DynamicProfile

protocol · iOS 27.0+ · SDK 27.1

protocol DynamicProfile

A dynamic profile that contains one or more profiles. A dynamic profile is the top-level coordination layer that manages profiles. It determines which ``Profile`` is in an active state and allows a ``LanguageModelSession`` to switch between entirely different configurations as app state changes. A body must resolve to a single profile. ``DynamicInstructions`` declares what content and tools the model sees, and ``Profile`` binds that content to how a single configuration runs. That configuration includes details like the model to use, temperature, reasoning level, and so on. ```swift struct PresentationProfile: LanguageModelSession.DynamicProfile { // The data source for the profile. var isEditingImage = true var isEditingAnimation = false // Determine which profile to load based on the current state. var body: some LanguageModelSession.DynamicProfile { if isEditingImage { // Use the editing image profile. } else if isEditingAnimation { // Use the editing animation profile. } else { // Use the default profile. } } } ``` Use ``historyTransform(_:)`` to perform stateless transcript transforms. This allows you to modify the transcript that's sent to the model, but doesn't impact the global transcript state. For example, the request might only need the last twenty entries instead of the full transcript: ```swift Profile { // The instructions and tools necessary for the task. } .historyTransform { history in Array(history.suffix(20)) } ```

Members (0)

This type has no directly callable members in this snapshot. See the framework’s skipped declarations for unsupported APIs.

Skipped declarations

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

LanguageModelSession.DynamicProfile.modifier(_:)

This declaration needs Swift generic type arguments. (no canonical witness for Modifier)

LanguageModelSession.DynamicProfile.model(_:)

This protocol needs associated types that cannot yet cross the bridge.

LanguageModelSession.DynamicProfile.model(_:)

This protocol needs associated types that cannot yet cross the bridge.

LanguageModelSession.DynamicProfile.temperature(_:)

This protocol needs associated types that cannot yet cross the bridge.

LanguageModelSession.DynamicProfile.samplingMode(_:)

This protocol needs associated types that cannot yet cross the bridge.

LanguageModelSession.DynamicProfile.maximumResponseTokens(_:)

This protocol needs associated types that cannot yet cross the bridge.

LanguageModelSession.DynamicProfile.reasoningLevel(_:)

This protocol needs associated types that cannot yet cross the bridge.

LanguageModelSession.DynamicProfile.toolCallingMode(_:)

This protocol needs associated types that cannot yet cross the bridge.

LanguageModelSession.DynamicProfile.historyTransform(_:)

callback cannot propagate synchronous failure

LanguageModelSession.DynamicProfile.transcriptErrorHandlingPolicy(_:)

This protocol needs associated types that cannot yet cross the bridge.

LanguageModelSession.DynamicProfile.onPrompt(perform:)

This protocol needs associated types that cannot yet cross the bridge.

LanguageModelSession.DynamicProfile.onPrompt(perform:)

This protocol needs associated types that cannot yet cross the bridge.

LanguageModelSession.DynamicProfile.onResponse(perform:)

This protocol needs associated types that cannot yet cross the bridge.

LanguageModelSession.DynamicProfile.onResponse(perform:)

This protocol needs associated types that cannot yet cross the bridge.

LanguageModelSession.DynamicProfile.onReasoning(perform:)

This protocol needs associated types that cannot yet cross the bridge.

LanguageModelSession.DynamicProfile.onReasoning(perform:)

This protocol needs associated types that cannot yet cross the bridge.

LanguageModelSession.DynamicProfile.onToolCall(perform:)

This protocol needs associated types that cannot yet cross the bridge.

LanguageModelSession.DynamicProfile.onToolCall(perform:)

This protocol needs associated types that cannot yet cross the bridge.

LanguageModelSession.DynamicProfile.onToolOutput(perform:)

This protocol needs associated types that cannot yet cross the bridge.

LanguageModelSession.DynamicProfile.onToolOutput(perform:)

This protocol needs associated types that cannot yet cross the bridge.

LanguageModelSession.DynamicProfile.onActivate(perform:)

This protocol needs associated types that cannot yet cross the bridge.

LanguageModelSession.DynamicProfile.onDeactivate(perform:)

This protocol needs associated types that cannot yet cross the bridge.

All FoundationModels types →