<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "visionOS: 27.0.0 -",
    "watchOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "FoundationModels",
  "identifier" : "/documentation/FoundationModels/LanguageModelSession/SessionProperty",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Foundation Models",
      "FoundationModels"
    ],
    "preciseIdentifier" : "s:16FoundationModels20LanguageModelSessionC0E8PropertyV"
  },
  "title" : "LanguageModelSession.SessionProperty"
}
-->

# LanguageModelSession.SessionProperty

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

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

## Overview

Use this to access properties across a language model session, like to access
the session history:

```swift
// Get a reference to the session history.
@SessionProperty(\.history)
var history
```

To create a custom session property, use [`SessionPropertyEntry()`](/documentation/FoundationModels/SessionPropertyEntry()) to define
a custom key that you access with [`LanguageModelSession.SessionProperty`](/documentation/FoundationModels/LanguageModelSession/SessionProperty).

## Topics

### Creating a session property

[`init(ReferenceWritableKeyPath<SessionPropertyValues, Value>)`](/documentation/FoundationModels/LanguageModelSession/SessionProperty/init(_:))

Creates a session property with the specified key path.

### Accessing the property value

[`var wrappedValue: Value`](/documentation/FoundationModels/LanguageModelSession/SessionProperty/wrappedValue)

The wrapped value of this property wrapper.

## Relationships

### Conforms To

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Sendable`](/documentation/Swift/Sendable)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)