---
title: LanguageModelSession.SessionProperty
framework: foundationmodels
role: symbol
role_heading: Structure
path: foundationmodels/languagemodelsession/sessionproperty
---

# LanguageModelSession.SessionProperty

A property wrapper that provides access to properties from within profiles,  dynamic instructions, and tools.

## Declaration

```swift
@propertyWrapper struct SessionProperty<Value>
```

## Mentioned in

Composing dynamic sessions with instructions and profiles

## Overview

Overview Use this to access properties across a language model session, like to access the session history: // Get a reference to the session history. @SessionProperty(\.history) var history To create a custom session property, use SessionPropertyEntry() to define a custom key that you access with LanguageModelSession.SessionProperty.

## Topics

### Creating a session property

- [init(_:)](foundationmodels/languagemodelsession/sessionproperty/init(_:).md)

### Accessing the property value

- [wrappedValue](foundationmodels/languagemodelsession/sessionproperty/wrappedvalue.md)

## Relationships

### Conforms To

- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Custom session properties

- [SessionPropertyKey](foundationmodels/sessionpropertykey.md)
- [SessionPropertyValues](foundationmodels/sessionpropertyvalues.md)
- [SessionPropertyEntry()](foundationmodels/sessionpropertyentry().md)
