---
title: SessionPropertyValues
framework: foundationmodels
role: symbol
role_heading: Class
path: foundationmodels/sessionpropertyvalues
---

# SessionPropertyValues

A container for property values.

## Declaration

```swift
final class SessionPropertyValues
```

## Mentioned in

Composing dynamic sessions with instructions and profiles

## Overview

Overview Use session property values across your session. To help manage the context window, access history to modify the transcript for the session: struct CompactingProfile: LanguageModelSession.DynamicProfile {     @SessionProperty(\.history)     var history

var body: some LanguageModelSession.DynamicProfile {         Profile {             // Custom instructions and tools that you define.         }         .onResponse { _ in             // Compact the history when the entries exceed a certain limit.             if history.count > 100 {                 history = Array(history.suffix(50))             }         }     } } Because updating the transcript history can cause cache invalidations for some models, carefully consider how you modify an existing transcript. For more information, see Optimizing key-value caching in language model sessions. Use SessionPropertyEntry() to create custom session properties.

## Topics

### Accessing the session history and instructions

- [history](foundationmodels/sessionpropertyvalues/history.md)
- [rootDynamicInstructions](foundationmodels/sessionpropertyvalues/rootdynamicinstructions.md)

### Accessing the subscript

- [subscript(_:)](foundationmodels/sessionpropertyvalues/subscript(_:).md)

## Relationships

### Conforms To

- [Copyable](swift/copyable.md)
- [Escapable](swift/escapable.md)
- [Observable](observation/observable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Custom session properties

- [LanguageModelSession.SessionProperty](foundationmodels/languagemodelsession/sessionproperty.md)
- [SessionPropertyKey](foundationmodels/sessionpropertykey.md)
- [SessionPropertyEntry()](foundationmodels/sessionpropertyentry().md)
