FirebaseAILogic Framework Reference

SlidingWindow

@available(watchOS, unavailable)
public struct SlidingWindow : Sendable

Configures 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 SlidingWindow value.

    Declaration

    Swift

    public init(targetTokens: Int? = nil)

    Parameters

    targetTokens

    The target number of tokens to keep in the context window.