---
title: LanguageModelSession.DynamicProfile
framework: foundationmodels
role: symbol
role_heading: Protocol
path: foundationmodels/languagemodelsession/dynamicprofile
---

# LanguageModelSession.DynamicProfile

A dynamic profile that contains one or more profiles.

## Declaration

```swift
protocol DynamicProfile
```

## Mentioned in

Composing dynamic sessions with instructions and profiles Expanding generation with tool calling

## Overview

Overview A dynamic profile is the top-level coordination layer that manages profiles. It determines which LanguageModelSession.DynamicProfile.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 LanguageModelSession.DynamicProfile.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. 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: Profile {     // The instructions and tools necessary for the task. } .historyTransform { history in     Array(history.suffix(20)) }

## Topics

### Implementing a dynamic profile

- [body](foundationmodels/languagemodelsession/dynamicprofile/body-swift.property.md)
- [Body](foundationmodels/languagemodelsession/dynamicprofile/body-swift.associatedtype.md)
- [LanguageModelSession.DynamicProfile.DynamicProfile](foundationmodels/languagemodelsession/dynamicprofile/dynamicprofile.md)
- [LanguageModelSession.DynamicProfile.Profile](foundationmodels/languagemodelsession/dynamicprofile/profile.md)
- [LanguageModelSession.DynamicProfile.SessionProperty](foundationmodels/languagemodelsession/dynamicprofile/sessionproperty.md)

### Transforming the history

- [historyTransform(_:)](foundationmodels/languagemodelsession/dynamicprofile/historytransform(_:).md)
- [inputFilter(_:)](foundationmodels/languagemodelsession/dynamicprofile/inputfilter(_:).md)

### Observing life cycle modifiers

- [onActivate(perform:)](foundationmodels/languagemodelsession/dynamicprofile/onactivate(perform:).md)
- [onDeactivate(perform:)](foundationmodels/languagemodelsession/dynamicprofile/ondeactivate(perform:).md)
- [onPrompt(perform:)](foundationmodels/languagemodelsession/dynamicprofile/onprompt(perform:).md)
- [onResponse(perform:)](foundationmodels/languagemodelsession/dynamicprofile/onresponse(perform:).md)
- [onToolCall(perform:)](foundationmodels/languagemodelsession/dynamicprofile/ontoolcall(perform:).md)
- [onToolOutput(perform:)](foundationmodels/languagemodelsession/dynamicprofile/ontooloutput(perform:).md)

### Applying tool modifiers

- [toolCallingMode(_:)](foundationmodels/languagemodelsession/dynamicprofile/toolcallingmode(_:).md)
- [toolCalling(_:)](foundationmodels/languagemodelsession/dynamicprofile/toolcalling(_:).md)

### Configuring the model

- [model(_:)](foundationmodels/languagemodelsession/dynamicprofile/model(_:).md)
- [temperature(_:)](foundationmodels/languagemodelsession/dynamicprofile/temperature(_:).md)
- [samplingMode(_:)](foundationmodels/languagemodelsession/dynamicprofile/samplingmode(_:).md)
- [reasoningLevel(_:)](foundationmodels/languagemodelsession/dynamicprofile/reasoninglevel(_:).md)
- [maximumResponseTokens(_:)](foundationmodels/languagemodelsession/dynamicprofile/maximumresponsetokens(_:).md)
- [modifier(_:)](foundationmodels/languagemodelsession/dynamicprofile/modifier(_:).md)

### Handling the error policy

- [transcriptErrorHandlingPolicy(_:)](foundationmodels/languagemodelsession/dynamicprofile/transcripterrorhandlingpolicy(_:).md)

## Relationships

### Conforming Types

- [LanguageModelSession.ConditionalDynamicProfile](foundationmodels/languagemodelsession/conditionaldynamicprofile.md)
- [LanguageModelSession.DynamicProfileModifierContent](foundationmodels/languagemodelsession/dynamicprofilemodifiercontent.md)
- [LanguageModelSession.ModifiedDynamicProfile](foundationmodels/languagemodelsession/modifieddynamicprofile.md)
- [LanguageModelSession.Profile](foundationmodels/languagemodelsession/profile.md)

## See Also

### Dynamic profiles

- [Composing dynamic sessions with instructions and profiles](foundationmodels/composing-dynamic-sessions-with-instructions-and-profiles.md)
- [Origami: Crafting a dynamic tutorial for Apple Intelligence](foundationmodels/origami-crafting-a-dynamic-tutorial-for-apple-intelligence.md)
- [DynamicInstructions](foundationmodels/dynamicinstructions.md)
- [LanguageModelSession.DynamicProfileModifier](foundationmodels/languagemodelsession/dynamicprofilemodifier.md)
- [LanguageModelSession.Profile](foundationmodels/languagemodelsession/profile.md)
