One Logo Pool Ball
FoundationModels · IOS API REFERENCE

SessionPropertyValues

class · iOS 27.0+ · SDK 27.1

final class SessionPropertyValues

A container for property values. Use session property values across your session. To help manage the context window, access ``SessionPropertyValues/history`` to modify the transcript for the session: ```swift 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 <doc:optimizing-key-value-caching-in-language-model-sessions>. Use ``SessionPropertyEntry()`` to create custom session properties.

Members (2)

get · iOS 27.0+

history

TypeScript
get history(): Transcript_HistoryView
Swift declaration
final var history: Transcript.HistoryView { get set }

The history portion of the session's transcript.

set · iOS 27.0+

history

TypeScript
set history(value: Transcript_HistoryView)
Swift declaration
final var history: Transcript.HistoryView { get set }

The history portion of the session's transcript.

Skipped declarations

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

SessionPropertyValues.subscript(_:)

Passing a Swift type itself is not supported.

All FoundationModels types →