FirebaseAILogic Framework Reference

ContextWindowCompressionConfig

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

Enables context window compression to manage the model's context window.

This mechanism prevents the context from exceeding a given length.

  • Creates a new ContextWindowCompressionConfig value.

    Declaration

    Swift

    public init(triggerTokens: Int? = nil, slidingWindow: SlidingWindow? = nil)

    Parameters

    triggerTokens

    The number of tokens that triggers the compression mechanism.

    slidingWindow

    The sliding window compression mechanism to use.