SlidingWindow
@available(watchOS, unavailable)
public struct SlidingWindow : SendableConfigures the sliding window context compression mechanism.
The SlidingWindow method operates by discarding content at the beginning of the context window. The resulting context will always begin at the start of a USER role turn. System instructions will always remain at the start of the result.
-
Creates a new
SlidingWindowvalue.Declaration
Swift
public init(targetTokens: Int? = nil)Parameters
targetTokensThe target number of tokens to keep in the context window.