---
title: "historyTransform(_:)"
framework: foundationmodels
role: symbol
role_heading: Instance Method
path: "foundationmodels/languagemodelsession/dynamicprofile/historytransform(_:)"
---

# historyTransform(_:)

Apply a transformation to the history prior to invoking the model.

## Declaration

```swift
func historyTransform(_ transform: @escaping ([Transcript.Entry]) -> [Transcript.Entry]) -> some LanguageModelSession.DynamicProfile

```

## Mentioned in

Composing dynamic sessions with instructions and profiles Optimizing key-value caching in language model sessions

## See Also

### Transforming the history

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